Documentation
¶
Index ¶
- Constants
- func ErrCyclicChain(key string) error
- func ErrInvalidPointerType(key string, value any, err error) error
- func ErrNoParent(key string, err error) error
- func ErrNoSchema(key string) error
- func ErrNoSchemaWithRef(key string, value any) error
- func ErrNotANumber(key string, err error) error
- func ErrUnhandledContainerType(key string, value any) error
- func ErrUnhandledParentRewrite(key string, value any) error
- func ErrUnhandledParentType(key string, value any) error
- func RewriteSchemaToRef(sp *spec.Swagger, key string, ref spec.Ref) error
- func UpdateRef(sp interface{}, key string, ref spec.Ref) error
- func UpdateRefWithSchema(sp *spec.Swagger, key string, sch *spec.Schema) error
- type DeepestRefResult
Constants ¶
View Source
const ( ErrReplace replaceError = "flatten replace error" ErrUnexpectedType replaceError = "unexpected type used in getPointerFromKey" )
Variables ¶
This section is empty.
Functions ¶
func ErrCyclicChain ¶
func ErrNoParent ¶
func ErrNoSchema ¶
func ErrNoSchemaWithRef ¶
func ErrNotANumber ¶
func ErrUnhandledParentType ¶
func RewriteSchemaToRef ¶
RewriteSchemaToRef replaces a schema with a Ref
Types ¶
type DeepestRefResult ¶
DeepestRefResult holds the results from DeepestRef analysis
func DeepestRef ¶
func DeepestRef(sp *spec.Swagger, opts *spec.ExpandOptions, ref spec.Ref) (*DeepestRefResult, error)
DeepestRef finds the first definition ref, from a cascade of nested refs which are not definitions.
- if no definition is found, returns the deepest ref.
- pointers to external files are expanded
NOTE: all external $ref's are assumed to be already expanded at this stage.
Click to show internal directories.
Click to hide internal directories.