Skip to content

Commit

Permalink
fix(openapi): publishes oas that passes linter
Browse files Browse the repository at this point in the history
The existing OpenAPI example did not adhere to 
the openapi-linter.

Some minor fixes on using the common example 
OAS proto.
  • Loading branch information
toumorokoshi committed Dec 11, 2024
1 parent c70e65a commit 76c6f95
Show file tree
Hide file tree
Showing 3 changed files with 374 additions and 298 deletions.
2 changes: 1 addition & 1 deletion aep/general/0135/aep.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Delete methods implement a common request pattern:

{% tab oas %}

{% sample '../example.oas.yaml', '$.paths./publishers/{publisher}/books/{book}.delete.responses.200' %}
{% sample '../example.oas.yaml', '$.paths./publishers/{publisher}/books/{book}.delete.responses.204' %}

- Delete methods **should** return `204 No Content` with no response body.

Expand Down
21 changes: 11 additions & 10 deletions aep/general/0136/aep.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ apply consistently:
- The HTTP URI **must** use a `:` character followed by the custom verb
(`:archive` in the above example), and the verb in the URI **must** match the
verb in the name of the RPC.
- If word separation is required, `camelCase` **must** be used.
- If word separation is required, `kebab-case` **must** be used.
- The name of the RPC **should** be a verb followed by a noun.
- The name of the RPC **must not** contain prepositions ("for", "with",
etc.).

{% tab proto %}

{% sample 'library.proto', 'rpc ArchiveBook' %}

- The name of the RPC **should** be a verb followed by a noun.
- The name **must not** contain prepositions ("for", "with", etc.).
- The `body` clause in the `google.api.http` annotation **should** be `"*"`.
- However, if using `GET` or `DELETE`, the `body` clause **must** be absent.
- Custom methods **must** take a request message exactly matching the RPC name,
Expand All @@ -45,11 +46,11 @@ apply consistently:

{% tab oas %}

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

- The name of the RPC **should** be a verb followed by a noun.
- The name of the RPC **must not** contain prepositions ("for", "with",
etc.).
```http
POST /v1/publishers/{publisher}/book/{book}:archive HTTP/2
Host: bookstore.example.com
Accept: application/json
```

{% endtabs %}

Expand All @@ -64,14 +65,14 @@ such:

{% tab proto %}

{% sample 'library.proto', 'rpc ArchiveBook' %}
{% sample '../example.proto', 'rpc ArchivePublisher' %}

- The parameter for the resource's path **must** be called `path`, and **must**
be the only variable in the URI path.

{% tab oas %}

**Note:** OAS example not yet written.
{% sample '../example.oas.yaml', '$.paths./publishers/{publisher}/books/{book}:archive' %}

{% endtabs %}

Expand Down
Loading

0 comments on commit 76c6f95

Please sign in to comment.