You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Presently, our team needs to utilize the .toJson method for our returned models from our auto generated services. However, we lose all semblance of references to the original model in the process. In grpc-web they have a similar method that returns a totally separate model that is a representation of the JSON returned from their method.
Describe the solution you'd like
It would be great if the .toJson method would return an auto generated model for the JSON instead of JsonValue.
The text was updated successfully, but these errors were encountered:
Hey @seanmcquaid. Just to clarify what you're looking for here - you're trying to put a Protobuf message in a store that requires it to be a plain object that is JSON serializable, correct? If that is the case, then using toPlainMessage on the message may be your best approach. I say 'may' because you could run into issues if your schema has 64-bit integrals or bytes fields. But, if not, doing something like:
might be the best solution. You could then use the messageAsPlainType object in your store.
If you do have a schema with 64-bit integrals, then this may not work for you quite yet. However, we are going to be implementing an option that allows you to generate your 64-bit numbers as strings (see issue), so that would hopefully become a non-issue.
If none of this works for you or is not what you're looking for, we do have an issue for creating typed JSON on our radar, it's just not prioritized yet.
Is your feature request related to a problem? Please describe.
Presently, our team needs to utilize the .toJson method for our returned models from our auto generated services. However, we lose all semblance of references to the original model in the process. In grpc-web they have a similar method that returns a totally separate model that is a representation of the JSON returned from their method.
Describe the solution you'd like
It would be great if the .toJson method would return an auto generated model for the JSON instead of JsonValue.
The text was updated successfully, but these errors were encountered: