Swagger 2.0 support for path aliases?

1,025 views
Skip to first unread message

David Biesack

unread,
Oct 1, 2014, 11:18:59 AM10/1/14
to swagger-sw...@googlegroups.com
In Swagger 2.0 is there any way to define a path alias?

For example, if I have

        paths:
           /products

Can I also declare that

           /products/

also works and is an alias for /products , without having to duplicate it?
I don't so much need it for swagger-ui but for codegen or testcase generation.

Ron

unread,
Oct 1, 2014, 11:26:58 AM10/1/14
to swagger-sw...@googlegroups.com
You'd have to duplicate the declaration but you could reference to a common definition. We currently have a small issue there we need to solve.
Theoretically, you could end up with:
paths: {
  "/products": { ... },
  "/products/" : { "$ref" : "#/paths~1products" }
}

Keep in mind this *will* lead to duplication in the ui as well.

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