Documentation
¶
Index ¶
- func BindSchemaValidationByValidateBytes(s *jsonschema.Schema, typ typesutil.Type, validateBytes []byte) error
- func BindSchemaValidationByValidator(s *jsonschema.Schema, v validator.Validator)
- func PropSchemaFromStructField(ctx context.Context, field typesutil.StructField, required bool) *jsonschema.Schema
- func Register(key string, getter OpenAPISchemaGetter)
- func SchemaFrom(v interface{}, optionFns ...SchemaFromOptFn) (s *jsonschema.Schema)
- func SchemaFromType(ctx context.Context, t typesutil.Type, def bool) (s *jsonschema.Schema)
- func WithDocGetter(ctx context.Context, docGetter DocGetter) context.Context
- type Definitions
- type DocGetter
- type OpenAPISchemaFormatGetter
- type OpenAPISchemaGetter
- type OpenAPISchemaTypeGetter
- type SchemaFromOptFn
- type TypeName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindSchemaValidationByValidator ¶
func BindSchemaValidationByValidator(s *jsonschema.Schema, v validator.Validator)
func PropSchemaFromStructField ¶
func PropSchemaFromStructField(ctx context.Context, field typesutil.StructField, required bool) *jsonschema.Schema
func Register ¶
func Register(key string, getter OpenAPISchemaGetter)
func SchemaFrom ¶
func SchemaFrom(v interface{}, optionFns ...SchemaFromOptFn) (s *jsonschema.Schema)
func SchemaFromType ¶
Types ¶
type Definitions ¶
type Definitions map[string]OpenAPISchemaGetter
func (Definitions) Ref ¶
func (Definitions) Ref(key string) jsonschema.Refer
type DocGetter ¶
func DocGetterFromContext ¶
type OpenAPISchemaFormatGetter ¶
type OpenAPISchemaFormatGetter interface {
OpenAPISchemaFormat() string
}
type OpenAPISchemaGetter ¶
type OpenAPISchemaGetter interface {
OpenAPISchema(ref func(t string) jsonschema.Refer) *jsonschema.Schema
}
func Get ¶
func Get(key string) (OpenAPISchemaGetter, bool)
func OpenAPISchemaGetterFromReflectType ¶
func OpenAPISchemaGetterFromReflectType(ctx context.Context, t reflect.Type) OpenAPISchemaGetter
type OpenAPISchemaTypeGetter ¶
type OpenAPISchemaTypeGetter interface {
OpenAPISchemaType() []string
}
type SchemaFromOptFn ¶
type SchemaFromOptFn = func(o *opt)
func SchemaFromOptRef ¶
func SchemaFromOptRef(ref func(t string) jsonschema.Refer) SchemaFromOptFn
Click to show internal directories.
Click to hide internal directories.