Skip to content

fix: name generated engine classes from schema titles - #227

Merged
Zaimwa9 merged 1 commit into
mainfrom
fix/pin-schema-refs
Sep 23, 2026
Merged

Zaimwa9 merged 1 commit into
mainfrom
fix/pin-schema-refs

Conversation

@Zaimwa9

@Zaimwa9 Zaimwa9 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

CI has failed on every branch since 2026-08-31. Upstream Flagsmith/flagsmith#8396 added a flags property to the evaluation context; jsonschema2pojo names classes from the property name, so it collided with the evaluation result's flags, emitting Flags__1 and breaking Engine.java:45.

Switches the plugin to useTitleAsClassname. Every object in the upstream schemas has a unique title matching its current generated name, so the generated class set is unchanged apart from the new FlagResults (titled by Flagsmith/flagsmith#8581). Schema $refs keep tracking main.

How did you test this code?

mvn clean install and mvn clean install -P test-okhttp4 against upstream main: 406 passed each, 0 checkstyle violations. Generated classes identical to before plus FlagResults.

@Zaimwa9
Zaimwa9 requested a review from a team as a code owner September 23, 2026 14:17
@Zaimwa9
Zaimwa9 requested review from emyller and removed request for a team September 23, 2026 14:17
emyller
emyller previously approved these changes Sep 23, 2026
@Zaimwa9
Zaimwa9 force-pushed the fix/pin-schema-refs branch from 5603f00 to 6beeffe Compare September 23, 2026 14:55
@Zaimwa9 Zaimwa9 changed the title fix: pin evaluation schema refs to a fixed upstream commit fix: name generated engine classes from schema titles Sep 23, 2026
@Zaimwa9
Zaimwa9 force-pushed the fix/pin-schema-refs branch from 6beeffe to 6ae2da2 Compare September 23, 2026 14:59
emyller
emyller previously approved these changes Sep 23, 2026

@emyller emyller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving because my one comment is not blocking, but I'd love to see it followed up.

Comment thread pom.xml Outdated
Upstream 58eb348 added a `flags` property to the evaluation context.
jsonschema2pojo names classes from the property name, so it collided with
the evaluation result's `flags`: one became Flags__1 and Engine.java no
longer compiled. CI had failed on every branch since 2026-08-31.

Name classes from the schema title instead. Every object in the upstream
schemas has a unique title matching its current generated name, so the
generated set is unchanged apart from the new FlagResults (titled so by
upstream Flagsmith/flagsmith#8581). The schema refs keep tracking main.

@emyller emyller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@Zaimwa9
Zaimwa9 merged commit a0c4f54 into main Sep 23, 2026
12 checks passed
@Zaimwa9
Zaimwa9 deleted the fix/pin-schema-refs branch September 23, 2026 15:30
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