如何解决swagger编辑器中的多行字符串
如果我将以下规范粘贴到editor.swagger.io中:
expected 'Search results for featured calc when logged out'
to include 'Search results for featured calc when logged out'
描述在一行上呈现:
openapi: 3.0.0
info:
title: Callback Example
version: 1.0.0
paths:
/streams:
post:
description: |
first line
second line
third line
responses:
'201':
description: subscription successfully created
content:
application/json:
schema:
description: subscription information
required:
- subscriptionId
properties:
subscriptionId:
description: this unique identifier allows management of the subscription
type: string
example: 2531329f-fb09-4ef7-887e-84e648214436
即使yaml规范指出,块样式字符串保留换行符:https://yaml-multiline.info/
如何在swagger编辑器中使用多行字符串?
解决方法
您可以尝试通过以下方式使用 br 标签:
description: |
First line. <br> Second line.<br> Third line
或者这也有效:
description: First line. <br> Second line.<br> Third line
,
您可以使用下面提到的解决方案之一来大摇大摆地获得多行。
解决方案 1:
description: |
first line \
second line \
third line
解决方案 2:
description: |
first line <br>
second line <br>
third line
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。