question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Swagger fails on response type of ObjectNode

See original GitHub issue

Several of our REST APIs return ObjectNode as a free-form JSON object. JAXRS handles this cleanly. However, swagger fails to initialize in this scenario with the following error:

java.lang.IllegalArgumentException: Conflicting setter definitions for property "all": com.fasterxml.jackson.databind.node.ObjectNode#setAll(1 params) vs com.fasterxml.jackson.databind.node.ObjectNode#setAll(1 params)
    at com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.getSetter(POJOPropertyBuilder.java:320)
    at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:267)
    at io.swagger.jackson.ModelResolver.resolve(ModelResolver.java:149)

It would be nice for swagger to not to be completely unusable in this scenario. For example, the implementation could special case ObjectNode response types and document as a schema-less response object.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:11
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
borillocommented, Dec 22, 2016

Thx a lot for the workaround @StevenChoo!!

1reaction
fehguycommented, Dec 22, 2016

Try snapshot, we’ve updated the jackson version there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swagger fails on response type of ObjectNode - Bountysource
Several of our REST APIs return ObjectNode as a free-form JSON object. JAXRS handles this cleanly. However, swagger fails to initialize in ...
Read more >
Custom ResponseModel in Springfox/Swagger for returning of ...
We can give custom request and response model in swagger api documentation using swagger springfox annotations as shown below
Read more >
com.fasterxml.jackson.databind.node.ArrayNode incompatible ...
I'm getting this error when trying to build a new REST API in IIB toolkit ... After changing the data type to object...
Read more >
Error when validating response body against a schema ...
JsonNode which returns following error: com.github.fge.jsonschema.core.report.ListProcessingReport: failure --- BEGIN MESSAGES --- error: ...
Read more >
Describing Responses - Swagger
To specify the response media types, use the content keyword at the operation level. ... For example, you can describe the conditions for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found