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

description conversion to comments may break if not escaped #166

Open
dweinstein opened this issue Jun 6, 2018 · 0 comments
Open

description conversion to comments may break if not escaped #166

dweinstein opened this issue Jun 6, 2018 · 0 comments

Comments

@dweinstein
Copy link

dweinstein commented Jun 6, 2018

{
    "type": "object",
    "description": "thing",
    "properties": {
      "oops": {
        "type": "object",
        "description": "oops I did it again */"
      }
    },
    "minProperties": 1,
    "additionalProperties": false
}

Because the description is directly converted to a javascript comment inside a /** */ the */ in the JSON description causes an early termination of the comment and breaks the conversion, causing an error like:

± ./node_modules/.bin/json2ts /tmp/test.json        Property or signature expected. (13:2)
  11 | /**
  12 |  * oops I did it again */
> 13 |  */
     |  ^
  14 | oops?: {
  15 | [k: string]: any
  16 | }% 

version

± ./node_modules/.bin/json2ts --help

json-schema-to-typescript 5.5.0
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants