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

Add strict option to v1 #1043

Open
wants to merge 3 commits into
base: v1
Choose a base branch
from
Open

Add strict option to v1 #1043

wants to merge 3 commits into from

Conversation

lukasIO
Copy link
Contributor

@lukasIO lukasIO commented Dec 30, 2024

addresses #414

This PR adds a strict option to protoc-gen-es v1 to allow for required labels in proto2 syntax to be reflected as actually required fields.

All current tests pass with strict=0 (which is of course the default), so there should be no breaking changes.

In order to facilitate type checking for strict mode there's a new PartialStrictMessage type that enforces required fields to be part of the initial message constructor.

Would highly appreciate if you considered adding this option. I tried to make it non breaking and as useful as possible for others.

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

Successfully merging this pull request may close these issues.

1 participant