Skip to content

Commit

Permalink
automatically add a google.rpc.Status response if requested. (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffsawatzky authored Apr 4, 2022
1 parent f0fd0ae commit e282a44
Show file tree
Hide file tree
Showing 55 changed files with 3,375 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ListShelvesResponse'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
post:
tags:
- LibraryService
Expand All @@ -63,6 +69,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Shelf'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v1/shelves/{shelf}:
get:
tags:
Expand All @@ -83,6 +95,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Shelf'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
delete:
tags:
- LibraryService
Expand All @@ -99,6 +117,12 @@ paths:
"200":
description: OK
content: {}
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v1/shelves/{shelf}/books:
get:
tags:
Expand Down Expand Up @@ -133,6 +157,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ListBooksResponse'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
post:
tags:
- LibraryService
Expand All @@ -158,6 +188,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Book'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v1/shelves/{shelf}/books/{book}:
get:
tags:
Expand All @@ -184,6 +220,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Book'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
put:
tags:
- LibraryService
Expand Down Expand Up @@ -222,6 +264,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Book'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
delete:
tags:
- LibraryService
Expand All @@ -244,6 +292,12 @@ paths:
"200":
description: OK
content: {}
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v1/shelves/{shelf}/books/{book}:move:
post:
tags:
Expand Down Expand Up @@ -278,6 +332,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Book'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/v1/shelves/{shelf}:merge:
post:
tags:
Expand Down Expand Up @@ -311,6 +371,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Shelf'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
components:
schemas:
Book:
Expand Down Expand Up @@ -346,6 +412,14 @@ components:
description: The last update date and time.
format: date-time
description: A single book in the library.
GoogleProtobufAny:
type: object
properties:
'@type':
type: string
description: The type of the serialized message.
additionalProperties: true
description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.
ListBooksResponse:
type: object
properties:
Expand Down Expand Up @@ -423,5 +497,21 @@ components:
description: The last update date and time.
format: date-time
description: A Shelf contains a collection of books with a theme.
Status:
type: object
properties:
code:
type: integer
description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
format: int32
message:
type: string
description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
details:
type: array
items:
$ref: '#/components/schemas/GoogleProtobufAny'
description: A list of messages that carry the error details. There is a common set of message types for APIs to use.
description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).'
tags:
- name: LibraryService
Loading

0 comments on commit e282a44

Please sign in to comment.