Skip to content

Commit c2e8baa

Browse files
authored
Jsonpath changes (#234)
* some samples * more changes
1 parent ab5fb7e commit c2e8baa

File tree

9 files changed

+20
-19
lines changed

9 files changed

+20
-19
lines changed

aep/general/0124/aep.md.j2

+5-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ associated with other resources through other fields on the resource.
2222

2323
{% tab oas %}
2424

25-
{% sample 'multiple_many_to_one.oas.yaml', 'Book' %}
25+
{% sample 'multiple_many_to_one.oas.yaml', '$.components.schema.Book' %}
26+
2627

2728
{% endtabs %}
2829

@@ -51,7 +52,7 @@ described for repeated fields in [arrays][/arrays].
5152

5253
{% tab oas %}
5354

54-
{% sample 'many_to_many_repeated.oas.yaml', 'Book' %}
55+
{% sample 'many_to_many_repeated.oas.yaml', '$.components.schema.Book' %}
5556

5657
{% endtabs %}
5758

@@ -68,7 +69,7 @@ relationship using a sub-resource with two one-to-many associations.
6869

6970
{% tab oas %}
7071

71-
{% sample 'many_to_many_subresource.oas.yaml', 'BookAuthor' %}
72+
{% sample 'many_to_many_subresource.oas.yaml', '$.components.schema.BookAuthor' %}
7273

7374
{% endtabs %}
7475

@@ -133,7 +134,7 @@ to define a view enum simply because another resource references it.
133134

134135
{% tab oas %}
135136

136-
{% sample 'embedded_resource.oas.yaml', 'Book' %}
137+
{% sample 'embedded_resource.oas.yaml', '$.components.schema.Book' %}
137138

138139
{% endtabs %}
139140

aep/general/0126/aep.md.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ choice (although `google.protobuf.BoolValue` is also available).
119119

120120
{% tab oas %}
121121

122-
{% sample 'enum.oas.yaml', 'format' %}
122+
{% sample 'enum.oas.yaml', '$.components.schema.Book.properties.format.enum' %}
123123

124124
- Enumerated fields **should** be strings.
125125
- If the enum is optional, The `null` value **should** be used as the empty

aep/general/0132/aep.md.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ when the REST/JSON interface is used.
194194

195195
`List` operations **must** be specified with consistent OpenAPI metadata:
196196

197-
{% sample 'list.oas.yaml', 'paths' %}
197+
{% sample 'list.oas.yaml', '$.paths' %}
198198

199199
- The `operationId` **must** begin with the word `list`. The remainder of the
200200
`operationId` **should** be the plural form of the resource type's name.

aep/general/0135/aep.md.j2

+4-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ rpc DeleteBook(DeleteBookRequest) returns (google.protobuf.Empty) {
5959

6060
{% tab oas %}
6161

62-
{% sample 'delete.oas.yaml', 'paths' %}
62+
{% sample 'delete.oas.yaml', '$.paths' %}
6363

6464
- The response body **should** be omitted.
6565
- The HTTP response code **should** be `204 No Content` if the delete was
@@ -104,7 +104,7 @@ message DeleteBookRequest {
104104

105105
{% tab oas -%}
106106

107-
{% sample 'delete.oas.yaml', 'paths' %}
107+
{% sample 'delete.oas.yaml', '$.paths' %}
108108

109109
- Delete methods **should** return `204 No Content` with no response body, or
110110
`202 Accepted` with a representation of the operation in the response body if
@@ -149,7 +149,7 @@ rpc DeleteBook(DeleteBookRequest) returns (aep.api.Operation) {
149149

150150
{% tab oas -%}
151151

152-
{% sample 'long_running_delete.oas.yaml', 'paths' %}
152+
{% sample 'long_running_delete.oas.yaml', '$.paths' %}
153153

154154
- The response status code should be `202 Accepted` if the request was accepted
155155
for later processing. When the request is processed it could still fail.
@@ -191,7 +191,7 @@ is `false` (or unset) and child resources are present.
191191

192192
{% tab oas -%}
193193

194-
{% sample 'cascading_delete.oas.yaml', 'paths' %}
194+
{% sample 'cascading_delete.oas.yaml', '$.paths' %}
195195

196196
The API **must** fail with a `409 Conflict` error if the `force` field is
197197
`false` (or unset) and child resources are present.

aep/general/0136/aep.md.j2

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ apply consistently:
4545

4646
{% tab oas %}
4747

48-
{% sample 'library.oas.yaml', '/publishers/{publisherId}/books/{bookId}:archive' %}
48+
{% sample 'library.oas.yaml', '$.paths./publishers/{publisherId}/books/{bookId}:archive' %}
4949

5050
- The name of the RPC **should** be a verb followed by a noun.
5151
- The name of the RPC **must not** contain prepositions ("for", "with",
@@ -86,7 +86,7 @@ While most custom methods operate on a single resource, some custom methods
8686

8787
{% tab oas %}
8888

89-
{% sample 'library.oas.yaml', '/publishers/{publisherId}/books:sort' %}
89+
{% sample 'library.oas.yaml', '$.paths./publishers/{publisherId}/books:sort' %}
9090

9191
{% endtabs %}
9292

@@ -106,7 +106,7 @@ permanent effect on data within the API.
106106

107107
{% tab oas %}
108108

109-
{% sample 'translate.oas.yaml', '/projects/{projectId}:translateText' %}
109+
{% sample 'translate.oas.yaml', '$.paths./projects/{projectId}:translateText' %}
110110

111111
{% endtabs %}
112112

aep/general/0144/aep.md.j2

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ define custom methods using the verbs `Add` and `Remove`:
111111

112112
{% tab oas %}
113113

114-
{% sample 'add_remove.oas.yaml', 'paths' %}
114+
{% sample 'add_remove.oas.yaml', '$.paths' %}
115115

116116
- The data being added or removed **should** be a primitive (usually a
117117
`string`).
@@ -157,7 +157,7 @@ subresource instead.
157157

158158
{% tab oas %}
159159

160-
{% sample 'add_remove.oas.yaml', 'requestBody' %}
160+
{% sample 'add_remove.oas.yaml', '$./publishers/{publisherId}/books/{bookId}:addAuthor.requestBody' %}
161161

162162
- A field for the value being added or removed **must** be included. It
163163
**should** be the singular name of the field.

aep/general/0151/aep.md.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ When using protocol buffers, the common component
133133

134134
{% tab oas %}
135135

136-
{% sample 'lro.oas.yaml', 'paths' %}
136+
{% sample 'lro.oas.yaml', '$.paths' %}
137137

138138
- `202` **must** be the only success status code defined.
139139
- The `202` response **must** define an `application/json` response body and no

aep/general/0164/aep.md.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ A resource that supports soft delete **should** provide an `Undelete` method:
4848

4949
{% tab oas %}
5050

51-
{% sample 'undelete.oas.yaml', 'paths' %}
51+
{% sample 'undelete.oas.yaml', '$.paths' %}
5252

5353
- The HTTP method **must** be `POST`.
5454
- The response message **must** be the resource itself.

aep/general/0231/aep.md.j2

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ message BatchGetBooksRequest {
8484

8585
{% tab oas %}
8686

87-
{% sample 'batchget.oas.yaml', 'paths' %}
87+
{% sample 'batchget.oas.yaml', '$.paths' %}
8888

8989
- The `paths` parameter **must** be a query parameter which accepts an array of
9090
resource paths specifying the resources to retrieve.
@@ -124,7 +124,7 @@ message BatchGetBooksResponse {
124124

125125
{% tab oas %}
126126

127-
{% sample 'batchget.oas.yaml', '/publishers/{publisherId}/books:BatchGet' %}
127+
{% sample 'batchget.oas.yaml', '$.paths./publishers/{publisherId}/books:BatchGet' %}
128128

129129
Example response body:
130130

0 commit comments

Comments
 (0)