help getting started with jackson generation
I'm trying to generate a java jackson api (with @JsonProperty annotation etc) from https://github.com/npomfret/coinsbank-php-sdk/blob/master/reference/coinsbank-sapi.json.
So i run:
swagger-codegen generate -i https://raw.githubusercontent.com/npomfret/coinsbank-php-sdk/master/reference/coinsbank-sapi.json -l java -o temp
How do I get it to generate the jackson annotations?
Also, it crashes after generating some classes at Resource: put /card/name/_{cardUniqueId} with:
Caused by: java.lang.NullPointerException
at io.swagger.codegen.DefaultCodegen.isDataTypeBinary(DefaultCodegen.java:2590)
This isn't my json, so I'm not too familiar with it. Maybe it's not well formed swagger?
I used spring language and it generated all Jackson annotations in models, if that is what you looking for then you run following command:
swagger-codegen generate -i https://raw.githubusercontent.com/npomfret/coinsbank-php-sdk/master/reference/coinsbank-sapi.json -l spring -o temp
Thanks, that's exactly the command I'm using. Some objects get generated - but then it crashes.
In your question you said you are using "java", so suggested to use "spring" language instead to get Jackson annotation in your models.
About your second question: You have huge specification file, I would recommend to split it. Thats aside I tried to import your specification to swagger editor and saw there are errors, so I would recommend to fix those errors before trying anything.
Thanks for the reply.
It's not my file unfortunately. Using the spring flag worked. Well, it at least generated some useful classes.