Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Feature Request: Support Markdown/HTML markup in API descriptions #457

@KristianMunsche

Description

@KristianMunsche

Description

Currently, trpc-openapi does not seem to support Markdown or HTML markup in API descriptions. This limits the ability to create rich, formatted documentation directly within the OpenAPI specification. Adding support for markup would greatly enhance the readability and usability of the generated API documentation.

Use Case

As an API developer, I want to include formatted text, links, and basic styling in my API descriptions. This would allow me to:

  • Create more readable and structured API overviews
  • Include clickable links to related documentation or resources
  • Highlight important information using basic text formatting

Proposed Solution

Implement support for CommonMark syntax (or a subset of it) in API descriptions. This could include:

  • Headers (# for h1, ## for h2, etc.)
  • Links (text)
  • Basic text formatting (italic, bold)
  • Lists (bulleted and numbered)

Alternatively, support a subset of HTML tags for formatting if Markdown is not feasible.

Current Workaround

Currently, descriptions are limited to plain text, which significantly reduces the ability to create clear, structured documentation within the OpenAPI spec itself.

Additional Context

Many other OpenAPI tools and viewers (such as Swagger UI) support Markdown in descriptions. Adding this feature would bring trpc-openapi in line with common practices in the API documentation space.

Potential Implementation

This could potentially be implemented by:

  1. Parsing Markdown/HTML in description fields during OpenAPI document generation
  2. Ensuring that the parsed content is properly escaped and formatted in the resulting OpenAPI JSON/YAML

Impact

This feature would significantly improve the quality and usability of API documentation generated through trpc-openapi, enhancing the developer experience for API consumers.

Thank you for considering this feature request!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions