OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
The generated code (generator v4.1.2) for the example responses in an api delegate has illegal date formats for the properties of type "string" and format "date".
openapi: 3.0.2
info:
title: Test for illegal date format in delegate examples
version: 1.0.0
paths:
/dummy:
get:
summary: just a dummy
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/result'
components:
schemas:
result:
description: the result with the illegal date format
type: object
properties:
attr1:
type: string
format: date
example: "2019-09-18"
Command line used for generation
docker run --rm -v %CD%:/local openapitools/openapi-generator-cli:v4.1.2 generate -i /local/test.yaml -g spring -o /local/testexample -c /local/config-test.json
Description
The generated code (generator v4.1.2) for the example responses in an api delegate has illegal date formats for the properties of type "string" and format "date".
openapi-generator version
4.1.2
OpenAPI declaration file content or url
Command line used for generation
docker run --rm -v %CD%:/local openapitools/openapi-generator-cli:v4.1.2 generate -i /local/test.yaml -g spring -o /local/testexample -c /local/config-test.json
The config-test.json looks like this:
Steps to reproduce
Just run the generator, you'll see
Related issues/PRs
Nothing found.
Suggest a fix
Not a fix , but a hint: The generated code have the expected date format: