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

Remove $typeName and $unknown #1016

Open
netanel-utila opened this issue Nov 10, 2024 · 2 comments
Open

Remove $typeName and $unknown #1016

netanel-utila opened this issue Nov 10, 2024 · 2 comments

Comments

@netanel-utila
Copy link

Hi,

Is there any way to exclude $typeName and $unknown from the types? we don't want to expose this to our clients:

Screenshot 2024-11-10 at 16 25 29

Thanks

@timostamm
Copy link
Member

You can remove properties (and do much more) with mapped types.

Here is an example for a Connect client that does not make properties optional, and strips the $typeName and $unknown properties: https://github.com/connectrpc/examples-es/tree/main/custom-client

The OmitTypeName type from this example might just be what you need.

@netanel-utila
Copy link
Author

I understand that it's possible to implement this; however, same as the timestamp issue, I thought this could be something incorporated as a plugin or something. This way, it would automatically generate the desired outcome and we won't need to create wrappers, etc.

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

2 participants