microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.17k stars 28.54k forks source link

[json] Allow (opt-in) 'description' field from JSON schema to behave as 'markdownDescription' #222033

Open mbronk opened 1 month ago

mbronk commented 1 month ago

Context:

VSCode extends JSON Schema with a markdownDescription property, allowing rich formatting in hovers.

Enhancements proposed

  1. Keep the default (description is ASCII), but extend the json.schemas settings property allowing to specify per-schema if the user does want to treat it as if it was markdown. Ex. like so:
    {
        "settings": {
            "json.schemas": [           
                {
                    "fileMatch": [
                        "*-my-file-format.json"                 
                    ],
                    "url": "./my-json-schema.json",
                    "descriptionIsMarkdown": true   //<-- <new> proposed property
                }
            ]
        }
    }
  2. Consider adding a schema extension (ex. descriptionsAreMarkdown top-level property or similar syntax, ex. using $comment), so that a VSCode-aware schema writer can opt-in to this behavior (instead of duplicating description/markdownDescription properties).

References:

aeschli commented 1 month ago

Are there other tools that interpret description as Markdown? I'm afraid that new flag will just add to the confusion.

VSCodeTriageBot commented 1 month ago

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

mbronk commented 1 month ago

Are there other tools that interpret description as Markdown? I'm afraid that new flag will just add to the confusion.

Did not do any thorough research, but for example I use JSON Schema for Humans (pretty popular and quite awesome schema ▶️ HTML doc generator) and it offers this exact option: description_is_markdown.