This only gives me one more swagger endpoint, what if I have 50 
microservices?  Should I hard code this 50 times?

On Wednesday, July 29, 2015 at 6:37:44 PM UTC-6, Ron wrote:
>
> There is a way.
>
> I've attached a sample index.html that shows how.
>
> Follow the following steps:
>
>    1. Create a new global SwaggerUi object, make sure to give the global 
>    variable a new name (in this case, swaggerUi2.
>    2. Assign a new URL - in this case, we use the same pet store URL, but 
>    just change the value to the swagger.json you want to display.
>    3. Provide a unique dom_id - in this case we went with 
>    swagger-ui-container2
>    4. Load the new SwaggerUi object 
>    5. Add a <div> to display it. In it, make sure the id is set to the 
>    dom_id set in step 3, and that the class is swagger-ui-wrap so that 
>    the CSS is applied 
>
>
>
> On Wed, Jul 29, 2015 at 2:36 PM, Nathaniel Shak <[email protected] 
> <javascript:>> wrote:
>
>> Hi, I feel that this question has already been addressed somewhat in 
>> other posts, but I wanted to clarify something that I'm not sure is 
>> completely supported in Swagger 2.0, but had some form of support in 
>> Swagger 1.2.
>>
>> To my understanding, in Swagger 1.2, you were able to aggregate multiple 
>> Swagger definitions to be displayed in a single swagger UI definition by 
>> specifying multiple paths in the "apis" field:
>>
>> "apis": [
>>   {
>>     "description": "this is a valid swagger definition",
>>     "path": "/swaggerDef1"
>>   },
>>   {
>>     "description": "this is also a valid swagger definition"
>>    "path": "/swaggerDef2"
>>   }
>> ]
>>
>> In this case, each path would lead to a valid swagger JSON object, and 
>> each of these swagger objects would be aggregated and displayed in the same 
>> UI.
>>
>> From what I've read about Swagger 2.0, it seems that this functionality 
>> is no longer supported, and that the swagger.json file must be all 
>> contained in one JSON object. I understand that certain fields, such as 
>> definitions and operations, can be referenced externally using the "$ref" 
>> field, but I haven't yet seen a way that multiple swagger objects can be 
>> aggregated together into one UI the way they could be in Swagger 1.2
>>
>> For our API, I currently have an endpoint that returns a valid swagger 
>> JSON object for a given plugin. The problem is that we want to provide 
>> swagger support in a single UI for any number of plugins, each of which 
>> have their own independent path corresponding to their swagger JSON object. 
>> I'm not sure there is a supported way to aggregate these swagger 
>> definitions to be displayed together.
>>
>> Is there any way that this sort of functionality is supported in Swagger 
>> 2.0? And if not, would anyone have any advice on what the best approach 
>> would be to achieve something like this?
>>
>> 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 [email protected] <javascript:>
>> .
>> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to