Skip to content

Clean up discriminated codec encoding#114

Merged
leoafarias merged 1 commit into
mainfrom
leoafarias/discriminated-codec-cleanup
May 29, 2026
Merged

Clean up discriminated codec encoding#114
leoafarias merged 1 commit into
mainfrom
leoafarias/discriminated-codec-cleanup

Conversation

@leoafarias
Copy link
Copy Markdown
Collaborator

Summary

  • Remove the discriminated branch encodeOnlyDefaults synthesis path from ObjectSchema.
  • Make DiscriminatedObjectSchema own discriminator injection after branch encoding.
  • Keep encode-time injected discriminators optional inside effective branches so codec branches can omit the discriminator while still rejecting conflicting values.
  • Disable DCM rules that do not fit the current package SDK floor and schema constructor model.

Validation

  • dart format --set-exit-if-changed packages/ack/lib/src/schemas/discriminated_object_schema.dart packages/ack/lib/src/schemas/object_schema.dart packages/ack/lib/src/utils/discriminated_branch_utils.dart
  • dart analyze packages/ack --fatal-infos
  • (cd packages/ack && dart test) - 921 tests passed

Notes

  • dart run melos run analyze --no-select is blocked locally because pubspec.yaml points Melos at .fvm/flutter_sdk, which is not present in this workspace.

@docs-page
Copy link
Copy Markdown

docs-page Bot commented May 29, 2026

To view this pull requests documentation preview, visit the following URL:

docs.page/btwld/ack~114

Documentation is deployed and generated using docs.page.

@leoafarias leoafarias marked this pull request as ready for review May 29, 2026 00:41
@leoafarias leoafarias merged commit 8daaada into main May 29, 2026
1 check passed
@leoafarias leoafarias deleted the leoafarias/discriminated-codec-cleanup branch May 29, 2026 00:43
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