Skip to content

fix(rust): add serde flatten for subclass field preservation#205

Closed
vyuan2037 wants to merge 1 commit into
accordproject:mainfrom
vyuan2037:fix/rust-serde-flatten
Closed

fix(rust): add serde flatten for subclass field preservation#205
vyuan2037 wants to merge 1 commit into
accordproject:mainfrom
vyuan2037:fix/rust-serde-flatten

Conversation

@vyuan2037
Copy link
Copy Markdown

Related to accordproject/concerto-rust#4

Changes

  • Add #[serde(flatten)] with catch-all extra field to Rust codegen for base types that have subclasses (Declaration, Property, ConceptDeclaration, etc.)
  • When deserializing Concerto JSON AST, parent structs now preserve child-specific fields instead of silently dropping them
  • Add serde_json and HashMap imports when base types are present in the generated output

Flags

  • Cross-repo change: the generated concerto_metamodel_1_0_0.rs in concerto-rust is produced by this codegen. A companion PR in concerto-rust will use the updated output.
  • All 569 existing tests pass, snapshot updated automatically

Screenshots or Video

N/A

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.
  • Vital features and changes captured in unit and/or integration tests
  • Commits messages follow AP format
  • Extend the documentation, if necessary
  • Merging to main from vyuan2037:fix/rust-serde-flatten

…ation

Signed-off-by: vyuan2037 <vyuan2037@users.noreply.github.com>
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