Skip to content

fix: property validation via serde flatten (partial #4)#7

Open
vyuan2037 wants to merge 5 commits into
accordproject:mainfrom
vyuan2037:fix/property-validation
Open

fix: property validation via serde flatten (partial #4)#7
vyuan2037 wants to merge 5 commits into
accordproject:mainfrom
vyuan2037:fix/property-validation

Conversation

@vyuan2037
Copy link
Copy Markdown
Contributor

@vyuan2037 vyuan2037 commented Mar 15, 2026

Partial fix for #4

Changes

  • Use #[serde(flatten)] on Declaration to preserve type-specific fields (properties, isAbstract, superType) during JSON deserialization
  • Add get_properties() helper on Declaration, remove hardcoded find_properties_for_declaration() workaround
  • Validate properties in all concept-like declarations (Concept, Asset, Participant, Transaction, Event)
  • Validate scalar bounds: integer range ordering, string length non-negative and minLength ≤ maxLength
  • Detect duplicate decorator names on declarations

Flags

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/property-validation

Signed-off-by: vyuan2037 <vyuan2037@users.noreply.github.com>
Signed-off-by: vyuan2037 <vyuan2037@users.noreply.github.com>
Comment thread src/metamodel/concerto_metamodel_1_0_0.rs
Signed-off-by: vyuan2037 <vyuan2037@users.noreply.github.com>
Signed-off-by: vyuan2037 <vyuan2037@users.noreply.github.com>
Signed-off-by: vyuan2037 <vyuan2037@users.noreply.github.com>
@vyuan2037 vyuan2037 marked this pull request as ready for review March 20, 2026 17:38
@vyuan2037 vyuan2037 requested a review from ekarademir March 20, 2026 17:38
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.

2 participants