6
我想记录和测试一个API,它使用http://editor.swagger.io/中的基于Cookie的认证。举一个简单的例子:如何在下面的YAML中写入/ login动作创建一个Cookie并且Cookie必须传递给/ showMySecretStuff?如何在Swagger编辑器中使用Cookie
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