Skip to content
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

feat: openApi refactor fields parameter to support multiple values with enum validation (getProductByBarCode/search) #11012

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

shinjigi
Copy link
Contributor

What

This PR improves the OpenAPI specification for the fields parameter in the product and search endpoint.

The changes make the API specification more accurate and provide better validation and documentation for the fields parameter, which is critical for controlling response payload size and structure.

Related issue(s) and discussion

  • Improves API documentation accuracy and completeness
  • Makes the fields parameter behavior more predictable and better documented
  • Helps API consumers understand available field options

Implementation details

  1. Created new file parameters/product_available-fields.yaml to house fields parameter definition
  2. Updated main API spec to reference the new parameter definition
  3. Removed redundant fields parameter definition from individual endpoints
  4. Added comprehensive enum of available field values
  5. Added validation rules and examples

Testing

  • Verified that the OpenAPI spec validates correctly
  • Checked that the parameter definition matches actual API behavior
  • Confirmed that examples are valid and helpful

Note: This change is purely to the API specification and does not affect the actual API implementation.

@shinjigi shinjigi requested a review from a team as a code owner November 13, 2024 19:30
@github-actions github-actions bot added the 📚 Documentation Documentation issues improve the project for everyone. label Nov 13, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.03%. Comparing base (dc04d18) to head (0acef3a).
Report is 762 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11012      +/-   ##
==========================================
- Coverage   49.54%   49.03%   -0.52%     
==========================================
  Files          67       77      +10     
  Lines       20650    22243    +1593     
  Branches     4980     5318     +338     
==========================================
+ Hits        10231    10906     +675     
- Misses       9131    10003     +872     
- Partials     1288     1334      +46     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented Nov 15, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 Documentation Documentation issues improve the project for everyone. 📚 OpenAPI
Development

Successfully merging this pull request may close these issues.

3 participants