You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
swagger: '2.0'
info:
title: Test API
description: This is my awesome documentation
version: 1.0.0
host: test.com
schemes:
- https
produces:
- application/json
paths:
/sites:
get:
description: |
Get some sites
responses:
'200':
description: Success
schema:
$ref: '#/definitions/sites'
definitions:
sites:
$ref: './schemas/sitesGETresponse.schema.json'
sitesGETresponse.schema.json:
{
"id": "sitesGETresponse.schema.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Site list",
"description": "Response to site list request",
"type": "array",
"items": {
"type": "string"
}
}
Created an error:
> java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i ../path/to/my/swagger/api.yaml -o samples/client/test/android-java -l android -v
[main] INFO io.swagger.codegen.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
reading from ../path/to/my/swagger/api.yaml
Exception in thread "main" java.lang.NullPointerException
at io.swagger.parser.processors.ExternalRefProcessor.processRefToExternalDefinition(ExternalRefProcessor.java:63)
at io.swagger.parser.processors.ModelProcessor.processRefModel(ModelProcessor.java:92)
at io.swagger.parser.processors.ModelProcessor.processModel(ModelProcessor.java:33)
at io.swagger.parser.processors.DefinitionsProcessor.processDefinitions(DefinitionsProcessor.java:40)
at io.swagger.parser.SwaggerResolver.resolve(SwaggerResolver.java:42)
at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:64)
at io.swagger.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:317)
at io.swagger.codegen.cmd.Generate.run(Generate.java:186)
at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)
Running swagger codegen built from source, master checkout
The text was updated successfully, but these errors were encountered:
I've tracked the issue to the processRefToExternalDefinition method in ExternalRefProcessor in swagger-parser. There seem to be numerous ways this one line can fail, and I've managed to find them all...
My api spec:
sitesGETresponse.schema.json:
Created an error:
Running swagger codegen built from source, master checkout
The text was updated successfully, but these errors were encountered: