Documentation
¶
Index ¶
- Variables
- func Hydrate(ctx context.Context, anyVal interface{}, cwd string, ...) (interface{}, error)
- func Loader(path string) gojsonschema.JSONLoader
- func Validate(schemaPath string, documentPath string) (*gojsonschema.Result, error)
- func WriteDereferencedSchema(schemaFilePath string, outFile io.Writer, c *client.MassdriverClient) error
- type Example
- type GenerateAuthFile
- type PropertiesMap
- type Property
- type RefdSchema
- type Schema
Constants ¶
This section is empty.
Variables ¶
View Source
var Object = "object"
Functions ¶
func Loader ¶
func Loader(path string) gojsonschema.JSONLoader
Load a JSON Schema with or without a path prefix
func Validate ¶
func Validate(schemaPath string, documentPath string) (*gojsonschema.Result, error)
Validate the input object against the schema
func WriteDereferencedSchema ¶
Types ¶
type Example ¶ added in v0.4.4
func (*Example) UnmarshalJSON ¶ added in v0.4.4
type GenerateAuthFile ¶
type PropertiesMap ¶
PropertiesMap is a named map of Property
type Property ¶
type Property struct {
AdditionalProperties bool `json:"additionalProperties"`
Type string `json:"type"`
Items *Property `json:"items"`
Properties PropertiesMap `json:"properties,omitempty"`
Default interface{} `json:"default,omitempty"`
GenerateAuthFile *GenerateAuthFile `json:"md.generateAuthFile,omitempty"`
Minimum *float64 `json:"minimum,omitempty"`
}
Property is a single JSON Schema property field
type RefdSchema ¶
type RefdSchema struct {
SchemaID string
Definition interface{}
}
A RefdSchema is a JSON Schema that may contain $ref
func (*RefdSchema) Type ¶
func (r *RefdSchema) Type() string
type Schema ¶
type Schema struct {
Properties PropertiesMap `json:"properties"`
Required []string `json:"required,omitempty"`
Examples []Example `json:"examples,omitempty"`
Type string `json:"type,omitempty"`
}
Schema is a flimsy representation of a JSON Schema. It provides just enough structure to get type information.
func GetJSONSchema ¶
Click to show internal directories.
Click to hide internal directories.