Skip to content

Instantly share code, notes, and snippets.

@EarthCitizen
Last active January 22, 2019 23:17
Show Gist options
  • Save EarthCitizen/9c03901e21ba588a4ce22a6824ff9ac8 to your computer and use it in GitHub Desktop.
Save EarthCitizen/9c03901e21ba588a4ce22a6824ff9ac8 to your computer and use it in GitHub Desktop.
swagger-codegen - Spring - NPE - Full Output
spring-client $ swagger-codegen generate -v -l spring -i ../openapi.yaml
16:15:37.061 [main] DEBUG io.swagger.codegen.v3.cli.SwaggerCodegen - there are not options for command 'langs'
16:15:37.063 [main] DEBUG io.swagger.codegen.v3.cli.SwaggerCodegen - there are not options for command 'version'
16:15:37.107 [Thread-1] INFO io.swagger.codegen.v3.config.CodegenConfigurator -
VERBOSE MODE: ON. Additional debug options are injected
- [debugSwagger] prints the swagger specification as interpreted by the codegen
- [debugModels] prints models passed to the template engine
- [debugOperations] prints operations passed to the template engine
- [debugSupportingFiles] prints additional data passed to the template engine
16:15:37.117 [Thread-1] DEBUG io.swagger.codegen.v3.config.CodegenConfigurator - Loaded raw data: openapi: '3.0.0'
into:
title: Records OpenAPI document
version: 1.0.0
components:
schemas:
Record:
type: object
properties:
id:
type: integer
format: int64
code:
type: string
info:
type: string
paths:
/records:
get:
description: Get the records
responses:
'200':
description: A list of records
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Record'
16:15:37.121 [Thread-1] DEBUG io.swagger.v3.parser.OpenAPIV3Parser - Loaded raw data: openapi: '3.0.0'
into:
title: Records OpenAPI document
version: 1.0.0
components:
schemas:
Record:
type: object
properties:
id:
type: integer
format: int64
code:
type: string
info:
type: string
paths:
/records:
get:
description: Get the records
responses:
'200':
description: A list of records
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Record'
16:15:37.122 [Thread-1] DEBUG io.swagger.v3.parser.OpenAPIV3Parser - Parsed rootNode: {"openapi":"3.0.0","into":{"title":"Records OpenAPI document","version":"1.0.0"},"components":{"schemas":{"Record":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"code":{"type":"string"},"info":{"type":"string"}}}}},"paths":{"/records":{"get":{"description":"Get the records","responses":{"200":{"description":"A list of records","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Record"}}}}}}}}}}
16:15:37.140 [Thread-1] INFO io.swagger.codegen.v3.ignore.CodegenIgnoreProcessor - No .swagger-codegen-ignore file found.
{
"openapi" : "3.0.0",
"servers" : [ {
"url" : "/"
} ],
"paths" : {
"/records" : {
"get" : {
"description" : "Get the records",
"responses" : {
"200" : {
"description" : "A list of records",
"content" : {
"application/json" : {
"schema" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/Record"
}
}
}
}
}
}
}
}
},
"components" : {
"schemas" : {
"Record" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "integer",
"format" : "int64"
},
"code" : {
"type" : "string"
},
"info" : {
"type" : "string"
}
}
}
}
}
}
Exception in thread "Thread-1" java.lang.NullPointerException
at io.swagger.codegen.v3.generators.java.SpringCodegen.preprocessOpenAPI(SpringCodegen.java:421)
at io.swagger.codegen.v3.DefaultGenerator.configureGeneratorProperties(DefaultGenerator.java:190)
at io.swagger.codegen.v3.DefaultGenerator.generate(DefaultGenerator.java:713)
at io.swagger.codegen.v3.cli.cmd.Generate.run(Generate.java:342)
at java.lang.Thread.run(Thread.java:745)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment