-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[typescript] Use static middleware when calltime options exist but specify no middleware #20985
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
Merged
macjohnny
merged 12 commits into
OpenAPITools:master
from
bodograumann:typescript-keep-static-middleware
Apr 1, 2025
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
31674b2
Keep static middleware when options contain no middleware field
bodograumann fed65e6
Regenerate samples
bodograumann 5b1f719
Fix indentation and quotes
bodograumann 843f813
Extract middleware merge logic into function
bodograumann d28fda8
Regenerate samples
bodograumann 3af67cf
Simplify extracted functions
bodograumann 6af63e9
Regenerate samples
bodograumann ecf0456
Fix: Pass static config when no options are given for inversify
bodograumann b4ace69
Fix: Allow overriding http api with options
bodograumann f102f02
Regenerate samples
bodograumann 9c32052
Use default parameter for default middlware merge strategy
bodograumann df15f6b
Throw exception for failed match within switch block
bodograumann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
55 changes: 25 additions & 30 deletions
55
samples/client/echo_api/typescript/build/configuration.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you move this out because of the explicit return rule? Otherwise I think it was semantically easier to understand inside the switch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It felt cleaner to me, because it made it obvious, that it is a last-resort for the function (actually in typescript it is unreachable anyway, because the switch completely covers all possible values of strategy)
Putting it into
defaultmakes sense as well because it is concerned with invalid values forstrategy.I can put it back into
default:if you prefer.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer it for future readers/changes, to make sure noone puts code in between. It should immediately exit on an unknown value. If you're happy to move it back in, that would be appreciated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I moved it back inside.