Documentation ¶
Index ¶
- Constants
- func GenerateOpenAPI3Spec(ctx context.Context, components *repository.Service, info openapi.Info, ...) (*openapi.OpenAPI, error)
- func IsHttpParamKind(kind state.Kind) bool
- type ComponentSchema
- func (c *ComponentSchema) Description(ctx context.Context, path string, defaultDescription string) (string, error)
- func (c *ComponentSchema) GenerateSchema(ctx context.Context, schema *Schema) (*openapi3.Schema, error)
- func (c *ComponentSchema) GetOrGenerateSchema(ctx context.Context, schema *Schema) (*openapi3.Schema, error)
- func (c *ComponentSchema) ReflectSchema(name string, rType reflect.Type, description string, ...) *Schema
- func (c *ComponentSchema) RequestBody(ctx context.Context) (*Schema, error)
- func (c *ComponentSchema) ResponseBody(ctx context.Context) (*Schema, error)
- func (c *ComponentSchema) SchemaWithTag(name string, rType reflect.Type, description string, ...) *Schema
- func (c *ComponentSchema) TypeName(schemaType reflect.Type, defaultValue string) string
- func (c *ComponentSchema) TypedSchema(ctx context.Context, stateType state.Type, defaultTypeName string, ...) (*Schema, error)
- type PathsBuilder
- type Schema
- type SchemaContainer
- type Tag
Constants ¶
View Source
const (
ApplicationJson = "application/json"
)
View Source
const (
SuccessSchemaDescription = "Success object schema"
)
Variables ¶
This section is empty.
Functions ¶
func GenerateOpenAPI3Spec ¶
func IsHttpParamKind ¶
Types ¶
type ComponentSchema ¶
type ComponentSchema struct {
// contains filtered or unexported fields
}
func NewComponentSchema ¶
func NewComponentSchema(components *repository.Service, component *repository.Component, container *SchemaContainer) *ComponentSchema
func (*ComponentSchema) Description ¶
func (*ComponentSchema) GenerateSchema ¶
func (*ComponentSchema) GetOrGenerateSchema ¶
func (*ComponentSchema) ReflectSchema ¶
func (c *ComponentSchema) ReflectSchema(name string, rType reflect.Type, description string, toFormatter text.CaseFormat) *Schema
func (*ComponentSchema) RequestBody ¶
func (c *ComponentSchema) RequestBody(ctx context.Context) (*Schema, error)
func (*ComponentSchema) ResponseBody ¶
func (c *ComponentSchema) ResponseBody(ctx context.Context) (*Schema, error)
func (*ComponentSchema) SchemaWithTag ¶
func (c *ComponentSchema) SchemaWithTag(name string, rType reflect.Type, description string, toFormatter text.CaseFormat, tag Tag) *Schema
func (*ComponentSchema) TypeName ¶
func (c *ComponentSchema) TypeName(schemaType reflect.Type, defaultValue string) string
func (*ComponentSchema) TypedSchema ¶
func (c *ComponentSchema) TypedSchema(ctx context.Context, stateType state.Type, defaultTypeName string, toFormatter text.CaseFormat) (*Schema, error)
type PathsBuilder ¶
type PathsBuilder struct {
// contains filtered or unexported fields
}
type SchemaContainer ¶
type SchemaContainer struct {
// contains filtered or unexported fields
}
func NewContainer ¶
func NewContainer() *SchemaContainer
func (*SchemaContainer) CreateSchema ¶
func (c *SchemaContainer) CreateSchema(ctx context.Context, componentSchema *ComponentSchema, fieldSchema *Schema) (*openapi3.Schema, error)
type Tag ¶
type Tag struct { Format string Inlined bool Ignore bool Description string CaseFormat string IsNullable bool Min *float64 Max *float64 ExclusiveMax bool ExclusiveMin bool MaxLength *uint64 MinLength uint64 WriteOnly bool ReadOnly bool MaxItems *uint64 Default interface{} Example string TypeName string // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.