[PM-33895] Filter [BindNever] parameters from OpenAPI schema#7257
Open
dani-garcia wants to merge 4 commits intomainfrom
Open
[PM-33895] Filter [BindNever] parameters from OpenAPI schema#7257dani-garcia wants to merge 4 commits intomainfrom
[BindNever] parameters from OpenAPI schema#7257dani-garcia wants to merge 4 commits intomainfrom
Conversation
Contributor
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Contributor
|
New Issues (2)Checkmarx found the following issues in this Pull Request
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7257 +/- ##
==========================================
+ Coverage 57.72% 57.73% +0.01%
==========================================
Files 2042 2043 +1
Lines 89817 89848 +31
Branches 7985 7991 +6
==========================================
+ Hits 51845 51875 +30
- Misses 36114 36115 +1
Partials 1858 1858 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.





🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-33895
bitwarden/sdk-internal#728 (comment)
https://bitwarden.slack.com/archives/C05LRC3DBDK/p1771858123530539
📔 Objective
Create a new Swagger filter to filter out complex type parameters using
[BindNever]. This is required to correctly generate the schema for some billing functions that look like this:The issue here is caused by Swashbuckle first expanding
Userinto one query parameter per field (id,name, etc) before trying to filter out the query parameteruser, which doesn't exist anymore and so it doesn't get correctly filtered out. This causes the OpenAPI schema and the SDK-generated code to have a lot of invalid query parameters:https://github.com/bitwarden/sdk-internal/blob/7637fdfd66c4403b9f718d85c4cbd5bde15288d9/crates/bitwarden-api-api/src/apis/account_billing_v_next_api.rs#L31
This filter fixes this by manually filtering all the properties of any parameter annotated with
[BindNever]. I've tested it locally and this fixes the invalid code generation for the billing endpoints.The cause of this issue seems to me like a Swashbuckle bug so I'm thinking about reporting it upstream, but this filter should at least solve it for the time being.
📸 Screenshots