Skip to content

Commit

Permalink
Add oas example of singleton resource
Browse files Browse the repository at this point in the history
  • Loading branch information
mkistler committed Oct 30, 2022
1 parent fc5998f commit 247fd19
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aip/general/0156/aip.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ Accept: application/json

{% sample 'singleton.proto', 'rpc GetConfig', 'rpc UpdateConfig' %}

{% tab oas %}

{% sample 'singleton.oas.yaml', 'paths' %}

{% endtabs %}
57 changes: 57 additions & 0 deletions aip/general/0156/singleton.oas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
openapi: 3.0.3
info:
title: Library
version: 1.0.0
paths:
/authors/{author}/config:
parameters:
- name: author
in: path
description: The id of the author.
required: true
schema:
type: string
get:
operationId: getConfig
description: Get the configuration for a author.
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Config'

patch:
operationId: updateConfig
description: Get the configuration for a author.
requestBody:
content:
'application/json':
schema:
$ref: '#/components/schemas/Config'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Config'
components:
schemas:
Config:
description: The configuration options for a author.
type: object
properties:
name:
type: string
description: |
The name of the config.
Format: authors/{author}/config
language_code:
type: string
description: |
The author's preferred language.
time_zone:
type: string
description: TThe time zone where the author resides.

0 comments on commit 247fd19

Please sign in to comment.