From 5b20bb3d2a4608a4523827f2bfc85159bae454ef Mon Sep 17 00:00:00 2001 From: Marco Denisi Date: Thu, 3 Sep 2020 16:59:07 +0200 Subject: [PATCH] BAEL-3619 - add swagger samples --- .../openapi-3-date-format.yaml | 36 +++++++++++++++++++ .../openapi-3-date-pattern.yaml | 36 +++++++++++++++++++ .../openapi-3-datetime-format.yaml | 36 +++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 spring-rest-http/src/main/resources/openapi-dates-definitions/openapi-3-date-format.yaml create mode 100644 spring-rest-http/src/main/resources/openapi-dates-definitions/openapi-3-date-pattern.yaml create mode 100644 spring-rest-http/src/main/resources/openapi-dates-definitions/openapi-3-datetime-format.yaml diff --git a/spring-rest-http/src/main/resources/openapi-dates-definitions/openapi-3-date-format.yaml b/spring-rest-http/src/main/resources/openapi-dates-definitions/openapi-3-date-format.yaml new file mode 100644 index 0000000000..7ee581d3d8 --- /dev/null +++ b/spring-rest-http/src/main/resources/openapi-dates-definitions/openapi-3-date-format.yaml @@ -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 \ No newline at end of file diff --git a/spring-rest-http/src/main/resources/openapi-dates-definitions/openapi-3-date-pattern.yaml b/spring-rest-http/src/main/resources/openapi-dates-definitions/openapi-3-date-pattern.yaml new file mode 100644 index 0000000000..ffba36f3da --- /dev/null +++ b/spring-rest-http/src/main/resources/openapi-dates-definitions/openapi-3-date-pattern.yaml @@ -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 \ No newline at end of file diff --git a/spring-rest-http/src/main/resources/openapi-dates-definitions/openapi-3-datetime-format.yaml b/spring-rest-http/src/main/resources/openapi-dates-definitions/openapi-3-datetime-format.yaml new file mode 100644 index 0000000000..8bf4ddd2dc --- /dev/null +++ b/spring-rest-http/src/main/resources/openapi-dates-definitions/openapi-3-datetime-format.yaml @@ -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 \ No newline at end of file