-
Notifications
You must be signed in to change notification settings - Fork 30
Demonstrate using tooling to produce JSON schema files enriched with descriptions #407
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
base: main
Are you sure you want to change the base?
Conversation
| @@ -0,0 +1,253 @@ | |||
| { | |||
| "$id": "https://opentelemetry.io/otelconfig/common.json", | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Showing these output files for demonstration purposes, but if we go in this direction, maybe we don't check these into git, but include them as release artifacts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after thinking about this more, i think we would definitely want to have whatever the current version is checked in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could also setup the tooling to directly modify the schema JSON files in place. This would also help ensure consistent formatting (i.e. indenting), and is akin to gofmt, prettier, spotless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A short script which:
- Reads all the JSON schema files into memory
- Walks through all the types and properties from the meta schema and for each:
- Finds the appropriate JSON schema file, type definition, and property definition, and updates the JSON to set
descriptionfrom the meta schema
- Finds the appropriate JSON schema file, type definition, and property definition, and updates the JSON to set
codeboten
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest that if this is the desired direction, we should remove the json schema and represent the data in yaml as the source of truth.
One problem with moving away from the source schema altogether is that the yaml and tooling then needs to be able to represent any relationship that json schema does, which may cost more down the road if we find new ways to use the schema that we have yet to implement.
Having both yaml and json schema be combined to produce another json makes it harder to make understand how this all works together.
| @@ -0,0 +1,253 @@ | |||
| { | |||
| "$id": "https://opentelemetry.io/otelconfig/common.json", | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after thinking about this more, i think we would definitely want to have whatever the current version is checked in
|
One thing to think about is that even if we embed
In this case, we'd need to publish the schema in JSON format. Correct?
Not sure I'm following. Can you elaborate? |
Alternative to #400 which uses tooling to produce JSON schema files enriched with descriptions from the meta schema.
Main advantage here is that we can include descriptions which are a combination of bits of information from the meta schema:
descriptionfrommeta_schema_types.yamlisSdkExtensionPluginfrommetah_schema_types.yaml