OAS:
openapi: 3.0.0
info:
title: User Management API
version: 1.0.0
servers:
- url: http://localhost:8080/api
paths:
/users:
get:
summary: "Find all existing users"
operationId: findAll
responses:
'200':
description: "Users found. Response: List<User>"
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
...
Checking SwaggerUI, I noticed the description is just
Users found. Response: List
when it should be
Users found. Response: List<User>
How do I escape the angle brackets?
OpenAPI allows for Markdown in the
descriptionfield. Relevant part of the specification:Markdown allows for inline HTML tags, as described in the CommonMark spec:
<User>looks like an inline HTML tag. Therefore when showing the description, it is not rendered as text, but ignored because it's an invalid HTML tag.The solution is to write
List<User>.