swagger - 是否可以使用 apispec 跟踪内部/私人文档?
问题描述
我正在使用 Flask 服务器并正在考虑使用 apispec 对其进行记录。问题是一些函数有内部注释或私人信息,例如开发者电子邮件、TODO 注释等。
是否可以将这些与 apispec 的 yaml 一起干净地包含在函数文档字符串中?
下面是一个玩具示例:
@app.route("/api/user/forgot-password", methods=["POST"])
def forgot_password():
"""
This API returns stuff.
---
post:
tags:
- user
parameters:
- name: comments
in: body
description: >-
Include comments.
default: true
required: false
schema:
type: boolean
responses:
'200':
description: Null response
content:
application/json:
schema:
type: object
"""
# Internal/original docstring
"""
TODO: etc.
Author: Author --<email@eyenuk.com>
Created: 6/28/2018 4:53:29 PM
解决方案
推荐阅读
- javascript - 模仿div中的textarea
- c# - 在模型状态验证 ASP.NET MVC 之前更改模型
- android - 返回按钮 - Android 工作室
- java - RandomAccess 基本上是什么?为什么我们使用 RandomAccess?
- php - preg_replace 不能按预期使用数字字符串数据
- angular - firebase Facebook oAuth addScope()
- ssl - Sqoop - 使用 ssl 连接到 DB2 时出错
- r - 堆叠 ggplot 对象而不重复构面名称
- ruby-on-rails - scss中的资产路径
- android - 调用 Firebase Firestore object.collection 后应用程序崩溃 无法添加 firebase firestore 集合