Closed hindsholm closed 6 years ago
I am generating HAL-style links using JsonObjectBuilder, but the generated Swagger is not as expected.
This method:
@GET @Produces(MediaType.APPLICATION_JSON) public JsonObject get() { return Json.createObjectBuilder() .add("_links", Json.createObjectBuilder() .add("self", Json.createObjectBuilder() .add("href", "http://example.com/self"))) .build(); }
produces this Swagger:
... "responses": { "200": { "description": "OK", "headers": { }, "schema": { "$ref": "#/definitions/JsonObject" } } } ... "definitions": { "JsonObject": { "properties": { "_links": { "$ref": "#/definitions/JsonObject_2" } } }, "JsonObject_2": { "properties": { "self": { "$ref": "#/definitions/JsonObject_2" } } } }
Please not that the 'href' property is missing in the Swagger spec and instead 'self' points back to itself. I really like the whole idea behind JAXRS-Analyzer, so I hope this issue can be fixed!
Fixed by #148.
I am generating HAL-style links using JsonObjectBuilder, but the generated Swagger is not as expected.
This method:
produces this Swagger:
Please not that the 'href' property is missing in the Swagger spec and instead 'self' points back to itself. I really like the whole idea behind JAXRS-Analyzer, so I hope this issue can be fixed!