Can we configure multiple yaml files for swagger-ui?

5,910 views
Skip to first unread message

jinu john

unread,
Jun 23, 2015, 5:26:17 PM6/23/15
to swagger-sw...@googlegroups.com
Hi,

We currently have more than 100 apis. Is there a way by which we can configure multiple yaml files for each use case?

Thanks 
Jinu John

Ron Ratovsky

unread,
Jun 24, 2015, 6:25:45 AM6/24/15
to swagger-sw...@googlegroups.com
You can, but you wouldn't want to split it to 100 files as it would be tedious to load them in the UI.
You can basically create multiple instances of the SwaggerUi object and load each one with a different URL.

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



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------

jinu john

unread,
Jun 24, 2015, 2:59:41 PM6/24/15
to swagger-sw...@googlegroups.com
Hi Ron,

Thanks for the suggestion.
But again all the apis are served from the same url.
Is there any way we can configure the yaml file to be used?

On Wednesday, June 24, 2015 at 3:25:45 AM UTC-7, Ron wrote:
You can, but you wouldn't want to split it to 100 files as it would be tedious to load them in the UI.
You can basically create multiple instances of the SwaggerUi object and load each one with a different URL.
On Wed, Jun 24, 2015 at 12:26 AM, jinu john <jinu....@gmail.com> wrote:
Hi,

We currently have more than 100 apis. Is there a way by which we can configure multiple yaml files for each use case?

Thanks 
Jinu John

--
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+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ron Ratovsky

unread,
Jun 24, 2015, 3:00:50 PM6/24/15
to swagger-sw...@googlegroups.com
How can multiple YAML files be served from the same URL?

On Wed, Jun 24, 2015 at 9:59 PM, jinu john <jinu....@gmail.com> wrote:
Hi Ron,

Thanks for the suggestion.
But again all the apis are served from the same url.
Is there any way we can configure the yaml file to be used?

On Wednesday, June 24, 2015 at 3:25:45 AM UTC-7, Ron wrote:
You can, but you wouldn't want to split it to 100 files as it would be tedious to load them in the UI.
You can basically create multiple instances of the SwaggerUi object and load each one with a different URL.
On Wed, Jun 24, 2015 at 12:26 AM, jinu john <jinu....@gmail.com> wrote:
Hi,

We currently have more than 100 apis. Is there a way by which we can configure multiple yaml files for each use case?

Thanks 
Jinu John

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



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------

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

jinu john

unread,
Jun 24, 2015, 4:05:52 PM6/24/15
to swagger-sw...@googlegroups.com
Hi Ron,

The use case goes like this lets say we have 2 roles (employee and manger).
We are planning to provide a drop down for the user to select the role. Based on that the user should be able to see the corresponding apis.

Also I can see that in swagger-node-runner, index.js I can see appPath is configured as 
swaggerFile: 'api/swagger/swagger.yaml',

What we are planning is to manipulate the swaggerFile property. is this ok?
Based on the user selection we will choose the file employee.yaml or manager.yaml .

Please let me know your thoughts



On Wednesday, June 24, 2015 at 12:00:50 PM UTC-7, Ron wrote:
How can multiple YAML files be served from the same URL?
On Wed, Jun 24, 2015 at 9:59 PM, jinu john <jinu....@gmail.com> wrote:
Hi Ron,

Thanks for the suggestion.
But again all the apis are served from the same url.
Is there any way we can configure the yaml file to be used?

On Wednesday, June 24, 2015 at 3:25:45 AM UTC-7, Ron wrote:
You can, but you wouldn't want to split it to 100 files as it would be tedious to load them in the UI.
You can basically create multiple instances of the SwaggerUi object and load each one with a different URL.
On Wed, Jun 24, 2015 at 12:26 AM, jinu john <jinu....@gmail.com> wrote:
Hi,

We currently have more than 100 apis. Is there a way by which we can configure multiple yaml files for each use case?

Thanks 
Jinu John

--
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+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------

--
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+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Josh Ponelat

unread,
Jun 25, 2015, 2:39:46 AM6/25/15
to swagger-sw...@googlegroups.com
Not sure I'm in the loop with this thread, but we have a gist for dropdown of multiple specs in the swagger-ui index.html file... take a look

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.



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------

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



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------

--
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.
Reply all
Reply to author
Forward
0 new messages