Skip to content

test: cover JSON schema registry loading and overwriteSchemaWith resolution - #704

Merged
ddecrulle merged 1 commit into
mainfrom
jackson3
Nov 4, 2026
Merged

ddecrulle merged 1 commit into
mainfrom
jackson3

Conversation

@ddecrulle

Copy link
Copy Markdown
Member

Why

After the Spring Boot 4 migration (#636), JsonSchemaRegistryService and JsonSchemaProfileRegistryService still used javax.annotation.PostConstruct. Spring 7 no longer honours the javax annotation, so the callbacks that fill the registries never ran, and nothing logged an error:

  • x-onyxia.overwriteSchemaWith in charts' values.schema.json (ide/resources.json, nodeSelector.json, ide/ingress.json, ide/s3.json, …) was returned unresolved;
  • the default user profile schema was not loaded.

#701 fixed it by switching to jakarta.annotation.PostConstruct, but no test covered it.

What

New JsonSchemaResolutionServiceTest, which goes through the Spring context so the lifecycle callback is exercised:

  • the registry loads the bundled schemas;
  • overwriteSchemaWith is replaced by the registry schema;
  • internal #/definitions/... $refs are resolved;
  • resolution does not mutate the chart schema;
  • the default profile schema is loaded from profile.schema.directory.

Checked

  • mvn verify: 71 tests pass, spotless OK.
  • With both @PostConstruct removed (same effect as Spring 7 ignoring the javax annotation), 3 of the 5 tests fail: empty registry, unresolved overwriteSchemaWith, null profile schema.

No production code change.

🤖 Generated with Claude Code

…lution

The schema registries are filled by a @PostConstruct callback. With Spring
Boot 4 (Spring 7), the javax.annotation.PostConstruct they used was silently
ignored, leaving the registries empty: x-onyxia.overwriteSchemaWith was no
longer resolved in values.schema.json and the default profile schema was not
loaded. #701 switched to jakarta.annotation.PostConstruct; these tests go
through the Spring context so that such a regression is caught.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@ddecrulle
ddecrulle merged commit 50216d2 into main Nov 4, 2026
9 checks passed
@ddecrulle
ddecrulle deleted the jackson3 branch November 4, 2026 15:25
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