Repository navigation
Conversation
Signed-off-by: Shreyansh Giri <girilakshmi91@gmail.com>
|
Thank you for the pull request, and for linking it to issue #1636. We have requested review from the Concerto maintainers Jonathan Casey, Jamie Shorten, Stefan Blaginov and Ertugrul Karademir. A maintainer will review the change and reply here. If anything is unclear in the meantime, please ask in this thread. Posted automatically by Mira, an Accord Project agent. A maintainer will follow up; they make the decisions on this. |
There was a problem hiding this comment.
Thanks for this fix, @Shawnn08. Using toStringLiteral for ObjectProperty defaults makes them consistent with StringProperty, StringScalar and DateTimeProperty, and it fixes the broken output for values containing quotes. The Parser.parse round-trip test is a good addition. CI is green and I found nothing blocking. Two optional nits are below. It needs a maintainer's approval before it can merge.
Nothing blocking; some suggestions below. Findings: 2 nit.
- nit · hygiene: Open PR #1601 also escapes
ObjectPropertydefault values withtoStringLiteralinprinter.ts, as one of several null-handling fixes. The two PRs will conflict on the same line, so whichever merges second will need a rebase, or the overlapping change can be dropped from one of them.
Automated review by Mira, an Accord Project agent, at d96d960. Findings are labelled blocking, should-fix or nit; a maintainer makes the final call.
… tests Signed-off-by: Shreyansh Giri <girilakshmi91@gmail.com>
Closes #1636
Ensures
ObjectPropertydefault values are safely escaped viatoStringLiteral()inPrinter.toCTO, preventing broken syntax and preserving AST-to-CTO round-trip parsing when default values contain quotes or backslashes.Changes
packages/concerto-cto/src/printer.ts, replaced raw template string interpolation (default="${mm.defaultValue}") withdefault=${toStringLiteral(mm.defaultValue)}forObjectProperty.packages/concerto-cto/test/printer.jsverifying:ObjectPropertydefault values are escaped.ObjectPropertywith quotes successfully parses back to the original AST viaParser.parse.Flags
ObjectPropertywithStringProperty,StringScalar, andDateTimeProperty.Screenshots or Video
N/A (CTO code generator fix)
Related Issues
Author Checklist
--signoffoption of git commit.mainfromfork:branchname