Skip to content

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

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

[SPIKE option B] Event oneOf + hydrate missing source to device (INTER-2457)#271
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
  • Option B spike. Do not merge. Compare with option C: #272.
  • Event stays a merged bag. DISCRIMINATOR = source looks up non-existent device / edge classes, so codegen never splits the oneOf.
  • Missing source hydrates to device in Event construction and ObjectSerializer::deserialize. source: edge is never rewritten.

Discussion point: hydrate vs flatten

Option B keeps the generated discriminator and patches omit → device. Option C (#272) keeps a single Event (source optional) and adds /edge as EventEdge separately.

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.

INTER-2457. Regenerated Event with a source discriminator to show PHP does not split the union. 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:
src/Api/FingerprintApi.php src/Model/Event.php src/ObjectSerializer.php

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: 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.`
Errors:

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

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

🟢 Coverage increased by 82.63%

Code Coverage Report

Coverage Report

St. Category Percentage Covered / Total
🟢 Statements 82.63% 3630 / 4393
🟢 Functions 83.19% 1435 / 1725
Files Coverage
St. File Methods Statements Total Coverage

@JuroUhlar
JuroUhlar marked this pull request as draft September 7, 2026 09:05
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