Can Swagger spec 2_0 definitions be recursive?

1,048 views
Skip to first unread message

Gary Bisaga

unread,
Sep 24, 2014, 6:46:19 PM9/24/14
to swagger-sw...@googlegroups.com
I need a recursive model definition, like this. Is this illegal? Swagger UI 2_0 goes into an infinite recursion.

  definitions:
    foo:
      properties:
        sub_foo:
          type: array
          items:
            $ref: foo

I don't see anything in the docs either for or against it, so I figured I'd ask. Thanks!

Gary

Ron

unread,
Sep 25, 2014, 5:26:30 AM9/25/14
to swagger-sw...@googlegroups.com
It is legal, yes. There's probably just a bug in the UI. Can you please open an issue?

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

Gary Bisaga

unread,
Sep 25, 2014, 9:00:20 AM9/25/14
to swagger-sw...@googlegroups.com
Sure. I just did, under https://github.com/wordnik/swagger-js/issues/137 - I hope that was the right place to put it. I put it there because the recursive loop is happening in swagger-client.js. Thanks!

Ron

unread,
Sep 25, 2014, 9:04:09 AM9/25/14
to swagger-sw...@googlegroups.com
Good point. I'm not sure if it's on ui or js. I'm sure Tony will ask to move the issue if it's on the ui.

On 25 September 2014 16:00, Gary Bisaga <gary....@pearson.com> wrote:
Sure. I just did, under https://github.com/wordnik/swagger-js/issues/137 - I hope that was the right place to put it. I put it there because the recursive loop is happening in swagger-client.js. Thanks!

Reply all
Reply to author
Forward
0 new messages