Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

MrLoh
Copy link
Contributor

@MrLoh MrLoh commented Jul 7, 2025

This PR adds a new --include-path-parameters CLI flag that enables the generation of parameter models containing both path and query parameters when using --openapi-scopes parameters.

Changes

  • Added --include-path-parameters flag to CLI arguments
  • Updated parameter model generation to include path parameters when flag is enabled
  • Changed model suffix from ParametersQuery to Parameters when path parameters are included
  • Added test coverage for the new functionality
  • Added exception on name conflicts between path and query parameters.

Rationale

I need this to validate the complete parameter set for an endpoint (e.g., GET /users/{user_id}?include=profile&format=json generates a single Parameters model containing user_id, include, and format fields) for use in SDKs.

The flag is opt-in to maintain backward compatibility.

gaborbernat
gaborbernat previously approved these changes Jul 10, 2025
Copy link
Collaborator

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

codspeed-hq bot commented Jul 10, 2025

CodSpeed Performance Report

Merging #2445 will not alter performance

Comparing MrLoh:mrloh/support-path-parameters (5512fe1) with main (ec84e8e)

Summary

✅ 32 untouched benchmarks

@MrLoh
Copy link
Contributor Author

MrLoh commented Jul 13, 2025

@gaborbernat thanks for reviewing and approving. I fixed the black formatting issues in the tests and verified that they are passing locally, can you approve the CI runs and merge if they pass.

Copy link

codecov bot commented Jul 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.10%. Comparing base (ec84e8e) to head (5512fe1).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2445   +/-   ##
=======================================
  Coverage   98.09%   98.10%           
=======================================
  Files          66       66           
  Lines        8307     8324   +17     
  Branches      837      838    +1     
=======================================
+ Hits         8149     8166   +17     
  Misses        115      115           
  Partials       43       43           
Flag Coverage Δ
unittests 98.10% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gaborbernat
Copy link
Collaborator

You need to add tests 👍

@MrLoh
Copy link
Contributor Author

MrLoh commented Jul 19, 2025

@gaborbernat I added a test for the uncovered lines and updated the readme and docs with the script

@gaborbernat
Copy link
Collaborator

You need to fix the linter errors now 😊

@MrLoh MrLoh force-pushed the mrloh/support-path-parameters branch from b2b78ff to 5512fe1 Compare July 25, 2025 11:25
@MrLoh
Copy link
Contributor Author

MrLoh commented Jul 25, 2025

@gaborbernat Sorry for missing that, still getting used to the setup here. The linter error is fixed in the same way as in other tests now.

@gaborbernat gaborbernat enabled auto-merge (squash) July 25, 2025 13:16
@gaborbernat gaborbernat merged commit 82b28d9 into koxudaxi:main Jul 25, 2025
28 checks passed
@MrLoh MrLoh deleted the mrloh/support-path-parameters branch July 25, 2025 13:57
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