Hi Markus,

I can't argue about that behavior, because the original code isn't mine.

Take a look at 
https://github.com/swagger-api/swagger-core/blob/d17f81c7e7ba99157ec7b3ab324a16372885416c/modules/swagger-jaxrs2/src/main/java/io/swagger/v3/jaxrs2/integration/resources/BaseOpenApiResource.java#L72
 - that's where the serialization code you linked to is originally from. 

In the version I supplied as pull request, see 
https://github.com/osx2000/aries-jax-rs-whiteboard/blob/master/integrations/openapi/openapi-resource/src/main/java/org/apache/aries/jax/rs/openapi/OpenApiResource.java
 the code duplication from the Swagger BaseOpenApiResource is replaced by 
inheritance 

Best regards,

Oliver

-----Original Message-----
From: Markus Rathgeb <maggu2...@gmail.com> 
Sent: 23 November 2019 11:59
To: user@aries.apache.org
Subject: Re: Jax-RS Whiteboard and OpenAPI

Hi Oliver,

there is another thing I don't understand:
Why you do not run into the following "problem" I ran with your code:

https://github.com/osx2000/finmath-service/blob/master/bundles/service/src/main/java/de/osx2000/finmath/service/OpenApiResource.java#L125

If a "json" reply is generated you stringify the object already and place the 
JSON string representation of the object as entity in the response.
As media type JSON is chosen...

For me the message body writer for the media type JSON is picked up by JAX-RS 
to encode the response's entity. The entity object (a string that already is a 
valid JSON string) is then again stringified as JSON...

Why is this not been the cause for your message body writer?

Reply via email to