-
Notifications
You must be signed in to change notification settings - Fork 75
Extends OpenAPISpecGeneratorPlugin to include default values for parameters #1323
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
Extends OpenAPISpecGeneratorPlugin to include default values for parameters #1323
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Extends the OpenAPI spec generator plugin to allow configuring which query parameters to include in the spec and automatically set their default values.
- Adds a new
includeParameters
array option to the plugin’s JSON schema. - Introduces
IncludeParameters
in the plugin configuration class with a default empty collection. - Updates parameter processing logic to mark included parameters as required and assign their default values.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
schemas/v1.0.0/openapispecgeneratorplugin.schema.json | Introduces the includeParameters property to the JSON schema |
DevProxy.Plugins/Generation/OpenApiSpecGeneratorPlugin.cs | Adds IncludeParameters config field and logic for defaults |
Comments suppressed due to low confidence (1)
DevProxy.Plugins/Generation/OpenApiSpecGeneratorPlugin.cs:346
- The new default-value logic (
SetParameterDefault
) and inclusion behavior lack unit tests. Add tests to verify that parameters listed inIncludeParameters
are marked required and have theirSchema.Default
set correctly.
private static void SetParameterDefault(OpenApiParameter parameter, object? value)
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works like a charm. Nothing to add 👏
#1110