-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathopenapi.go
27 lines (22 loc) · 853 Bytes
/
openapi.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package llm
type OpenAPIType string
const (
OpenAPITypeString OpenAPIType = "string"
OpenAPITypeNumber OpenAPIType = "number"
OpenAPITypeInteger OpenAPIType = "integer"
OpenAPITypeBoolean OpenAPIType = "boolean"
OpenAPITypeArray OpenAPIType = "array"
OpenAPITypeObject OpenAPIType = "object"
)
type Schema struct {
Type OpenAPIType `json:"type"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Properties map[string]*Schema `json:"properties,omitempty"`
Items *Schema `json:"items,omitempty"`
Required []string `json:"required,omitempty"`
Nullable bool `json:"nullable,omitempty"`
Format string `json:"format,omitempty"`
Enum []interface{} `json:"enum,omitempty"`
Default interface{} `json:"default,omitempty"`
}