module:
post:
tags:
- module
summary: Create a module
operationId: createModule
security:
- TokenAuth: []
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/BaseModule'
- $ref: '#/components/schemas/FullModule'
responses:
200:
description: "Success: module created"
...
components:
schemas:
BaseModule:
description: Basic information about a model
type: object
properties:
moduleId:
type: integer
format: int64
moduleName:
type: string
details:
type: string
numberOfWords:
type: integer
format: int32
example: 10
parent:
type: integer
format: int64
child:
type: integer
format: int64
required:
- moduleName
FullModule:
allOf:
- $ref: '#/components/schemas/InfoModule'
- type: object
properties:
words:
type: array
items:
$ref: '#/components/schemas/Dictionary'
quiz:
type: array
items:
$ref: '#/components/schemas/Quiz'
required:
- words
python-flask server stub I get the following errorThere was an error generating the servers python-flask code. Please ensure that the definition and all external refs (inc. domains) are valid.
swagger-codegen generate -i Documents/asltutor.ymal -l python-flask -o Desktop and got the following error:java.lang.NullPointerException
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.fromProperty(DefaultCodegenConfig.java:1685)
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.fromRequestBody(DefaultCodegenConfig.java:2589)
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.fromOperation(DefaultCodegenConfig.java:2102)
at io.swagger.codegen.v3.DefaultGenerator.processOperation(DefaultGenerator.java:901)
at io.swagger.codegen.v3.DefaultGenerator.processPaths(DefaultGenerator.java:828)
at io.swagger.codegen.v3.DefaultGenerator.generateApis(DefaultGenerator.java:462)
at io.swagger.codegen.v3.DefaultGenerator.generate(DefaultGenerator.java:776)
at io.swagger.codegen.v3.cli.cmd.Generate.run(Generate.java:342)
at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-1" java.lang.RuntimeException: Could not process operation:
Tag: class Tag {
name: module
description: null
externalDocs: null
}
Operation: create_module
Resource: post /modules
Exception: null
at io.swagger.codegen.v3.DefaultGenerator.processOperation(DefaultGenerator.java:926)
at io.swagger.codegen.v3.DefaultGenerator.processPaths(DefaultGenerator.java:828)
at io.swagger.codegen.v3.DefaultGenerator.generateApis(DefaultGenerator.java:462)
at io.swagger.codegen.v3.DefaultGenerator.generate(DefaultGenerator.java:776)
at io.swagger.codegen.v3.cli.cmd.Generate.run(Generate.java:342)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.fromProperty(DefaultCodegenConfig.java:1685)
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.fromRequestBody(DefaultCodegenConfig.java:2589)
at io.swagger.codegen.v3.generators.DefaultCodegenConfig.fromOperation(DefaultCodegenConfig.java:2102)
at io.swagger.codegen.v3.DefaultGenerator.processOperation(DefaultGenerator.java:901)
... 5 more
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/BaseModule'
- $ref: '#/components/schemas/FullModule'
content:
application/json:
schema:
$ref: '#/components/schemas/FullModule'
code-gen error does not occur when building a spring, inflector or aspnetcore server stub. No idea why.@shawntavious - this _is_ an issue with the codegen, actually. It should work, but it doesn't. As you've mentioned, it works with the other generators. Moving this to the codegen for them to look at.
Most helpful comment
@shawntavious - this _is_ an issue with the codegen, actually. It should work, but it doesn't. As you've mentioned, it works with the other generators. Moving this to the codegen for them to look at.