[BUG] Change default value for header parameter#15990
[BUG] Change default value for header parameter#15990wing328 merged 3 commits intoOpenAPITools:masterfrom
Conversation
|
this fix is mainly for the postman collection generator, right? if that's the case, I don't think we should update default codegen. What about overriding the method in postman collection generator instead? |
|
Yes, that's an option but this applies to all generators IMO. When a parameter has no default the default codegen provides My suggestion would be to return |
The comment simply said the code block is to illustrate how to handle default value for different type so that generators can override this method easily.
The default codegen was created primarily for java client/server generators so it won't meet the requirement of generators in different languages. That's why generators should override
I don't think the header parameter should default to "" (empty string) in most generators as the header with as opposed to simply omitting the header in the HTTP request. Updating something in default codegen requires lots of tests and reviews and in this case I would suggest simply overriding |
|
FYI. I've fled #16003 to clean up the code a bit to avoid confusions. |
9bfb8e6 to
b465d88
Compare
|
@wing328 thanks for the clarifications. The issue is that the default value I thought that would be an issue for most generators. Anyway, I followed your suggestion and dealt with this within the Postman generator, please see the changes. |
Fix #15989
When a property has no default value the string
"null"is used as default.This PR changes the
getPropertyDefaultValuefor strings from"null"to""(empty string)PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master(6.3.0) (minor release - breaking changes with fallbacks),7.0.x(breaking changes without fallbacks)