gpt4 book ai didi

yaml - swagger 编辑器中的多行字符串

转载 作者:行者123 更新时间:2023-12-05 04:58:18 27 4
gpt4 key购买 nike

如果我将以下规范粘贴到 editor.swagger.io 中:

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

描述在一行中呈现:

first line second line third line

即使 yaml 规范声明 block 样式字符串保留换行符:https://yaml-multiline.info/

如何在 swagger 编辑器中使用多行字符串?

最佳答案

您可以使用下面提到的解决方案之一来获得 multiline in swagger。

解决方案一:

description: |
first line \
second line \
third line

enter image description here

解决方案 2:

description: |
first line <br>
second line <br>
third line

enter image description here

关于yaml - swagger 编辑器中的多行字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64085227/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com