Skip to content

Commit ad7e185

Browse files
author
Luke Sneeringer
committed
Complete the OpenAPI examples.
1 parent 046bd25 commit ad7e185

File tree

2 files changed

+65
-7
lines changed

2 files changed

+65
-7
lines changed

aip/general/0162/aip.md.j2

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Revision" custom operation:
108108

109109
{% tab oas %}
110110

111-
{% sample 'revisions.oas.yaml', '/publishers/{publisherId}/books/{bookId}:tagRevision' %}
111+
{% sample 'revisions.oas.yaml', '/publishers/{publisherId}/books/{bookId}@{revisionId}:tagRevision' %}
112112

113113
{% endtabs %}
114114

@@ -139,6 +139,10 @@ standard `List` operations (AIP-132):
139139

140140
{% sample 'revisions.proto', 'rpc ListBookRevisions', 'message ListBookRevisionsRequest' %}
141141

142+
{% tab oas %}
143+
144+
{% sample 'revisions.oas.yaml', '/publishers/{publisherId}/books/{bookId}:listRevisions' %}
145+
142146
{% endtabs %}
143147

144148
While revision listing operations are mostly similar to standard `List`
@@ -202,6 +206,10 @@ on user request **should** handle this with a `Commit` custom operation:
202206

203207
{% sample 'revisions.proto', 'rpc CommitBook', 'message CommitBookRequest' %}
204208

209+
{% tab oas %}
210+
211+
{% sample 'revisions.oas.yaml', '/publishers/{publisherId}/books/{bookId}:commit' %}
212+
205213
{% endtabs %}
206214

207215
- The operation **must** use the `POST` HTTP method.
@@ -222,6 +230,10 @@ operation:
222230

223231
{% sample 'revisions.proto', 'rpc RollbackBook', 'message RollbackBookRequest' %}
224232

233+
{% tab oas %}
234+
235+
{% sample 'revisions.oas.yaml', '/publishers/{publisherId}/books/{bookId}:rollback' %}
236+
225237
{% endtabs %}
226238

227239
- The operation **must** use the `POST` HTTP method.
@@ -254,6 +266,10 @@ to `Delete` (AIP-135) operations:
254266

255267
{% sample 'revisions.proto', 'rpc DeleteBookRevision', 'message DeleteBookRevisionRequest' %}
256268

269+
{% tab oas %}
270+
271+
{% sample 'revisions.oas.yaml', '/publishers/{publisherId}/books/{bookId}@{revisionId}:deleteRevision' %}
272+
257273
{% endtabs %}
258274

259275
- The request message **must** have a `id` field to identify the resource

aip/general/0162/revisions.oas.yaml

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ paths:
5151
next page.
5252
5353
If this field is omitted, there are no subsequent pages.
54-
/publishers/{publisherId}/books/{bookId}:tagRevision:
54+
/publishers/{publisherId}/books/{bookId}@{revisionId}:tagRevision:
5555
post:
5656
operationId: tagBookRevision
5757
description: |
@@ -65,11 +65,6 @@ paths:
6565
application/json:
6666
description: Request structure for tagging a book revision.
6767
properties:
68-
id:
69-
type: string
70-
description: |
71-
The ID of the book to be tagged, including the revision ID.
72-
required: true
7368
tag:
7469
type: string
7570
description: |
@@ -83,6 +78,53 @@ paths:
8378
application/json:
8479
schema:
8580
$ref: '#/components/schemas/Book'
81+
/publishers/{publisherId}/books/{bookId}@{revisionId}:deleteRevision:
82+
delete:
83+
operationId: deleteBookRevision
84+
description: Delete a single revision of this book.
85+
responses:
86+
200:
87+
description: OK
88+
/publishers/{publisherId}/books/{bookId}:commit:
89+
post:
90+
operationId: commitBook
91+
description: Save a new, discrete revision snapshot of the given book.
92+
responses:
93+
200:
94+
description: OK
95+
content:
96+
application/json:
97+
schema:
98+
$ref: '#/components/schemas/Book'
99+
/publishers/{publisherId}/books/{bookId}:rollback:
100+
post:
101+
operationId: rollbackBook
102+
description: |
103+
Rollback the primary revision of a book to a previous revision.
104+
105+
This creates a new revision, with a new revision ID, with the contents
106+
of the provided revision, as the most recent revision in the sequence.
107+
requestBody:
108+
content:
109+
application/json:
110+
description: |
111+
Request structure for rolling back a book to a previous revision.
112+
properties:
113+
revisionId:
114+
type: string
115+
description: |
116+
The revision ID to roll back to.
117+
It must be a revision of the same book.
118+
119+
Example: c7cfa2a8
120+
required: true
121+
responses:
122+
200:
123+
description: OK
124+
content:
125+
application/json:
126+
schema:
127+
$ref: '#/components/schemas/Book'
86128
components:
87129
schema:
88130
Book:

0 commit comments

Comments
 (0)