Re: Autogenerate Client from Swagger UI

2018-02-12 Thread Ellis
Solved - if you open developer tools in the browser and open the network 
tab and refresh the page hosting the swagger ui, it loads a document (I've 
seen it as swagger.json and swagger/docs/v2 in my case) and navigating 
directly to that path brings up the swagger file json. You can copy and 
paste it into a swagger editor and generate the corresponding client code 
package.


On Friday, February 9, 2018 at 10:19:09 AM UTC-8, Ellis wrote:
>
> Is there a way to autogenerate a client from just the Swagger UI for API 
> documentation/testing? The developer hosts a site like this: 
> https://imgur.com/a/bQfsj that only has the API calls and they say they 
> don't have a raw Swagger yaml or json file. I want to know if it's possible 
> to obtain the Swagger file (or generate it) from just the Swagger UI 
>  someone hosts, so that I may use it to 
> paste into the Swagger Editor and autogenerate a java client.
>

-- 
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 3: schema for map of maps

2018-02-12 Thread Ron Ratovsky
Yes.

 

 

 

From:  on behalf of 
"arindam.choudh...@ackstorm.com" 
Reply-To: "swagger-swaggersocket@googlegroups.com" 

Date: Tuesday, February 6, 2018 at 05:50
To: Swagger 
Subject: swagger 3: schema for map of maps

 

I want to model a schema where the json is map of maps:

 
{
  'id1': {
    'type': 'type1',
    'active': true,
  }, 
  'id2': {
    'type': 'type2',
    'active': false,
  },
  ... 
  ... 
}
 

 

I have defined:

 
components:
  schemas:
    accountData:
  type: object
  required:
    - type
    - active
  properties:
    type:
  type: string
    active:
  type: boolean
 
    accounts:
  type: object
  additionalProperties:
    $ref: '#/components/schemas/accountData'
 

Is it correct?

-- 
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: Authentication in phoenix

2018-02-12 Thread Ron Ratovsky
What is phoenix?

 

 

 

From:  on behalf of "a...@evercam.io" 

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

Date: Friday, February 9, 2018 at 00:13
To: Swagger 
Subject: Authentication in phoenix

 

anyone can help me how can we use Swagger  Authentication in phoenix?

-- 
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: Please help translate Swagger 2.0 simple example to OAS3

2018-02-12 Thread Daniel Belcher
Ah, interesting.  Well, that would come in useful, but I'm just learning 
swagger and I don't yet have a spec published, so I can't really use that 
converter.

On Monday, February 12, 2018 at 1:43:55 PM UTC-8, Ron wrote:
>
> You can use a converter tool such as oai.swagger.io/api/convert?url=<...>.
>
>  
>
>  
>
>  
>
> *From: * on behalf of 
> Daniel Belcher 
> *Reply-To: *"swagger-sw...@googlegroups.com " <
> swagger-sw...@googlegroups.com >
> *Date: *Monday, February 12, 2018 at 09:46
> *To: *Swagger 
> *Subject: *Please help translate Swagger 2.0 simple example to OAS3
>
>  
>
> Hi All- 
>
>  
>
> I managed to get a simple POST API with swagger 2.0 before realizing I 
> should probably start learning and experimenting with OAS3 instead.  Here 
> is the working swagger 2.0 simple test that works great:
>
>  
>
> swagger: "2.0"
> # ...
> paths:
>   /Rhino/Geometry/Point3d/New:
> post:
>   tags:
>   - "all"
>   summary: "Create new Point3d"
>   operationId: "Point3dNew"
>   consumes:
>   - "application/json"
>   produces:
>   - "application/json"
>   parameters:
>   - in: "body"
> name: "body"
> required: true
> schema:
>   type: "array"
>   items:
> type: "number"
>   responses:
> 200:
>   description: "OK"
> 400:
>   description: "Invalid input"
>
>  
>
> I can POST the following:
>
>  
>
> [
>   1,2,3
> ]
>
>  
>
> and it returns the following Response body:
>
>  
>
> {"X":1.0,"Y":2.0,"Z":3.0}
>
>
> ...which is great, so far so good.  
>
>  
>
> However, I'm having trouble figuring out how to translate this to OAS3.  
> I'm afraid the petstore sample is a little too complex for this rather dumb 
> API (and rather dumb developer).
>
>  
>
> Any help would be appreciated,
>
> -Dan
>
>  
>
> -- 
> 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: Please help translate Swagger 2.0 simple example to OAS3

2018-02-12 Thread Ron Ratovsky
You can create a gist at gist.github.com, and feed the converter the link to 
the raw instance of the gist.

 

 

 

From:  on behalf of Daniel Belcher 

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

Date: Monday, February 12, 2018 at 15:07
To: Swagger 
Subject: Re: Please help translate Swagger 2.0 simple example to OAS3

 

Ah, interesting.  Well, that would come in useful, but I'm just learning 
swagger and I don't yet have a spec published, so I can't really use that 
converter.

On Monday, February 12, 2018 at 1:43:55 PM UTC-8, Ron wrote: 

You can use a converter tool such as oai.swagger.io/api/convert?url=<...>.

 

 

 

From:  on behalf of Daniel Belcher 

Reply-To: "swagger-sw...@googlegroups.com" 
Date: Monday, February 12, 2018 at 09:46
To: Swagger 
Subject: Please help translate Swagger 2.0 simple example to OAS3

 

Hi All- 

 

I managed to get a simple POST API with swagger 2.0 before realizing I should 
probably start learning and experimenting with OAS3 instead.  Here is the 
working swagger 2.0 simple test that works great:

 

swagger: "2.0"
# ...
paths:
  /Rhino/Geometry/Point3d/New:
post:
  tags:
  - "all"
  summary: "Create new Point3d"
  operationId: "Point3dNew"
  consumes:
  - "application/json"
  produces:
  - "application/json"
  parameters:
  - in: "body"
name: "body"
required: true
schema:
  type: "array"
  items:
type: "number"
  responses:
200:
  description: "OK"
400:
  description: "Invalid input"

 

I can POST the following:

 

[
  1,2,3
]

 

and it returns the following Response body:

 

{"X":1.0,"Y":2.0,"Z":3.0}


...which is great, so far so good.  

 

However, I'm having trouble figuring out how to translate this to OAS3.  I'm 
afraid the petstore sample is a little too complex for this rather dumb API 
(and rather dumb developer).

 

Any help would be appreciated,

-Dan

 

-- 
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: Please help translate Swagger 2.0 simple example to OAS3

2018-02-12 Thread Daniel Belcher
Thanks Ron!  That worked and was quite helpful.

On Monday, February 12, 2018 at 2:38:25 PM UTC-8, Ron wrote:
>
> You can create a gist at gist.github.com, and feed the converter the link 
> to the raw instance of the gist.
>
>  
>
>  
>
>  
>
> *From: * on behalf of 
> Daniel Belcher 
> *Reply-To: *"swagger-sw...@googlegroups.com " <
> swagger-sw...@googlegroups.com >
> *Date: *Monday, February 12, 2018 at 15:07
> *To: *Swagger 
> *Subject: *Re: Please help translate Swagger 2.0 simple example to OAS3
>
>  
>
> Ah, interesting.  Well, that would come in useful, but I'm just learning 
> swagger and I don't yet have a spec published, so I can't really use that 
> converter.
>
> On Monday, February 12, 2018 at 1:43:55 PM UTC-8, Ron wrote: 
>
> You can use a converter tool such as oai.swagger.io/api/convert?url=<...>.
>
>  
>
>  
>
>  
>
> *From: * on behalf of Daniel Belcher <
> d...@mcneel.com>
> *Reply-To: *"swagger-sw...@googlegroups.com" <
> swagger-sw...@googlegroups.com>
> *Date: *Monday, February 12, 2018 at 09:46
> *To: *Swagger 
> *Subject: *Please help translate Swagger 2.0 simple example to OAS3
>
>  
>
> Hi All- 
>
>  
>
> I managed to get a simple POST API with swagger 2.0 before realizing I 
> should probably start learning and experimenting with OAS3 instead.  Here 
> is the working swagger 2.0 simple test that works great:
>
>  
>
> swagger: "2.0"
> # ...
> paths:
>   /Rhino/Geometry/Point3d/New:
> post:
>   tags:
>   - "all"
>   summary: "Create new Point3d"
>   operationId: "Point3dNew"
>   consumes:
>   - "application/json"
>   produces:
>   - "application/json"
>   parameters:
>   - in: "body"
> name: "body"
> required: true
> schema:
>   type: "array"
>   items:
> type: "number"
>   responses:
> 200:
>   description: "OK"
> 400:
>   description: "Invalid input"
>
>  
>
> I can POST the following:
>
>  
>
> [
>   1,2,3
> ]
>
>  
>
> and it returns the following Response body:
>
>  
>
> {"X":1.0,"Y":2.0,"Z":3.0}
>
>
> ...which is great, so far so good.  
>
>  
>
> However, I'm having trouble figuring out how to translate this to OAS3.  
> I'm afraid the petstore sample is a little too complex for this rather dumb 
> API (and rather dumb developer).
>
>  
>
> Any help would be appreciated,
>
> -Dan
>
>  
>
> -- 
> 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: display request body properties as fields instead of json in openapi 3.0

2018-02-12 Thread Ron Ratovsky
Hi Serge – it’s currently not implemented. Follow 
https://github.com/swagger-api/swagger-ui/issues/3641 for updates.

 

 

 

From:  on behalf of Serge Joukov 

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

Date: Sunday, February 11, 2018 at 21:31
To: Swagger 
Subject: display request body properties as fields instead of json in openapi 
3.0

 

I am not able to figure out a way to display the requestBody properties as 
"input fields" instead of a json. Basically I need to display the formdata as 
form rather than json. 

 

Is this supported?

 

openapi: 3.0.1

info:

  title: My API

  description: A sample API

  version: 1.2.3

security:

  - AccessToken: []

  - OAuth2: []

paths:

  /pet/token:

post:

  summary: Something

  description: 'Blah'

  operationId: authorize

  parameters:

- name: Ext-Access-Token

  in: header

  description: something something.

  schema:

type: string

enum:

  - 'true'

  - 'false'

  requestBody:

description: Form data

content:

  application/x-www-form-urlencoded:

schema:

  type: object

  properties:

id:

  type: string

  format: uuid

required: true

 

-- 
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 Editor Validation Error- "pattern" should match format "regex"

2018-02-12 Thread Ron Ratovsky
Which version of the editor do you use? I checked with the online one and I’m 
getting no such validation error.

 

 

 

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

Date: Friday, February 9, 2018 at 08:33
To: Swagger 
Subject: Swagger Editor Validation Error- "pattern" should match format "regex"

 

Hello,

When i check my swagger code in a swagger editor I always receive the same 
validation error: 

 
Schema error at definitions ... .pattern
should match format "regex"
format: regex 
Structure of my object:

Object:

type: object

title: 

required:

  - wheel

  - window

properties:

  wheel:

type: string

title: Wheel

description: Wheel

pattern: '^\d{3}-\d{2}-\d{4}$'

example: Wheel

  window:

type: string

title: Window

description: Window

pattern: '^\d{3}-\d{2}-\d{4}$'

example: Window

 


Could you help me please to resolve this problem?


P.S. I'm using swagger 2.0

Regards, Galyna

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