Mark stored procedure parameters without defaults as required in OpenAPI#3687
Draft
Copilot wants to merge 2 commits into
Draft
Mark stored procedure parameters without defaults as required in OpenAPI#3687Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix required params not marked in OpenAPI schema
Mark stored procedure parameters without defaults as required in OpenAPI
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why make this change?
requiredarray on the{entity}_sp_requestschema, so parameters that must be supplied (e.g.firstName,lastName) were not flagged as required.What is this change?
CreateSpRequestComponentSchema(OpenApiDocumentor.cs): a parameter is now marked required when it is explicitly flagged in config or has no default value. Previously only an explicit configrequired: truepopulated the array, which is almost never set, so the array was always empty.IsRequestBodyRequiredlogic (!HasConfigDefault), keeping body-level and property-level required semantics consistent. An explicit configrequired: falseis still honored.How was this tested?
Extended
StoredProcedureGeneration.ValidateRequestBodyContentsto assert the request body schema'srequiredset contains the expected parameters. Verified the assertion fails when the fix is reverted.Sample Request(s)
GET /api/openapi— request body schema component for a stored procedure with parameterstitle,publisher_name(neither having a default):