Documentation
¶
Overview ¶
NOTE:
This package primarily exists for Wave's JSON schema generation. It does not -- and probably won't ever -- cover the entire JSON schema spec (or anywhere near it).
Buyer beware.
Index ¶
- Constants
- func UniqueFrom(strs ...string) string
- type Def
- type Entry
- func ObjectWithOverride(override string, sd Def) Entry
- func OptionalArray(sd Def) Entry
- func OptionalBoolean(sd Def) Entry
- func OptionalNumber(sd Def) Entry
- func OptionalObject(sd Def) Entry
- func OptionalString(sd Def) Entry
- func RequiredArray(sd Def) Entry
- func RequiredBoolean(sd Def) Entry
- func RequiredObject(sd Def) Entry
- func RequiredString(sd Def) Entry
- func ToJSONSchema(sd Def) Entry
- type IfThen
Constants ¶
View Source
const ( TypeObject = "object" TypeString = "string" TypeBoolean = "boolean" TypeArray = "array" TypeNumber = "number" )
Variables ¶
This section is empty.
Functions ¶
func UniqueFrom ¶
Types ¶
type Entry ¶
type Entry struct {
Schema string `json:"$schema,omitempty"`
Type string `json:"type"`
Description string `json:"description,omitempty"`
Default any `json:"default,omitempty"`
Required []string `json:"required,omitempty"`
AllOf []any `json:"allOf,omitempty"`
Properties any `json:"properties,omitempty"`
Items any `json:"items,omitempty"`
Enum []string `json:"enum,omitempty"`
Examples []string `json:"examples,omitempty"`
}
func ObjectWithOverride ¶
func OptionalArray ¶
func OptionalBoolean ¶
func OptionalNumber ¶
func OptionalObject ¶
func OptionalString ¶
func RequiredArray ¶
func RequiredBoolean ¶
func RequiredObject ¶
func RequiredString ¶
func ToJSONSchema ¶
Click to show internal directories.
Click to hide internal directories.