Closed Gama11 closed 5 years ago
I think this and #60 will requires the use of some function given to JsonSchemaWriter that allow some kind of customization of the schema object while staying within the spec.
With the latest commits, we've added the possibility to generate schema that differ a bit from the spec.
We've added json2object.utils.special.VSCodeSchemaWriter
.
For your example it generates the following description
"markdownDescription": "This is a list:\n- a\n- 1\n- 2\n- b\n- c"
This is still not quite correct, the nesting of the list / leading whitespace is removed. Current result is:
"This is a list:\n- a\n- 1\n- 2\n- b\n- c"
But there should be tabs before -1
and -2
:
"This is a list:\n- a\n - 1\n - 2\n- b\n- c"
Are extra tabulation on all lines but the first one a problem ?
Haxe return this string for your example:
This is a list:\n\t\t- a\n\t\t\t- 1\n\t\t\t- 2\n\t\t- b\n\t\t- c
Would this display correctly or should I remove extra tabulation if all lines but the first have some ?
Well, what should be removed is the indentation, which is two tab characters per line in this case. Anything after that belongs to the "content" of the doc comment.
This should be fixed with 00d1dde2287ca0d00cee8927976d22b8b0b0662f.
Great, looks like markdown lists are working now. 👍
This is valid markdown:
However, all newlines are removed from the generated schema, breaking the list formatting:
json2object 3.6.2