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

Inline Documentation support #128

Open
Profpatsch opened this issue May 11, 2021 · 4 comments
Open

Inline Documentation support #128

Profpatsch opened this issue May 11, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@Profpatsch
Copy link

It would be cool if the mode could display documentation of the fields when hovering over keys, or looking at intellisense completions.

@ak1394
Copy link
Collaborator

ak1394 commented May 11, 2021

Hi @Profpatsch ! Are you talking about editing YAML files? Where it shows "Validation schema for OpenAPI ..."?

@Profpatsch
Copy link
Author

Yes! Exactly. I’d expect some documentation about the field at that point.

@ak1394
Copy link
Collaborator

ak1394 commented May 14, 2021

These text in these hovers comes from OpenAPI JSON schema we use for validation. Unfortunately, the official schema does not come with the "description" fields for every property defined in schema.

We'll look into adding descriptions to the schema, but it probably will take some time.

@ak1394 ak1394 added the enhancement New feature or request label May 14, 2021
@duncanbeevers
Copy link

duncanbeevers commented Jul 8, 2023

I poked at this for a little while today, and encountered promising behavior.

  • VSCode Tooltips are driven by the title property, not description both title and description field values.
  • Embedding \n\n is unsightly, and is unlikely to be accepted upstream
  • The Specification documentation is fairly well-structured
diff --git a/schema/openapi-3.0-2019-04-02.json b/schema/openapi-3.0-2019-04-02.json
index a36d749..3eb3f61 100644
--- a/schema/openapi-3.0-2019-04-02.json
+++ b/schema/openapi-3.0-2019-04-02.json
@@ -66,6 +66,7 @@
     },
     "Info": {
       "type": "object",
+      "title": "InfoObject\n\nThe object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.",
       "required": [
         "title",
         "version"
image

🥦 Generate title fields

Since the specification is fairly well-structured, it may be possible to extract some documentation from there and use it to augment the schema documents in this plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants