BAEL-3619 - add swagger samples

This commit is contained in:
Marco Denisi 2020-09-03 16:59:07 +02:00
parent 2133920f2a
commit 5b20bb3d2a
3 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,36 @@
openapi: 3.0.1
info:
title: API Title
description: This is a sample API.
version: 1.0.0
servers:
- url: https://host/
paths:
/users:
get:
summary: Get Users
operationId: getUsers
responses:
200:
description: Valid input
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
components:
schemas:
User:
type: object
properties:
id:
type: integer
format: int64
createdAt:
type: string
format: date
description: Creation date
example: "2021-01-30"
username:
type: string

View File

@ -0,0 +1,36 @@
openapi: 3.0.1
info:
title: API Title
description: This is a sample API.
version: 1.0.0
servers:
- url: https://host/
paths:
/users:
get:
summary: Get Users
operationId: getUsers
responses:
200:
description: Valid input
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
components:
schemas:
User:
type: object
properties:
id:
type: integer
format: int64
customDate:
type: string
pattern: '^\d{4}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])$'
description: Custom date
example: "20210130"
username:
type: string

View File

@ -0,0 +1,36 @@
openapi: 3.0.1
info:
title: API Title
description: This is a sample API.
version: 1.0.0
servers:
- url: https://host/
paths:
/users:
get:
summary: Get Users
operationId: getUsers
responses:
200:
description: Valid input
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
components:
schemas:
User:
type: object
properties:
id:
type: integer
format: int64
createdAt:
type: string
format: date-time
description: Creation date and time
example: "2021-01-30T08:30:00Z"
username:
type: string