Skip to content

fix: remove strict mode and add serializer options for concerto v4#137

Open
rockaxorb13 wants to merge 1 commit intoaccordproject:mainfrom
rockaxorb13:fix/v4-api-updates
Open

fix: remove strict mode and add serializer options for concerto v4#137
rockaxorb13 wants to merge 1 commit intoaccordproject:mainfrom
rockaxorb13:fix/v4-api-updates

Conversation

@rockaxorb13
Copy link
Copy Markdown
Contributor

fixes #136

This PR fixes the first and second problems listed in #136, as directed by @mttrbrts, these changes did not break the v3 build and as per my understanding, the strict : true parameter for modelManager was mostly redundant.

For the serializer API changes I updated Serializer.fromJSON() calls, adding an option:
({ validate: true, acceptResourcesForRelationships: false });
This satisfies v3's strict TypeScript requirements for the SerializerOptions interface while preparing the calls for v4's updated signature where these options are made optional.

Updated snapshots to adjust these changes.

Signed-off-by: Aadityavardhan Singh <singhrashmi018@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates template-engine to better align with Concerto v4 API changes by removing deprecated ModelManager strict-mode usage and adding explicit serializer option objects to relevant deserialization calls.

Changes:

  • Remove { strict: true } from ModelManager instantiations (tests + interpreter internal validation helpers).
  • Update Serializer.fromJSON(...) call sites to pass an explicit SerializerOptions object.
  • Update Jest snapshots to match the new diagnostics output.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/TemplateMarkInterpreter.ts Removes ModelManager strict mode and adds serializer options for validation/deserialization.
test/TemplateMarkInterpreter.test.ts Removes strict mode from ModelManager in interpreter integration tests.
test/HelloWorld.test.ts Removes strict mode from ModelManager in hello-world test setup.
test/GenerateOptions.test.ts Removes strict mode from ModelManager in generation options tests.
test/CustomTemplateModel.test.ts Removes strict mode from ModelManager in custom model test setup.
test/__snapshots__/TemplateMarkInterpreter.test.ts.snap Snapshot updates reflecting changed error locations/output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -688,7 +688,7 @@ export class TemplateMarkInterpreter {
async generate(templateMark: object, data: TemplateData, options?: GenerationOptions): Promise<any> {
const factory = new Factory(this.modelManager);
const serializer = new Serializer(factory, this.modelManager);
modelManager.addCTOModel(TemplateMarkModel.MODEL, 'templatemark.cto');
const factory = new Factory(modelManager);
const serializer = new Serializer(factory, modelManager);
const serializer = new Serializer(factory, modelManager,{});
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.

Breaking changes for Concerto V4 compatibility and hardening

2 participants