Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot Reload of the OpenApi Document #1869

Open
Tracked by #67
aaronburtle opened this issue Nov 8, 2023 · 2 comments · May be fixed by #1870
Open
Tracked by #67

Hot Reload of the OpenApi Document #1869

aaronburtle opened this issue Nov 8, 2023 · 2 comments · May be fixed by #1870
Assignees
Labels
enhancement New feature or request 🔥Hot Reload Tasks related to DAB's Hot Reload feature proposal
Milestone

Comments

@aaronburtle
Copy link
Contributor

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.

@aaronburtle aaronburtle added the enhancement New feature or request label Nov 8, 2023
@aaronburtle aaronburtle self-assigned this Nov 8, 2023
@aaronburtle aaronburtle linked a pull request Nov 8, 2023 that will close this issue
@seantleonard seantleonard added this to the 0.11rc milestone Jan 24, 2024
@seantleonard seantleonard modified the milestones: 0.11rc, 0.12rc Feb 7, 2024
@seantleonard seantleonard modified the milestones: 0.12rc, 1.2rc Mar 7, 2024
@seantleonard
Copy link
Contributor

Moving this + hot reload related tasks to post GA -> tracking via 1.2rc milestone.

@seantleonard seantleonard added the 🔥Hot Reload Tasks related to DAB's Hot Reload feature proposal label May 14, 2024
@seantleonard
Copy link
Contributor

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:

  • Should we lock or wait for new createdocument operation to complete before allowing new GET https://dab/api/openapi requests to be fulfilled?
  • Do we need a feature switch for anything hot reload related here? (probably not, but please consider as part of design).

@seantleonard seantleonard modified the milestones: 1.2rc, Feature Backlog May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 🔥Hot Reload Tasks related to DAB's Hot Reload feature proposal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants