You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Erukala Uttam <23...@gmail.com> on 2016/01/28 11:27:44 UTC

Able to read Swagger schema model from a json file instead of creating a POJO.

In this route ,

rest(“/sample”).post(“/test”) .description("Health Check route").
outType(User.class)

.produces("application/json")

.param().dataType("string").name("id").type(RestParamType.query

            ).description("partnerId of the Service").required(true)

                                                .endParam()

                                        .param()

    .dataType("string").name("secret").type(RestParamType.query

).description("partner_secret of the Service").required(true)

                                       .endParam()

.param()

.dataType("application/json").name("body").type(RestParamType.body).description("
request body").required(false)

                                    .endParam()

                                   .responseMessage()

.code(200).message("returns the health details of the
application").endResponseMessage().responseMessage();


In the Above route instead of specifying the outType as a Class name.Cam we
give a json file which has a schema of the required format of the response
?Can we do something like that ...

Re: Able to read Swagger schema model from a json file instead of creating a POJO.

Posted by Erukala Uttam <23...@gmail.com>.
Can we Do something about this ..
I meant we can read a json file and add that directly to the response model
instead of Create a class and annotating it..It well be efficient right..

On Thu, Jan 28, 2016 at 4:02 PM, Claus Ibsen <cl...@gmail.com> wrote:

> No this is not possible.
>
> On Thu, Jan 28, 2016 at 11:27 AM, Erukala Uttam <23...@gmail.com>
> wrote:
> > In this route ,
> >
> > rest(“/sample”).post(“/test”) .description("Health Check route").
> > outType(User.class)
> >
> > .produces("application/json")
> >
> > .param().dataType("string").name("id").type(RestParamType.query
> >
> >             ).description("partnerId of the Service").required(true)
> >
> >                                                 .endParam()
> >
> >                                         .param()
> >
> >     .dataType("string").name("secret").type(RestParamType.query
> >
> > ).description("partner_secret of the Service").required(true)
> >
> >                                        .endParam()
> >
> > .param()
> >
> >
> .dataType("application/json").name("body").type(RestParamType.body).description("
> > request body").required(false)
> >
> >                                     .endParam()
> >
> >                                    .responseMessage()
> >
> > .code(200).message("returns the health details of the
> > application").endResponseMessage().responseMessage();
> >
> >
> > In the Above route instead of specifying the outType as a Class name.Cam
> we
> > give a json file which has a schema of the required format of the
> response
> > ?Can we do something like that ...
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

Re: Able to read Swagger schema model from a json file instead of creating a POJO.

Posted by Claus Ibsen <cl...@gmail.com>.
No this is not possible.

On Thu, Jan 28, 2016 at 11:27 AM, Erukala Uttam <23...@gmail.com> wrote:
> In this route ,
>
> rest(“/sample”).post(“/test”) .description("Health Check route").
> outType(User.class)
>
> .produces("application/json")
>
> .param().dataType("string").name("id").type(RestParamType.query
>
>             ).description("partnerId of the Service").required(true)
>
>                                                 .endParam()
>
>                                         .param()
>
>     .dataType("string").name("secret").type(RestParamType.query
>
> ).description("partner_secret of the Service").required(true)
>
>                                        .endParam()
>
> .param()
>
> .dataType("application/json").name("body").type(RestParamType.body).description("
> request body").required(false)
>
>                                     .endParam()
>
>                                    .responseMessage()
>
> .code(200).message("returns the health details of the
> application").endResponseMessage().responseMessage();
>
>
> In the Above route instead of specifying the outType as a Class name.Cam we
> give a json file which has a schema of the required format of the response
> ?Can we do something like that ...



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2