Merge pull request #9969 from md-fork/BAEL-3619

BAEL-3619 - Dates in OpenAPI Files
This commit is contained in:
davidmartinezbarua 2020-09-05 10:22:20 -03:00 committed by GitHub
commit cc74ffc80e
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