Hey, I'm rather new to Swagger, and am trying to build out documentation 
using the spring-fox annotations and the swagger-maven-plugin to generate a 
swagger file. I'm having trouble building out the x-code-samples vendor 
extension.

As I understand it, the generated json for x-code-samples should look like 
this:


"x-code-samples" : [

{
"source" : "C#",
"lang" : "[Example Code in C#]"
},
{
"source" : "Java",
"lang" : "[Example Code in Java]"
}

]


But when I try to use the @Extension annotation to build this, I can't seem 
to figure out how to get it to generate an array. For example, doing this:

@ApiOperation(value = "My Op", extensions = {
  @Extension(name = "code-samples", properties = {
    @ExtensionProperty(name = "lang", value="C#"),
    @ExtensionProperty(name = "source", value = "[Example Code in C#]")
  }),
  @Extension(name = "code-samples", properties = {
    @ExtensionProperty(name = "lang", value="Java"),
    @ExtensionProperty(name = "source", value = "[Example Code in Java]")
  })
})


Then the plugin overwrites one or the other, and I end up with something 
like the following:

"x-code-samples" : {

"source" : "C#",
"lang" : "[Example Code in C#]"
}

The @Extension doesn't generate an array. Any ideas (or am I asking in the 
wrong place)?


Thanks,
Jeremy


-- 
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