Skip to content

Replace jsonschema2pojo with hand rolled version#8600

Open
jack-berg wants to merge 1 commit into
open-telemetry:mainfrom
jack-berg:remove-jsonschema2pojo
Open

Replace jsonschema2pojo with hand rolled version#8600
jack-berg wants to merge 1 commit into
open-telemetry:mainfrom
jack-berg:remove-jsonschema2pojo

Conversation

@jack-berg

Copy link
Copy Markdown
Member

I've recently made a handful of changes to heavily customize the behavior of jsonschema2pojo. Along the way, I started increasingly feeling like I was working against the currents - jumping through hoops to get the output I wanted. And I've been wondering what it would look like to rip out jsonschema2pojo in favor of hand rolling.

This PR does just that.

Its faithfully recreates the generated output of jsonschema2pojo with just a few exceptions:

  • Change @Generated("jsonschema2pojo") to @Generated("io.opentelemetry.gradle.DeclarativeConfigPojoGenerator")
  • Change enums to top level instead of nested. jsonschema2pojo has been doing something weird with enum types. It adds them as inner classes to the class that first references them. Given the strangeness, uselessness, and that recreating added complexity, I opted to fix in the handrolled version.
  • Enum types now include *Model suffix

@jack-berg jack-berg requested a review from a team as a code owner July 15, 2026 21:08
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.10945% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.62%. Comparing base (6f6e146) to head (ff8596d).

Files with missing lines Patch % Lines
...re/declarativeconfig/model/AttributeTypeModel.java 86.36% 2 Missing and 1 partial ⚠️
...e/declarativeconfig/model/ExemplarFilterModel.java 82.35% 2 Missing and 1 partial ⚠️
...odel/ExporterDefaultHistogramAggregationModel.java 81.25% 2 Missing and 1 partial ⚠️
...nfig/model/ExporterTemporalityPreferenceModel.java 82.35% 2 Missing and 1 partial ⚠️
...e/declarativeconfig/model/InstrumentTypeModel.java 85.71% 2 Missing and 1 partial ⚠️
...declarativeconfig/model/OtlpHttpEncodingModel.java 81.25% 2 Missing and 1 partial ⚠️
...e/declarativeconfig/model/SeverityNumberModel.java 92.10% 2 Missing and 1 partial ⚠️
...xperimentalPrometheusTranslationStrategyModel.java 83.33% 2 Missing and 1 partial ⚠️
...declarativeconfig/model/AlwaysOffSamplerModel.java 0.00% 1 Missing ⚠️
.../declarativeconfig/model/AlwaysOnSamplerModel.java 0.00% 1 Missing ⚠️
... and 18 more

❌ Your patch check has failed because the patch coverage (78.10%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8600      +/-   ##
============================================
- Coverage     91.62%   91.62%   -0.01%     
- Complexity    10321    10361      +40     
============================================
  Files          1013     1021       +8     
  Lines         27287    27285       -2     
  Branches       3203     3203              
============================================
- Hits          25001    24999       -2     
  Misses         1559     1559              
  Partials        727      727              

☔ View full report in Codecov by Harness.
📢 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.

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.

1 participant