修复文档不规范格式
This commit is contained in:
@ -130,8 +130,8 @@ type Schema struct {
|
||||
Properties map[string]*Property `json:"properties,omitempty"` // 数据字段 => 数据规则
|
||||
Required []string `json:"required,omitempty"` // 必传属性列表
|
||||
Enum []any `json:"enum,omitempty"` // 枚举值列表
|
||||
Type string `json:"type"` // 类型
|
||||
Ref string `json:"$ref"` // 类型引用
|
||||
Type string `json:"type,omitempty"` // 类型
|
||||
Ref string `json:"$ref,omitempty"` // 类型引用
|
||||
}
|
||||
|
||||
// Property 是从 JSON Schema 提取出来的,但是做了一些调整以适应 OpenAPI Specification。
|
||||
@ -193,10 +193,10 @@ type XML struct {
|
||||
//
|
||||
// Date : 17:17 2024/7/19
|
||||
type RequestBody struct {
|
||||
Required bool `json:"required"` // 指定请求体是不是应该被包含在请求中,默认值是false。
|
||||
Description string `json:"description"` // 对请求体的简要描述,可以包含使用示例,CommonMark syntax可以被用来呈现富文本格式
|
||||
Content map[string]*Media `json:"content"` // content_type => 相应数据描述的映射 必选. 请求体的内容。请求体的属性key是一个媒体类型或者媒体类型范围,值是对应媒体类型的示例数据。对于能匹配多个key的请求,定义更明确的请求会更优先被匹配。比如text/plain会覆盖text/*的定义。
|
||||
Ref string `json:"$ref"` // 一个允许引用规范内部的其他部分或外部规范的对象。 Reference 对象 定义于 JSON Reference 且遵循相同的结构、行为和规则。
|
||||
Required bool `json:"required"` // 指定请求体是不是应该被包含在请求中,默认值是false。
|
||||
Description string `json:"description,omitempty"` // 对请求体的简要描述,可以包含使用示例,CommonMark syntax可以被用来呈现富文本格式
|
||||
Content map[string]*Media `json:"content,omitempty"` // content_type => 相应数据描述的映射 必选. 请求体的内容。请求体的属性key是一个媒体类型或者媒体类型范围,值是对应媒体类型的示例数据。对于能匹配多个key的请求,定义更明确的请求会更优先被匹配。比如text/plain会覆盖text/*的定义。
|
||||
Ref string `json:"$ref,omitempty"` // 一个允许引用规范内部的其他部分或外部规范的对象。 Reference 对象 定义于 JSON Reference 且遵循相同的结构、行为和规则。
|
||||
}
|
||||
|
||||
// Media 本质即为不一样 content_type 对应的数据结构定义
|
||||
|
Reference in New Issue
Block a user