Open
Description
SwaggerUI version (maven): 3.17.1
When I add a model to my requestBody, then it shows that model in SwaggerUI.
swagger.yaml
openapi: 3.0.0
info:
title: my title
description: my description
version: 0.0.1
components:
schemas:
OrderRequest:
type: object
properties:
id:
type: string
example:
id: "123456"
paths:
/order:
post:
summary: get my order
tags:
- routes
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/OrderRequest'
As seen in the screenshot below:
However, If I move my model out to a separate file (as done below):
swagger.yaml (OrderRequest extract out)
openapi: 3.0.0
info:
title: my title
description: my description
version: 0.0.1
components:
schemas:
OrderRequest:
$ref: ./models/order_request.yaml
paths:
/order:
post:
summary: get my order
tags:
- routes
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/OrderRequest'
models/order_request.yaml
type: object
properties:
id:
type: string
example:
id: "123456"
...then model title is not shown in the requestBody. Does anyone know why that is and what I can do to make it appear?
Screenshot
Notice that under the requestBody section, it shows the object, but doesn't label it as "OrderRequest"
Thanks in advanced.