How Do I Fix "Property Must Not be Null" Exception?
Swagger2Markup version: 1.3.2
Problem description: I am a technical writer, not a developer. I asked a developer to set up swagger2markup for me. He did, and it worked perfectly with the example file you provide.
Then we tried a real-life example: a large Swagger Web API JSON. It failed with the error shown below. Can you give us an idea of what this message means? The JSON is valid and working: it displays our documentation beautifully in a web browser and contains no syntax errors. We tried this command with a compressed version of the JSON and an uncompressed (pretty printed) version. Saw the same error each time.
Thanks in advance for your help. Nina
Command used to generate the document:
java -jar swagger2markup-cli-1.3.2.jar convert -i swagger2.json -d /outputNina
==============ERROR MESSAGE TEXT================
0:55:44.430 [main] WARN io.swagger.util.PropertyDeserializer - no property from null, null, {ENUM=null, TITLE=null, DESCRIPTION=The location of the created User, DEFAULT=null, PATTERN=null, DESCRIMINATOR=null, MIN_ITEMS=null, MAX_ITEMS=null, MIN_PROPERTIES=null, MAX_PROPERTIES=null, MIN_LENGTH=null, MAX_LENGTH=null, MINIMUM=null, MAXIMUM=null, EXCLUSIVE_MINIMUM=null, EXCLUSIVE_MAXIMUM=null, UNIQUE_ITEMS=null, EXAMPLE=null, TYPE=null, FORMAT=null, READ_ONLY=null, VENDOR_EXTENSIONS={}, MULTIPLE_OF=null}
10:55:44.721 [main] DEBUG i.g.s.i.document.PathsDocument - Generate examples is disabled.
10:55:44.721 [main] DEBUG i.g.s.i.document.PathsDocument - Create separated operation files is disabled.
10:55:44.726 [main] DEBUG i.g.s.i.document.DefinitionsDocument - Create separated definition files is disabled.
10:55:44.897 [main] INFO i.g.s.m.b.i.asciidoc.AsciiDocBuilder - Markup document written to: C:\outputNina\overview.adoc
Exception in thread "main" java.lang.NullPointerException: property must not be null
at org.apache.commons.lang3.Validate.notNull(Validate.java:222)
at io.github.swagger2markup.internal.adapter.PropertyAdapter.
I guess you would have to provide (e.g. attach) swagger2.json.
I got this as well because response headers are not parsed properly.
eg. I have something like this under an operation (several properties ommitted):
"responses": {
"200": {
"headers": {
"Link": {
"description": "next/previous for scrolling through results",
"type": "http://tools.ietf.org/html/rfc5988#page-6"
}
}
}
}
Headers are parsed as a Map<String, Property>, however the value of every entry (the Property) is always null.
edit: not this library, seems to be https://github.com/swagger-api/swagger-parser