-
Notifications
You must be signed in to change notification settings - Fork 877
feat: Generic API page schema #9267
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
Conversation
Codecov ReportAll modified lines are covered by tests ✅ 📢 Thoughts on this report? Let us know!. |
| /** Code text */ | ||
| code: string; | ||
|
|
||
| /** Code [langauge identifier](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers) */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /** Code [langauge identifier](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers) */ | |
| /** Code [language identifier](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers) */ |
| /** Opaque metadata about the API as HTML data-* attributes */ | ||
| metadata?: { [key: string]: string }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not clear whether the "data-" prefix is part of the key here, or added during the conversion to HTML.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data- is added to key, will adjust the comment to clarify.
| /** Page title */ | ||
| title: string; | ||
|
|
||
| /** Opaque metadata about the page as HTML <meta> tags */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Willl this documentation be parsed as Markdown? If so, <meta> should be quoted or escaped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, properties using markdown formats are explicitly typed as markdown, such as parameters.description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the documentation of the property, not the value of the property.
/** Opaque metadata about the page as HTML `<meta>` tags */because you used Markdown syntax for hyperlinks in the documentation of other properties.
| /** Represents a heading */ | ||
| type Heading = | ||
| | { /** Heading title */ h1: string; /** URL fragment */ id?: string } | ||
| | { /** Heading title */ h2: string; /** URL fragment */ id?: string } | ||
| | { /** Heading title */ h3: string; /** URL fragment */ id?: string } | ||
| | { /** Heading title */ h4: string; /** URL fragment */ id?: string } | ||
| | { /** Heading title */ h5: string; /** URL fragment */ id?: string } | ||
| | { /** Heading title */ h6: string; /** URL fragment */ id?: string }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does "URL fragment" mean it is expected to match the fragment definition in https://www.rfc-editor.org/rfc/rfc3986#section-3.5? I.e. does not include #, and can contain pct-encoded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, renderers are not expected to change this id to match rfc3986, renders MAY encode the id to produce valid HTML.
This PR proposes the draft shape of the
ApiPageschema.#9266