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

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

Closed
mbronk opened this issue Jul 18, 2024 · 5 comments
Assignees
Labels
feature-request Request for new features or functionality json JSON support issues

Comments

@mbronk
Copy link

mbronk commented Jul 18, 2024

Context:

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

  • Separation of the raw description (ASCII-only) from Markdown-enriched markdownDescription is a good default practice, promoting toolset interoperability.
    JSON Schema specification is vague on the subject though. While plaintext is probably recommended, the specification wording:

    9.1. "title" and "description"
    The value of both of these keywords MUST be a string.

    does not necessarily specify whether rich formatting of description is not allowed (Markdown is a string after all).

  • I work with schema files which are not VSCode-aware (I just happen to use VSCode as the JSON editor). These schemas do use Markdown for the primary description field.
    Would like these descriptions to render using rich formatting.
    While I could do a post-process of the file through jq and replace description --> markdownDescription, this doesn't scale well on updates and is cumbersome to work with.

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
Copy link
Contributor

aeschli commented Jul 19, 2024

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

@aeschli aeschli added feature-request Request for new features or functionality json JSON support issues labels Jul 19, 2024
@aeschli aeschli added this to the Backlog Candidates milestone Jul 19, 2024
@vscodenpa
Copy link

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
Copy link
Author

mbronk commented Jul 19, 2024

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.

Copy link

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Copy link

🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vs-code-engineering vs-code-engineering bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality json JSON support issues
Projects
None yet
Development

No branches or pull requests

3 participants