Open medwards opened 5 years ago
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'openapi': was expecting ('true', 'false' or 'null')
Looks like a spec issue. Can you validate it using https://apidevtools.org/swagger-parser/online/ ?
The following example passes validation on the linked swagger parser: https://pastebin.com/ShkPm323
It crashes the openapi-generator validation command in its current version on 5b7dbd1 (I have some commits on top but the crash comes well before anything these commits affect). I also tried changing:
duration:
allOf:
- $ref: '#/components/schemas/Duration'
- default: 0
This also crashes. Removing default: 0
passes.
allOf: - $ref: '#/components/schemas/Duration' - default: 0
I agree the generator shouldn't crash. What does "default: 0" mean here? does it mean the default value of '#/components/schemas/Duration' ?
sorry for the late reply: Yes, it does.
When trying to override a basic type alias with a default I get a stacktrace failure and
com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'openapi': was expecting ('true', 'false' or 'null')
andSwaggerCompatConverter - failed to read resource listing
.The guilty part of the spec looks something like (obviously simplified):
Alternative forms fail the same way:
openapi-generator version
master, I think its a regression as I was using an older version of master /wo the issue
Command line used for generation
Occurs when I just validate. Also when generating rust /w reqwest but the bug hits way before any codegen happens
Steps to reproduce
Validate a spec that sets a default for an inherited schema object. Deleting the default allows it to validate.