vlingo / xoom-schemata

The VLINGO XOOM Schema Registry.
https://vlingo.io
Mozilla Public License 2.0
17 stars 9 forks source link

Sanitize descriptions in code generator #47

Open wwerner opened 5 years ago

wwerner commented 5 years ago

Currently, both the editor and the display support markdown formatting. As (I think) the description will be rendered into the generated code's comments, we need to make sure that this does not break the target syntax.

This is also true for arbitrary comments.

VaughnVernon commented 5 years ago

@wwerner Do you mean using AJAX to compile check on perhaps line-by-line changes?

wwerner commented 5 years ago

No, I thought we'd check validity/escape/sanitize content on the server side when the user saves content, as the request can come from our UI as well as from some other API client.

We could additionally hook into Monaco Editor's highlighting to show invalid content.

Just for traceability: Referring to https://github.com/vlingo/vlingo-schemata/issues/35#issuecomment-533789928, I was under the impression that the Description in SchemaVersion would be part of the sources generated from the Specification, probably in the comments.

VaughnVernon commented 5 years ago

@wwerner Ah, ok, good point. Let's do generate comments for the (sanitized) description.