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

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

Open
KristianMunsche opened this issue Oct 4, 2024 · 0 comments
Open

Comments

@KristianMunsche
Copy link

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!

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

No branches or pull requests

1 participant