Skip to content
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

Option for remove toJSON #859

Open
f0rmat1k opened this issue Jul 1, 2023 · 2 comments
Open

Option for remove toJSON #859

f0rmat1k opened this issue Jul 1, 2023 · 2 comments

Comments

@f0rmat1k
Copy link
Contributor

f0rmat1k commented Jul 1, 2023

There is no option, to remove toJSON from output. Only both with --ts_proto_opt=outputJsonMethods=false. We are using tool on the client and we need only fromJSON there. It would be nice to have option about removing toJSON (or only fromJOSN). I can try to send PR, if you don't mind

@f0rmat1k f0rmat1k changed the title Options for remove toJSON Option for remove toJSON Jul 1, 2023
@stephenh
Copy link
Owner

stephenh commented Jul 1, 2023

Hi @f0rmat1k , sure if you wanted to add support for outputJsonMethods=fromJSON, so it becomes like outputJsonMethods=true|false|fromJSON|toJSON" that sgtm. Thanks!

@Frabat
Copy link
Contributor

Frabat commented Jul 5, 2023

Hi! I didn't read this issue but I've managed to do the same thing!
I've opened a PR for this

Frabat added a commit to Frabat/ts-proto that referenced this issue Jul 18, 2023
feat(ts-proto-stephenh#859): added encode-only options to toJSON methods
Frabat pushed a commit to Frabat/ts-proto that referenced this issue Jul 18, 2023
Frabat pushed a commit to Frabat/ts-proto that referenced this issue Jul 19, 2023
stephenh pushed a commit that referenced this issue Jul 20, 2023
* feat(ts-proto-#859): added encode-only options to toJSON methods

* feat(ts-proto-#859): fixed error in implementation

* feat(ts-proto#859): inverted fromJSON and toJSON methods to avoid changing all tests

* feat(ts-proto#859): ran yarn format

* feat(ts-proto-#859): updated docs and renamed methods to toOnly and fromOnly

---------

Co-authored-by: Francesco Battista <francesco.battista@nbcuni.com>
stephenh pushed a commit that referenced this issue Jul 20, 2023
stephenh pushed a commit that referenced this issue Sep 3, 2023
* feat(ts-proto-#859): added encode-only options to toJSON methods

* feat(ts-proto-#859): fixed error in implementation

* feat(ts-proto#859): inverted fromJSON and toJSON methods to avoid changing all tests

* feat(ts-proto#859): ran yarn format

* feat(ts-proto-#859): updated docs and renamed methods to toOnly and fromOnly

* feat: removed toJson/fromJSON enums when not used

* feat(#909): ran format

---------

Co-authored-by: Francesco Battista <francesco.battista@nbcuni.com>
stephenh pushed a commit that referenced this issue Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants