-
Notifications
You must be signed in to change notification settings - Fork 349
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
fix: simplify handling useJsonWireFormat=true and fix onlyTypes=true #583
Conversation
oyvindwe
commented
Jun 2, 2022
- Moved logic for required and implied options into options.ts
- Made onlyTypes=true behave as documented.
// We should promote onlyTypes to its own documented flag, but just an alias for now | ||
if (!options.outputJsonMethods && !options.outputEncodeMethods && !options.outputClientImpl && !options.nestJs) { | ||
// onlyTypes=true implies outputJsonMethods=false,outputEncodeMethods=false,outputClientImpl=false,nestJs=false | ||
if (options.onlyTypes) { |
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.
...huh, yeah, not sure why we weren't doing this before. Great fix!
If you want to add test cases to options-test.ts
to make sure these don't regress, that'd be great!
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.
This should probably have been fixed when the option was documented. :)
I'll add test cases!
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.
Tests added.
@@ -396,7 +396,7 @@ Generated code will be placed in the Gradle build directory. | |||
|
|||
- With `--ts_proto_opt=onlyTypes=true`, only types will be emitted, and imports for `long` and `protobufjs/minimal` will be excluded. | |||
|
|||
Note: _This is a combination_ of `outputJsonMethods=false,outputEncodeMethods=false,outputClientImpl=false,nestJs=false` | |||
This is the same as setting `outputJsonMethods=false,outputEncodeMethods=false,outputClientImpl=false,nestJs=false` |
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.
Not sure if nestJs=false
should be included here, as it is false by default, but nestJs=true -> onlyTypes=false.
Looks great @oyvindwe , thanks! |
## [1.115.2](v1.115.1...v1.115.2) (2022-06-03) ### Bug Fixes * simplify handling useJsonWireFormat=true and fix onlyTypes=true ([#583](#583)) ([6e7f938](6e7f938))
🎉 This PR is included in version 1.115.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |