-
Notifications
You must be signed in to change notification settings - Fork 31
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
Generate JSON Schema from Protobuf definitions and use it to enforce fields? #67
Comments
An alternative approach: the protobuf files are not expected to change that frequently. How about we hand code validate functions for each ecosystem, as part of the language bindings in this repo? |
Tbh I think we could get most of the benefits here by just making sure the conformance tests check for a proper media type, then each language can do it however they’d like.(I think all of the prior ideas are “better” but want to make sure we spend time on the most impactful issues :) )
|
Noting that the using language binding generated from JSON schema seem to have a corner cases around variable naming conventions when trying to share artifacts from bindings generated from protobuf. Concretely, the camelCase sigstore-python artifacts break Rust bindings (#118), as the JSON schema names are all normalized to snake_case. See: Marwes/schemafy#73 |
Breakout from #64 (comment): I think one possible solution to our "required" field woes is as follows:
This shouldn't be too difficult to do, and it looks like there's already some tooling out there that does it (https://github.com/chrusty/protoc-gen-jsonschema).
OTOH, it adds yet another layer of schematization, and only applies to JSON-marshaled messages.
cc @znewman01
The text was updated successfully, but these errors were encountered: