Open sbeh opened 7 years ago
This looks to be a problem with swagger-parser. I debugged against the referenced specification and swagger.getDefinitions()
doesn't include ApiResponseDelete
.
I thought it may be a problem with missing type
on the schema, but the OpenAPI 2.0 specification and JSON Schema don't appear to require type
or 1..n properties in the properties object. The JSON Schema goes as far as to say that an empty schema doesn't even mean there are no properties, only that the properties aren't known. It's not clear if that refers to a schema defined as ApiResponseDelete: { }
or ApiResponseDelete: { description:"",properties:{} }
. The latter is how the linked schema defines the type.
Somebody may want to verify this behavior to make sure I'm not misspelling a key or something.
You can edit bin/csharp-petstore.sh
with the above schema, then setup IntelliJ or whatever IDE to debug on port 5009. I put a breakpoint in DefaultGenerator#processOperation
.
export JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,address=5009,suspend=y"
JAVA_OPTS="$JAVA_OPTS -DdebugModels -DdebugOperations -DdebugSwagger" ./bin/csharp-petstore.sh
Start your debugger and you can walk through the generation of the above schema to verify the type is missing from swagger.getDefinitions()
.
When done debugging, unset or clear JAVA_OPTS
:
export JAVA_OPTS=""
I have a feeling this bug will have to get moved to swagger-parser.
@sbeh Please file the issue with Swagger Parser instead as suggested by Jim.
@sbeh also when I used https://editor2.swagger.io to load the spec (https://docs.newsletter2go.com/doc/swagger.json), I got many errors.
Description
The csharp client is missing one class file (in this case ApiResponseDelete.cs). Other classes use instances of the missing ApiResponseDelete class.
Swagger-codegen version
2.2.2
Swagger declaration file content or url
https://docs.newsletter2go.com/doc/swagger.json
Command line used for generation
Steps to reproduce