[SPIKE option B] Event oneOf + hydrate missing source to device (INTER-2457) - #49
[SPIKE option B] Event oneOf + hydrate missing source to device (INTER-2457)#49JuroUhlar wants to merge 3 commits into
Conversation
INTER-2457. Regenerated Event as an interface to show the compile break. Do not merge.
|
Following files do not match corresponding templates: To fix this warning, make sure template files are up-to-date, and generate files by running the following command: bash ./scripts/generate.sh |
pnpm exec changesetto create a changeset. |
Wrong commit message format detectedWe use Semantic Commit Messages in our project.
Run the next command in the project root to activate local hooks: sh ./install_hooks.shMore info you can find in job logs Commitlint ErrorsCommit: 9cf2407 `chore: SPIKE Event oneOf discriminated union INTER-2457. Regenerated Event as an interface to show the compile break. Do not merge.`
|
EventoneOf union (EventDevice|EventEdge) and hydrate a missingsourcetoEventDevicevia JacksondefaultImpl.source: edgestaysEventEdge. We do not rewrite it.Eventback to a class sogetIdentification()still compiles.Discussion point: omit → device vs flatten Event
Option B keeps the discriminated union. Existing
getEventJSON withoutsourcedeserializes asEventDevice. Callers still losegetIdentification()onEventand must cast. Option C avoids that compile break by flattening.Break: compile / binary
Eventused to be a class withgetIdentification(). It is now an interface (useOneOfInterfaces: true) with nogetIdentification().api.getEvent(id).getIdentification()does not compile. Identification is onEventDevice.getEvent: FingerprintApi.javaKnown issue: CI will fail
FingerprintApiTeststill does not compile. That is the spike. The hydrate unit test inSerializationTestpasses when compiled on its own.