-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add options to limit generation of encode and decode methods to…
… only specific message types (#1085) I created this PR as a possible to solution to the feature request submitted in #1084. I added integration tests for test coverage, and updated the documentation to include the two new options.
- Loading branch information
1 parent
bf304b2
commit c7372fa
Showing
15 changed files
with
276 additions
and
49 deletions.
There are no files selected for viewing
This file contains 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/wrappers.proto"; | ||
|
||
message EncodeWithDecodeMethod { | ||
string encode = 1; | ||
} | ||
|
||
message EncodeDontGenerateDecodeMethod { | ||
string encode_dont_generate_decode_method = 1; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
outputEncodeMethods=decode-only,outputPartialMethods=false,outputJsonMethods=false,nestJs=false,outputDecodeIncludeTypes=^EncodeWithDecodeMethod |
1 change: 1 addition & 0 deletions
1
integration/output-encode-decode-include-types-combined/parameters.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
outputEncodeMethods=true,outputPartialMethods=false,outputJsonMethods=false,nestJs=false,outputEncodeIncludeTypes=^Request,outputDecodeIncludeTypes=^Response$ |
17 changes: 17 additions & 0 deletions
17
integration/output-encode-decode-include-types-combined/request_response.proto
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/wrappers.proto"; | ||
|
||
message Request { | ||
string request_id = 1; | ||
|
||
message Nested { | ||
string more_data = 1; | ||
} | ||
|
||
Nested nested = 2; | ||
} | ||
|
||
message Response { | ||
string response_id = 1; | ||
} |
88 changes: 88 additions & 0 deletions
88
integration/output-encode-decode-include-types-combined/request_response.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
syntax = "proto3"; | ||
|
||
import "google/protobuf/wrappers.proto"; | ||
|
||
message Encode { | ||
string encode = 1; | ||
} | ||
|
||
message DontGenerateEncode { | ||
string dont_generate_encode = 1; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
outputEncodeMethods=encode-only,outputPartialMethods=false,outputJsonMethods=false,nestJs=false,outputEncodeIncludeTypes=^Encode$ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
integration/output-encode-only/google/protobuf/wrappers.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.