Request body object where keys and values are both user-specified

11 views
Skip to first unread message

E

unread,
May 19, 2017, 3:29:20 p.m.2017-05-19
to Swagger
I have a link model with only two parameters, id and url. My API can create links from hashes where each key represents an id and the value represents the url. So the following:

{
  "10" => "http://example.com",
  "11" => "http://google.com",
  "12" => "http://yahoo.com",
}

Sent to the correct endpoint will create 3 links, with IDs 10, 11, and 12.

I'm unsure of how to represent this in the "parameters" section of Swagger? Is it even possible?

Ron Ratovsky

unread,
May 19, 2017, 4:02:37 p.m.2017-05-19
to swagger-sw...@googlegroups.com

Pretty much:

 

type: object

additionalProperties:

  type: string

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

Reply all
Reply to author
Forward
0 new messages