fix: remove strict mode and add serializer options for concerto v4#137
Open
rockaxorb13 wants to merge 1 commit intoaccordproject:mainfrom
Open
fix: remove strict mode and add serializer options for concerto v4#137rockaxorb13 wants to merge 1 commit intoaccordproject:mainfrom
rockaxorb13 wants to merge 1 commit intoaccordproject:mainfrom
Conversation
Signed-off-by: Aadityavardhan Singh <singhrashmi018@gmail.com>
Contributor
There was a problem hiding this comment.
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 }fromModelManagerinstantiations (tests + interpreter internal validation helpers). - Update
Serializer.fromJSON(...)call sites to pass an explicitSerializerOptionsobject. - 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,{}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.