-
Notifications
You must be signed in to change notification settings - Fork 18
/
openapi.yaml
154 lines (147 loc) · 4.56 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
openapi: 3.0.3
info:
title: Books API
version: 1.0.0
description: |
The **Books API** - allows searching of books from the book catalog as well as retrieving the specific details on a selected book. This is a simple API to demonstrate the capabilities between [SwaggerHub](https://swagger.io/tools/swaggerhub/) and AWS Gateway.
termsOfService: http://swagger.io/terms/
contact:
name: Frank Kilcommins
email: [email protected]
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
x-amazon-apigateway-request-validators:
all:
validateRequestBody: true
validateRequestParameters: true
params:
validateRequestBody: true
validateRequestParameters: true
body:
validateRequestBody: true
validateRequestParameters: false
tags:
- name: Bookstore
description: APIs for our fictional bookstore
servers:
- description: AWS API Gateway Endpoint
url: https://example.com
paths:
/books:
get:
summary: Get a list of Books based on the provided criteria
description: |
This API method supports searching the book catalog based on book title or author name
operationId: getBooks
x-amazon-apigateway-request-validator: params
tags:
- Bookstore
parameters:
- name: title
description: The title (or partial title) of a book
in: query
required: false
schema:
type: string
- name: author
description: The author name (or partial author name)
in: query
required: false
schema:
type: string
responses:
'200':
$ref: '#/components/responses/books'
'400':
description: 400 Bad Request
'500':
description: 500 Internal Server Error
x-amazon-apigateway-integration:
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetBooksFunction.Arn}/invocations
responses:
default:
statusCode: "200"
passthroughBehavior: "when_no_match"
httpMethod: "POST"
contentHandling: "CONVERT_TO_TEXT"
type: "aws_proxy"
/books/{id}:
get:
summary: Get the details for a specific book
description: Retrieve the full detailed response for a known book
operationId: getBookById
x-amazon-apigateway-request-validator: params
tags:
- Bookstore
parameters:
- name: id
description: The identifier for a book
in: path
required: true
schema:
type: string
responses:
'200':
$ref: '#/components/responses/book'
'400':
description: 400 Bad Request
'404':
description: 404 Not Found
'500':
description: 500 Internal Server Error
x-amazon-apigateway-integration:
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetSingleBookFunction.Arn}/invocations
responses:
default:
statusCode: "200"
passthroughBehavior: "when_no_match"
httpMethod: "POST"
contentHandling: "CONVERT_TO_TEXT"
type: "aws_proxy"
components:
schemas:
Book:
description: The schema object for a Book
type: object
additionalProperties: false
properties:
id:
type: string
description: the identifier for a book
example: 1e331a0f-29bd-4b6b-8b21-8b87ed653c6b
title:
type: string
description: The book title
example: Designing APIs with Swagger and OpenAPI
authors:
type: array
description: A list of book authors
items:
type: string
description: A string holding an author's name
minItems: 1
example: [Joshua S. Ponelat, Lukas L. Rosenstock]
published:
type: string
format: date
pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
example: "2022-05-01"
responses:
books:
description: List of books
content:
application/json:
schema:
type: array
minItems: 0
items:
$ref: '#/components/schemas/Book'
book:
description: Book details
content:
application/json:
schema:
$ref: '#/components/schemas/Book'