Skip to content

Conversation

@moutonjeremy
Copy link
Member

Improve OpenAPI parameter extraction and validation, adding support for path and query parameters. Implement auto-generated parameters from struct tags and merge them with manual parameters. Include comprehensive tests for both auto-generated and manual parameters, ensuring robustness. Add necessary module dependency files for better management. Implement an endpoint for user search with auto-generated parameters.

Copilot AI review requested due to automatic review settings October 21, 2025 23:40
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 enhances OpenAPI parameter generation by implementing auto-extraction of parameters from struct field tags and enabling seamless merging with manually defined parameters. The key improvements include support for both path and query parameters with automatic type detection, validation-based requirement inference, and comprehensive test coverage for edge cases.

  • Automatic parameter extraction from struct tags (path: and query:)
  • Intelligent parameter merging where manual parameters override auto-generated ones
  • Comprehensive test suite covering standard cases and edge cases (unexported fields, pointer types, complex validation)

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
fiberoapi.go Integrates auto-parameter generation into OpenAPI spec generation with merge logic
common.go Implements core parameter extraction, schema generation, and merge functions; adds unexported field filtering
auto_params_test.go Tests standard auto-parameter generation and manual override scenarios
auto_params_edge_cases_test.go Tests edge cases including unexported fields, pointer types, and complex validation
_examples/auto_params/main.go Demonstrates auto-parameter generation with a user search endpoint
_examples/auto_params/go.mod Defines module dependencies for the example

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@moutonjeremy moutonjeremy merged commit 833d8ae into main Oct 21, 2025
4 checks passed
@moutonjeremy moutonjeremy deleted the feat/query-params-documentation branch October 21, 2025 23:41
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