Tôi muốn tài liệu và kiểm tra API, sử dụng tính năng xác thực dựa trên cookie trong http://editor.swagger.io/. Để đưa ra một ví dụ đơn giản: Làm thế nào để viết trong YAML sau, hành động/login đó tạo ra một Cookie và Cookie phải được chuyển đến/showMySecretStuff?Cách sử dụng Cookie trong trình chỉnh sửa Swagger
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