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

Configure JSON format case #43

Open
easyCZ opened this issue Jan 30, 2025 · 1 comment
Open

Configure JSON format case #43

easyCZ opened this issue Jan 30, 2025 · 1 comment

Comments

@easyCZ
Copy link

easyCZ commented Jan 30, 2025

By default, the generated jsonschema uses underscores, the same as the proto files. However, your other library, connect, by default uses camel case. The end result is that the generated schema does not actually match what connect expects.

Is there a way to configure the json encoder?

My use-case is as follows:

  • Use grpc & connect for APIs, this works well
  • We have a command which accepts a yaml file which gets serialized to proto and uploaded - think github actions definition. We want to publish a schema for just that file, so that editors can auto-complete appropriately.
@Alfus
Copy link
Contributor

Alfus commented Jan 31, 2025

This library actually generates both sets of json schema rules and lets you pick which cases you prefer.

See https://github.com/bufbuild/protoschema-plugins/tree/main/internal/testdata/jsonschema

There are both *.schema.json (underscores) and *.jsonschema.json (camelCase)

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