Skip to content

fix(markdown-template): support concerto-core 4 typing#676

Merged
mttrbrts merged 3 commits into
accordproject:mainfrom
Rishabh060105:Rishabh060105/issue-673-typevisitor-concerto4
May 28, 2026
Merged

fix(markdown-template): support concerto-core 4 typing#676
mttrbrts merged 3 commits into
accordproject:mainfrom
Rishabh060105:Rishabh060105/issue-673-typevisitor-concerto4

Conversation

@Rishabh060105
Copy link
Copy Markdown
Contributor

@Rishabh060105 Rishabh060105 commented May 28, 2026

Closes #673

Fixes markdown-template typing against @accordproject/concerto-core@4.x by removing the direct dependency on property.isPrimitive() in TypeVisitor.

Changes

  • replace direct property.isPrimitive() checks in TypeVisitor with compatibility helpers for primitive detection, enum detection, and fully-qualified type resolution
  • keep the generated lib/TypeVisitor.js output in sync with the source change
  • add a regression test covering template typing when Concerto property objects do not expose isPrimitive(), including primitive, optional, join, and nested object cases

Flags

  • this change is intentionally limited to markdown-template typing behavior for Concerto 4.x compatibility
  • no documentation updates were needed because this is an internal compatibility fix with regression coverage

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 Rishabh060105/issue-673-typevisitor-concerto4

Validation

  • npm test in packages/markdown-template

Signed-off-by: Rishabh Jain <rishabhj2005@gmail.com>
@Rishabh060105
Copy link
Copy Markdown
Contributor Author

Rishabh060105 commented May 28, 2026

Hi @mttrbrts, I’ve pushed a fix for this.

The change removes TypeVisitor’s direct dependency on property.isPrimitive() and replaces it with Concerto 4.x-safe primitive,enum, and type-resolution helpers. I also added a regression test covering primitive, optional, join, and nested object typing.

Validation:

npm test in packages/markdown-template

@mttrbrts
Copy link
Copy Markdown
Member

Thanks for the contribution @Rishabh060105. The original issue looks like a bug in Concerto v4, so I recommend an upstream fix to expose the isPrimitive function on the Property class. That should mean that no change is needed for clients like markdown-transfor .

Signed-off-by: Rishabh Jain <rishabhj2005@gmail.com>
Signed-off-by: Rishabh Jain <rishabhj2005@gmail.com>
@Rishabh060105
Copy link
Copy Markdown
Contributor Author

Rishabh060105 commented May 28, 2026

Hi @mttrbrts, I’ve updated the PR based on your suggestion.

This PR does not expose isPrimitive() in markdown-transform itself. Instead, it now relies on the upstream @accordproject/concerto-core@4.1.3 fix where Property.isPrimitive() is available again, so the local TypeVisitor workaround is no longer needed here.

I also merged the latest main to resolve the dependency and lockfile conflicts, and reran the full test suite successfully with npm test.

@mttrbrts mttrbrts merged commit 5c593b9 into accordproject:main May 28, 2026
9 checks passed
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.

markdown-template TypeVisitor.isPrimitive() incompatible with concerto-core 4.x

2 participants