Re: Array of objects as an input parameter

2016-09-21 Thread Tony Tam
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.


Array of objects as an input parameter

2016-09-21 Thread Mathieu Pheulpin
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.


Online courses on API documentation

2016-09-21 Thread Peter Gruenbaum
I normally wouldn't post something commercial in this forum, but it seems 
to me like this could be very useful information for Swagger users. I offer 
a series of inexpensive online courses on how to document APIs. If you are 
using Swagger, you know how to create automatically-generated 
documentation, but do you know the best practices of what to write in those 
descriptions?

You can take these courses at your own pace on any device. They are a 
combination of videos and hands-on exercises for learning how to write 
documentation.

I would find it extremely valuable for Swagger users to try them out and 
give me feedback, so I am offering significant discounts on all of the 
courses. Use these links to get the discount.


   - *API Documentation 1: JSON and XML.* $14 (regularly $25). 
   https://www.udemy.com/api-documentation-1-json-and-xml/?couponCode=SWAGGER
   - *API Documentation 2: REST. *$24 (regularly $40). 
   
https://www.udemy.com/learn-api-technical-writing-2-rest-for-writers/?couponCode=SWAGGER
   - *API Documentation 3: The Art of API Documentation. *$19 (regularly 
   $25). 
   https://www.udemy.com/the-art-of-api-documentation/?couponCode=SWAGGER

Thanks.
Peter

P.S. If you are not a programmer, you might be interested in my latest 
course:

   - *Coding for Writers 1: Basic Programming. * $29 (regularly $45). 
   
https://www.udemy.com/coding-for-writers-1-basic-programming/?couponCode=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.


Re: Infinite loops in Swagger UI Example values

2016-09-21 Thread Andrew Campbell
Done - https://github.com/swagger-api/swagger-ui/issues/2417

-- 
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 a Java library for request/response validation that is framework agnostic?

2016-09-21 Thread Tom Akehurst
Thanks, that's very useful.

I'm working on writing a validator now. Hopefully I should be able to open 
source it in the next few days.

On Tuesday, September 20, 2016 at 5:23:50 PM UTC+1, tony tam wrote:
>
> Yes, there is a JSON schema to describe the swagger specification, and 
> also the definitions are a *subset* of JSON schema.  Please take a look 
> here for all the gory details:
>
> https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
>
> On Sep 20, 2016, at 8:54 AM, Tom Akehurst > 
> wrote:
>
> Haha, showing my ignorance here. Hadn't realised that the definitions part 
> of a Swagger doc was actually JSON schema.
>
> On Tuesday, September 20, 2016 at 4:49:37 PM UTC+1, tony tam wrote:
>>
>> What do you mean?
>>
>> On Sep 20, 2016, at 8:48 AM, Tom Akehurst  wrote:
>>
>> Is there a way to adapt a Swagger spec to JSON schema?
>>
>> On Tuesday, September 20, 2016 at 3:38:03 PM UTC+1, Max Goldstein wrote:
>>>
>>> Not only is the inflector tied to a specific stack, it seems to not be 
>>> feature-complete. My best idea is to validate incoming requests (and 
>>> outgoing responses) using this json schema validator 
>>> , adding a custom 
>>> pass to check for the discriminator, readOnly, and other properties that 
>>> get added if you use them. That's what I'm planning to do for my project 
>>> anyway, I haven't actually tried it, so take this with a grain of salt.
>>>
>>
>> -- 
>> 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: Auto generated code in Python: How to specify controller name in Yaml file

2016-09-21 Thread Benjamin SOULAS
Hi Ron,

I did it and wing328 solved the issue on the codegen project.

Kind regards.

2016-09-21 1:22 GMT+02:00 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" <
> 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 a topic in the
> Google Groups "Swagger" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/swagger-swaggersocket/dEwveynTmSk/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.