Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
- incorrect syntax in 132 create.
  • Loading branch information
toumorokoshi committed Nov 6, 2024
1 parent 1c968b7 commit 77ed1e1
Show file tree
Hide file tree
Showing 2 changed files with 451 additions and 29 deletions.
37 changes: 8 additions & 29 deletions aep/general/0133/aep.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ rpc CreateBook(CreateBookRequest) returns (Book) {
{% tab oas %}

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

{% endtabs %}

Expand Down Expand Up @@ -107,38 +108,13 @@ message CreateBookRequest {

{% tab oas %}

**Note:** OAS guidance not yet written

{% endtabs %}
- The request body **must** be the resource being created.

### Long-running create
{% sample '../oas.yaml', 'book:' %}

Some resources take longer to create a resource than is reasonable for a
regular API request. In this situation, the API **should** use a long-running
operation (AEP-151) instead:
{% sample '../oas.yaml', '$.paths./publishers/{publisher}/books.post.requestBody' %}

- The response type **must** be set to the resource (what the return type would
be if the RPC was not long-running).

{% tab proto %}

```proto
rpc CreateBook(CreateBookRequest) returns (aep.api.Operation) {
option (google.api.http) = {
post: "/v1/{parent=publishers/*}/books"
};
option (aep.api.operation_info) = {
response_type: "Book"
metadata_type: "OperationMetadata"
};
}
```

- Both the `response_type` and `metadata_type` fields **must** be specified.

{% tab oas %}

**Note:** OAS guidance not yet written
- The request body **must** be the resource being created.

{% endtabs %}

Expand Down Expand Up @@ -191,6 +167,9 @@ publishers/012345678-abcd-cdef/books/12341234-5678-abcd
{% tab oas %}

**Note:** OAS guidance not yet written
{% sample '../oas.yaml', '$.paths./publishers/{publisher}/books.post.requestBody' %}

- The `id` field **must** be a query parameter on the request.

{% endtabs %}

Expand Down
Loading

0 comments on commit 77ed1e1

Please sign in to comment.