Skip to content

Conversation

@moutonjeremy
Copy link
Member

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.

Copilot AI review requested due to automatic review settings October 21, 2025 23:53
Copy link
Contributor

Copilot AI left a 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.

@moutonjeremy moutonjeremy requested a review from Copilot October 22, 2025 00:04
Copy link
Contributor

Copilot AI left a 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.

moutonjeremy and others added 4 commits October 22, 2025 02:10
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>
@moutonjeremy moutonjeremy requested a review from Copilot October 22, 2025 00:11
Copy link
Contributor

Copilot AI left a 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.

moutonjeremy and others added 3 commits October 22, 2025 02:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@moutonjeremy moutonjeremy requested a review from Copilot October 22, 2025 00:13
Copy link
Contributor

Copilot AI left a 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.

@moutonjeremy moutonjeremy requested a review from Copilot October 22, 2025 00:16
Copy link
Contributor

Copilot AI left a 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>
@moutonjeremy moutonjeremy merged commit b46b37c into main Oct 22, 2025
4 checks passed
@moutonjeremy moutonjeremy deleted the fix/optional-params-missing-info-spec branch October 22, 2025 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants