rapi-doc / RapiDoc

RapiDoc -WebComponent for OpenAPI Spec
https://rapidocweb.com
MIT License
1.71k stars 285 forks source link

Rapidoc throws errors when an OpenAPI 3 doc contains empty server array property #1034

Closed neptunecentury closed 2 months ago

neptunecentury commented 2 months ago

Hello I am using NSwag to directly generate an OAS 3 doc for an asp.net framework 4.8 Web API controller. When the spec is generated, it contains empty server: [] property as seen here:

image

This causes Rapidoc to throw errors when clicking on the operation in the nav pane image

If I delete the empty servers:[] property, then Rapidoc works fine. But this is a manual process, and I can't use an api endpoint to provide the spec.

Can we have Rapidoc handle the empty array? Thanks