Closed abhijeetgiri20 closed 2 years ago
In YAML double quotes are not needed for strings. In addition, it is the underlying swagger parser that does the heavy lifting (maven plugin is just a thin wrapper). If it would be an error it is an error of the swagger parser.
Background:
We have multiple APIs in our application and so we have kept some common components, schemas & parameters in common external files which are referenced in the API specs. So, we use this validator plugin to validate and consolidate the API specs into a single file via resolving all external refs. Pretty standard use.
Bug:
As seen below, we have this schema declaration for a date field in our API specs along with an example. Now if we see the API spec as it is in the swagger editor we see this date field example correctly i.e
startDate: "2021-11-11"
. But if see the generated swagger file from this plugin in the swagger editor, this date field example is NOT correct. It gets displayed as -startDate: {}
.Checking the schema section in swagger editor it says:
startDate: string($date), example: OrderedMap {}
.Issue is that after validation when the final swagger file is generated, the date field example's quotes are getting removed.
Its a problem because the standard way of conveying the date format related information to the API client is not functional. We have to rely on other indirect ways to do this.
Our plugin configuration: using version 1.0.2
API spec
Generated final output file