Re: How do I define an array of geospatial coordinates?

2016-07-11 Thread Ron Ratovsky
The spec doesn’t support multiple types under items, so you can’t really do 
that.

 

From:  on behalf of Deryk Sinotte 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 11 July 2016 at 12:07
To: Swagger 
Subject: How do I define an array of geospatial coordinates?

 

I feel like I'm missing something fundamental.  I have a Swagger file that 
contains the following body parameter to describe a geospatial position 
[longitude,latitude]: 

 

"parameters": [
  {
"name": "body",
"in": "body",
"description": "Interesting description",
"required": true,
"schema": {
  "$ref": "#/definitions/Position"
}
  }
]

I describe the Position as: 

 

"Position": {
  "description": "A single position",
  "type": "array",
  "minItems": 2,
  "maxItems": 2,
  "items": [
{
  "type": "number"
}
  ]

Which works and doesn't cause a problem for the Swagger UI but I want to 
provide a bit more detail:

 

"Position": {
  "description": "A single position",
  "type": "array",
  "minItems": 2,
  "items": [
{
  "type": "number"
},
{
  "type": "number"
}
  ]
 

As soon as that second item to the array, the Swagger UI will not display it.  
Ideally, I'd like to describe it something more like this:

 

"Longitude": {
  "title": "Longitudinal Value",
  "description": "A valid longitude (-180 to 180).",
  "type": "number",
  "minimum": -180,
  "maximum": 180,
  "default": 0
},
"Latitude": {
  "title": "Latitudinal Value",
  "description": "A valid latitude (-90 to 90).",
  "type": "number",
  "minimum": -90,
  "maximum": 90,
  "default": 0
},
"Position": {
  "description": "A single position",
  "type": "array",
  "minItems": 2,
  "maxItems": 2,
  "items": [
{
  "$ref": "#/definitions/Longitude"
},
{
  "$ref": "#/definitions/Latitude"
}
  ],
  "additionalItems": false
}

It just seems that once I add a second entry into the Position items array, the 
Swagger UI can't handle it.  Am I describing it incorrectly or is it some kind 
of Swagger UI limitation/bug?

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I define an array of geospatial coordinates?

2016-07-11 Thread Ron Ratovsky
You’re correct. The Swagger spec (now OpenAPI) supports an extended subsect of 
JSON Schema. One of the things it does not support is multi-types.

JSON Schema wise – that’s absolutely valid.

 

 

From:  on behalf of Deryk Sinotte 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 11 July 2016 at 13:42
To: Swagger 
Subject: Re: How do I define an array of geospatial coordinates?

 

Thanks for responding. 

 

Just to be clear, I presume that you mean that the Swagger spec does not 
support this?  But the JSON Schema spec does?  It seems to be "legal" from the 
schema perspective and I've seen other JSON schema examples that have a similar 
approach.

 

Deryk

On Monday, 11 July 2016 12:29:18 UTC-7, Ron wrote: 

The spec doesn’t support multiple types under items, so you can’t really do 
that.

 

From:  on behalf of Deryk Sinotte 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Monday, 11 July 2016 at 12:07
To: Swagger 
Subject: How do I define an array of geospatial coordinates?

 

I feel like I'm missing something fundamental.  I have a Swagger file that 
contains the following body parameter to describe a geospatial position 
[longitude,latitude]: 

 

"parameters": [
  {
"name": "body",
"in": "body",
"description": "Interesting description",
"required": true,
"schema": {
  "$ref": "#/definitions/Position"
}
  }
]

I describe the Position as: 

 

"Position": {
  "description": "A single position",
  "type": "array",
  "minItems": 2,
  "maxItems": 2,
  "items": [
{
  "type": "number"
}
  ]

Which works and doesn't cause a problem for the Swagger UI but I want to 
provide a bit more detail:

 

"Position": {
  "description": "A single position",
  "type": "array",
  "minItems": 2,
  "items": [
{
  "type": "number"
},
{
  "type": "number"
}
  ]
 

As soon as that second item to the array, the Swagger UI will not display it.  
Ideally, I'd like to describe it something more like this:

 

"Longitude": {
  "title": "Longitudinal Value",
  "description": "A valid longitude (-180 to 180).",
  "type": "number",
  "minimum": -180,
  "maximum": 180,
  "default": 0
},
"Latitude": {
  "title": "Latitudinal Value",
  "description": "A valid latitude (-90 to 90).",
  "type": "number",
  "minimum": -90,
  "maximum": 90,
  "default": 0
},
"Position": {
  "description": "A single position",
  "type": "array",
  "minItems": 2,
  "maxItems": 2,
  "items": [
{
  "$ref": "#/definitions/Longitude"
},
{
  "$ref": "#/definitions/Latitude"
}
  ],
  "additionalItems": false
}

It just seems that once I add a second entry into the Position items array, the 
Swagger UI can't handle it.  Am I describing it incorrectly or is it some kind 
of Swagger UI limitation/bug?

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: OAuth 2 Implicit Flow on localhost

2016-07-11 Thread Ron Ratovsky
I assume you’re talking about swagger-ui?

Which version of swagger-ui do you use?

 

 

 

From:  on behalf of Joshua Tester 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 11 July 2016 at 12:57
To: Swagger 
Subject: OAuth 2 Implicit Flow on localhost

 

Good day, 

 

I am creating an Azure Web API application using .Net 4.6.1.

 

I have just a simple test controller that returns the string "success".  I have 
followed the instructions here: 
https://blogs.msdn.microsoft.com/pratushb/2016/04/28/enable-swagger-to-authenticate-against-azure-ad/
 and I have successfully setup the OAuth2 bearer tokens on the PUBLISHED azure 
web api site.

 

I have now tried to setup swagger, with the OAuth2 tokens from our AD tenant, 
to work when debugging on my https://;ocalhost:44305.  I click the 'On' button 
for the OAuth2 token and it goes to Azure AD and gets a token.  But the token 
is apparently invalid and just keeps telling me I am not authorized.  I did the 
exact same setup TWICE now and it continuously works on the published Azure API 
site.  Localhost continues to deny me.  If I remove the [Authorize] tags on the 
controller methods, it works fine.

 

Any thoughts, comments, questions are welcome.

 

Thank you for your time.

 

V/R

J

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: OAuth 2 Implicit Flow on localhost

2016-07-11 Thread Ron Ratovsky
The latest swagger-ui version is 2.1.4.

Is that the version of Swashcubkle?

 

 

 

From:  on behalf of Joshua Tester 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 11 July 2016 at 15:39
To: Swagger 
Subject: Re: OAuth 2 Implicit Flow on localhost

 

5.3.2

On Monday, July 11, 2016 at 1:17:35 PM UTC-8, Ron wrote: 

I assume you’re talking about swagger-ui?

Which version of swagger-ui do you use?

 

 

 

From:  on behalf of Joshua Tester 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Monday, 11 July 2016 at 12:57
To: Swagger 
Subject: OAuth 2 Implicit Flow on localhost

 

Good day, 

 

I am creating an Azure Web API application using .Net 4.6.1.

 

I have just a simple test controller that returns the string "success".  I have 
followed the instructions here: 
https://blogs.msdn.microsoft.com/pratushb/2016/04/28/enable-swagger-to-authenticate-against-azure-ad/
 and I have successfully setup the OAuth2 bearer tokens on the PUBLISHED azure 
web api site.

 

I have now tried to setup swagger, with the OAuth2 tokens from our AD tenant, 
to work when debugging on my https://;ocalhost:44305.  I click the 'On' button 
for the OAuth2 token and it goes to Azure AD and gets a token.  But the token 
is apparently invalid and just keeps telling me I am not authorized.  I did the 
exact same setup TWICE now and it continuously works on the published Azure API 
site.  Localhost continues to deny me.  If I remove the [Authorize] tags on the 
controller methods, it works fine.

 

Any thoughts, comments, questions are welcome.

 

Thank you for your time.

 

V/R

J

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How monitore Swagger UI

2016-07-12 Thread Ron Ratovsky
 

 

What do you mean by monitor swagger-ui?

 

 

From:  on behalf of Natalia Queiroz 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 12 July 2016 at 06:49
To: Swagger 
Subject: How monitore Swagger UI

 

Hello group, is there any possibility to monitore Swagger UI? 
What is main proposal of API key?

Regards,
Natália

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Difference between the swagger code generator maven-plugin and that on the editor(that is editor.io)

2016-07-12 Thread Ron Ratovsky
The difference would be the version of the generator code used.

 

 

 

 

From:  on behalf of Durvesh Kambli 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 11 July 2016 at 22:48
To: Swagger 
Subject: Difference between the swagger code generator maven-plugin and that on 
the editor(that is editor.io)

 

When created the same client using the generate client option on the 
editor(that is editor.io) I get auto generated test classes. These are not 
created when I use the maven plugin. What is that I need to give as input to 
generate these test classes.
Just in case if anyone asks, I have used the same swagger file for both.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: OAuth 2 Implicit Flow on localhost

2016-07-12 Thread Ron Ratovsky
Okay, in that case please try with the latest master version of swagger-ui and 
not the one provided with Swashbuckle.

 

 

 

From:  on behalf of Joshua Tester 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 11 July 2016 at 16:37
To: Swagger 
Subject: Re: OAuth 2 Implicit Flow on localhost

 

Yes, sorry.  Swashbuckle and Swashbuckle.Core

On Monday, July 11, 2016 at 3:25:44 PM UTC-8, Ron wrote: 

The latest swagger-ui version is 2.1.4.

Is that the version of Swashcubkle?

 

 

 

From:  on behalf of Joshua Tester 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Monday, 11 July 2016 at 15:39
To: Swagger 
Subject: Re: OAuth 2 Implicit Flow on localhost

 

5.3.2

On Monday, July 11, 2016 at 1:17:35 PM UTC-8, Ron wrote: 

I assume you’re talking about swagger-ui?

Which version of swagger-ui do you use?

 

 

 

From:  on behalf of Joshua Tester 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Monday, 11 July 2016 at 12:57
To: Swagger 
Subject: OAuth 2 Implicit Flow on localhost

 

Good day, 

 

I am creating an Azure Web API application using .Net 4.6.1.

 

I have just a simple test controller that returns the string "success".  I have 
followed the instructions here: 
https://blogs.msdn.microsoft.com/pratushb/2016/04/28/enable-swagger-to-authenticate-against-azure-ad/
 and I have successfully setup the OAuth2 bearer tokens on the PUBLISHED azure 
web api site.

 

I have now tried to setup swagger, with the OAuth2 tokens from our AD tenant, 
to work when debugging on my https://;ocalhost:44305.  I click the 'On' button 
for the OAuth2 token and it goes to Azure AD and gets a token.  But the token 
is apparently invalid and just keeps telling me I am not authorized.  I did the 
exact same setup TWICE now and it continuously works on the published Azure API 
site.  Localhost continues to deny me.  If I remove the [Authorize] tags on the 
controller methods, it works fine.

 

Any thoughts, comments, questions are welcome.

 

Thank you for your time.

 

V/R

J

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can not read header param from Filter

2016-07-13 Thread Ron Ratovsky
This will only work if you a security definition called “authorization” in your 
spec? otherwise swagger-ui will not send it.

 

 

 

From:  on behalf of swaggerUser 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 13 July 2016 at 13:55
To: Swagger 
Subject: Can not read header param from Filter

 

Hi, 

 

I am using swagger with Jersey.

I am trying to send header parameter through index.html so that all APIs will 
get that as a header param, and I can see that as well into te CURL stmt.

 

I added this to my index.html:

 

 swaggerUi.api.clientAuthorizations.add("key", new 
SwaggerClient.ApiKeyAuthorization("authorization", "authValue", "header"));

 

But when I try to read this header param from filter, I am getting null value.

 

If I execute the same API through Post or SoupUI, then filter is reading the 
header parameter "authorization".

 

I tried reading the header param as this in filter:

 

public void doFilter(ServletRequest request, ServletResponse response,

FilterChain filter) throws IOException, ServletException {

 

HttpServletRequest req= (HttpServletRequest) request;

 

 Enumeration headerNames = req.getHeaderNames();

 

if (headerNames != null) {

 while (headerNames.hasMoreElements()) {

String key = headerNames.nextElement();

   

 

System.out.println("Header key: " + key);

   System.out.println("Header value: " + req.getHeader(key));

 

}

 

while debugging I get one of this :

access-control-request-headers = accept, authorization

 

Please help. 

 

Thanks,

 

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Swagger v1.2 is not allowing for ipv6 hosts

2016-07-14 Thread Ron Ratovsky
Where do you experience the problem?

 

 

 

 

From:  on behalf of Mohammad Riyazuddin 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 14 July 2016 at 12:57
To: Swagger 
Subject: Swagger v1.2 is not allowing for ipv6 hosts

 

Hi, 
Currently we are migrating from ipv4 to ipv6 , we are in process of using 
swagger in ipv6 hosts, looks like swagger 1.2V is not recognizing ipv6 hosts. 
Can anyone please suggest what is the work around for this ? 

 

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: volley timeout error

2016-07-15 Thread Ron Ratovsky
Please open a ticket on swagger-codegen.

 

 

 

From:  on behalf of Pradeep Kumar Reddy 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 15 July 2016 at 03:57
To: Swagger 
Subject: volley timeout error

 

 

I'm getting the following exception when trying to do a get request by using 
the swagger generated code : 

 

exception : java.util.concurrent.ExecutionException: 
com.android.volley.TimeoutError

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add Proxy host and port to make Swagger Calls

2016-07-15 Thread Ron Ratovsky
Assuming you’re asking about swagger-ui, you can use swaggerUi.api.setHost(...) 
to change the host of the API calls.

 

 

 

From:  on behalf of One Solution 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 15 July 2016 at 09:37
To: Swagger 
Subject: How to add Proxy host and port to make Swagger Calls

 

Hello, 

 

Our server is not accessing direct internet thus using a proxy host/IP and port 
to access API.

 

Please help me to add proxy host and port for every swagger try it out calls...

 

Thanks

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Swagger v1.2 is not allowing for ipv6 hosts

2016-07-15 Thread Ron Ratovsky
I’m just really not sure what you mean by ‘swagger is not recognizing ipv6 
hosts’. Swagger is the name of the spec, or the set of tools, but it’s not a 
specific tool.

Please describe what it is exactly that you’re doing, which libraries and 
versions, and where exactly it fails.

 

 

 

 

From:  on behalf of Mohammad Riyazuddin 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 14 July 2016 at 21:45
To: Swagger 
Subject: Re: Swagger v1.2 is not allowing for ipv6 hosts

 

Small Correction, we have Swagger v1.2 embedded in OpenDayLight, Not in Apache 
Karaf

On Friday, July 15, 2016 at 10:13:13 AM UTC+5:30, Mohammad Riyazuddin wrote: 

 

We are using Apache-Karaf-Beryllium-SR2 for our OSGI projects, and Apache Karaf 
has inbuilt support for Swagger v1.2, As we are trying to access the rest conf 
through IPV6 url in IPV6 machine  , 

 

 

Sample url format : 
http://[hd18:695c:f038:2:a25:27ff:fe16:b22c]:8181/apidoc/explorer/index.html

 

we were facing the issue as 'Can\'t read swagger JSON from "http://..";' even if 
the json is available .

 

We did not face this issue in IPV4 

 

 

 

 



On Friday, July 15, 2016 at 1:27:26 AM UTC+5:30, Mohammad Riyazuddin wrote: 

Hi, 
Currently we are migrating from ipv4 to ipv6 , we are in process of using 
swagger in ipv6 hosts, looks like swagger 1.2V is not recognizing ipv6 hosts. 
Can anyone please suggest what is the work around for this ? 

 

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: RESTEasy using Application/BeanConfig not seeing resources

2016-07-18 Thread Ron Ratovsky
Hi,

 

First thing would be to use the latest version which is 1.5.9. 

Second, the output of the swagger.json you share doesn’t make sense as it’s  
not even JSON.

Is that the full output you get? Anything else in the logs?

 

 

 

 

From:  on behalf of hancholo 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 18 July 2016 at 09:11
To: Swagger 
Subject: RESTEasy using Application/BeanConfig not seeing resources

 

Can't figure this seemingly easy problem out 

 

Using Wildfly 10, have a basic REST CRUD webapp with a /hello endpoint for 
testing, which works fine.

 

Set up Swagger per Swagger Core RESTEasy 2.X Project Setup 1.5

 

and got to the point of the 'empty' swagger.json :

 

{
swagger: "2.0",
info: {},
version: "0.0.3",
title: "HelloWorld2Api"
host: "http://localhost:8080";,
basePath: "/HelloWorld2/rest",
schemes: [] "http"
}

 

my setup:

 

 

in pom.xml:

 


   io.swagger
   swagger-jaxrs
1.5.0


 

in jboss-web.xml

HelloWorld2

 

 

Here are the annotations on my test resource:

@Path("hello")
@Api(value="hello")
@Produces({"application/json", "application/xml"})
public class HelloREST { ... }

 

 

Here's the extended Application:

 

@ApplicationPath("rest")
public class ApplicationConfig extends Application {


/**
 * Custom constructor for Swagger
 */
public ApplicationConfig() {
BeanConfig beanConfig = new BeanConfig();
beanConfig.setTitle("HelloWorld2Api");
beanConfig.setVersion("0.0.3");
beanConfig.setSchemes(new String[]{"http"});
beanConfig.setHost("http://localhost:8080";);
beanConfig.setBasePath("/HelloWorld2/rest");
beanConfig.setScan(true);
beanConfig.setResourcePackage("io.swagger.resources");
  //  beanConfig.setResourcePackage("helloworld2.rest");
beanConfig.setPrettyPrint(true);
}


@Override
public Set> getClasses() {
Set> resources = new java.util.HashSet<>();

resources.add(helloworld2.rest.HelloREST.class);

resources.add(io.swagger.jaxrs.listing.ApiListingResource.class);
resources.add(io.swagger.jaxrs.listing.SwaggerSerializers.class);

return resources;
}


}

 

 

If the above commented out line: 

  //  beanConfig.setResourcePackage("helloworld2.rest")


is used instead of

  beanConfig.setResourcePackage("io.swagger.resources");

 

then the swagger.json returns

Context Path:
/HelloWorld2

Servlet Path:
/rest

Path Info:
/swagger.json

Query String:
null
Stack Trace
org.jboss.resteasy.spi.UnhandledException: 
java.lang.ArrayIndexOutOfBoundsException: 1

 

 

I've tried all sorts of permutations of configurations, paths, using xml 
descriptors and not, but can't find the problem. I would very much prefer to 
use the non-Spring beanConfig technique.  Where's my mistake? 

 

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to add Proxy host and port to make Swagger Calls

2016-07-18 Thread Ron Ratovsky
You’d use the setHost to run the calls against the proxy, not the other way 
around.

 

 

 

From:  on behalf of One Solution 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Saturday, 16 July 2016 at 23:29
To: Swagger 
Subject: Re: How to add Proxy host and port to make Swagger Calls

 

Hi Ron,


Yes I am asking about swagger-ui.
Our API calls are hosted at example.com but our server can't access example.com 
directly, it has to access through proxy
by using swaggerUi.api.setHost(...) I can change the API call host i.e 
example.com right?
If yes my question is how to tell swagger UI to use proxy to make API call 
hosted at example.com through proxy(proxy host and proxy port)..!


Thanks



On Friday, July 15, 2016 at 10:52:51 PM UTC+5:30, Ron wrote: 

Assuming you’re asking about swagger-ui, you can use swaggerUi.api.setHost(...) 
to change the host of the API calls.

 

 

 

From:  on behalf of One Solution 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Friday, 15 July 2016 at 09:37
To: Swagger 
Subject: How to add Proxy host and port to make Swagger Calls

 

Hello, 

 

Our server is not accessing direct internet thus using a proxy host/IP and port 
to access API.

 

Please help me to add proxy host and port for every swagger try it out calls...

 

Thanks

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: curl -X *method* --header 'Accept: application/json' not working

2016-07-18 Thread Ron Ratovsky
There are some known issues regarding that. Try the latest master version of 
swagger-ui.

 

 

 

 

From:  on behalf of Natalia Queiroz 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 15 July 2016 at 15:48
To: "swagger-swaggersocket@googlegroups.com" 

Subject: curl -X *method* --header 'Accept: application/json' not working

 

Hello group,

my json application is not showing the correct Accept response on the curl 
method.

Even using the header("Content-Type: application/json;charset=utf-8") or , 
header("Content-Type: application/json"), it keeps showing 


curl -X GET --header 'Accept: text/html' 
'http://servicos.jbrj.gov.br/jabot/collections'



Does anybody know if is it a bug? or how to fix it?



Thanks,


-- 



Natália Oliveira

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can swagger be used with Oauth 1.0 consumer_key and consumer_secret

2016-07-18 Thread Ron Ratovsky
There’s no support for OAuth 1 – see 
https://github.com/OAI/OpenAPI-Specification/issues/61.

 

 

 

From:  on behalf of Tara Czutno 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 18 July 2016 at 17:37
To: Swagger 
Subject: Can swagger be used with Oauth 1.0 consumer_key and consumer_secret

 

Can swagger be used with Oauth 1.0 consumer_key and consumer_secret?

Please point me to some documentation on how to accomplish this.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Generate Swagger json from Swagger annotations

2016-07-18 Thread Ron Ratovsky
Have you seen the wiki - 
https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-JAX-RS-Project-Setup-1.5.X
 and the samples - https://github.com/swagger-api/swagger-samples?

 

 

 

 

From:  on behalf of Kallen 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 18 July 2016 at 19:57
To: Swagger 
Subject: Generate Swagger json from Swagger annotations

 

I'm looking for a way to generate the swagger json files from swagger annotated 
java classes.  All the examples seem to revolve around serving from within a 
web container where swagger scans with reflection at run time.  Seems like this 
is possible to do but no clear examples. 

 

Thanks in advance

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: RESTEasy using Application/BeanConfig not seeing resources

2016-07-19 Thread Ron Ratovsky
Maintenance wise, it’d be very difficult to keep the docs updated with the 
latest version all the time.

However, the docs do say – 

"Check the change log to see information about the latest version and the 
changes from previous versions.”

 

 

 

 

From:  on behalf of hancholo 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 19 July 2016 at 07:18
To: Swagger 
Subject: Re: RESTEasy using Application/BeanConfig not seeing resources

 

 

First thing would be to use the latest version which is 1.5.9. 

 

Good to know.  Someone should update the docs since I can't be the first person 
to cut and paste the maven dependency.

 

And that did it

 

Thanks so much.

 

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mongo ObjectId in swagger api-docs url

2016-07-19 Thread Ron Ratovsky
Which tool do you use to generate the spec? Which version?

 

 

 

 

From:  on behalf of 
"assaf.kozlow...@teamaol.com" 
Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 19 July 2016 at 11:16
To: Swagger 
Subject: Mongo ObjectId in swagger api-docs url

 

Hello All 

One of the fields in my DTO object is Mongo ID ObjectID

problem is that api-docs url renders it as following

 "companyId": {

"counter": 0,

"date": "2016-07-19T18:14:15.953Z",

"machineIdentifier": 0,

"processIdentifier": 0,

"time": 0,

"timeSecond": 0,

"timestamp": 0

  }

 

Why the actual output for the same object is as follows : "companyId": 
"54c64814e4b0239071c154a1",

 

How can i match the schema to be present as a simple hash string key

 

Thanks

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Generate Swagger json from Swagger annotations

2016-07-19 Thread Ron Ratovsky
You can write your own Reader, yes. Swagger-core at its base is intended for 
jax-rs and servlets only. You didn’t mention which library you use to expose 
your REST API (if any).

 

 

 

From:  on behalf of Kallen 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 19 July 2016 at 14:47
To: Swagger 
Subject: Re: Generate Swagger json from Swagger annotations

 

Was looking for something that didn't pull in JAX-RS and just leveraged the 
swagger annotations.  I found the swagger-servlet module helped me understand 
what needs to be done to just scan for swagger annotations and build the 
Swagger model for output to json.  

On Tuesday, July 19, 2016 at 1:15:04 PM UTC+10, Ron wrote: 

Have you seen the wiki - 
https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-JAX-RS-Project-Setup-1.5.X
 and the samples - https://github.com/swagger-api/swagger-samples?

 

 

 

 

From:  on behalf of Kallen 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Monday, 18 July 2016 at 19:57
To: Swagger 
Subject: Generate Swagger json from Swagger annotations

 

I'm looking for a way to generate the swagger json files from swagger annotated 
java classes.  All the examples seem to revolve around serving from within a 
web container where swagger scans with reflection at run time.  Seems like this 
is possible to do but no clear examples. 

 

Thanks in advance

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: swagger-ui only showing top-level info

2016-07-19 Thread Ron Ratovsky
Well, that’s not good. Can you share your swagger.json so I can test it locally?

 

 

 

 

From:  on behalf of hancholo 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 19 July 2016 at 14:52
To: Swagger 
Subject: swagger-ui only showing top-level info

 

Just getting started with Swagger-ui.  Latest versions of everything 
downloaded. 

 

My swagger.json is valid and populated correctly.

After downloading and serving up the swagger-ui dist and updating the url in 
index.html per instructions, but the only thing that appears is the metadata 
assigned through my beanConfig (Application constructor technique):

 

 

 beanConfig.setTitle("My API");
 beanConfig.setVersion("0.0.4");
 beanConfig.setDescription("This is a description.");

 

The only indication of error is found in the browser console (both in Chrome 
and IE/Edge):

 

 

Now I'm stuck.

 

 

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Embed param and Swagger

2016-07-20 Thread Ron Ratovsky
The spec currently doesn’t support describing such APIs.

 

 

 

From:  on behalf of Denys Dorofeiev 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 20 July 2016 at 05:36
To: Swagger 
Subject: Embed param and Swagger

 

Good day folks! 

 

I need to implement an API where connected resources can be "expanded" the 
following way:

 

GET /orders/1

{

 id: 1

 items: [1, 2]

}

 

GET /orders/1?expand=items

{

 id: 1

 items: [

{

  id: 1,

  name: test

},

{

  id: 2

  name: test2

}

  ]

}

 

So basically when I'm sending "expand" param with value of the resource to 
expand, the API will return full version of resource which is common practice 
in REST APIs.

 

Is there any agreed way on how to describe such behaviour in Swagger?

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Integrating Swagger with JAX-RS of IBM Rational

2016-07-21 Thread Ron Ratovsky
Rational is an entire huge subdivision in IBM and not a specific product. Can’t 
help without more details.

 

 

 

 

From:  on behalf of Giovanni Genna 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 21 July 2016 at 05:43
To: Swagger 
Subject: Integrating Swagger with JAX-RS of IBM Rational

 

Hello!
I want to integrate swagger with my JAX-RS service made with IBM Rational. 

Is it possible ? If it is possible, have you some suggestion or some guide to 
do that ?

 

Thanks

Gio

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Generate Jaxrs classes from Swagger Api Specification

2016-07-21 Thread Ron Ratovsky
The codegen is completely customizable. 

 

https://github.com/swagger-api/swagger-codegen - check the README for more 
details.

 

 

 

 

From:  on behalf of Amruta 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 20 July 2016 at 11:26
To: Swagger 
Subject: Generate Jaxrs classes from Swagger Api Specification

 

Is there a way to generate jaxrs classes from Swagger API Specification. I 
looked at swagger-codegen-cli but is there flexibility where I can tell the 
generator to use my specific implementation while generating API classes.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Configuration problem: Method 'objectMapperConfigurer' must not be private, final or static

2016-07-25 Thread Ron Ratovsky
As Springfox is a third party tool, it’d be better to open a ticket directly on 
that project.

 

 

 

From:  on behalf of Vishal Thakur 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 25 July 2016 at 00:28
To: Swagger 
Subject: Configuration problem: Method 'objectMapperConfigurer' must not be 
private, final or static

 

Hi 

 

I am using Spring 4.x, jersey 1.x and springfox swagger2 and my project is not 
using SpringBoot.

While running the project on apache tomcat 7.x, I am getting following error :

 

SEVERE: Exception sending context initialized event to listener instance of 
class org.springframework.web.context.ContextLoaderListener

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: 
Configuration problem: Method 'objectMapperConfigurer' must not be private, 
final or static; change the method's modifiers to continue

Offending resource: class path resource 
[springfox/documentation/spring/web/SpringfoxWebMvcConfiguration.class]

 

Can anybody help me to resolve this issue.

 

Regards

Vishal 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Swagger 2.0: 'Definitions'(Or Model in 1.2) inheritance

2016-07-25 Thread Ron Ratovsky
I really have no knowledge of loopback.

 

 

 

From:  on behalf of Abhijeet Seal 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 25 July 2016 at 11:17
To: Swagger 
Subject: Re: Swagger 2.0: 'Definitions'(Or Model in 1.2) inheritance

 

Hi Ron, 

 

 

The slc loopback:swagger codegen will generate base of UserCredential as 
PersistedModel, but I want to inherit the properties of loopback inbuilt User 
Model

Foe example

“UserCredential”: {
properties: {
“password”: { “type”: “string” }
},
allOf : [
{ “$ref”: “#/definitions/User” }
]
}
}

Here instead of “#/definitions/User” I want to use loopback inbuilt model 
'User'. In this case how can we handle this scenario?


On Monday, October 27, 2014 at 5:05:37 PM UTC+5:30, Ron R wrote: 

Close, but not quite.

Ignoring the name of the sample - 
https://github.com/swagger-api/swagger-spec/blob/master/fixtures/v2.0/json/models/modelWithComposition.json
 - serves as a great sample of showing inheritance.

Composition is pretty much the same, you'd just throw out the "discriminator" 
field.

Hope this helps.

 

On 27 October 2014 13:29, mission liao  wrote:

Hi Ron, 

 

   I would like to compose some example to make sure what I understood is spec 
compliant.

   For 'composition':

{
“User”: {
properties: {
“id”: { “type”: “string” },
“email”: { “type”: “string” }
}
},
“UserCredential”: {
properties: {
“password”: { “type”: “string” }
},
allOf : [
{ “$ref”: “#/definitions/User” }
]
}
}

 

 For inheritance:

{
“Pet” : {
properties: {
“pet_type”: { “type”: “string” }
},
discriminator: “pet_type”,
required: [“pet_type”]
},
“Dog”: {
allOf: [
{ “$ref”: “#/definitions/Pet” }
]
}
} 

When an operation accepting Pet as a parameter, we can pass a Dog(with 
pet_type=Dog) instead.

Am I on the right track? Thanks for any advice.


On Monday, 27 October 2014 17:25:07 UTC+8, Ron R wrote: 

It is defined, I just need to expand on the documentation.

For a quick overview - there are two.. let's say "types" of inheritance with 
Swagger 2.0.

The first is composition using the "allOf" keyword - you can say that a model 
contains the properties of other models (more than one).

The second is polymorphism where the "discriminator" can be used on top of the 
"allOf" property.

Just like in 1.2, the "discriminator" must be defined at the top level model 
and it must be required.

Unlike 1.2, there's no "subTypes". Any model that includes the super mode in 
the "allOf" definition will be considered a sub type of it.

So the super model is unaware of its children, but now the child is aware of 
its parent.

 

On 27 October 2014 10:07, mission liao  wrote:

Hi, 

 

   Just want to confirm that if model inheritance is still undefined in swagger 
2.0.

TODO: Add explanation about composition and inheritance in the new spec.

 

   We have 'discriminator' but have nothing compared to 'subTypes'.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: curl -X *method* --header 'Accept: application/json' not working

2016-07-27 Thread Ron Ratovsky
What version is that?

 

 

 

 

From:  on behalf of Natalia Queiroz 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 27 July 2016 at 14:02
To: Swagger 
Subject: Re: curl -X *method* --header 'Accept: application/json' not working

 


Hi Tony and Ron, I am using the last version of swagger ui, same problem :(

Regards,
Natália Oliveira

Em quarta-feira, 20 de julho de 2016 03:03:09 UTC-3, tony tam escreveu: 

Did you try Ron’s suggestion? 

 

"There are some known issues regarding that. Try the latest master version of 
swagger-ui.”

 

 

On Jul 19, 2016, at 4:53 PM, Natália Oliveira  wrote:

 

Anyone?!


Em 15 de jul de 2016, às 19:48, Natalia Queiroz  escreveu:

Hello group,

my json application is not showing the correct Accept response on the curl 
method.

Even using the header("Content-Type: application/json;charset=utf-8") or , 
header("Content-Type: application/json"), it keeps showing 


curl -X GET --header 'Accept: text/html' 
'http://servicos.jbrj.gov.br/jabot/collections'



Does anybody know if is it a bug? or how to fix it?



Thanks,


-- 



Natália Oliveira

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: swagger-ui only showing top-level info

2016-07-27 Thread Ron Ratovsky
Just loaded the latest spec file you shared with the latest version of 
swagger-ui and everything seems to be in order – tested in Chrome and FF.

 

 

 

 

From:  on behalf of hancholo 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 27 July 2016 at 12:49
To: Swagger 
Subject: Re: swagger-ui only showing top-level info

 

After some debugging, I traced the problem to some circular references in my 
entities.  There are related issues in github for codegen (e.g. 
https://github.com/swagger-api/swagger-codegen/issues/728) .  The json is 
getting generated correctly, but the javascript in swagger-ui is leading to the 
stack issues. 



On Tuesday, July 19, 2016 at 5:52:47 PM UTC-4, hancholo wrote: 

Just getting started with Swagger-ui.  Latest versions of everything 
downloaded. 

 

My swagger.json is valid and populated correctly.

After downloading and serving up the swagger-ui dist and updating the url in 
index.html per instructions, but the only thing that appears is the metadata 
assigned through my beanConfig (Application constructor technique):

 

 

 beanConfig.setTitle("My API");
 beanConfig.setVersion("0.0.4");
 beanConfig.setDescription("This is a description.");

 

The only indication of error is found in the browser console (both in Chrome 
and IE/Edge):

 

 

Now I'm stuck.

 

 

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Swagger for Spring 3 MVC

2016-07-29 Thread Ron Ratovsky
swagger-core doesn’t support Spring MVC.

Not sure if Springfox supports Spring 3 – you’d need to check with their 
documentation.

 

 

From:  on behalf of Vishal Thakur 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 27 July 2016 at 23:59
To: Swagger 
Subject: Swagger for Spring 3 MVC

 

Hi 

 

I tried different approaches for integrating swagger with Spring 3 mvc as 
mentioned below :

1. 
https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-1.X-Project-Setup-1.5
 with changes in web.xml and spring too.

   I cannot use SpringBoot as it is not used in our project.

2. I tried with Springfox but get exceptions while running server.

https://github.com/springfox/springfox/issues/938

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Swagger YAML to HTML like in swagger-editor

2016-07-29 Thread Ron Ratovsky
I don’t think there’s a way to do it. Keep in mind that if you’re looking for 
the try it out functionality, then it’s not really just HTML and in that case 
you just go with swagger-ui.

If you’re looking for something more static to be generated in your build 
process, then yeah, you can use swagger-codegen (where you can customize the 
template to fit the looks of swagger-editor) or use tools like swagger2markup.

 

 

From:  on behalf of Michal Bubnár 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 28 July 2016 at 03:04
To: Swagger 
Subject: Swagger YAML to HTML like in swagger-editor

 

Hi, 

 

I have created pretty long swagger definition file for the REST API of the 
company I work at, and now my task is to convert it to HTML. I was able to do 
this using either Swagger Codegen or using bootprint-swagger and using command 
line, which is also required, because this generation is supposed to be 
automated during build of our products.

 

Now here's what I couldn't find anywhere. I really like the live preview 
created in Swagger Editor, I think it's the most beautiful of all HTMLs 
generated and somehow I would like to generate exactly same HTML here for the 
company. Is this somehow possible? I would really like to have this, since it 
also has Try This Operation, color theme is really nice and basically that 
would be the way to go and everyone here would be satisfied.

 

Can somebody help me with this? Thank you in advance :)

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Add swagger support to custom framework

2016-07-29 Thread Ron Ratovsky
 

 

That’s really not enough details.

 

 

From:  on behalf of Aleksandr Savvopulo 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 28 July 2016 at 07:12
To: Swagger 
Subject: Add swagger support to custom framework

 

Hello, 

 

I'd like to add a swagger documentation generation possibility to my custom 

framework. But I didn't find a documentation about that. 

How and where should I start to enable resources scanning and documentation 

generation. 

 

Is there any examples or guide on that? 

 

Thanks.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: @ApiOperation annotation does not cause swagger ui to render descriptions

2016-07-29 Thread Ron Ratovsky
Something here doesn’t make sense.

You’re using swagger-core 1.5.9 and swagger-springmvc – you can’t really use 
both.

Based on your code, it’s a Spring MVC project. Swagger-springmvc is very old 
and produces an old version of Swagger which may not translate well in 
swagger-ui.

Consider upgrading to https://github.com/springfox/springfox/.

 

 

 

From:  on behalf of 
"jdepo...@gmail.com" 
Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 28 July 2016 at 08:03
To: Swagger 
Subject: @ApiOperation annotation does not cause swagger ui to render 
descriptions

 

 
I cannot seem to get the annotations I am adding to be seen by swagger-ui.  I 
am specifically having trouble with the annotations to update the method 
descriptions and implementation notes.  Everything compiles and runs, but my 
descriptions do not show.
 
As an example, I would expect the method below to update the Implementation 
notes section to "Returns news items".  Instead it is set to "entries" (the 
name of the method).
 
@RequestMapping(value = "/qtl/hey", method = RequestMethod.GET)
@ApiOperation(value = "Get News", notes = "Returns news items")
Collection entries() {
    return this.entries.values();
}
 

 

I am using Java Spring rest controllers and my gradle config is below.  any 
help is appreciated 

 

compile group: 'com.mangofactory', name: 'swagger-springmvc', version: '1.0.2'
compile group: 'io.swagger', name: 'swagger-core', version: '1.5.9'
 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is there way to show the Example request parameter on the swagger UI?

2016-07-29 Thread Ron Ratovsky
Hi,

 

You can add examples for body parameters using the @Example annotation – keep 
in mind it was added in 1.5.4 and you are using 1.5.0 so you’d need to upgrade 
before being able to use it.

 

 

 

 

From:  on behalf of smk 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 29 July 2016 at 12:22
To: Swagger 
Subject: Is there way to show the Example request parameter on the swagger UI?

 

Hi , 

 

 

To add a user to the Db i have user Pojo class and a Post method. If i am not 
wrong in this case swagger automatically detect and bind the request to the 
user class and able show the example parameters that are sent in the UI like in 
the "add.png"

 

Now if i have post method that takes a json value as the request than is there 
a way to display the example json like in the "add.png" so that i can just 
click and give some values. Currently its emply (Please look at taje.png).

 

I am using swagger+jersey

 





org.glassfish.jersey.containers

jersey-container-servlet-core







 



org.glassfish.jersey.media

jersey-media-moxy





io.swagger

swagger-jersey2-jaxrs

1.5.0







com.sun.jersey

jersey-servlet

1.19





-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple authentications and associated problems

2016-08-03 Thread Ron Ratovsky
Hello Andrew!

 

Which version of swagger-ui do you use?

 

 

 

From:  on behalf of Andrew Campbell 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 3 August 2016 at 09:09
To: Swagger 
Subject: Multiple authentications and associated problems

 

I am having difficulty with my securityDefinitions object.

 

My folder structure is like this:

 

/api

/console

  /swagger

/file1.json

/file2.json

  /swagger-ui

 

We are not yet ready to make the console (or associated swagger files) 
available to the whole internet, so everything under /console is protected 
using Basic Authentication. 

 

Most of the API calls require apiKey authorization.

 

If I just put the apiKey authorization in the securityDefinitions and then 
authorize via the Authorize button, and the json files are refreshed for any 
reason (such as changing from file1.json to file2.json) my browser displays an 
HTTP Basic Authentication dialog box, and no matter what values I enter, the 
dialog box just refreshes.

 

If I put both the apiKey authorization and basic authorization in the 
securityDefinitions, then I can refresh the json files without any problems as 
long as I authorize with both the apiKey and basic, but all calls to the API 
seem to use just basic authentication and ignore the apiKey authorization.

 

This is what my securityDefinitions object looks like:

 

  "securityDefinitions": {

"Basic": {

  "type": "basic",

  "description": "You must enter your username and password"

},

"Authorization": {

  "type": "apiKey",

  "name": "Authorization",

  "in": "header",

  "description": "Fill out as described in the documentation"

}

  }

 

And this is an example of the curl that the console generates for me when 
authorised with both basic and apiKey:

 

curl -X GET --header 'Accept: application/json' --header 'Authorization: Basic 
xx' 'http://example.com/api/call'

 

What I want to get is

 

curl -X GET --header 'Accept: application/json' --header 'Authorization: 
apiKey_value' 'http://example.com/api/call'

 

Is there an easy solution to this problem? I'm inclined to think I should 
remove the Basic authentication and restrict access based on IP address.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to avoid @ApiModelProperty on DTO or Model

2016-08-03 Thread Ron Ratovsky
Hi,

 

Since you’re using Spring-MVC, you’re probably using Springfox – and questions 
about that should be directed at their repository directly.

Afaik, Springfox does use swagger-core annotations but swagger-core itself 
doesn’t support such functionality so you’d have to use different models to 
describe that.

Springfox may have an alternative solution though.

 

 

 

From:  on behalf of Raju Madanu 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 2 August 2016 at 20:09
To: Swagger 
Subject: How to avoid @ApiModelProperty on DTO or Model

 

Hi,

 

I have a scenario where a DTO is used for POST and PUT operations. I am 
currently using Spring MVC (RESTful). I would like to reuse DTO in multiple 
cases. So I want to avoid any annotations in the DTO. I prefer them on the 
controller instead. I may be wrong but, please advise.

 

Below is the scenario: There are three fields id, a, b in the DTO. For POST 
operation a and b are required and for PUT operation all three are required. I 
am currently using attribute "required" in @ApiModelProperty annotation (in 
DTO).

a. How do I enforce conditional required for "id" incase of PUT operation using 
@ApiModelProperty?

b. I would like to have something on the controller itself where I can specify 
all conditions instead on the DTO itself. That way I can reuse DTO in many 
scenarios. I tried @ApiImplicitParams with paramType as "body". If I do this, I 
am seeing multiple body fields instead of one in swagger html documentation.

 

Any suggestions would be greatly helpful.

 

FYI - I have posted this question in stackoverflow

http://stackoverflow.com/questions/38721711/how-to-avoid-apimodelproperty-on-dto-or-model

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dynamically change Schema Based on Content-Type

2016-08-03 Thread Ron Ratovsky
Hi ,

 

It’s a bit unclear what you’re trying to do that doesn’t work.

In general, if your Swagger describes an endpoint as producing/consuming either 
JSON or XML, it will give you the dropdown to select the media type 
automatically, and changing its value will change the rendering.

 

 

 

From:  on behalf of Thiru k 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 2 August 2016 at 11:52
To: Swagger 
Subject: Dynamically change Schema Based on Content-Type

 


  Hi,

  I don't have much knowledge about Swagger-UI, I have started Implementing 
Swagger-UI to my Spring RestApi for last few days only. I don't know how to 
dynamically change the request "Example Schema" based on the content-type(JSON 
(or) XML). How do I achieve these by using annotations. Could you provide some 
suggestions or perfect examples for my scenarios. Let me know if more details 
needed.

Dependencies: 

io.springfox

springfox-swagger-ui

2.2.2



 

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Model/Schema not showing if inherited from Azure DocumentDB Document

2016-08-03 Thread Ron Ratovsky
Really need more context.

 

 

 

From:  on behalf of Leon Potgieter 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 2 August 2016 at 08:05
To: Swagger 
Subject: Model/Schema not showing if inherited from Azure DocumentDB Document

 

Hi, my models inherit from Azure DocumentDB Documents as follows: 

 

public class EmployeeDocument : Document
{   }
 

Doing this the models don't show in the Swagger UI, if I remove the inheritance 
they show up fine...

 

How can I resolve this?

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Petstore oauth2 application source code

2016-08-03 Thread Ron Ratovsky
We use Apache Oltu if I recall correctly.

 

 

 

From:  on behalf of THIRUPATHIREDDY 
VAJJALA 
Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 2 August 2016 at 02:15
To: Swagger 
Subject: Re: Petstore oauth2 application source code

 

thanks for the reply, but im more looking about oauth2 authentication that is 
implemented in the swagger petstore app. others things i can able to implement

On Monday, 1 August 2016 18:19:59 UTC+5:30, tony tam wrote: 

This is the source:

 

https://github.com/swagger-api/swagger-samples/tree/master/java/java-jersey-jaxrs

 

It's not with spring boot though, you can certainly implement the petstore with 
spring boot by following some of the community guides on the web. 


On Aug 1, 2016, at 12:18 PM, THIRUPATHIREDDY VAJJALA  
wrote:

Can anyone provide source code for the petstore.swagger.io with oauth2 
authorization using spring boot

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Swagger UI integration.

2016-08-03 Thread Ron Ratovsky
You don’t provide enough details to point you in the right direction as it 
depends on how which application server you use (among other things) – this 
issue has nothing to do with Swagger.

Based on what you mentioned, the UI could potentially be accessible via 
http://localhost:8080/ or http://localhost:8080/SwaggerRestAPI or 
http://localhost:8080/SwaggerRestAPI/rest/.

As another troubleshooting step, you might consider putting the contents of 
swagger-ui under a directory and not directly at the root.

 

 

From:  on behalf of Sandip Mangale 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 1 August 2016 at 06:52
To: Swagger 
Subject: Swagger UI integration.

 

Hello everyone, 

 

I am trying to integrate Swagger UI for Rest easy API. I am able to see 
swagger.json at http://localhost:8080/SwaggerRestAPI/rest/swagger.json. I have 
copied dist folder in WEB-INF folder and changed the url in index.html to 
http://localhost:8080/SwaggerRestAPI/rest/swagger.json and tried to fetch UI by 
using URL http://localhost:8080/SwaggerRestAPI but it is returning 404 
response. Can anybody help me?

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Run swagger UI in a port different to 8080

2016-08-03 Thread Ron Ratovsky
Swagger-ui is just a set of static file, you don’t need to use npm to run it. 
Simply deploy it on whichever web server you’re comfortable with and configure 
the port as you see fit.

 

 

 

From:  on behalf of Gorka Sanz Monllor 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 1 August 2016 at 04:56
To: Swagger 
Subject: Run swagger UI in a port different to 8080

 

Hello , I would like to run swagger UI in a different port to 8080. I have 
downloaded the source code and I would like to run it in a different port, for 
example 9090. I have tried with npm run serve options and I haven't found any 
solution. I have also tried to find in the source code and I have not found any 
solution. 

Any idea ???

Thanks, Gorka

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Swagger not validating additionalProperties: false, required fields when using discriminator field

2016-08-03 Thread Ron Ratovsky
 

Since Swagger is not a specific tool, you’d need to specify which tools you 
actually use with which you experience the problems.

 

 

 

From:  on behalf of Ahamed 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 1 August 2016 at 04:54
To: Swagger 
Subject: Swagger not validating additionalProperties: false, required fields 
when using discriminator field

 

I am having a base definitions and multiple concrete implementation using 
'discriminator' field. When i set the fields mandatory in concrete 
implementation and additionalProperties = false, swagger not validating this 
condition and allowing user to skip mandatory field and allow specifying 
additional fields which are not part of definitions. Below is the sample 
definitions i have given for reference. To say, when using Polymorphism , non 
of the validation is being done for concrete implementation. Only base product 
gets validation because i have specified the base 'product' in my Api body 
specification  

 

Is the above condition bug in swagger validation or it's not supported? 

 

api layer

-

 

/companies/{companyId}/products:
post:
  x-swagger-router-controller: product
  operationId: create
  description: |
    xx.
  parameters:
    - name: companyId
  in: path
  description: ID of the `Company`
  type: integer
  required: true
    - name: order
  in: body
  description: Payload
  schema:
    $ref: '#/definitions/Product'
  tags:
    - product
  responses:
    '200':
  description: Successful response.
  schema:
    $ref: '#/definitions/Product'
    default:
  description: Error response.
  schema:
    $ref: '#/definitions/Error'
 

definitions:
Product:
  type: object
  required:
  - type
  discriminator: type
  properties:
    id:
  type: string
  description: Unique URI identifying this resource. 
parent:
  type: string
  description: A reference to a Resource of which this Product is a 
component. 
  readOnly: true
    type:
  description: The type of item being ordered.
  type: string
  enum:
  - Create_X
  - Create_Y
  - Create_Z
Create_X:
  allOf:
  - $ref: '#/definitions/Product'
  - type: object
    required:
    - resourceURI
    - quantity
    properties:
  resourceURI:
    type: string
    description: Unique URI that is associated with the type of API 
resource.
    enum:
    - http://.com/api/1/Product-Create-X
  quantity:
    description: The number of product instances ordered with the same 
configuration
    type: integer
    format: int32
    minimum: 1
    additionalProperties: false
Create_Y:
  allOf:
  - $ref: '#/definitions/Product'
  - type: object
    required:
    - resourceURI
    - quantity
    properties:
  resourceURI:
    type: string
    description: Unique URI that is associated with the type of API 
resource.
    enum:
    - http://.com/api/1/Product-Create-Y
  quantity:
    description: The number of product instances ordered with the same 
configuration
    type: integer
    format: int32
    minimum: 1
    additionalProperties: false
Create_Z:
  allOf:
  - $ref: '#/definitions/Product'
  - type: object
    required:
    - resourceURI
    - quantity
    properties:
  resourceURI:
    type: string
    description: Unique URI that is associated with the type of API 
resource.
    enum:
    - http://.com/api/1/Product-Create-Z
  quantity:
    description: The number of product instances ordered with the same 
configuration
    type: integer
    format: int32
    minimum: 1
    additionalProperties: false
-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I try to add Odata Controllers (I Succeed to add API controllers). But I always get this error.

2016-08-03 Thread Ron Ratovsky
You don’t really provide enough details here – but based on the exception it 
looks like it’s a Swashbuckle integration. 

If that’s indeed the case, you should open a ticket directly on Swashbuckles 
repository as it’s a third party tool.

 

 

From:  on behalf of Michal Carmeli 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Sunday, 31 July 2016 at 22:56
To: Swagger 
Subject: I try to add Odata Controllers (I Succeed to add API controllers). But 
I always get this error.

 

500 : {"$id":"1","Message":"An error has 
occurred.","ExceptionMessage":"Precondition failed: currentProperty != 
null","ExceptionType":"System.Diagnostics.Contracts.__ContractsRuntime+ContractException","StackTrace":"
 at 
System.Diagnostics.Contracts.__ContractsRuntime.TriggerFailure(ContractFailureKind
 kind, String msg, String userMessage, String conditionTxt, Exception 
inner)\r\n at 
System.Diagnostics.Contracts.__ContractsRuntime.ReportFailure(ContractFailureKind
 kind, String msg, String conditionTxt, Exception inner)\r\n at 
System.Diagnostics.Contracts.__ContractsRuntime.Requires(Boolean condition, 
String msg, String conditionTxt)\r\n at 
Swashbuckle.OData.SchemaRegistryExtensions.GetEdmPropertyName(MemberInfo 
currentProperty, IEdmStructuredType edmType)\r\n at 
Swashbuckle.OData.SchemaRegistryExtensions.ApplyEdmModelPropertyNamesToSchema(SchemaRegistry
 registry, IEdmModel edmModel, Type type)\r\n at 
Swashbuckle.OData.SchemaRegistryExtensions.GetOrRegisterResponseType(SchemaRegistry
 registry, IEdmModel edmModel, Type type)\r\n at 
Swashbuckle.OData.ODataSwaggerProvider.CreateOperation(ApiDescription 
apiDescription, SchemaRegistry schemaRegistry)\r\n at 
Swashbuckle.OData.ODataSwaggerProvider.CreatePathItem(IEnumerable`1 
apiDescriptions, SchemaRegistry schemaRegistry)\r\n at 
Swashbuckle.OData.ODataSwaggerProvider.<>c__DisplayClass4_0.b__3(IGrouping`2
 group)\r\n at 
System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 
source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 
comparer)\r\n at 
System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 
source, Func`2 keySelector, Func`2 elementSelector)\r\n at 
Swashbuckle.OData.ODataSwaggerProvider.GetSwagger(String rootUrl, String 
apiVersion)\r\n at 
Swashbuckle.Application.SwaggerDocsHandler.SendAsync(HttpRequestMessage 
request, CancellationToken cancellationToken)\r\n at 
System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, 
CancellationToken cancellationToken)\r\n at 
System.Web.Http.Dispatcher.HttpRoutingDispatcher.SendAsync(HttpRequestMessage 
request, CancellationToken cancellationToken)\r\n at 
System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, 
CancellationToken cancellationToken)\r\n at 
ThirdPartyWebAPI.ApiKeyVerificationChannel.SendAsync(HttpRequestMessage 
request, CancellationToken cancellationToken) in 
c:\\SM\\NG\\Trunk\\Odata4\\SM_NG_VH_DEV\\WebAPIServerV2\\ThirdPartyWebAPI\\Common\\ApiKeyVerificationChannel.cs:line
 55\r\n at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage 
request, CancellationToken cancellationToken)\r\n at 
ThirdPartyWebAPI.Common.CorsHandler.SendAsync(HttpRequestMessage request, 
CancellationToken cancellationToken) in 
c:\\SM\\NG\\Trunk\\Odata4\\SM_NG_VH_DEV\\WebAPIServerV2\\ThirdPartyWebAPI\\Common\\CorsHandler.cs:line
 70\r\n at System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage 
request, CancellationToken cancellationToken)\r\n at 
System.Web.Http.Tracing.Tracers.RequestMessageHandlerTracer.<>n__FabricatedMethod6(HttpRequestMessage
 , CancellationToken )\r\n at 
System.Web.Http.Tracing.Tracers.RequestMessageHandlerTracer.<>c__DisplayClass4.b__1()\r\n
 at 
System.Web.Http.Tracing.ITraceWriterExtensions.TraceBeginEndAsync[TResult](ITraceWriter
 traceWriter, HttpRequestMessage request, String category, TraceLevel level, 
String operatorName, String operationName, Action`1 beginTrace, Func`1 execute, 
Action`2 endTrace, Action`1 errorTrace)\r\n at 
System.Web.Http.Tracing.Tracers.RequestMessageHandlerTracer.SendAsync(HttpRequestMessage
 request, CancellationToken cancellationToken)\r\n at 
System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, 
CancellationToken cancellationToken)\r\n at 
System.Web.Http.HttpServer.<>n__FabricatedMethod9(HttpRequestMessage , 
CancellationToken )\r\n at 
System.Web.Http.HttpServer.d__0.MoveNext()"} 
http://localhost:59418/swagger/docs/v1

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups

Re: How to add Proxy host and port to make Swagger Calls

2016-08-03 Thread Ron Ratovsky
I’m a bit confused. Since this is an intranet and you need to use a proxy to 
access anything outside (from the sound of it) – don’t you just set your proxy 
in your browser and/or OS to allow access to the internet in general?

 

 

 

 

From:  on behalf of One Solution 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 20 July 2016 at 06:02
To: Swagger 
Subject: Re: How to add Proxy host and port to make Swagger Calls

 

Hi Ron,

 

Let me explain with examples.

Say, Our domain is mydomain.com

We dynamically change the API host name (say dynamicdomain.com) by using 
setHost('dynamicdomain.com').

As mydomain.com is not having internet connectivity to access dynamicdomain.com 
directly, we need to use proxydomain.com and proxyport for internet 
connectivity.

When I tried setHost('proxydomain.com:proxyport'), it is replacing host name in 
swagger json file with proxydomain.com:proxyport, hence it is not making call 
to dynamicdomain.com

But what I'm looking for is to add proxydomain.com and proxyport for 
connectivity between mydomain.com and dynamicdomain.com

 

If setHost() can be used to change host name as well as to set proxy, please 
provide me the syntax.

 

Thanks in advance!



On Tuesday, July 19, 2016 at 3:43:07 AM UTC+5:30, Ron wrote: 

You’d use the setHost to run the calls against the proxy, not the other way 
around.

 

 

 

From:  on behalf of One Solution 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Saturday, 16 July 2016 at 23:29
To: Swagger 
Subject: Re: How to add Proxy host and port to make Swagger Calls

 

Hi Ron,


Yes I am asking about swagger-ui.
Our API calls are hosted at example.com but our server can't access example.com 
directly, it has to access through proxy
by using swaggerUi.api.setHost(...) I can change the API call host i.e 
example.com right?
If yes my question is how to tell swagger UI to use proxy to make API call 
hosted at example.com through proxy(proxy host and proxy port)..!


Thanks



On Friday, July 15, 2016 at 10:52:51 PM UTC+5:30, Ron wrote: 

Assuming you’re asking about swagger-ui, you can use swaggerUi.api.setHost(...) 
to change the host of the API calls.

 

 

 

From:  on behalf of One Solution 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Friday, 15 July 2016 at 09:37
To: Swagger 
Subject: How to add Proxy host and port to make Swagger Calls

 

Hello, 

 

Our server is not accessing direct internet thus using a proxy host/IP and port 
to access API.

 

Please help me to add proxy host and port for every swagger try it out calls...

 

Thanks

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Vulnerability in handlebars.js version 2.0.0

2016-08-04 Thread Ron Ratovsky
We’ve pushed the updated version to master yesterday, please check it out.

 

 

 

From:  on behalf of Vijay 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 3 August 2016 at 23:00
To: Swagger 
Subject: Re: Vulnerability in handlebars.js version 2.0.0

 

Hi Tony, 

 

I've not posted on this topic before. Anyways, good to know that it is being 
addressed. Any tentative date for this fix?

 

Thanks,

Vijay

On Wednesday, August 3, 2016 at 8:23:31 PM UTC+5:30, tony tam wrote: 

Hi Vijay, I believe you already reached out on this.  Expect it will be 
addressed shortly. 

 

On Aug 3, 2016, at 3:36 PM, Vijay  wrote:

 

Hi, 

 

Our security team has found vulnerabilities in handlebars.js version 2.0.0 
which is being used by Swagger UI.

References provided:

https://yahoo-security.tumblr.com/post/128130790295/paranoid-labs-open-source-and-solving-xss-in
https://github.com/wycats/handlebars.js/pull/1083 
https://blog.srcclr.com/handlebars_vulnerability_research_findings/

 

Is it already a known issue and being taken care to upgrade to handlebars.js 
latest stable version ?

 

Thanks,

Vijay

 

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Vulnerability in handlebars.js version 2.0.0

2016-08-04 Thread Ron Ratovsky
My bad, looks like we missed something, but we’re definitely working on it, 
will keep you posted.

 

 

 

From:  on behalf of Ron Ratovsky 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 4 August 2016 at 08:27
To: "swagger-swaggersocket@googlegroups.com" 

Subject: Re: Vulnerability in handlebars.js version 2.0.0

 

We’ve pushed the updated version to master yesterday, please check it out.

 

 

 

From:  on behalf of Vijay 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 3 August 2016 at 23:00
To: Swagger 
Subject: Re: Vulnerability in handlebars.js version 2.0.0

 

Hi Tony, 

 

I've not posted on this topic before. Anyways, good to know that it is being 
addressed. Any tentative date for this fix?

 

Thanks,

Vijay

On Wednesday, August 3, 2016 at 8:23:31 PM UTC+5:30, tony tam wrote: 

Hi Vijay, I believe you already reached out on this.  Expect it will be 
addressed shortly. 

 

On Aug 3, 2016, at 3:36 PM, Vijay  wrote:

 

Hi, 

 

Our security team has found vulnerabilities in handlebars.js version 2.0.0 
which is being used by Swagger UI.

References provided:

https://yahoo-security.tumblr.com/post/128130790295/paranoid-labs-open-source-and-solving-xss-in
https://github.com/wycats/handlebars.js/pull/1083 
https://blog.srcclr.com/handlebars_vulnerability_research_findings/

 

Is it already a known issue and being taken care to upgrade to handlebars.js 
latest stable version ?

 

Thanks,

Vijay

 

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't Generate swagger.json With CXFNonSpringJaxrsServlet

2016-08-04 Thread Ron Ratovsky
Hi Jeff,

 

Since you’re using the Swagger2Feature, you could get better support for it in 
the CXF mailing list as that’s their implementation for it.

 

 

 

From:  on behalf of Jeff Davis 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 4 August 2016 at 13:47
To: Swagger 
Subject: Can't Generate swagger.json With CXFNonSpringJaxrsServlet

 

I am attempting to integrate swagger with a legacy REST service implemented 
using an older version of CXF.  I've attempted several configurations but can't 
get the swagger.json to generate.  Guidance on getting this resolved is greatly 
appreciated.  Please see project code below: 

 

HelloService.java

 

package swaggerRest;

import javax.ws.rs.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Path("/sample")
@Api(value = "/sample", description = "Sample REST for Swagger Testing")
public class HelloService {
 @GET
 @Path("hello")
 @ApiOperation(value = "Get hello message", response = String.class)
 public String sayHello(){
 return "Hello World";
 }
}

 

web.xml

 


http://www.w3.org/2001/XMLSchema-instance"; 
xmlns="http://java.sun.com/xml/ns/javaee"; 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"; id="WebApp_ID" version="3.0">

  swaggerRest
  
  
contextParam
contextParamValue
  
  
  
CXFServlet

org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet

  jaxrs.serviceClasses
  swaggerRest.HelloService


  jaxrs.features
  org.apache.cxf.jaxrs.swagger.Swagger2Feature 
(basePath=/rest)

  

  
CXFServlet
/rest/*
  


 

pom.xml

 

http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
  4.0.0
  com.test
  swaggerRest
  0.0.1-SNAPSHOT
  war
  
  


 org.apache.cxf

  cxf-rt-frontend-jaxrs
  2.7.14


  org.apache.cxf
  cxf-rt-transports-http
  2.7.14


  org.apache.cxf
  cxf-rt-rs-extension-providers
  2.7.14


  org.apache.cxf
  cxf-rt-rs-service-description
  3.1.7


  org.codehaus.jackson
  jackson-jaxrs
  1.1.1
  
  


io.swagger
swagger-jaxrs
1.5.8


  io.swagger
  swagger-annotations
  1.5.9


org.webjars
swagger-ui
2.1.4


org.slf4j
slf4j-api
1.7.21


org.slf4j
slf4j-simple
1.7.21
 

  org.apache.cxf
  cxf-rt-rs-service-description-swagger
  3.1.7
 
  
 
  
src

  
maven-compiler-plugin
3.5.1

  1.8
  1.8

  
  
maven-war-plugin
2.6

  WebContent
  false

  

  


 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't Generate swagger.json With CXFNonSpringJaxrsServlet

2016-08-04 Thread Ron Ratovsky
So for CXF 2.7 I think swagger-core could work out of the box.

To be honest, I don’t know exactly what the internal integration CXF has with 
swagger-core provides, though I know they’ve worked on it to hook up nicely 
with CXF so it should be easier.

 

For swagger-core we have a sample that shows how to integrate it with a 
Spring-based CXF application - 
https://github.com/swagger-api/swagger-samples/tree/master/java/java-jaxrs-cxf 
but not one for Non-Spring one.

Based on your knowledge of other frameworks, you can look at the integrations 
with them and figure out what steps you need to take - 
https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-JAX-RS-Project-Setup-1.5.X.

In short, you need to:

1.   Add the dependencies (in your case, it would be swagger-jaxrs)

2.   Register these two classes as JAX-RS resources:

a.   io.swagger.jaxrs.listing.ApiListingResource

b.   io.swagger.jaxrs.listing.SwaggerSerializers

3.   Set up the basic configuration of Swagger-core based on one of the 
methods described in the wiki linked above.

 

Following that you’d need to add the various annotations to produce the 
documentation.

 

The second instruction (registering the resources) is enough to get at least a 
basic swagger.json output. It won’t describe anything without the annotations, 
but it should give you a sense that you hooked it up in your app properly.

Since it’s just a JAX-RS resource like the rest, it will be found at the 
context root you use for any other resource in your app.

 

If you’re having trouble getting to that point, provide more details as to what 
you’re trying to access.

 

 

 

 

From:  on behalf of Jeff Davis 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 4 August 2016 at 14:15
To: Swagger 
Subject: Re: Can't Generate swagger.json With CXFNonSpringJaxrsServlet

 

Ron, 

 

I'm indifferent to what I'm using so long as I can generate the swagger.json.  
Is there something I can use other that Swagger2Feature?

On Thursday, August 4, 2016 at 3:10:21 PM UTC-6, Ron wrote: 

Hi Jeff,

 

Since you’re using the Swagger2Feature, you could get better support for it in 
the CXF mailing list as that’s their implementation for it.

 

 

 

From:  on behalf of Jeff Davis 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Thursday, 4 August 2016 at 13:47
To: Swagger 
Subject: Can't Generate swagger.json With CXFNonSpringJaxrsServlet

 

I am attempting to integrate swagger with a legacy REST service implemented 
using an older version of CXF.  I've attempted several configurations but can't 
get the swagger.json to generate.  Guidance on getting this resolved is greatly 
appreciated.  Please see project code below: 

 

HelloService.java

 

package swaggerRest;

import javax.ws.rs.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Path("/sample")
@Api(value = "/sample", description = "Sample REST for Swagger Testing")
public class HelloService {
 @GET
 @Path("hello")
 @ApiOperation(value = "Get hello message", response = String.class)
 public String sayHello(){
 return "Hello World";
 }
}

 

web.xml

 


http://www.w3.org/2001/XMLSchema-instance"; 
xmlns="http://java.sun.com/xml/ns/javaee"; 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"; id="WebApp_ID" version="3.0">

  swaggerRest
  
  
contextParam
contextParamValue
  
  
  
CXFServlet

org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet

  jaxrs.serviceClasses
  swaggerRest.HelloService


  jaxrs.features
  org.apache.cxf.jaxrs.swagger.Swagger2Feature 
(basePath=/rest)

  

  
CXFServlet
/rest/*
  


 

pom.xml

 

http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
  4.0.0
  com.test
  swaggerRest
  0.0.1-SNAPSHOT
  war
  
  


 org.apache.cxf

  cxf-rt-frontend-jaxrs
  2.7.14


  org.apache.cxf
  cxf-rt-transports-http
  2.7.14


  org.apache.cxf
  cxf-rt-rs-extension-providers
  2.7.14


  org.apache.cxf
  cxf-rt-rs-service-description
  3.1.7


  org.codehaus.jackson
  jackson-jaxrs
  1.1.1
  
  


io.swagger
swagger-jaxrs
1.5.8


  io.swagger
  swagger-annotations
  1.5.9


org.webjars
swagger-ui
2.1.4


org.slf4j
slf4j-api
1.7.21


org.slf4j
slf4j-simple
1.7.21
 

  org.apache.cxf
  cxf-rt-rs-service-description-swagger
  3.1.7
 
  
 
  
src

  
maven-compiler-plugin
3.5.1

  1.8
  1.8

  
  
maven-war-plugin
2.6

 

Re: Different response format in case of error

2016-08-04 Thread Ron Ratovsky
Hi Axel,

 

So you know how it is, when a client sends an HTTP request it says “I’m sending 
you this media type and I expect you to send me that one!”, and then you say 
“well, okay, I’ll send you your requested media type when it’s a successful 
reply, but if it’s an error, all options are free!” – it’s, well, potentially a 
problem. But in some cases you gotta do what you gotta do right?

So in the current version of the spec, you can’t really go ahead and define 
that the media type for 200 is this and for 400 is that. I think we’re covering 
this in the next version of the spec, or rather there is a proposal for that.

As a workaround for now, you can pretty much say that the operation produces 
both media types and go with that.

 

 

From:  on behalf of Axel Bonnet 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 4 August 2016 at 10:44
To: Swagger 
Subject: Different response format in case of error

 

Hello, 

 

I'm specifying an API with swagger and I have an operation that return plain 
text when it's OK, and json when there is an error. I can't find how to express 
that with swagger.

Should I say that the path produces "application/json" and "text/plain" ? 
Doesn't it mean that the user could expect a json response even if it's OK ?

 

On one hand, it is logical that the method return some plain text, on the 
other, it looks logical to return json on any error to be consistent with the 
rest of the API. So i don't know what to do.

 

Thanks for any help !

Axel

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I try to add Odata Controllers (I Succeed to add API controllers). But I always get this error.

2016-08-04 Thread Ron Ratovsky
https://github.com/domaindrivendev/Swashbuckle

 

We really have little knowledge of the tool – it’s not part of our toolset.

 

 

 

From:  on behalf of Michal Carmeli 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 4 August 2016 at 03:21
To: Swagger 
Subject: Re: I try to add Odata Controllers (I Succeed to add API controllers). 
But I always get this error.

 

Thanks If you need any thing else I will add it to here. Where can I find this 
tool? 

 

Any way this is my Swagger config file:

 

using System.Web.Http;

using WebActivatorEx;

using ThirdPartyWebAPI;

using Swashbuckle.Application;

using Swashbuckle.OData;

using System;

using System.IO;

using System.Reflection;

using ThirdPartyWebAPI.App_Start;

using Swashbuckle.Swagger;

using System.Web.Http.Description;

using System.Collections.Generic;

using System.Linq;

using System.Web.Http.Controllers;

 

[assembly: PreApplicationStartMethod(typeof(SwaggerConfig), "Register")]

 

namespace ThirdPartyWebAPI

{

public class SwaggerConfig

{

public static void Register()

{

var thisAssembly = typeof(SwaggerConfig).Assembly;

 

GlobalConfiguration.Configuration 

.EnableSwagger(c =>

{

// By default, the service root url is inferred from 
the request used to access the docs.

// However, there may be situations (e.g. proxy and 
load-balanced environments) where this does not

// resolve correctly. You can workaround this by 
providing your own code to determine the root URL.

//

//c.RootUrl(req => GetRootUrlFromAppConfig());

 

// If schemes are not explicitly provided in a Swagger 
2.0 document, then the scheme used to access

// the docs is taken as the default. If your API 
supports multiple schemes and you want to be explicit

// about them, you can use the "Schemes" option as 
shown below.

//

//c.Schemes(new[] { "http", "https" });

 

// Use "SingleApiVersion" to describe a single version 
API. Swagger 2.0 includes an "Info" object to

// hold additional metadata for an API. Version and 
title are required but you can also provide

// additional fields by chaining methods off 
SingleApiVersion.

//

c.SingleApiVersion("v1", "ThirdPartyWebAPI");

c.CustomProvider(defaultProvider => new 
ODataSwaggerProvider(defaultProvider, c).Configure(odataConfig =>

{

 odataConfig.IncludeNavigationProperties();

}));

 

 

// If your API has multiple versions, use 
"MultipleApiVersions" instead of "SingleApiVersion".

// In this case, you must provide a lambda that tells 
Swashbuckle which actions should be

// included in the docs for a given API version. Like 
"SingleApiVersion", each call to "Version"

// returns an "Info" builder so you can provide 
additional metadata per API version.

//

//c.MultipleApiVersions(

//(apiDesc, targetApiVersion) => 
ResolveVersionSupportByRouteConstraint(apiDesc, targetApiVersion),

//(vc) =>

//{

//vc.Version("v2", "Swashbuckle Dummy API V2");

//vc.Version("v1", "Swashbuckle Dummy API V1");

//});

 

// You can use "BasicAuth", "ApiKey" or "OAuth2" 
options to describe security schemes for the API.

// See 
https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md for 
more details.

// NOTE: These only define the schemes and need to be 
coupled with a corresponding "security" property

// at the document or operation level to indicate which 
schemes are required for an operation. To do this,

// you'll need to implement a custom IDocumentFilter 
and/or IOperationFilter to set these properties

// according to your specific authorization 
implementation

//

//c.BasicAuth("basic")

//.Description("Basic HTTP Authentication");

//

//c.ApiKey("apiKey")

//.Description("API Key Authentication")

//.Name("apiKey")

//.In("header");

//

   

Re: Editing field names in Swagger UI

2016-08-04 Thread Ron Ratovsky
The spec itself doesn’t really support ‘unnamed’ parameters.

 

 

 

From:  on behalf of Andrew Campbell 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 4 August 2016 at 03:27
To: Swagger 
Subject: Editing field names in Swagger UI

 

Can field names be editable in Swagger UI?

 

The curl to upload a file to my API looks something like this:

 

curl -i -X POST \

-H "Authorization: $AUTH" \

-H "Accept: application/json" \

-H "Content-Type: multipart/form-data" \

-F "$CHECKSUM=@$FILE" \

$HOST/api/fileupload

 

The problem is the -F "$CHECKSUM=@$FILE" line. $CHECKSUM is a checksum for the 
file being uploaded, so naturally it varies from one file to another.

 

My options are

Make the field name editable
Provide a file with a known checksum for using with the console
Any thoughts?

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple authentications and associated problems

2016-08-04 Thread Ron Ratovsky
If you’re just using master branch, try to pull in the latest and try again 
first – there may have been related fixes.

 

 

 

From:  on behalf of Andrew Campbell 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 4 August 2016 at 01:10
To: Swagger 
Subject: Re: Multiple authentications and associated problems

 

Hi Ron, 

 

I usually use the latest version from Git hub - I update every couple of weeks.

 

Where do I check to find the precise version?

 

Andrew

On Wednesday, 3 August 2016 23:42:13 UTC+1, Ron wrote: 

Hello Andrew!

 

Which version of swagger-ui do you use?

 

 

 

From:  on behalf of Andrew Campbell 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Wednesday, 3 August 2016 at 09:09
To: Swagger 
Subject: Multiple authentications and associated problems

 

I am having difficulty with my securityDefinitions object.

 

My folder structure is like this:

 

/api

/console

  /swagger

/file1.json

/file2.json

  /swagger-ui

 

We are not yet ready to make the console (or associated swagger files) 
available to the whole internet, so everything under /console is protected 
using Basic Authentication. 

 

Most of the API calls require apiKey authorization.

 

If I just put the apiKey authorization in the securityDefinitions and then 
authorize via the Authorize button, and the json files are refreshed for any 
reason (such as changing from file1.json to file2.json) my browser displays an 
HTTP Basic Authentication dialog box, and no matter what values I enter, the 
dialog box just refreshes.

 

If I put both the apiKey authorization and basic authorization in the 
securityDefinitions, then I can refresh the json files without any problems as 
long as I authorize with both the apiKey and basic, but all calls to the API 
seem to use just basic authentication and ignore the apiKey authorization.

 

This is what my securityDefinitions object looks like:

 

  "securityDefinitions": {

"Basic": {

  "type": "basic",

  "description": "You must enter your username and password"

},

"Authorization": {

  "type": "apiKey",

  "name": "Authorization",

  "in": "header",

  "description": "Fill out as described in the documentation"

}

  }

 

And this is an example of the curl that the console generates for me when 
authorised with both basic and apiKey:

 

curl -X GET --header 'Accept: application/json' --header 'Authorization: Basic 
xx' 'http://example.com/api/call'

 

What I want to get is

 

curl -X GET --header 'Accept: application/json' --header 'Authorization: 
apiKey_value' 'http://example.com/api/call'

 

Is there an easy solution to this problem? I'm inclined to think I should 
remove the Basic authentication and restrict access based on IP address.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't Generate swagger.json With CXFNonSpringJaxrsServlet

2016-08-04 Thread Ron Ratovsky
So swagger-core doesn’t know what to scan in this case.

The easy path? Replace the Jersey2Config method (hey, you’re not using Jersey!) 
with the BeanConfig method and make sure to set the resource package in it to 
the package(s) of your resource(s).

Should be smooth sailing from there.

 

 

 

From:  on behalf of Jeff Davis 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 4 August 2016 at 16:50
To: Swagger 
Subject: Re: Can't Generate swagger.json With CXFNonSpringJaxrsServlet

 

Thanks for the quick response and guidance Ron.  Definitely made some great 
progress.  I'm now getting a swagger.json that looks like: 

 

{"swagger":"2.0","info":{"version":"1.0","title":""},"host":"localhost:8080","basePath":"/rest/sample","schemes":["http"]}
 
Lacks the actual information about my service even though I have it annotated 
in my original code as visible in the snippet above.  Any thoughts on why that 
may be?  I modified my web.xml as follows: 

 

  swaggerRest
  
  
contextParam
contextParamValue
  
  
  
CXFServlet

org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet

  jaxrs.serviceClasses
  io.swagger.jaxrs.listing.ApiListingResource, 
swaggerRest.HelloService


  jaxrs.providers
  io.swagger.jaxrs.listing.SwaggerSerializers

1
  


  
Jersey2Config
io.swagger.jaxrs.config.DefaultJaxrsConfig

  api.version
  1.0


  swagger.api.basepath
  http://localhost:8080/rest/sample

2
  


  
CXFServlet
/rest/*
  

 


On Thursday, August 4, 2016 at 4:38:57 PM UTC-6, Ron wrote: 

So for CXF 2.7 I think swagger-core could work out of the box.

To be honest, I don’t know exactly what the internal integration CXF has with 
swagger-core provides, though I know they’ve worked on it to hook up nicely 
with CXF so it should be easier.

 

For swagger-core we have a sample that shows how to integrate it with a 
Spring-based CXF application - 
https://github.com/swagger-api/swagger-samples/tree/master/java/java-jaxrs-cxf 
but not one for Non-Spring one.

Based on your knowledge of other frameworks, you can look at the integrations 
with them and figure out what steps you need to take - 
https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-JAX-RS-Project-Setup-1.5.X.

In short, you need to:

1.   Add the dependencies (in your case, it would be swagger-jaxrs)

2.   Register these two classes as JAX-RS resources:

a.   io.swagger.jaxrs.listing.ApiListingResource

b.   io.swagger.jaxrs.listing.SwaggerSerializers

3.   Set up the basic configuration of Swagger-core based on one of the 
methods described in the wiki linked above.

 

Following that you’d need to add the various annotations to produce the 
documentation.

 

The second instruction (registering the resources) is enough to get at least a 
basic swagger.json output. It won’t describe anything without the annotations, 
but it should give you a sense that you hooked it up in your app properly.

Since it’s just a JAX-RS resource like the rest, it will be found at the 
context root you use for any other resource in your app.

 

If you’re having trouble getting to that point, provide more details as to what 
you’re trying to access.

 

 

 

 

From:  on behalf of Jeff Davis 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Thursday, 4 August 2016 at 14:15
To: Swagger 
Subject: Re: Can't Generate swagger.json With CXFNonSpringJaxrsServlet

 

Ron, 

 

I'm indifferent to what I'm using so long as I can generate the swagger.json.  
Is there something I can use other that Swagger2Feature?

On Thursday, August 4, 2016 at 3:10:21 PM UTC-6, Ron wrote: 

Hi Jeff,

 

Since you’re using the Swagger2Feature, you could get better support for it in 
the CXF mailing list as that’s their implementation for it.

 

 

 

From:  on behalf of Jeff Davis 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Thursday, 4 August 2016 at 13:47
To: Swagger 
Subject: Can't Generate swagger.json With CXFNonSpringJaxrsServlet

 

I am attempting to integrate swagger with a legacy REST service implemented 
using an older version of CXF.  I've attempted several configurations but can't 
get the swagger.json to generate.  Guidance on getting this resolved is greatly 
appreciated.  Please see project code below: 

 

HelloService.java

 

package swaggerRest;

import javax.ws.rs.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Path("/sample")
@Api(value = "/sample", description = "Sample REST for Swagger Testing")
public class HelloService {
 @GET
 @Path("hello")
 @ApiOperation(value = "Get hello message", response = String.class)
 public String sayHello(){
 return "Hello World";
 }
}

 

web.xml

 


http://www.w3.org/2001/XMLSchema-instance"; 
xmlns="http://java.sun.com/xml/ns/javaee"; 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"; id="WebAp

Re: curl -X *method* --header 'Accept: application/json' not working

2016-08-08 Thread Ron Ratovsky
In that case, please open a ticket and provide a spec that reproduces the issue.

 

 

 

From:  on behalf of Natalia Queiroz 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 8 August 2016 at 12:15
To: Swagger 
Subject: Re: curl -X *method* --header 'Accept: application/json' not working

 


Ron, I'm using the master version of Swagger

Em quarta-feira, 27 de julho de 2016 18:19:40 UTC-3, Ron escreveu: 

What version is that?

 

 

 

 

From:  on behalf of Natalia Queiroz 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Wednesday, 27 July 2016 at 14:02
To: Swagger 
Subject: Re: curl -X *method* --header 'Accept: application/json' not working

 


Hi Tony and Ron, I am using the last version of swagger ui, same problem :(

Regards,
Natália Oliveira

Em quarta-feira, 20 de julho de 2016 03:03:09 UTC-3, tony tam escreveu: 

Did you try Ron’s suggestion? 

 

"There are some known issues regarding that. Try the latest master version of 
swagger-ui.”

 

 

On Jul 19, 2016, at 4:53 PM, Natália Oliveira  wrote:

 

Anyone?!


Em 15 de jul de 2016, às 19:48, Natalia Queiroz  escreveu:

Hello group,

my json application is not showing the correct Accept response on the curl 
method.

Even using the header("Content-Type: application/json;charset=utf-8") or , 
header("Content-Type: application/json"), it keeps showing 

curl -X GET --header 'Accept: text/html' 
'http://servicos.jbrj.gov.br/jabot/collections'
 

Does anybody know if is it a bug? or how to fix it?


Thanks,


-- 



Natália Oliveira

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple authentications and associated problems

2016-08-08 Thread Ron Ratovsky
Okay, so that’s not good.

Can you share your spec so I can test it locally? You can send it in private if 
you prefer.

 

 

 

From:  on behalf of Andrew Campbell 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 5 August 2016 at 02:01
To: Swagger 
Subject: Re: Multiple authentications and associated problems

 

Just tried grabbing the latest version from Git. Same problem. 

 

I've also tried reversing the order of the apiKey and Basic authorizations - 
again, the same problem. When assembling the curl command, Swagger UI seems to 
favour the basic authentication.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Swagger for Spring 3 MVC

2016-08-08 Thread Ron Ratovsky
Spring Core is not really relevant. What’s relevant is the framework you use to 
expose your REST API. If you use SpringMVC, you want to use Springfox, if you 
use a JAX-RS implementation, then opt for swagger-core.

 

 

 

From:  on behalf of Vishal Thakur 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 5 August 2016 at 04:51
To: Swagger 
Subject: Re: Swagger for Spring 3 MVC

 

Thanks Ron for the response. 

One more query, is there any support for Spring 3 core  (non- mvc) as you 
mentioned it doesnot support Spring 3 MVC ?



On Friday, July 29, 2016 at 11:09:01 PM UTC+5:30, Ron wrote: 

swagger-core doesn’t support Spring MVC.

Not sure if Springfox supports Spring 3 – you’d need to check with their 
documentation.

 

 

From:  on behalf of Vishal Thakur 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Wednesday, 27 July 2016 at 23:59
To: Swagger 
Subject: Swagger for Spring 3 MVC

 

Hi 

 

I tried different approaches for integrating swagger with Spring 3 mvc as 
mentioned below :

1. 
https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-1.X-Project-Setup-1.5
 with changes in web.xml and spring too.

   I cannot use SpringBoot as it is not used in our project.

2. I tried with Springfox but get exceptions while running server.

https://github.com/springfox/springfox/issues/938

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Wiki/Knowledge Base Tools which support swagger

2016-08-08 Thread Ron Ratovsky
It sounds like you’re looking for a developer portal solution?

 

 

 

From:  on behalf of 
"john.medfo...@blacksquaremedia.com" 
Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 8 August 2016 at 11:58
To: Swagger 
Subject: Wiki/Knowledge Base Tools which support swagger

 

Hi,  

 

I'm looking to create a knowledge base for one of my clients. They would like 
the usual client facing documentation, how to, faqs etc. I would also like to 
include a couple of swagger endpoints and have the API description. 


Does anyone know of any off the shelf tools which would meet these 
requirements? 

 

J

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Swagger throws “Swagger Error Not a valid parameter definition”

2016-08-08 Thread Ron Ratovsky
You defined your query parameter as an object, but query parameters can only be 
primitives.

Only body parameters can 

 

be objects.

 

From:  on behalf of Benjamin SOULAS 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 8 August 2016 at 01:57
To: Swagger 
Subject: Re: Swagger throws “Swagger Error Not a valid parameter definition”

 

Still the same problem, maybe I missunderstood the way to handle POST request? 
Here is a screenshot: 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: RESTful API documentations using swagger

2016-08-09 Thread Ron Ratovsky
Hi Pradeep,

 

The answer depends on which development language you use and which framework.

Check out the list of supporting libraries at 
http://swagger.io/open-source-integrations/.

 

 

 

 

From:  on behalf of Pradeep Tripathi 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 9 August 2016 at 06:14
To: Swagger 
Subject: RESTful API documentations using swagger

 

Hi, 

 

I am new to this group and trying to explore more features of swagger for ny 
project. I have RESTful web services implemented on the server and i want to 
generate the API documentation which can be available to client for use of 
those APIs.

 

Which swagger tool should i use to generate the RESTful API document from 
existing server code, and how?

 

Any inputs will be highly appreciated.

 

Thanks,

Pradeep

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: spec file and validation code in swagger-editor project

2016-08-11 Thread Ron Ratovsky
The document is not validated against a spec. The tool that’s used for 
validation in swagger-editor is called Sway.

 

 

 

From:  on behalf of Shima 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 11 August 2016 at 09:53
To: Swagger 
Subject: spec file and validation code in swagger-editor project

 

I've downloaded and installed swagger-editor. I would like to customize the 
spec that the yaml/json document is validated against. Where can I find the 
spec file and the validation code in swagger-editor project? Thanks


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why the swagger Editor generation is not the same than server generated result ?

2016-08-11 Thread Ron Ratovsky
If you’re asking about the different Uis, those are two different projects, so 
their UI looks different.

 

 

 

From:  on behalf of Nigel Kozlowski 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 9 August 2016 at 16:59
To: Swagger 
Subject: Why the swagger Editor generation is not the same than server 
generated result ?

 

why the swagger Editor generation is not the generated one i've got when i do 
"Generate Server" -> "Node.js" (in my case)

 

 

 

is not

 

 

 

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how can i display model/modelschema properly.?

2016-08-11 Thread Ron Ratovsky
How can we know without seeing your code or generated spec?

 

 

 

From:  on behalf of smk 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 11 August 2016 at 15:54
To: Swagger 
Subject: how can i display model/modelschema properly.?

 

Hi ,  

 

 

Currently this is what i am doing to display my json in the Model/Mode Schema 
on the swagger UI .

 

-> convert my json  to json schema

->use json schema to generate a pojo class

-> usiing @implicitparam(DataType="path/to/jar/that/has/the/.class" .. .. .. ) 
or using the response ="/path/to/.class "

 

 

but the json schema conversion is not accurate for array type where instead of 

[

{

}

]

 

UI displays 

{

}

 

moreover it doesnt show all the parameters in an arraytype when converted in to 
pojo.

 

 

My question is how would one display a model/model schema( i have attached a 
screenshot) on the swagger UI when i have the json request and response 
parameters of my api's . Is there a  better way of doing,

 

Im using Swagger + jersey2.

 

Thank you

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Display the @Copy httpMethod in SwaggerUI

2016-08-12 Thread Ron Ratovsky
No. It’s not a swagger-ui issue, it’s the spec that doesn’t allow it, and I’ve 
never seen anyone ask for COPY to be added to the spec.

 

 

 

From:  on behalf of Henrik Helmø Larsen 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 12 August 2016 at 00:21
To: Swagger 
Subject: Display the @Copy httpMethod in SwaggerUI

 

Is there any plans in the future to be able to display documentation for the 
@COPY httpMethod in the SwaggerUI? 

 

We are in a situation where we need to copy resources. I have now implemented 
it in two ways:

 

using a queryParameter via a POST:

 

POST /resouces?copyOf=123123


and using the COPY httpMethod:

 

COPY /resources/123123


My code looks like this:

 

@COPY
@Path("{id : [0-9]+}")
@ApiOperation(
 value = "Copies a ...",
 notes = "Makes a copy of ...",
 response = ...
)
public Response copy(@ApiParam(value="Id of the ...", required = true) 
@PathParam("id") long id) {
  // Make a copy of the resource with id = {id}
  ...
}
 
Would it be easy to modify Swagger to also display COPY documentation? Has 
anyone done this?
-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I specify a payload that allows different sub types?

2016-08-12 Thread Ron Ratovsky
You just set the body parameter to be Animal. The rest inherit from it, and are 
valid as input.

 

 

 

From:  on behalf of Jeff Haynes 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 12 August 2016 at 15:10
To: Swagger 
Subject: How do I specify a payload that allows different sub types?

 

 

 

I am trying to design an endpoint of our API and the payload is an object which 
(in Java) is represented by a base class and several sub classes.

 

definitions:
  AnimalType:
type: string
enum: &animal_type_values
- dog
- cat
- pig
- horse

  EntityType:
description: An enumeration of the supported entity types
type: string
enum:
- Animal
- Crop
- Person
- Building

  Entity:
discriminator: entity_type
required:
  - entity_type
  - id
properties:
  id:
type: integer
format: int64
readOnly: true
description: The internal entity id for this entity representation
example: 1438752
  entity_type:
$ref: '#/definitions/EntityType'

  AnimalPayload:
discriminator: animal_type
allOf:
  - $ref: '#/definitions/Dog'
  - $ref: '#/definitions/Cat'
  - $ref: '#/definitions/Pig'
  - $ref: '#/definitions/Horse'

  Animal:
discriminator: animal_type
allOf:
  - $ref: '#/definitions/Entity'
  - type: object
required:
  - animal_type
properties:
  animal_type:
$ref: '#/definitions/AnimalType'
  name:
type: string
readOnly: true
  birth_date:
type: string
format: date
  gender:
type: string
enum:
- male
- female

  Dog:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  breed:
type: string

  Cat:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  num_lives:
type: integer
format: int32

  Pig:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  color:
type: string

  Horse:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  breed:
type: string
tamed:
  type: boolean
paths:
  /animals:

post:
  parameters:
animal:
  name: animal
  in: body
  schema:
- $ref: '#/parameters/Dog'
- $ref: '#/parameters/Cat'
- $ref: '#/parameters/Pig'
- $ref: '#/parameters/Horse'

 

 

I know this is not valid, but how do I get this to work in some form? I would 
like to simply use a Dog, Cat, Pig, or Horse object as the payload.

 

The only way I can think of is to create the AnimalPayload object. That is 
messy and confusing. Am I missing something? Can I model this differently to 
make this work more intuitively?

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: issue with the model schema

2016-08-16 Thread Ron Ratovsky
Why would you expect to see an array of the model when you describe only the 
model?

 

 

 

From:  on behalf of sdav 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 16 August 2016 at 12:05
To: Swagger 
Subject: issue with the model schema

 

Hi  

 

I have up running project and decided to integrate swagger. 

 

I am using jersey 2 .

 

so, i got an api response that i converted in to jsonschema and generated a 
pojo class. using something like below i am able to show the model schema of 
the response 

 

 

@GET

@ApiOperation(value="Retrives all items" , response = /path/to/.class/in/the 
jar.class )

@Produces({MediaType.APPLICATION_JSON})

public getStoreitems(..)

Below is the schema of my response from api and along with the generated POJO 
that i am using to point in the @Apioperation(@ApiOperation(value="Retrives all 
items" , response = /path/to/.class/in/the jar.class )

{
  "$schema": "http://json-schema.org/draft-04/schema#";,
  "type": "object",
  "properties": {
    "id": {
  "type": "string"
    },
    "storeitem": {
  "type": "string"
    },
    "description": {
  "type": "string"
    }
  },
  "required": [
    "id",
    "storeitem",
    "description"
  ]
}
 
pojo class

import java.util.HashMap;
import java.util.Map;
import javax.annotation.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
@JsonPropertyOrder({
"id",
"storeitem",
"description"
})
public class Example {

/**
* 
* (Required)
* 
*/
@JsonProperty("id")
private String id;
/**
* 
* (Required)
* 
*/
@JsonProperty("storeitem")
private String storeitem;
/**
* 
* (Required)
* 
*/
@JsonProperty("description")
private String description;
@JsonIgnore
private Map additionalProperties = new HashMap();

/**
* 
* (Required)
* 
* @return
* The id
*/
@JsonProperty("id")
public String getId() {
return id;
}

/**
* 
* (Required)
* 
* @param id
* The id
*/
@JsonProperty("id")
public void setId(String id) {
this.id = id;
}

/**
* 
* (Required)
* 
* @return
* The storeitem
*/
@JsonProperty("storeitem")
public String getStoreitem() {
return storeitem;
}

/**
* 
* (Required)
* 
* @param storeitem
* The storeitem
*/
@JsonProperty("storeitem")
public void setStoreitem(String storeitem) {
this.storeitem = storeitem;
}

/**
* 
* (Required)
* 
* @return
* The description
*/
@JsonProperty("description")
public String getDescription() {
return description;
}

/**
* 
* (Required)
* 
* @param description
* The description
*/
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}

@JsonAnyGetter
public Map getAdditionalProperties() {
return this.additionalProperties;
}

@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}

}
 
on the UI Model scheam, i am expecting something like this. 
[
{
  "id": "string",
  "storeitem": "string",
  "description": "string"
}
]
but what i get 
{
"id":

"string",

 "storeitem":

"string",

 "description":

"string"

 }



Thanks

devin

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Integrate Swagger to Android

2016-08-16 Thread Ron Ratovsky
Which sample project?

 

 

 

From:  on behalf of Esti Zinger 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 16 August 2016 at 04:18
To: Swagger 
Subject: Integrate Swagger to Android

 

When I'm trying to build the sample project "petstore" it is build it with 
those dependencies: 

compile "org.apache.httpcomponents:httpcore:4.4.4"
compile "org.apache.httpcomponents:httpmime:4.5.2"
compile "org.apache.httpcomponents:httpclient-android:4.3.3"
but then I get the error that there are duplicate files (in htttpmine and 
httpcore)
I saw that the recommended way is to use the okhttp-gson library, but then I 
had to add another jars because it is not enough.
has anyone done this before and can send me this sample project please?
-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: issue with the model schema

2016-08-16 Thread Ron Ratovsky
I have no knowledge of jsonschema2pojo.

 

Your Example.java is a pojo, not an array.

Your API method signature in the java code is incomplete (there’s no return 
type) so I can’t tell whether you return the array of the object, or whether 
you use the Response class.

If you just return the array of the object, it should work OOTB.

If you return a Response, you can use the @ApiOperation to set the 
responseContainer to be a List and that should describe it as an array.

 

 

 

 

From:  on behalf of sdav 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 16 August 2016 at 14:49
To: Swagger 
Subject: Re: issue with the model schema

 

Hi Ron, 

 

Thanks for the reply . I am extremely sorry for posting the wrong schema.  This 
is the schema i have defined for the api. which than i converted in to Jackson 
annotated pojo class using  plugin provided by http://www.jsonschema2pojo.org/

 

{
  "$schema": "http://json-schema.org/draft-04/schema#";,
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
  "id": {
    "type": "string"
  },
  "storeitem": {
    "type": "string"
  },
  "description": {
    "type": "string"
  }
    },
    "required": [
  "id",
  "storeitem",
  "description"
    ]
  }
}
 

I checked my swagger.json file and it shows

  "storeitem":{

   "type":"object",

   "properties":

   {

   "id":{

   "type":"string"

   },

  "caption":{

   "type":"string"},

  "storeitem":{

  "type":"string"}

  }}

  

so its clear that swagger UI is seeing it as an object but i want that it to be 
an array type. The pojo class generated by  http://www.jsonschema2pojo.org/ is 
below, could it be that the parsing of array-type to jackson annotated pojo 
class is not correct?. In that case is there any better way i could present my 
model to the UI instead of converting from json schema to pojo and than 
pointing it.

 

---com.example.Example.java---

package com.example;

import java.util.HashMap;
import java.util.Map;
import javax.annotation.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
@JsonPropertyOrder({
"id",
"storeitem",
"description"
})
public class Example {

/**
* 
* (Required)
* 
*/
@JsonProperty("id")
private String id;
/**
* 
* (Required)
* 
*/
@JsonProperty("storeitem")
private String storeitem;
/**
* 
* (Required)
* 
*/
@JsonProperty("description")
private String description;
@JsonIgnore
private Map additionalProperties = new HashMap();

/**
* 
* (Required)
* 
* @return
* The id
*/
@JsonProperty("id")
public String getId() {
return id;
}

/**
* 
* (Required)
* 
* @param id
* The id
*/
@JsonProperty("id")
public void setId(String id) {
this.id = id;
}

/**
* 
* (Required)
* 
* @return
* The storeitem
*/
@JsonProperty("storeitem")
public String getStoreitem() {
return storeitem;
}

/**
* 
* (Required)
* 
* @param storeitem
* The storeitem
*/
@JsonProperty("storeitem")
public void setStoreitem(String storeitem) {
this.storeitem = storeitem;
}

/**
* 
* (Required)
* 
* @return
* The description
*/
@JsonProperty("description")
public String getDescription() {
return description;
}

/**
* 
* (Required)
* 
* @param description
* The description
*/
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}

@JsonAnyGetter
public Map getAdditionalProperties() {
return this.additionalProperties;
}

@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}

}

 


On Tuesday, August 16, 2016 at 1:16:21 PM UTC-7, Ron wrote: 

Why would you expect to see an array of the model when you describe only the 
model?

 

 

 

From:  on behalf of sdav 
Reply-To: "swagger-sw...@googlegroups.com" 
Date: Tuesday, 16 August 2016 at 12:05
To: Swagger 
Subject: issue with the model schema

 

Hi  

 

I have up running project and decided to integrate swagger. 

 

I am using jersey 2 .

 

so, i got an api response that i converted in to jsonschema and generated a 
pojo class. using something like below i am able to show the model schema of 
the response 

 

 

@GET

@ApiOperation(value="Retrives all items" , response = /path/to/.class/in/the 
jar.class )    

@Produces({MediaType.APPLICATION_JSON})

public getStoreitems(..)

Below is the schema of my response from api and along with the generated POJO 
that i am using to point in the @Apioperation(@ApiOperation(value="Retrives all 
items" , response = /path/to/.class/in/the jar.class )

{
  "$schema": "htt

Re: in Swagger UI Example Value

2016-08-16 Thread Ron Ratovsky
The problem is the spec is just invalid. The Comments model just doesn’t follow 
the supported spec.

 

 

 

From:  on behalf of Andrew Campbell 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 15 August 2016 at 04:01
To: Swagger 
Subject:  in Swagger UI Example Value

 

I'm getting  in my Example Values in Swagger UI. 

 

For example

 













 

The model looks like this

 

Comments { 

comment (Array[Comment], optional)

}
Comment { 

id (string,null):  

http://www.w3.org/TR/xmlschema-2/#string

}

 

I have attached a sample Swagger file that displays the problem.

 

I just can't see what is causing this problem. Can anyone help me?

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to provide example value to a Response Body of content-type: text/html in Swagger

2016-08-16 Thread Ron Ratovsky
By not specifying a schema for the response, you’re pretty much saying the 
response is empty.

Now, describing the response for HTMl with json schema is not really doable.

In that case, just specify that the schema is {}, pretty much saying anything 
goes, but it still suggests there’s a response body 

 

expected.

 

From:  on behalf of Shachar Romi 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Saturday, 13 August 2016 at 08:43
To: Swagger 
Subject: How to provide example value to a Response Body of content-type: 
text/html in Swagger

 

Hello, 

 

I have an API call which responds 200 OK and returns an HTML. I would like to 
add this to my API documentation

(especially since i validate it using dredd and unless i provide it with the 
expected response body the test fails). How

would i do this in Swagger?

 

--- More details ---

My Response to an API call is 200 OK and with a one line Response Body:

You are being https://my.domain.com/users/sign_in";>redirected.

 

I can easily define the Response Body in Blueprint in the following form:

 

>+ Response 302 (text/html; charset=utf-8)

>

>+ Body

>

>You are being  href="https://my.domain.com/users/sign_in";>redirected.

 

But i'm not sure how to do this in Swagger. Almost all examples i can find are 
for application/json responses (understandably) and i'm having trouble

guessing the correct syntax for this kind of response.

 

The relevant swagger text in my document is this (so far without specifying the 
response body, so with an empty body dredd

fails because the response body should be You are being https://my.domain.com/users/sign_in";>redirected.):

 

# this is my API spec in YAML

swagger: '2.0'

info:

  title: My API (Swagger)

  description: blablabla

  version: "1.0.0"

# the domain of the service

host: my.domain.com

# array of all schemes that your API supports

schemes:

  - https

# will be prefixed to all paths

basePath: /

produces:

  - application/json; charset=utf-8

paths:

  /users/password:

post:

  summary: Password Reset

  description: |

Handles Reset password for existing user.

  consumes:

- application/x-www-form-urlencoded

  produces:

- text/html; charset=utf-8

  parameters:

- name: "user[email]"

  description: email

  in: formData

  required: true

  type: string

  default: "u...@gmail.com"

  tags:

- Reset Password

  responses:

200:

  description: Success

 

Please comment if you have any suggestions on this. Thanks!

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I specify a payload that allows different sub types?

2016-08-16 Thread Ron Ratovsky
Currently, neither tool will show those fields. And since neither of them 
performs validation on responses, sub types are irrelevant.

 

 

 

From:  on behalf of Jeff Haynes 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 12 August 2016 at 15:22
To: "swagger-swaggersocket@googlegroups.com" 

Subject: Re: How do I specify a payload that allows different sub types?

 

Does that show all the fields for each type through swagger-ui and 
swagger-editor? 

And does that allow validation of the sub types?

 

Thanks

 

 

On Aug 12, 2016, at 5:14 PM, Ron Ratovsky  wrote:

 

You just set the body parameter to be Animal. The rest inherit from it, and are 
valid as input.

 

 

 

From:  on behalf of Jeff Haynes 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 12 August 2016 at 15:10
To: Swagger 
Subject: How do I specify a payload that allows different sub types?

 

 

 

I am trying to design an endpoint of our API and the payload is an object which 
(in Java) is represented by a base class and several sub classes.

 

definitions:
  AnimalType:
type: string
enum: &animal_type_values
- dog
- cat
- pig
- horse

  EntityType:
description: An enumeration of the supported entity types
type: string
enum:
- Animal
- Crop
- Person
- Building

  Entity:
discriminator: entity_type
required:
  - entity_type
  - id
properties:
  id:
type: integer
format: int64
readOnly: true
description: The internal entity id for this entity representation
example: 1438752
  entity_type:
$ref: '#/definitions/EntityType'

  AnimalPayload:
discriminator: animal_type
allOf:
  - $ref: '#/definitions/Dog'
  - $ref: '#/definitions/Cat'
  - $ref: '#/definitions/Pig'
  - $ref: '#/definitions/Horse'

  Animal:
discriminator: animal_type
allOf:
  - $ref: '#/definitions/Entity'
  - type: object
required:
  - animal_type
properties:
  animal_type:
$ref: '#/definitions/AnimalType'
  name:
type: string
readOnly: true
  birth_date:
type: string
format: date
  gender:
type: string
enum:
- male
- female

  Dog:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  breed:
type: string

  Cat:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  num_lives:
type: integer
format: int32

  Pig:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  color:
type: string

  Horse:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  breed:
type: string
tamed:
  type: boolean
paths:
  /animals:

post:
  parameters:
animal:
  name: animal
  in: body
  schema:
- $ref: '#/parameters/Dog'
- $ref: '#/parameters/Cat'
- $ref: '#/parameters/Pig'
- $ref: '#/parameters/Horse'

 

 

I know this is not valid, but how do I get this to work in some form? I would 
like to simply use a Dog, Cat, Pig, or Horse object as the payload.

 

The only way I can think of is to create the AnimalPayload object. That is 
messy and confusing. Am I missing something? Can I model this differently to 
make this work more intuitively?

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

-- 
You received this message because you are subscribed to a topic in the Google 
Groups "Swagger" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/swagger-swaggersocket/Jkz8lvE4s5A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I specify a payload that allows different sub types?

2016-08-16 Thread Ron Ratovsky
Should have been clearer, sorry. 

 

For requests, the validation is limited to primitives, mostly.

I believe that if you enable the JSON Schema Form editor (in swagger-ui), you 
will get some basic field-level validation for the payload fields, but it still 
doesn’t support the inheritance model.

 

 

 

From:  on behalf of Jeff Haynes 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 16 August 2016 at 21:05
To: "swagger-swaggersocket@googlegroups.com" 

Subject: Re: How do I specify a payload that allows different sub types?

 

Thanks for the response. 

 

You spoke about responses. What about as part of a payload?

 

Thanks

 

 

On Aug 16, 2016, at 10:46 PM, Ron Ratovsky  wrote:

 

Currently, neither tool will show those fields. And since neither of them 
performs validation on responses, sub types are irrelevant.

 

 

 

From:  on behalf of Jeff Haynes 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 12 August 2016 at 15:22
To: "swagger-swaggersocket@googlegroups.com" 

Subject: Re: How do I specify a payload that allows different sub types?

 

Does that show all the fields for each type through swagger-ui and 
swagger-editor? 

And does that allow validation of the sub types?

 

Thanks

 

 

On Aug 12, 2016, at 5:14 PM, Ron Ratovsky  wrote:

 

You just set the body parameter to be Animal. The rest inherit from it, and are 
valid as input.

 

 

 

From:  on behalf of Jeff Haynes 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 12 August 2016 at 15:10
To: Swagger 
Subject: How do I specify a payload that allows different sub types?

 

 

 

I am trying to design an endpoint of our API and the payload is an object which 
(in Java) is represented by a base class and several sub classes.

 

definitions:
  AnimalType:
type: string
enum: &animal_type_values
- dog
- cat
- pig
- horse

  EntityType:
description: An enumeration of the supported entity types
type: string
enum:
- Animal
- Crop
- Person
- Building

  Entity:
discriminator: entity_type
required:
  - entity_type
  - id
properties:
  id:
type: integer
format: int64
readOnly: true
description: The internal entity id for this entity representation
example: 1438752
  entity_type:
$ref: '#/definitions/EntityType'

  AnimalPayload:
discriminator: animal_type
allOf:
  - $ref: '#/definitions/Dog'
  - $ref: '#/definitions/Cat'
  - $ref: '#/definitions/Pig'
  - $ref: '#/definitions/Horse'

  Animal:
discriminator: animal_type
allOf:
  - $ref: '#/definitions/Entity'
  - type: object
required:
  - animal_type
properties:
  animal_type:
$ref: '#/definitions/AnimalType'
  name:
type: string
readOnly: true
  birth_date:
type: string
format: date
  gender:
type: string
enum:
- male
- female

  Dog:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  breed:
type: string

  Cat:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  num_lives:
type: integer
format: int32

  Pig:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  color:
type: string

  Horse:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  breed:
type: string
tamed:
  type: boolean
paths:
  /animals:

post:
  parameters:
animal:
  name: animal
  in: body
  schema:
- $ref: '#/parameters/Dog'
- $ref: '#/parameters/Cat'
- $ref: '#/parameters/Pig'
- $ref: '#/parameters/Horse'

 

 

I know this is not valid, but how do I get this to work in some form? I would 
like to simply use a Dog, Cat, Pig, or Horse object as the payload.

 

The only way I can think of is to create the AnimalPayload object. That is 
messy and confusing. Am I missing something? Can I model this differently to 
make this work more intuitively?

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

-- 
You received this message because you are subscribed to a topic in the Google 
Groups "Swagger" gr

Re: How do I specify a payload that allows different sub types?

2016-08-17 Thread Ron Ratovsky
Take a look at https://github.com/swagger-api/swagger-ui#parameters.

 

 

 

From:  on behalf of Jeff Haynes 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 17 August 2016 at 11:32
To: "swagger-swaggersocket@googlegroups.com" 

Subject: Re: How do I specify a payload that allows different sub types?

 

How do I enable the JSON Schema Form editor? 

 

On Aug 16, 2016, at 11:12 PM, Ron Ratovsky  wrote:

 

Should have been clearer, sorry. 

 

For requests, the validation is limited to primitives, mostly.

I believe that if you enable the JSON Schema Form editor (in swagger-ui), you 
will get some basic field-level validation for the payload fields, but it still 
doesn’t support the inheritance model.

 

 

 

From:  on behalf of Jeff Haynes 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 16 August 2016 at 21:05
To: "swagger-swaggersocket@googlegroups.com" 

Subject: Re: How do I specify a payload that allows different sub types?

 

Thanks for the response. 

 

You spoke about responses. What about as part of a payload?

 

Thanks

 

 

On Aug 16, 2016, at 10:46 PM, Ron Ratovsky  wrote:

 

Currently, neither tool will show those fields. And since neither of them 
performs validation on responses, sub types are irrelevant.

 

 

 

From:  on behalf of Jeff Haynes 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 12 August 2016 at 15:22
To: "swagger-swaggersocket@googlegroups.com" 

Subject: Re: How do I specify a payload that allows different sub types?

 

Does that show all the fields for each type through swagger-ui and 
swagger-editor? 

And does that allow validation of the sub types?

 

Thanks

 

 

On Aug 12, 2016, at 5:14 PM, Ron Ratovsky  wrote:

 

You just set the body parameter to be Animal. The rest inherit from it, and are 
valid as input.

 

 

 

From:  on behalf of Jeff Haynes 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 12 August 2016 at 15:10
To: Swagger 
Subject: How do I specify a payload that allows different sub types?

 

 

 

I am trying to design an endpoint of our API and the payload is an object which 
(in Java) is represented by a base class and several sub classes.

 

definitions:
  AnimalType:
type: string
enum: &animal_type_values
- dog
- cat
- pig
- horse

  EntityType:
description: An enumeration of the supported entity types
type: string
enum:
- Animal
- Crop
- Person
- Building

  Entity:
discriminator: entity_type
required:
  - entity_type
  - id
properties:
  id:
type: integer
format: int64
readOnly: true
description: The internal entity id for this entity representation
example: 1438752
  entity_type:
$ref: '#/definitions/EntityType'

  AnimalPayload:
discriminator: animal_type
allOf:
  - $ref: '#/definitions/Dog'
  - $ref: '#/definitions/Cat'
  - $ref: '#/definitions/Pig'
  - $ref: '#/definitions/Horse'

  Animal:
discriminator: animal_type
allOf:
  - $ref: '#/definitions/Entity'
  - type: object
required:
  - animal_type
properties:
  animal_type:
$ref: '#/definitions/AnimalType'
  name:
type: string
readOnly: true
  birth_date:
type: string
format: date
  gender:
type: string
enum:
- male
- female

  Dog:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  breed:
type: string

  Cat:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  num_lives:
type: integer
format: int32

  Pig:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  color:
type: string

  Horse:
allOf:
  - $ref: '#/definitions/Animal'
  - type: object
properties:
  breed:
type: string
tamed:
  type: boolean
paths:
  /animals:

post:
  parameters:
animal:
  name: animal
  in: body
  schema:
- $ref: '#/parameters/Dog'
- $ref: '#/parameters/Cat'
- $ref: '#/parameters/Pig'
- $ref: '#/parameters/Horse'

 

 

I know this is not valid, but how do I get this to work in some form? I would 
like to simply use a Dog, Cat, Pig, or Horse object as the payload.

 

The only way I can think of is to create the AnimalPayload object. That is 
messy and confusing. Am I missing something? Can I model this differently to 

Re: in Swagger UI Example Value

2016-08-17 Thread Ron Ratovsky
So I don’t really know what you’re trying to describe but if you change the 
Comment definition to just

"Comment": {

  "type": "object",

  "title": "Comment",

  "required": [

    "id"

  ],

  "properties": {

    "id": {

  "title": "id",

  "type": "string"

    }

  }

    }

it will render as expected.

Keep in mind, ‘null’ is not a valid type, nor is an array of types.

 

From:  on behalf of Andrew Campbell 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 17 August 2016 at 02:54
To: Swagger 
Subject: Re:  in Swagger UI Example Value

 

Thanks. I've used http://bigstickcarpet.com/swagger-parser/www/index.html to 
find the validation issues with my spec, and I have altered it so it is now 
valid, at least according to that validator. 

 

I'm still getting the same problem, and I could really use some help in getting 
this fixed.

 

Updated spec is attached.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Integrate Swagger to Android

2016-08-17 Thread Ron Ratovsky
It may be better to open a ticket on swagger-codegen.

 

 

 

From:  on behalf of Esti Zinger 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 16 August 2016 at 22:42
To: Swagger 
Subject: Re: Integrate Swagger to Android

 

 

thak you for reply!

 

they have a swagger api "petstore", and in git there is project to build with 
(https://github.com/swagger-api/swagger-codegen)

so I built it to android project by this command:

 

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate 

  -i http://petstore.swagger.io/v2/swagger.json

  -l android

  -o samples/client/petstore/android

 

it is realy build an android project, but when I am truing to run it - it is 
failed because duplicate files in the http libraries

 

can you help me?



On Tuesday, August 16, 2016 at 11:16:54 PM UTC+3, Ron wrote: 

Which sample project?

 

 

 

From:  on behalf of Esti Zinger 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Tuesday, 16 August 2016 at 04:18
To: Swagger 
Subject: Integrate Swagger to Android

 

When I'm trying to build the sample project "petstore" it is build it with 
those dependencies: 

compile "org.apache.httpcomponents:httpcore:4.4.4"
compile "org.apache.httpcomponents:httpmime:4.5.2"
compile "org.apache.httpcomponents:httpclient-android:4.3.3"
but then I get the error that there are duplicate files (in htttpmine and 
httpcore)
I saw that the recommended way is to use the okhttp-gson library, but then I 
had to add another jars because it is not enough.
has anyone done this before and can send me this sample project please?
-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: in Swagger UI Example Value

2016-08-18 Thread Ron Ratovsky
Glad to hear you got it sorted out. Swagger on!

 

 

 

 

From:  on behalf of Andrew Campbell 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 18 August 2016 at 02:25
To: Swagger 
Subject: Re:  in Swagger UI Example Value

 

Thank you! 

 

The problem was the missing "type": "string". This was further obfuscated by a 
typo in the full 13k line spec; I wouldn't have found either of those problems 
without your help.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I have a simple and noob problem!!

2016-08-19 Thread Ron Ratovsky
That depends on the library you use to generate the swagger.json…

 

 

 

From:  on behalf of Juan Lopez Rodao 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 19 August 2016 at 00:59
To: Swagger 
Subject: I have a simple and noob problem!!

 

Hello everybody! I have one problem... A simple problem... Sorry for this, I'm 
Junior and I can't find my swagger.json in my project... how can i get this 
file?? 

I cant resolve this problem for generate my html!! 

Regards!!

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Swagger definition generation issue

2016-08-22 Thread Ron Ratovsky
You’re using an ancient version of swagger-core. Please update to the latest 
and try again.

 

 

 

From:  on behalf of 
"avinash.upadhy...@gmail.com" 
Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 22 August 2016 at 10:35
To: Swagger 
Subject: Swagger definition generation issue

 

Hi All, 

 

I have created a sample service suing servlet, and annotated as per the swagger 
specification. But when i do http://localhost:8080/MyApp/api it gives me below 
response.

 

{"apiVersion":"0.0","swaggerVersion":"1.2"}

 

I have seen all previous discussion on this issue in this forum and other 
similar. But no luck with me. Requesting for help on this.

 

My Web.xml

 


http://www.w3.org/2001/XMLSchema-instance";
 xmlns="http://java.sun.com/xml/ns/javaee";
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd";
 id="WebApp_ID" version="3.0">
 Servlet
 
 
 DefaultServletReaderConfig
 
com.wordnik.swagger.servlet.config.DefaultServletReaderConfig
 
 swagger.resource.package
 servlet
 
 
 swagger.api.basepath
 http://localhost:8080/MyApp/api/
 
 
 api.version
 1.0.0
 


 
 
 ApiDeclarationServlet
 
com.wordnik.swagger.servlet.listing.ApiDeclarationServlet
 
 
 ApiDeclarationServlet
 /api/*
 
 


 

My POM.xml is as below

 

http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
  4.0.0
  Servlet
  Servlet
  0.0.1-SNAPSHOT
  war
  
src

  
maven-compiler-plugin
3.3

  1.7
  1.7

  
  
maven-war-plugin
2.6

  WebContent
  false

  

  
  
  
com.wordnik
swagger-annotations
1.3.11


com.wordnik
swagger-servlet_2.10
1.3.13


com.google.guava
guava




io.swagger
swagger-servlet
1.5.7


com.google.guava
guava




com.wordnik
swagger-jersey-jaxrs_2.10
1.3.13


com.google.guava
guava
19.0


com.wordnik
swagger-core_2.10
1.3.13
compile

 


 

Thanks

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I have a simple and noob problem!!

2016-08-22 Thread Ron Ratovsky
Juan, you’re saying you can’t find the swagger.json – that suggest that there’s 
already integration with some library, I just don’t know which one it is – you 
need to tell me that.

If you don’t have any integration, obviously you won’t find the swagger.json 
because nothing generates it.

 

 

 

From:  on behalf of Juan Lopez Rodao 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 22 August 2016 at 05:10
To: Swagger 
Subject: Re: I have a simple and noob problem!!

 

Hi Ron, can you recommend me any library??

El viernes, 19 de agosto de 2016, 16:54:04 (UTC+2), Ron escribió: 

That depends on the library you use to generate the swagger.json…

 

 

 

From:  on behalf of Juan Lopez Rodao 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Friday, 19 August 2016 at 00:59
To: Swagger 
Subject: I have a simple and noob problem!!

 

Hello everybody! I have one problem... A simple problem... Sorry for this, I'm 
Junior and I can't find my swagger.json in my project... how can i get this 
file?? 

I cant resolve this problem for generate my html!! 

Regards!!

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Does Swagger have some sort of caching mechanism?

2016-08-23 Thread Ron Ratovsky
Well, you’re missing more details. Are you talking about swagger-ui? The spec 
itself? Are you generating the spec? Manually hosting it? If it’s generated, 
how is it generated?

What exactly do you expect to be updated at runtime that isn’t considering it’s 
static?

 

 

 

From:  on behalf of Systema 
Sephiroticum 
Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 23 August 2016 at 15:34
To: Swagger 
Subject: Re: Does Swagger have some sort of caching mechanism?

 

Also, I'm using Swagger 2.0

On Tuesday, 23 August 2016 15:32:14 UTC-7, Systema Sephiroticum wrote: 

I'm using swagger with Tomcat 7. Even swagger is just a bunch of static files, 
I can't seem to bust cache for swagger webpages without restarting my 
webserver, and this is true in any browser use. I've never seen anything like 
it, and other static files on my webserver outside the Swagger directory do not 
have this problem.  

 

Is there something about swagger that it has a ridiculously sticky cache, and 
is there anything I can do about it? What am I missing?

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: OAuth2 authorization

2016-08-23 Thread Ron Ratovsky
It’s unclear if you’re using Spring MVC or other Spring components, and so 
whether you use Springfox or swagger-core.

Have you looked into the generated spec itself to see that the oauth2 flow is 
included there?

Which version of swagger-ui do you use?

 

 

 

From:  on behalf of Bojan Gašpar 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 23 August 2016 at 00:58
To: Swagger 
Subject: OAuth2 authorization

 

Hi everyone. I'm having problems with swagger documentation for API endpoints 
which have the @PreAuthorize annotation (we use spring framework and OAuth2 for 
authorization). When I click "Try it out!" I get a 403 response (forbidden). I 
was trying to use the @Authorization and @AuthorizationScope annotations but 
without any luck.  

 

Can I perform the authorization somehow or at least is there a way to detect 
that an endpoint needs authorization so that I can mark that endpoint in the 
documentation?

 

This is how I used the annotations: 

@ApiOperation(value = "Value", authorizations = { @Authorization("ADMIN") })

@PreAuthorize("isAuthenticated()")

 

...but the response was the same.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I have a simple and noob problem!!

2016-08-23 Thread Ron Ratovsky
So I’m not sure if you can or cannot find the swagger.json, however, if the 
issue is with finding it, then I’d suggest asking the question in Springfox’s 
repo.

If the issue is with swagger2markup, then it’s best to ask the question on the 
repo of that project.

 

Best of luck!

 

From:  on behalf of Juan Lopez Rodao 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 22 August 2016 at 23:40
To: Swagger 
Subject: Re: I have a simple and noob problem!!

 

Hi, i have my little application that runs with Spring boot with one controller 
and 1 Class with my module... I have my SwaggerConfig; 

 

@Configuration

@EnableSwagger2

public class SwaggerConfig {

@Bean

public Docket api() { 

 

 

return new Docket(DocumentationType.SWAGGER_2)  

  .select()  

  .apis(RequestHandlerSelectors.any())  

  .paths(PathSelectors.any())  

  .build();   

}

}

 

and i configure my pom to extrat the html with swagger2marktup... with the 
example all correct, because i have the example swagger.json already. But which 
library i have to implement to make a swagger.json...

 

Sorry, i'm a fng noob, and i'm lost!! I can't find the solution!!!

 

Regards!!! And thank you!


El lunes, 22 de agosto de 2016, 21:27:39 (UTC+2), Ron escribió: 

Juan, you’re saying you can’t find the swagger.json – that suggest that there’s 
already integration with some library, I just don’t know which one it is – you 
need to tell me that.

If you don’t have any integration, obviously you won’t find the swagger.json 
because nothing generates it.

 

 

 

From:  on behalf of Juan Lopez Rodao 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Monday, 22 August 2016 at 05:10
To: Swagger 
Subject: Re: I have a simple and noob problem!!

 

Hi Ron, can you recommend me any library??

El viernes, 19 de agosto de 2016, 16:54:04 (UTC+2), Ron escribió: 

That depends on the library you use to generate the swagger.json…

 

 

 

From:  on behalf of Juan Lopez Rodao 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Friday, 19 August 2016 at 00:59
To: Swagger 
Subject: I have a simple and noob problem!!

 

Hello everybody! I have one problem... A simple problem... Sorry for this, I'm 
Junior and I can't find my swagger.json in my project... how can i get this 
file?? 

I cant resolve this problem for generate my html!! 

Regards!!

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use @ExampleProperty.

2016-08-23 Thread Ron Ratovsky
Which version of swagger-core do you use? And assuming it’s not the latest, can 
you try updating first?

 

 

 

From:  on behalf of sdav 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 23 August 2016 at 12:37
To: Swagger 
Subject: How to use @ExampleProperty.

 

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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Does Swagger have some sort of caching mechanism?

2016-08-23 Thread Ron Ratovsky
No worries, glad you got it sorted out. If you think it could be relevant to 
others, please share your experience so that they may benefit from it.

 

 

 

From:  on behalf of Systema 
Sephiroticum 
Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 23 August 2016 at 18:18
To: Swagger 
Subject: Re: Does Swagger have some sort of caching mechanism?

 

I meant swagger-ui. Turned out it was a webserver issue, sorry.

On Tuesday, 23 August 2016 18:10:57 UTC-7, Ron wrote: 

Well, you’re missing more details. Are you talking about swagger-ui? The spec 
itself? Are you generating the spec? Manually hosting it? If it’s generated, 
how is it generated?

What exactly do you expect to be updated at runtime that isn’t considering it’s 
static?

 

 

 

From:  on behalf of Systema Sephiroticum 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Tuesday, 23 August 2016 at 15:34
To: Swagger 
Subject: Re: Does Swagger have some sort of caching mechanism?

 

Also, I'm using Swagger 2.0

On Tuesday, 23 August 2016 15:32:14 UTC-7, Systema Sephiroticum wrote: 

I'm using swagger with Tomcat 7. Even swagger is just a bunch of static files, 
I can't seem to bust cache for swagger webpages without restarting my 
webserver, and this is true in any browser use. I've never seen anything like 
it, and other static files on my webserver outside the Swagger directory do not 
have this problem.  

 

Is there something about swagger that it has a ridiculously sticky cache, and 
is there anything I can do about it? What am I missing?

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: OAuth2 authorization

2016-08-24 Thread Ron Ratovsky
I don’t know what version of swagger-ui is provided with springfox – we don’t 
maintain that project.

Try checking with the latest swagger-ui release (not the one provided with 
springfox). If it works use that. If not, we can proceed from there.

 

 

 

From:  on behalf of Bojan Gašpar 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 24 August 2016 at 01:42
To: Swagger 
Subject: Re: OAuth2 authorization

 

We use SpringMVC and springfox (io.springfox:springfox-swagger2:jar:2.5.0 and 
io.springfox:springfox-swagger-ui:jar:2.5.0). 

 

I don't see the OAuth2 flow in the documentation (there should be an ON/OFF 
button?). I guess I have to add "securityDefinitions" to the swagger 
configuration, but I don't know where because I'm using annotations in java for 
all my settings.

On Wednesday, August 24, 2016 at 3:12:51 AM UTC+2, Ron wrote: 

It’s unclear if you’re using Spring MVC or other Spring components, and so 
whether you use Springfox or swagger-core.

Have you looked into the generated spec itself to see that the oauth2 flow is 
included there?

Which version of swagger-ui do you use? 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't install swagger on JBoss EAP 6.4

2016-09-14 Thread Ron Ratovsky
It all depends how you’re packing your app. If you’re getting CNFE, you’re 
missing a dependency in the deployment.

 

 

 

 

From:  on behalf of Fabrizio Stellato 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 14 September 2016 at 03:54
To: Swagger 
Subject: Can't install swagger on JBoss EAP 6.4

 

Hi,
I've followed this link for installing swagger on JBoss 6 with Resteasy.

When I launch my app JBoss can't find swagger classes and return the following 
error:

[...]
 Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: 
java.lang.ClassNotFoundException: io.swagger.jaxrs.config.DefaultJaxrsConfig
[...]

I guess I should copy swagger files into the container, but I haven't found any 
hint on how to exactly do this.

Any suggestion ?

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Where is my JSON file?

2016-09-20 Thread Ron Ratovsky
I assume you’re using Swashbuckle. Check out the documentation at 
https://github.com/domaindrivendev/Swashbuckle#custom-routes.

 

 

 

 

From:  on behalf of Dave Ward 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 20 September 2016 at 06:38
To: Swagger 
Subject: Re: Where is my JSON file?

 

Hmm... i'm walking into this from the side... sorry, we have a .NET app and we 
simply pulled in the swagger package.  the URL below is where i go (in our 
WebAPI project) when i run the API and debug it...

On Monday, September 19, 2016 at 11:17:01 AM UTC-5, tony tam wrote: 

What framework do you use?  It depends on that specific implementation and 
configuration. 


On Sep 19, 2016, at 9:11 AM, Dave Ward  wrote:

OK, easy question... i can't seem to find my JSON file to use in the 
Swagger-to-pdf tool, to generate a PDF.  Where are the files outputted to when 
running and testing locally? 

 

here is my local URL: http://localhost:50722/swagger/ui/index.html

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Gulp plugin for Swagger Endpoints

2016-09-20 Thread Ron Ratovsky
Hi Colin,

 

Thanks for sharing. Feel free to submit a PR against 
http://swagger.io/open-source-integrations/ to ad it to the list there if you 
want.

 

 

From:  on behalf of Colin Ogoo 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 20 September 2016 at 03:56
To: Swagger 
Subject: Gulp plugin for Swagger Endpoints

 

Hi Guys, 

 

A colleague of mine and I, developed an open source gulp plugin that generates 
a JS file, which contains all endpoints that are provided by swagger.

 

The package is available on npm and on Github.

 

Github Repo

 

npm

 

The Read me:

 

Swagger Endpoints
Install
Install with npm
npm install gulp-swagger-endpoint --save-dev
Configuration File.
Set plugin configuration

endpoints: This takes an array of objects, multiple domain and endpoint 
combinations can be added

useCommonJs: If using common js to build your app, set this to true. If false, 
a JS object will be created with your endpoints as Key/Value pairs

fileName: Your filename

prefix: If you wish to change the prefix of your URL, assign prefix.change to 
true. e.g. /api/product will change to /_api/product

gulp.swagger.conf.json file

This is the default configuration file located in the package root, please copy 
this file into your app root (where your package.json file is), and edit your 
configuartions there. This is to avoid your beautiful config file being 
overwritten on an npm update command.

{
  "Default": {
"endpoints": [{
"domain": "http://petstore.swagger.io";,
"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json";,
"prefix": { 
  "change": false,
  "oldPrefix" : "api",
  "newPrefix" : "_api"
}
  }],
  "useCommonJs": true,
  "fileName": "endpoint.js"
  }
}
You can add more environment variables as properties; so your file could end up 
looking like this:

{
  "Default": {
"endpoints": [{
"domain": "http://petstore.swagger.io";,
"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json";,
"prefix": { 
  "change": false,
  "oldPrefix" : "api",
  "newPrefix" : "_api"
}
  }],
  "useCommonJs": true,
  "fileName": "endpoint.js"
  },
  "Local": {
"endpoints": [{
"domain": "http://petstore.swagger.io";,
"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json";,
"prefix": { 
  "change": false,
  "oldPrefix" : "api",
  "newPrefix" : "_api"
}
  }],
  "useCommonJs": true,
  "fileName": "local.endpoint.js"
  }
}
Example
gulpfile.js

Plugin creates a js file which is containing all endpoints in your restfull API

You can pass a parameter to the swagger function (in this case: 'Local') to 
create the endpoints for a specific environment. If left blank or '', default 
environment will be used

gulp.task('endPoint', function() {
return gulp.src("./node_modules/gulp-swagger-endpoint/index.js")
  .pipe(swagger('Default'))
  .pipe(gulp.dest('./Scripts/Common/angularjs/config'));
});
endpoints.js

Sample output file w/ commonJS = true

module.exports = {
 API_URLS: {
  /*  Endpoints from http://petstore.swagger.io/v2/swagger.json */ 
 Get_Product: "http://petstore.swagger.io/api/product";,
 Get_ProductById: "http://petstore.swagger.io/api/product/{Id}";,
 Get_ProductByCategoryId: 
"http://petstore.swagger.io/api/product/{CategoryId}";,
 Post_Product: "http://petstore.swagger.io/api/product";
 }
};
Sample output file w/ commonJS = false

 API_URLS = {
/*  Endpoints from http://petstore.swagger.io/v2/swagger.json */ 
 "Get_Product": "http://petstore.swagger.io/api/product";,
 "Get_ProductById": "http://petstore.swagger.io/api/product/{Id}";,
 "Get_ProductByCategoryId": 
"http://petstore.swagger.io/api/product/{CategoryId}";,
 "Post_Product": "http://petstore.swagger.io/api/product";
 };
 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: @ApiResponse - reference element

2016-09-20 Thread Ron Ratovsky
As you said, it’s a string representing a JSON Reference and can point either 
to something ‘local’ or remote. Assuming this is a model, all local models will 
end up appearing under #/definitions according to the spec.

 

 

 

From:  on behalf of Stephen 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 20 September 2016 at 00:51
To: Swagger 
Subject: @ApiResponse - reference element

 

I am trying to understand what the 'reference' parameter is used for. The java 
docs simply states: 

"Specifies a reference to the response type. The specified reference can be 
either local or remote and will be used as-is, and will override any specified 
response() class."

 

Which to a newbie does help very much. So looking at the example here:
https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-jaxrs/src/test/java/io/swagger/resources/ResourceWithReferences.java

To looks like you can reference an element within a given JSON document. If 
this is the case, then that is exactly what I want to do. But can't seem to get 
it to work. I'd like to reference a local json resource, but unsure of the 
structure of the JSON and how to reference it. What ever I do get:

Objects defined by the response from the content provider

xx is not defined!

 

Can any one help here?

Cheers

Stephen

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: autocompletion problem for adding mutiple parameters

2016-09-20 Thread Ron Ratovsky
Hi Shima,

 

You can try adding a new parameter by adding another entry to the array and 
then trying to auto-complete.

If that doesn’t work, or you find the user experience not as expected, please 
open a ticket on the project and we’ll have a look at it.

 

Thanks,

Ron

 

From:  on behalf of Shima 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 8 September 2016 at 15:33
To: Swagger 
Subject: autocompletion problem for adding mutiple parameters

 

I'm using swagger editor, with auto-completion enabled. 
I want to add "parameters" for an operation, so I choose "parameters" keyword, 
under that I get the "parameter" snippet which gives me the snippet for one 
parameter. Now I want to add another parameter. But the autocompletion does not 
suggest the "parameter" snippet for the second parameter. I checked the code, 
it does not recognize the path correctly. I have snapshots attached. 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: subTypes

2016-09-20 Thread Ron Ratovsky
So two different projects, two different statuses.

 

For swagger-codegen, I believe there should be support for sub-types, at least 
for some of the languages.

If you find that’s not the case, please open a ticket on the project.

 

For swagger-ui it’s a bit more complicated. It’s indeed not directly supported 
right now, for input.

We’re not actively working on resolving it at the moment as our focus is on 
something else for the project right now.

That said, once we’re done with that (no ETA), it should hopefully be easier to 
support.

Regardless, it would be challenging to present this UI-wise.

 

 

 

From:  on behalf of Sebastian Stehle 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 7 September 2016 at 11:48
To: Swagger 
Subject: Re: subTypes

 

I have the same question. It is very unclear how the current status is, 
especially about swagger-ui. 

Am Freitag, 2. September 2016 20:29:23 UTC+2 schrieb Ben Gill: 

Hi, 

 

I want my Swagger API to show subtypes so I can use Swagger code gen to 
generate those subtypes.  However, I see this is not supported / implemented.

 

Is there a work around for this, or should I just not being using subtypes in a 
RESTful web service?

 

Thanks

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Auto generated code in Python: How to specify controller name in Yaml file

2016-09-20 Thread Ron Ratovsky
Hi Benjamin,

 

We may have discussed this on IRC. 

Generally speaking, the ‘tags’ should affect the controller name.

If you find that’s not the case, please open a ticket on the codegen project so 
that it can be addressed.

 

 

From:  on behalf of Benjamin SOULAS 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 7 September 2016 at 07:16
To: Swagger 
Subject: Auto generated code in Python: How to specify controller name in Yaml 
file

 

Hello everyone,

Actually, I use the swagger editor to generate my API skeleton, but it 
generates only one Controller (named "default_controller.py").
I don't find any doc on "How specify a controller" for a route? The idea is to 
generate several controllers for the API in order to avoid a huge one.

Thanks !

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Same resource path

2016-09-20 Thread Ron Ratovsky
In the current version of the spec, there is no way to do that.

Assuming both operation return the same type but have different input, your 
option is to specify the input options as optional and describe it as a single 
operation.

 

 

 

From:  on behalf of 
"avinash.upadhy...@gmail.com" 
Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, 6 September 2016 at 22:52
To: Swagger 
Subject: Same resource path

 

Is there any way i can have document two method with same name but with 
different input parameter?

 

I am having a situation where i need to document the resources which all are 
hosted on a same path (kind of micro services in MyProjects/get?Parameters) but 
each micro-service has a same name but different input parameters.

 

When i annotate my Java source code it generates the paths. But Shen i feed 
this json to swaggerUI it gives me only one micro-service (i believe this is 
because same resource path `MyProjects/get)

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Issues with modelling duplicated XML parameters..

2016-09-20 Thread Ron Ratovsky
Hi Rene,

 

Swagger-editor has a few glitches when it comes to displaying xml-related 
metadata.

Try loading your spec in swagger-ui and see if it displays as expected.

 

 

 

From:  on behalf of 
"rene.min...@gmail.com" 
Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Monday, 5 September 2016 at 07:42
To: Swagger 
Subject: Issues with modelling duplicated XML parameters..

 

Hi

 

I am new to Swagger, trying to model an existing XML based API with key value 
pairs as this one...

 





customerType

http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="xs:string">type1





customerId

http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="xs:string">1234







 

...in Swagger like this...

swagger: '2.0'

info:

  title: Case Mgmt APIs

  description: 

host: 

schemes:

  - http

basePath: /

securityDefinitions:

  basicAuth:

type: basic

description: HTTP Basic Authentication. Works over `HTTP` and `HTTPS`

paths:

  /crmCase:

post:

  summary: Create a new case

  description: Create a new case

  operationId: createCase

  consumes: 

- application/xml

  produces:

- application/xml

  security:

- basicAuth: []

  parameters:

- name: request_body

  in: body

  required: true

  schema:

$ref: "#/definitions/crmCase"

  tags:

- crmCase

  responses:

200:

  

403:

  

definitions:

  customerType:

type: object

required:

  - key

  - value

properties:

  key:

type: string

default: customerType

enum: 

  - customerType

  value:

type: string

enum:

  - type1

  - type2

xml:

  namespace: http://www.w3.org/2001/XMLSchema-instance

  prefix: xsi

xml:

  name: attribute

  customerId:

type: object

required:

  - key

  - value

properties:

  key:

type: string

default: customerId

enum: 

  - customerId

  value:

type: string

pattern: '^[1][0-9]{3}$'

xml:

  namespace: http://www.w3.org/2001/XMLSchema-instance

  prefix: xsi

xml:

  name: attribute

  crmCase:

type: object

properties:

  attributeList:

description: Customer deployment specific list of parameters

type: array

items:

  type: object

  properties:

customerType:

  $ref: '#/definitions/customerType'

customerId:

  $ref: '#/definitions/customerId'

  required:

- customerType

xml:

  name: attribute

 

 

 

... but no luck. Having searched on this subject a lot, I still have two issues:

 

I1) name: attribute is not taken/displayed in editor.swagger.io. Any idea why 
and whether this approach is correct for having multiple times the same 
attribute?

 

I2) key and value on customerId is considered mandatory by editor.swagger.io, 
although the customerId as such is supposed to be optional in this sample. 
Maybe I am dayblind... but I struggle to identify what I am doing wrongly. 
Whenever optional customer is added, key and value are mandatory. 

 

 

Many thanks for your help

René

 

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Does describing JSON RPC 2.0 API by Swagger is possible?

2016-09-20 Thread Ron Ratovsky
Without reading what steem specifically does, when it comes to JSON RPC the 
answer will normally be “not so much”.

 

 

 

From:  on behalf of Jacob Gadikian 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Sunday, 4 September 2016 at 17:06
To: Swagger 
Subject: Re: Does describing JSON RPC 2.0 API by Swagger is possible?

 

Okay, so: 

 

I use this:  github.com/steemit/steem

 

It is a JSON RPC API.  Is there any way for me to do swagger for this API, or 
is that a "not so much"?

 

Thank you!

On Tuesday, April 19, 2016 at 4:32:28 PM UTC+7, svyatosla...@gmail.com wrote: 

I really want to use swagger to describe my API, but it was designed according 
JSON RPC 2.0 specification because of high flexibility and simplicity in 
design. And as I could notice it is not possible to use swagger to describe 
JSON RPC API. May be am I wrong? Does somebody know other tool to describing 
RPC API?

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can we use mongoose schema when defining the schema in swagger.json ?

2016-09-20 Thread Ron Ratovsky
Maybe. What is a mongoose schema?

 

 

 

From:  on behalf of Abezar Baker 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 31 August 2016 at 06:13
To: Swagger 
Subject: Can we use mongoose schema when defining the schema in swagger.json ?

 

"paths": {
  "/testing": {
    "post": {
  "tags": [
    "testing"
  ],
  "summary": "",
  "description": "Add a test",
  "parameters": [
    {
  "name": "body",
  "in": "body",
  "description": "",
  "required": true,
  "schema": {
    "$ref": "#/definitions/SomeSchema" //can we instead point to the 
mongoose schema in my project so that i dont violate DRY
  }
    }
  ],
  "responses": {
    "200": {},
    "400": {
  "description": "Invalid request"
    }
  }
    },
}
 
"definitions": {
  "SomeSchema": {
    "type": "object",
    "required": [
  "name"
    ],
    "properties": {
  "name": {
    "type": "string",
    "example": "hello"
  }
    }
  }
}
 
 
Example mongoose schema:
'use strict';

let mongoose = require('mongoose');
let Schema = mongoose.Schema;

let testSchema = new Test({
  name: {
    type: String,
    required: true
  }
}, {
  collection: 'test',
  versionKey: false
});

module.exports = mongoose.model('Test', testSchema);
-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Infinite loops in Swagger UI Example values

2016-09-20 Thread Ron Ratovsky
Can you open a ticket on swagger-ui?

 

 

 

From:  on behalf of Andrew Campbell 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Wednesday, 31 August 2016 at 04:03
To: Swagger 
Subject: Infinite loops in Swagger UI Example values

 

Hi, 

 

I'm getting infinite loops in my Swagger UI example values.

 



















 

As you can guess from the name, I'm trying to describe a filesystem folder, 
which can contain other folders (example Swagger attached).

 

 

 

I'd prefer not to have the infinite loop message. Can anyone point me in the 
right direction?

 

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Array of objects as an input parameter

2016-09-22 Thread Ron Ratovsky
If you go to http://editor.swagger.io and open the full_petstore.yaml example, 
you can search for any ‘body’ parameter and that will show you what Tony was 
talking about.

 

 

 

From:  on behalf of Mathieu Pheulpin 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 22 September 2016 at 8:17
To: Swagger 
Subject: Re: Array of objects as an input parameter

 

Could you please show an example of what you're describing? Thanks

On Wednesday, September 21, 2016 at 7:42:54 PM UTC-7, tony tam wrote: 

You don't want formData, you want an object, with attribute "sources" which is 
type "array". 


On Sep 21, 2016, at 6:50 PM, Mathieu Pheulpin  wrote:

I'm trying to describe the following post parameter in swagger:

 

{
"sources": [
{
"id": 101,
"parentId": 201
},{
"id": 102,
"parentId": 201
},{
"id": 102,
"parentId": 202
}
],
"destinationId": 301,
"param1": "value 1",
"param2": "value 2",
}

 

 

The issue is that the sources is an array of objects, that swagger does not 
seem to support. Ideally I'd like something like that:

 

paths:
/bulk-action:
post:
parameters:
- name: sources
  in: formData
  type: array
  enum:
  $ref: '#/definitions/BulkSource'
- name: destinationId
  in: formData
  type: integer
- name: param1
  in: formData
  type: string
- name: param2
  in: formData
  type: string
definitions:
BulkSource:
type: object
properties:
id:
type: integer
parentId:
type: integer

 

 

Any idea on how to work around this limitation?

 

Thanks

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Customizing Swagger-UI for a Custom Field "x-foo" in swagger.json

2016-09-22 Thread Ron Ratovsky
Hi Carlos,

 

I’d suggest starting off by opening a ticket on swagger-js and we’ll take it 
from there.

 

 

 

From: 'Carlos Angel M Rivera Pagan' via Swagger 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 22 September 2016 at 8:46
To: Swagger 
Subject: Customizing Swagger-UI for a Custom Field "x-foo" in swagger.json

 

Hello community, 

 

I will start with the example of I want to simulate.

Go to: http://docs.sencha.com/extjs/4.2.5/#!/api

 

Below the Tree View for the API documentation, there is a "Show private 
classes" checkbox. By default they only show the API of the classes you will 
use, but for your convenience, they offer the option to see the internal 
classes (which are not recommended to use), you just have to check "Show 
private classes". 

 

So, in my company we are using older versions of Swagger, and we want to 
upgrade to newest versions. We have a similar situation with EXTjs. We have a 
REST API, and we documented all our routes for the convenience of our clients, 
and developers. But now we would like to differentiate between internal routes 
used by our developers, and the external routes used by our clients.

 

I have read most of Swagger's documentation, and I realized that I will have to 
implement it by myself.

 

My first approach was:

1) Added a custom field to the Swagger "x-internal" which can hold a boolean.

2) I would customize Swagger-UI to get that API, read the "x-internal" field, 
and finally just display what the user wants to see.

 

My problem is:

I noticed that Swagger-UI depends on SwaggerClient, which is doing the hard 
work. SwaggerClient is not consuming the "x-internal" field, and it strip it 
away.

 

 

So! I am here to see if someone has done something similar to this, and/or if 
they have a better approach.  I am guessing that I will have to customize first 
Swagger-js, and then customize Swagger-UI.

I think I understand quite well (or at least partially well) Swagger-UI, but 
now I will have to understand the source code of Swagger-js, so it will be of 
great help if you guys could give me hits of where I need to do the changes.

 

Thank you all!

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Customizing Swagger-UI for a Custom Field "x-foo" in swagger.json

2016-09-22 Thread Ron Ratovsky
Yes, https://github.com/swagger-api/swagger-js.

 

IIRC, you are right that we currently don’t expose all vendor extensions, but 
we with your help, we can probably get to a point where we expose what’s 
relevant to you.

 

 

 

From: 'Carlos Angel M Rivera Pagan' via Swagger 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Thursday, 22 September 2016 at 11:23
To: Swagger 
Subject: Re: Customizing Swagger-UI for a Custom Field "x-foo" in swagger.json

 

Hey Ron, 

 

I am new to all this. Do you mean an issue at the swagger-js GitHub project?

 

Thank you, by the way, you guys reply super fast, I am impressed.

 



On Thursday, September 22, 2016 at 2:04:15 PM UTC-4, Ron wrote: 

Hi Carlos,

 

I’d suggest starting off by opening a ticket on swagger-js and we’ll take it 
from there.

 

 

 

From: 'Carlos Angel M Rivera Pagan' via Swagger 
Reply-To: "swagger-sw...@googlegroups.com" 
Date: Thursday, 22 September 2016 at 8:46
To: Swagger 
Subject: Customizing Swagger-UI for a Custom Field "x-foo" in swagger.json

 

Hello community, 

 

I will start with the example of I want to simulate.

Go to: http://docs.sencha.com/extjs/4.2.5/#!/api

 

Below the Tree View for the API documentation, there is a "Show private 
classes" checkbox. By default they only show the API of the classes you will 
use, but for your convenience, they offer the option to see the internal 
classes (which are not recommended to use), you just have to check "Show 
private classes". 

 

So, in my company we are using older versions of Swagger, and we want to 
upgrade to newest versions. We have a similar situation with EXTjs. We have a 
REST API, and we documented all our routes for the convenience of our clients, 
and developers. But now we would like to differentiate between internal routes 
used by our developers, and the external routes used by our clients.

 

I have read most of Swagger's documentation, and I realized that I will have to 
implement it by myself.

 

My first approach was:

1) Added a custom field to the Swagger "x-internal" which can hold a boolean.

2) I would customize Swagger-UI to get that API, read the "x-internal" field, 
and finally just display what the user wants to see.

 

My problem is:

I noticed that Swagger-UI depends on SwaggerClient, which is doing the hard 
work. SwaggerClient is not consuming the "x-internal" field, and it strip it 
away.

 

 

So! I am here to see if someone has done something similar to this, and/or if 
they have a better approach.  I am guessing that I will have to customize first 
Swagger-js, and then customize Swagger-UI.

I think I understand quite well (or at least partially well) Swagger-UI, but 
now I will have to understand the source code of Swagger-js, so it will be of 
great help if you guys could give me hits of where I need to do the changes.

 

Thank you all!

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Issues with the PetStore demo.

2016-09-23 Thread Ron Ratovsky
Since it’s a public demo, people play around with the pet store and… it’s not 
always too stable.

I’ve restarted the app, and it seems to be working well now.

 

Until next time!

 

 

From:  on behalf of Tom Christie 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 23 September 2016 at 6:19
To: Swagger 
Subject: Issues with the PetStore demo.

 

Hi there, 

 

I'm using the PetStore demo to help validate a Swagger command-line client I've 
been working on.

Everything in 'pet' and 'store' is working fine, but I'm having problems with 
some of the 'users' endpoints, and it's unclear if this is due to the server 
implemention, or if it's something I'm missing from the spec.

 

For example, I'm unable to formulate a valid POST /user request that results in 
anything other than a 500 response, either from my own client, or from Swagger 
UI. Attempting to authenticate with "api_key:special-key" doesn't appear to 
have any effect, nor does going through the oauth flow in Swagger UI. Is anyone 
able to confirm that this endpoint works, and if so are you able to demonstrate 
how to make a successful request to it using eg `curl`?

 

The GET /user/login/ endpoint appears to be broken. It returns a response with 
the application/json content type, but malformed content, eg...

 

> GET /v2/user/login?password=tom&username=tom HTTP/1.1

> Accept-Encoding: gzip, deflate

> Connection: keep-alive

> Accept: application/coreapi+json, */*

> Host: petstore.swagger.io

> User-Agent: coreapi

< 200 OK

< Access-Control-Allow-Headers: Content-Type, api_key, Authorization

< Access-Control-Allow-Methods: GET, POST, DELETE, PUT

< Access-Control-Allow-Origin: *

< Connection: close

< Content-Type: application/json

< Date: Fri, 23 Sep 2016 11:43:47 GMT

< Server: Jetty(9.2.9.v20150224)

< X-Expires-After: Fri Sep 23 12:43:47 UTC 2016

< X-Rate-Limit: 5000

< 

< logged in user session:1474631027450

 

It's also unclear to me if I should be able to use this session identifier in 
future requests, and if so, how?

 

Being able to say for sure if these are server-side issues, or if I'm missing 
something in the spec and formulating my requests incorrectly would go a long 
way towards helping validate that the command line client really is working as 
expected (or not)

 

Many thanks for your time,

 

  Tom

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: documenting an API for a resource whose representation is determined by a query parameter

2016-09-23 Thread Ron Ratovsky
The current version can’t do it, we’re trying to make sure the next version 
supports it.

 

 

 

From:  on behalf of Gary 

Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Friday, 23 September 2016 at 13:55
To: Swagger 
Subject: documenting an API for a resource whose representation is determined 
by a query parameter

 

Is there support or workarounds for APIs which return different representations 
of a resource based on a query parameter? 

 

In our work scenario, we expose, for example:

 

/terms

 

which takes an optional view query parameter with a default value of ID and 
available values of ID, VALUE and ENTITY.  All successful requests will return 
a 200 and an array of term id, value or entity objects based on the view query 
parameter value.

 

Can swagger be used to document this api and, if not, is it due a flaw or 
weakness in our API?

 

Thanks!

 

Gary

-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
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 swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   4   5   6   7   >