-
Notifications
You must be signed in to change notification settings - Fork 0
Fix parameter handling with optional pointer types and validation improvements #14
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
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
This PR fixes parameter handling for optional pointer types in struct-based OpenAPI parameter generation. The changes ensure that pointer types are correctly marked as optional and nullable in the generated OpenAPI specification, while path parameters remain always required.
Key changes:
- Separated validation logic for query parameters vs path parameters, with path parameters always required
- Added nullable schema property for pointer types in OpenAPI spec
- Added comprehensive test coverage for pointer type parameter handling
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| common.go | Refactored parameter validation logic to distinguish between path and query parameters, added isQueryFieldRequired function, and updated schema generation to mark pointer types as nullable |
| auto_params_test.go | Added test case TestAutoParamsPointerTypesInline to verify pointer type parameters are correctly marked as optional and nullable |
| _examples/auto_params/main.go | Added example usage of pointer type parameters (Category, MaxResults, IncludeInactive) to demonstrate optional parameter handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…n extractParametersFromStruct
…on in validateResourceAccess
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
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Fix optional pointer parameters in SearchInput, improve validation logic for path and query parameters, and add tests for pointer types in auto-generated parameters. Clean up code for consistency.