# Functions
No description provided by the author
No description provided by the author
MarkdownGoObject 将 Go 对象转换为 markdown 表示方式
对于结构类型会自动展开。
如果 v 的字段包含 [CommentTag] 的标签内容,会尝试装将其本地化并作为注释放在字段之后。
t 需要转换的类型; m 在此表中的类型会直接转换为键值表示的类型,而不是真实的类型。.
MarkdownProblems 将 problems 的内容生成为 markdown
titleLevel 标题的级别,0-6: 如果取值为 0,表示以列表的形式输出,并忽略 detail 字段的内容。 1-6 表示输出 detail 内容,并且将 type 和 title 作为标题;.
New 声明 [Document] 对象
title 文档的标题;.
NewSchema 根据 v 生成 [Schema] 对象
如果 v 不是空值,那么 v 也将同时作为默认值出现在 [Schema] 中。.
No description provided by the author
WithCallback 预定义回调对象.
WithContact 添加联系信息
NOTE: 多次调用会相互覆盖.
WithCookie 向 components/parameters 添加对象
p 要求必须指定 Ref.Ref。其它接口可以通过 problem 引用此对象。
global 是否将该对象默认应用在所有的接口上;
NOTE: 多次调用会依次添加.
WithDescription 指定描述信息
summary 指定的是 openapi.info.summary 属性; description 指定的是 openapi.info.description 属性;
NOTE: 多次调用会相互覆盖.
WithExternalDocs 指定扩展文档
NOTE: 多次调用会相互覆盖.
WithHeader 向 components/headers 添加对象
p 要求必须指定 Ref.Ref,其它接口可以通过 Ref 引用该对象。 global 是否将该对象默认应用在所有的接口上;
NOTE: 多次调用会依次添加.
WithHeadMethod 是否生成 HEAD 接口请求.
WithHTML 指定 HTML 模板
这将开启 [Document.Handler] 对 [html.Mimetype] 类型的支持。 此选项仅是定义了 [Document.Handler] 输出的一些内容, 还需要向 [github.com/issue9/web/mimetype/html] 添加模板。
tpl 表示 HTML 模板名称,该模板由 [html.Install] 注册; assets 资源基地址,apidoc 的浏览工具一般都是在一个 html 文件中引入一些依赖文件, assets 就是这些依赖文件的基地址,可是指向一个 CDN 的地址,比如 swagger 的 https://unpkg.com/[email protected]; logo LOGO 图标,可能还会被用于 favicon 等功能,请确保格式能被正确处理,可以为空;
NOTE: [github.com/issue9/webuse/openapi] 下实现了部分简单的模板。.
WithLicense 添加版权信息
NOTE: 多次调用会相互覆盖.
WithMediaType 指定所有接口可用的媒体类型
t 用于指定支持的媒体类型,必须是 [web.Server] 实例支持的类型。
NOTE: 多次调用会依次添加,相同值会合并。.
WithOptions 合并多个 [Option] 为一个.
WithOptionsMethod 是否生成 OPTIONS 请求.
WithPath 向 components/parameters 添加 InPath 的对象
p 要求必须指定 Ref.Ref。其它接口可以通过 ref 引用此对象。
NOTE: 多次调用会依次添加.
PresetOptions 提供 [web.Problem] 的 [Response] 对象并应用所有接口的 4XX 和 5XX 状态码.
WithQuery 向 components/parameters 添加 InQuery 的对象
p 要求必须指定 Ref.Ref。其它接口可以通过 ref 引用此对象。
NOTE: 多次调用会依次添加.
WithResponse 向 components/responses 添加对象
一般用于指定非正常状态的返回对象,比如 400 状态码的对象。
resp 返回对象,需要指定 resp.Ref.Ref,其它接口可以通过 Ref 引用该对象; status: 状态码,可以是 4XX 的形式,如果该值不为空,那么将当前对象以此状态码应用到所有的接口, 否则仅仅是写入 components/responses,后续需要用户手动引用;
NOTE: 多次调用会依次添加.
WithSecurityScheme 指定验证方案
s 需要添加的验证方案; scope 如果指定了该值,那么会以 s.ID 为名称,scope 为值添加至 openapi.security, 如果仅需要添加至 components 中,则需要将 scope 指定为 Nil。 scope 如果是多个参数,每个参数应该都是不同的;
NOTE: 多次调用会依次添加.
WithServer 添加 openapi.servers 变量.
WithTag 添加标签
name 标签名称; desc 标签描述; extDocURL 扩展文档的地址; extDocDesc 扩展文档的描述;
NOTE: 多次调用会依次添加.
WithTerms 服务条款的连接
NOTE: 多次调用会相互覆盖.
# Constants
CommentTag 可提取翻译内容的结构体标签名称.
文档中表示没有返回对象在 components/responses 中的引用值.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Version 支持的 openapi 版本.
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Interfaces
OpenAPISchema 自定义某个类型在 openapi 文档中的类型.
# Type aliases
No description provided by the author