Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: CTO format as an optional model description #17 #44

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Marvinrose
Copy link

@Marvinrose Marvinrose commented Mar 17, 2025

This pull request resolves issue #17 by enabling the /templates POST endpoint in the Accord Project Agreement Protocol to accept a CTO string as an optional alternative to a structured model within the templateModel object. The server now parses the cto field into a [email protected] using @accordproject/concerto-core’s ModelManager, enhancing flexibility for users defining template models.

Key changes include:

  • Updated index.ts to parse cto strings in the createTemplate handler, ensuring a fresh ModelManager instance per request and returning the parsed model.

  • Modified openapi.json to include cto as an optional property in the TemplateModel schema.

  • Revised Specification.md and index.md to document the new feature.

  • Testing Postman confirms successful parsing, with the response including the parsed model. This maintains backward compatibility while meeting the requirements.

  • Unit Test: npm test -- tests/create-template.test.ts passes:
    Screenshot (564)

Screenshot (562)
Screenshot (563)
Screenshot (561)

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