小编muy*_*ya_的帖子

设置 Ansible 模板模块的备份日期格式

使用该选项时,如何更改 Ansible 模板模块创建的文件的日期格式backup

例如,命令:

template: src=supervisord.conf.j2 dest=/etc/supervisor/supervisord.conf backup=yes

创建备份文件:supervisord.conf.2015-08-24@12:17~

我希望它是这样的:supervisord.conf.20150824_1217

ansible

5
推荐指数
1
解决办法
3615
查看次数

如何使用数组为 application/x-www-form-urlencoded 请求定义 Swagger

我有一个API,其curl请求如下:

curl --request POST \
  --url 'http://some.url/api/Resource/findByIds' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data 'data[ids][]=100025' \
  --data 'data[ids][]=100028'
Run Code Online (Sandbox Code Playgroud)

如何在 OpenAPI (Swagger) 请求定义和示例(版本 3)中表示这一点?

这是我到目前为止所拥有的,但我似乎无法让示例正确显示。

    api/Resource/findByIds:
      post:
        summary: Find resource by IDs
        requestBody:
          content:
            application/x-www-form-urlencoded:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      ids:
                        type: array
                        description: IDs of resources to fetch
                        items:
                          type: integer
                encoding:
                  data:
                    style: deepObject
                    explode: true
              example:
                data:
                  ids: [2334, 234, 20043]
Run Code Online (Sandbox Code Playgroud)

swagger openapi x-www-form-urlencoded

5
推荐指数
0
解决办法
1962
查看次数

标签 统计

ansible ×1

openapi ×1

swagger ×1

x-www-form-urlencoded ×1