Skip to content

Commit 729bb81

Browse files
committed
Add oas example of singleton resource
1 parent fc5998f commit 729bb81

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

aip/general/0156/aip.md.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,8 @@ Accept: application/json
3737

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

40+
{% tab oas %}
41+
42+
{% sample 'singleton.oas.yaml', 'paths' %}
43+
4044
{% endtabs %}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
openapi: 3.0.3
2+
info:
3+
title: Library
4+
version: 1.0.0
5+
paths:
6+
/authors/{author}/config:
7+
parameters:
8+
- name: author
9+
in: path
10+
description: The id of the author.
11+
required: true
12+
schema:
13+
type: string
14+
get:
15+
operationId: getConfig
16+
description: Get the configuration for a author.
17+
responses:
18+
'200':
19+
description: OK
20+
content:
21+
application/json:
22+
schema:
23+
$ref: '#/components/schemas/Config'
24+
25+
patch:
26+
operationId: updateConfig
27+
description: Get the configuration for a author.
28+
requestBody:
29+
content:
30+
'application/json':
31+
schema:
32+
$ref: '#/components/schemas/Config'
33+
responses:
34+
'200':
35+
description: OK
36+
content:
37+
application/json:
38+
schema:
39+
$ref: '#/components/schemas/Config'
40+
components:
41+
schemas:
42+
Config:
43+
description: The configuration options for a author.
44+
type: object
45+
properties:
46+
name:
47+
type: string
48+
description: |
49+
The name of the config.
50+
Format: authors/{author}/config
51+
languageCode:
52+
type: string
53+
description: |
54+
The author's preferred language.
55+
timeZone:
56+
type: string
57+
description: TThe time zone where the author resides.

0 commit comments

Comments
 (0)