Skip to content

[SPIKE option B] Event oneOf + hydrate missing source to device (INTER-2457) - #49

Open
JuroUhlar wants to merge 3 commits into
mainfrom
spike/INTER-2457-event-oneof
Open

[SPIKE option B] Event oneOf + hydrate missing source to device (INTER-2457)#49
JuroUhlar wants to merge 3 commits into
mainfrom
spike/INTER-2457-event-oneof

Conversation

@JuroUhlar

@JuroUhlar JuroUhlar commented Aug 31, 2026

Copy link
Copy Markdown
Contributor
  • SPIKE. Do not merge. Option B: keep the Event oneOf union (EventDevice | EventEdge) and hydrate a missing source to EventDevice via Jackson defaultImpl.
  • source: edge stays EventEdge. We do not rewrite it.
  • Contrast: option C (#50) flattens Event back to a class so getIdentification() still compiles.

Discussion point: omit → device vs flatten Event

Option B keeps the discriminated union. Existing getEvent JSON without source deserializes as EventDevice. Callers still lose getIdentification() on Event and must cast. Option C avoids that compile break by flattening.

Break: compile / binary

Event used to be a class with getIdentification(). It is now an interface (useOneOfInterfaces: true) with no getIdentification(). api.getEvent(id).getIdentification() does not compile. Identification is on EventDevice.

Known issue: CI will fail

FingerprintApiTest still does not compile. That is the spike. The hydrate unit test in SerializationTest passes when compiled on its own.

INTER-2457. Regenerated Event as an interface to show the compile break. Do not merge.
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Template files and generated files are not in-sync.

Following files do not match corresponding templates:
sdk/src/main/java/com/fingerprint/v4/api/FingerprintApi.java sdk/src/main/java/com/fingerprint/v4/model/Event.java

To fix this warning, make sure template files are up-to-date, and generate files by running the following command:

bash ./scripts/generate.sh

@JuroUhlar JuroUhlar changed the title [SPIKE] Event oneOf discriminated union (INTER-2457) [SPIKE option B] Event oneOf + hydrate missing source to device (INTER-2457) Sep 6, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ This PR doesn't contain any changesets. If there are user-facing changes, don't forget to run:

pnpm exec changeset

to create a changeset.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Wrong commit message format detected

We use Semantic Commit Messages in our project.

Warning
Probably you forgot to activate local git hooks.

Run the next command in the project root to activate local hooks:

sh ./install_hooks.sh

More info you can find in job logs

Commitlint Errors

Commit: 9cf2407 `chore: SPIKE Event oneOf discriminated union

INTER-2457. Regenerated Event as an interface to show the compile break. Do not merge.`
Errors:

  • subject must not be sentence-case, start-case, pascal-case, upper-case

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