On Tue, Oct 21, 2014 at 9:12 AM, panzerhans <[email protected]> wrote:
> I I expose this class:
>
> @ApiModel(value = "MyDTO ", description = "My data transporter")
> public class MyDTO {
>     @ApiModelProperty(value = "This is a private field")
>     private String myPrivateField;
> }
>
> Swagger will not document the class as JSON. I am unsure if this is
> happening in camel-core, or if this is a problem with Swagger. However, the
> behaviour is inconsistent with e.g. Gson, which handles private fields just
> fine. Instead it relies on annotations for how the class variables should be
> exposed.
>
> Is there anywhere that I can change the configuration to have this private
> property inspected by camel-swagger?
>

camel-swagger uses the swagger code to read the models.
https://github.com/apache/camel/blob/master/components/camel-swagger/src/main/scala/org/apache/camel/component/swagger/RestSwaggerReader.scala#L150

So not sure what is happening.

I guess if you have a small sample project that demonstrates the
issue, we could use that to take a look.

And btw does it work if you change the property from private to public ?

And how do you run the app? standalone, tomcat, osgi or something else?

>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Private-variables-not-being-inspected-camel-swagger-tp5757833.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: [email protected]
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to