Skip to content

feat: add codegen support for @BoundAny field generation#660

Merged
david-waltermire merged 1 commit intometaschema-framework:developfrom
david-waltermire:feature/any-codegen
Feb 8, 2026
Merged

feat: add codegen support for @BoundAny field generation#660
david-waltermire merged 1 commit intometaschema-framework:developfrom
david-waltermire:feature/any-codegen

Conversation

@david-waltermire
Copy link
Contributor

@david-waltermire david-waltermire commented Feb 8, 2026

Summary

  • Add AnyInstanceTypeInfoImpl to generate @BoundAny-annotated IAnyContent fields during code generation
  • Update AssemblyDefinitionTypeInfoImpl.processModel() to handle IAnyInstance from assembly definitions
  • Add codegen test verifying generated class structure matches the hand-written AnyAssembly fixture
  • Add Claude rule documenting the full scope of changes required when adding new Metaschema model features

This complements PR #657 which added runtime <any/> support (core model, databind I/O, schemagen) but did not update the code generator. Without this change, generated binding classes for assemblies with <any/> would not capture unmodeled content.

Closes #220

Test plan

  • AnyCodegenTest verifies generated class has @BoundAny field of type IAnyContent with getter/setter
  • All 236 databind tests pass
  • Full CI build (mvn clean install -PCI -Prelease) passes with 0 SpotBugs/Checkstyle violations

Summary by CodeRabbit

  • New Features

    • Code generation now supports assemblies with unmodeled (flexible) content, producing appropriately-typed fields with the needed annotations.
  • Tests

    • Added tests verifying generation of annotated fields and corresponding accessors for flexible-content assemblies.
  • Documentation

    • Added a comprehensive Metaschema feature checklist covering mandatory/conditional areas and verification steps.

Loading
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