Documentation ¶
Overview ¶
Package schema 将 ast 转换铖 openapi 的 schema 对象
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema 管理 Schema 的查询
func (*Schema) New ¶
func (s *Schema) New(ctx context.Context, t *openapi.OpenAPI, typePath string, q bool) (*openapi3.SchemaRef, error)
New 根据类型名称 typePath 生成 SchemaRef 对象
typePath 表示需要查找的类型名,一般格式为 [path.]name,path 为包的路径,name 为类型名。 如果是内置类型可省略 path 部分。 如果 typePath 以 #components/schemas 开头,则从 t.Components.Schemas 下查找。 q 是否用于查询参数,如果是查询参数,那么字段名的获取将采用 json。
可能返回的错误值为 Error
Click to show internal directories.
Click to hide internal directories.