我想记录和测试一个 API,它在http://editor.swagger.io/中使用基于 Cookie 的身份验证。举个简单的例子:如何在下面的 YAML 中编写 /login 操作创建一个 Cookie 并且 Cookie 必须传递给 /showMySecretStuff?
swagger: '2.0'
info:
title: Test API
version: '1'
host: my.test.com
schemes:
- https
basePath: /
consumes:
- multipart/form-data
produces:
- application/json
paths:
/login:
post:
parameters:
- name: username
in: formData
required: true
type: string
- name: password
in: formData
required: true
type: string
default: secret
responses:
200:
description: OK
/showMySecretStuff:
get:
responses:
200:
description: OK