Skip to content

[FEATURE] Ability to jump directly to payload properties via link #536

@JannickKemming1997

Description

@JannickKemming1997

Why do we need this improvement?

For large APIs it can become unwieldy to reference specific payload properties since it's only possible to link to the "Payload" headline. This makes it necessary to scroll (sometimes quite far) to find whatever property one is looking for.

How will this change help?

I suggest turning the property names into links that when opened jump directly to said property. This would prevent the tedious scrolling currently necessary.

Screenshots

Here is an example of a payload section rendered on GitHub.

Before: before

After: after

How could it be implemented/designed?

I suggest wrapping the property name in an a tag to give it an id and a link. To avoid conflicts between different payloads, an index suffix (-0, -1 etc.) could be used. Lastly, it might make sense to do this for headers as well in the name of consistency.

Before:

| (root)| object | - | - | - | **additional properties are allowed** |
| title | string | Title of the article | - | - | - |

After:

| <a id="(root)-0" href="#(root)-0">(root)</a> | object | - | - | - | **additional properties are allowed** |
| <a id="title-0" href="#title-0">title</a> | string | Title of the article | - | - | - |

🚧 Breaking changes

No

👀 Have you checked for similar open issues?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue?

Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions