-
Notifications
You must be signed in to change notification settings - Fork 121
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
Publish JSON schemas to validate configurations #407
Comments
The configs are defined as go structs: https://github.com/ossf/allstar/blob/main/pkg/config/config.go#L33-L67 Do you know of any tools that can generate a schema from those? |
@jeffmendoza It seems that I found a couple of tools/packages to generate a OpenAPI JSON schema from golang types. But, I haven't looked into them whether or not they support JSON schema 7. |
@jeffmendoza We found another package looks nicer than what I shared before. |
@jeffmendoza I did't find any tool to generate a JSON schema from the struct types, which follows the draft-7 specification of JSON schema.
https://github.com/yu-iskw/allstar-jsonschema/blob/main/allstar-config.json |
I figured out there is no perfect existing tool to generate JSON schemas from the definitions in golang. After all, I took advantage of ChatGPT to generate the JSON schemas. |
Motivation
As a lot of code editors enable us to validate files with JSON schemas, it would be great to publish JSON schemas of the allstar configurations. We can also publish them to https://json-schema.org/ .
The text was updated successfully, but these errors were encountered: