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

feat(ts-proto-#859): added encode-only options to toJSON methods #886

Merged
merged 6 commits into from
Jul 20, 2023

Conversation

Frabat
Copy link
Contributor

@Frabat Frabat commented Jul 18, 2023

Now we can use the toJSON and fromJSON methods separately.

@haines
Copy link
Contributor

haines commented Jul 19, 2023

I just found myself needing this exact feature 😄

I think it needs to be documented here:

ts-proto/README.markdown

Lines 375 to 377 in 44e8e8a

- With `--ts_proto_opt=outputJsonMethods=false`, the `Message.fromJSON` and `Message.toJSON` methods for working with JSON-coded data will not be output.
This is also useful if you want "only types".

Copy link
Owner

@stephenh stephenh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great @Frabat ! Thanks for the PR!

I can merge it now, but will wait just a bit to see if you'd like to do the readme update that @haines mentioned.

src/options.ts Outdated Show resolved Hide resolved
Copy link
Owner

@stephenh stephenh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks!

@stephenh stephenh merged commit d0cf57d into stephenh:main Jul 20, 2023
6 checks passed
stephenh pushed a commit that referenced this pull request Jul 20, 2023
# [1.156.0](v1.155.1...v1.156.0) (2023-07-20)

### Features

* **ts-proto-#859:** added encode-only options to toJSON methods ([#886](#886)) ([d0cf57d](d0cf57d)), closes [ts-proto-#859](https://github.com/ts-proto-/issues/859) [ts-proto-#859](https://github.com/ts-proto-/issues/859) [ts-proto#859](https://github.com/ts-proto/issues/859) [ts-proto#859](https://github.com/ts-proto/issues/859) [ts-proto-#859](https://github.com/ts-proto-/issues/859)
@stephenh
Copy link
Owner

🎉 This PR is included in version 1.156.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants