How to generate swagger file (YAML or JSON) from the Rest Resource?

2017-03-09 Thread tech . narsingh
Hi, I know how to generate server side and client side code from swagger file i.e. Top Down Approach. Now I want to learn, how to generate Swagger file from the Rest Resource (i.e. server side code) i.e. the Bottom Up Approach. It is just like the web Services as we generate the java code from t

How to add two different paths to the same endpoint in swagger?

2017-03-09 Thread Caio Ricci
We can have two endpoints that lead to the same method if we have nested resources. Example: GET /menus/5/sections or GET /sections We can document a single endpoint using the annotations, is it possible to document automatically both urls, maybe with two different path params? See the quest

Re: Swagger parameter example value can't be defined

2017-03-09 Thread tony tam
You may need to set the `defaultValue` attribute. The “example” and “defaultValue” are confusing in the swagger-core implementation in 2.0, it will be changed in the next major version > On Mar 9, 2017, at 5:53 AM, Sergio Stateri wrote: > > Hi, > > I'm using Swagger 2 and it isn't being poss

Swagger parameter example value can't be defined

2017-03-09 Thread Sergio Stateri
Hi, I'm using Swagger 2 and it isn't being possible to define the parameter example value textbox, that's the example that can be used to try the service. I already tried using: @ApiImplicitParam( ..., example = "{\"channelCode\": \"WEB\", \"email\": \"m

Re: Swagger UI to use X-Auth-Token

2017-03-09 Thread lior solodkin
I found out that I had used swagger 1.5.9 that doesn't have SecurityDefinition. I upgraded to 1.5.12. Now how should look my annotation to genarate this in yaml: securityDefinitions: X-Auth-Token: type: "apiKey" name: "X-Auth-Token" in: "header" flow: "implicit" Thanks. בתאריך

Swagger UI to use X-Auth-Token

2017-03-09 Thread lior solodkin
Hi, I would like to add an option to my Swagger UI, that the user could fill once a token that he received, and than it will be send in the header in each API call. I tried to use securityDefinitions, but didn't manage to get it work with X-Auth-Token. Can it work this way? If it can work what