Open aaronburtle opened 10 months ago
Moving this + hot reload related tasks to post GA -> tracking via 1.2rc milestone.
Current OpenApiDocumentor implementation has function CreateDocument()
which has this preliminary check
if (_openApiDocument is not null)
{
throw new DataApiBuilderException(
message: DOCUMENT_ALREADY_GENERATED_ERROR,
statusCode: HttpStatusCode.Conflict,
subStatusCode: DataApiBuilderException.SubStatusCodes.OpenApiDocumentAlreadyExists);
}
Enabling hot reload involes removing this check and rethinking what situations necessitate calling OpenApiDocumentor::CreateDocument()
again.
At first glance, adding a hot reload function directly to IOpenApiDocumentor or OpenApiDocumentor is not appropriate. Another service should call openapidocumentor.CreateDocument()
when new config comes in.
Consider:
GET https://dab/api/openapi
requests to be fulfilled?
The Open Api Document is generated on startup, and so to properly update the doc when a hot reload occurs we need to trigger that create document call as part of the hot reload process. This issues covers implementation of that plus the other changes needed to make sure that the open api docs properly update during a hot reload.