Skip to content

Add file_format field to JSON Schema v2#1262

Merged
jsuereth merged 12 commits intoopen-telemetry:mainfrom
lmolkova:add-file-format-to-json-schema-v2
Mar 9, 2026
Merged

Add file_format field to JSON Schema v2#1262
jsuereth merged 12 commits intoopen-telemetry:mainfrom
lmolkova:add-file-format-to-json-schema-v2

Conversation

@lmolkova
Copy link
Member

@lmolkova lmolkova commented Mar 4, 2026

JSON Schema v2 does not contain file_format resulting in benign but annoying VS code errors

image

This PR brings it there without breaking compatibility with version: "2" and other tricks we do in custom deserialization.

@lmolkova lmolkova requested a review from a team as a code owner March 4, 2026 03:41
@lmolkova lmolkova force-pushed the add-file-format-to-json-schema-v2 branch from 12d9eb4 to 69c4695 Compare March 6, 2026 01:58
@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.8%. Comparing base (9043dd3) to head (ec70550).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1262   +/-   ##
=====================================
  Coverage   80.8%   80.8%           
=====================================
  Files        111     111           
  Lines       9301    9308    +7     
=====================================
+ Hits        7516    7523    +7     
  Misses      1785    1785           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lmolkova lmolkova force-pushed the add-file-format-to-json-schema-v2 branch from f8eb945 to 8345e13 Compare March 6, 2026 02:45
@@ -59,7 +59,7 @@ pub(crate) fn command(args: &RegistryJsonSchemaArgs) -> Result<ExitDirectives, D
let json_schema = match args.json_schema {
JsonSchemaType::ResolvedRegistry => schema_for!(ResolvedRegistry),
JsonSchemaType::SemconvGroup => schema_for!(Versioned),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do this same trick for V1?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

V1 is perfectly fine without file format - I don't want anyone to start using it, so I'd rather keep it intact

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right - but look at it returning Versioned here - which means it's both V1 and V2 in the same schema - This is the complaint you have on my PR which blindly updated the schema :)

I think we should probably just changed SemconvGroup to be schema_for!(SemconvGroupV1) or whatever here... then I can merge in your pr before submitting mine.

Copy link
Contributor

@jsuereth jsuereth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should be doing the same fix on V1 or if we dont' care for now.

@jsuereth jsuereth enabled auto-merge (squash) March 9, 2026 12:33
@jsuereth jsuereth merged commit d033ca6 into open-telemetry:main Mar 9, 2026
22 checks passed
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.

2 participants