Hey,

I am using  io.swagger.core of version 1.5.16 and it works for me.

@ApiImplicitParams({

      @ApiImplicitParam(name = "graph", value = "list of the graph record IDs 
for each network which are going to be merged in a single network", paramType = 
"body", dataType = "jsonNode") ,
      @ApiImplicitParam(name = "name", value = "graph name", paramType = 
"body",examples = @Example(value = {@ExampleProperty(mediaType = 
"application/json" ,value = "{}")}))})
  


On Wednesday, August 24, 2016 at 1:07:50 AM UTC+5:30, sdav wrote:
>
> Hi ,
>
> I have checked the examples on github about @example property (
> https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-jaxrs/src/test/java/io/swagger/resources/ClassWithExamplePost.java).
>  
> I tried to implement the same on my api but i always get the error 
> indicating that " @example is disallowed at this location " or "can not be 
> resolved in to type".
>
>
> @POST
> @Produces({MediaType.APPLICATION_JSON})
> @Consumes({MediaType.APPLICATION_JSON})
> @ApiOperation(value="Creates new Data control")
> @ApiImplicitParams({
> @ApiImplicitParam(
> paramType = "body",
> name = "myPody",
> dataType = "[Ljava.lang.String;",
> examples = @Example(value = {
> @ExampleProperty(mediaType="application/json", value="[\"a\",\"b\"]")}))
> })
>
> @ApiResponses(value = {
> @ApiResponse(code = 403, message = "Invalid credentials"),
> @ApiResponse(code = 404, message = "Invalid Request") })  
> public JsonObject create(@ApiParam(hidden=true)JsonObject request) {
> log.info("create new data control");
> JsonObject response = null;
> try{..................................
> ...............................}
> }
>
> No matter where i use i get the same error. so can you please tell me what 
> is the correct way of using the @example property?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to