[SPIKE option B] Event oneOf + hydrate missing source to device (INTER-2457) - #271
[SPIKE option B] Event oneOf + hydrate missing source to device (INTER-2457)#271JuroUhlar wants to merge 3 commits into
Conversation
INTER-2457. Regenerated Event with a source discriminator to show PHP does not split the union. 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: 93d2de3 `chore: SPIKE Event oneOf discriminated union INTER-2457. Regenerated Event with a source discriminator to show PHP does not split the union. Do not merge.`
|
|
🟢 Coverage increased by 82.63% Code Coverage ReportCoverage Report
Files Coverage
|
Eventstays a merged bag.DISCRIMINATOR = sourcelooks up non-existentdevice/edgeclasses, so codegen never splits the oneOf.sourcehydrates todeviceinEventconstruction andObjectSerializer::deserialize.source: edgeis never rewritten.Discussion point: hydrate vs flatten
Option B keeps the generated discriminator and patches omit → device. Option C (#272) keeps a single
Event(sourceoptional) and adds/edgeasEventEdgeseparately.Known issue: PHP still merges oneOf fields
The same flattening happens for
EventRuleAction(allow + block fields on one class). PHP surviving the union is a codegen quirk, not proof this shape is safe.