Azure / data-api-builder

Data API builder provides modern REST and GraphQL endpoints to your Azure Databases and on-prem stores.
https://aka.ms/dab/docs
MIT License
814 stars 147 forks source link

[Bug]: Unable to enable Swagger UI / GraphQL UI in Static Web Apps #1770

Open hajekj opened 9 months ago

hajekj commented 9 months ago

What happened?

I would like to be able to enable full Swagger UI / GraphQL UI when deployed to Static Web Apps. I am able to get those enabled when running locally with mode: Development however it doesn't seem to have any effect when deployed to SWA.

Version

Microsoft.DataApiBuilder 0.8.52+c69925060e1942d28515b9c4b89ea24832da0c7c

What database are you using?

Azure SQL

What hosting model are you using?

Static Web Apps (SWA)

Which API approach are you accessing DAB through?

REST, GraphQL

Relevant log output

No response

Code of Conduct

thomasgauvin commented 9 months ago

@hajekj can you detail more your usage of these views in SWA? By default, these are hidden because they could expose inner details of your APIs to your end users. Is this request specific to SWAs preview environments? Are you using a SWA as a separate dev object that has a private endpoint to restrict this to specific users?

hajekj commented 9 months ago

I would like to have this enabled for at least preview environments, so it can be used for troubleshooting directly when deployed. Additionally, with regards to OpenAPI endpoint, the definition is already exposed when deployed anyways - https://hajekj-dab.labs.tntg.cz/data-api/rest/openapi so there should be no reason to prevent the Swagger UI from showing.