replace

package
v0.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrReplace        replaceError = "flatten replace error"
	ErrUnexpectedType replaceError = "unexpected type used in getPointerFromKey"
)

Variables

This section is empty.

Functions

func ErrCyclicChain added in v0.24.0

func ErrCyclicChain(key string) error

func ErrInvalidPointerType added in v0.24.0

func ErrInvalidPointerType(key string, value any, err error) error

func ErrNoParent added in v0.24.0

func ErrNoParent(key string, err error) error

func ErrNoSchema added in v0.24.0

func ErrNoSchema(key string) error

func ErrNoSchemaWithRef added in v0.24.0

func ErrNoSchemaWithRef(key string, value any) error

func ErrNotANumber added in v0.24.0

func ErrNotANumber(key string, err error) error

func ErrUnhandledContainerType added in v0.24.0

func ErrUnhandledContainerType(key string, value any) error

func ErrUnhandledParentRewrite added in v0.24.0

func ErrUnhandledParentRewrite(key string, value any) error

func ErrUnhandledParentType added in v0.24.0

func ErrUnhandledParentType(key string, value any) error

func RewriteSchemaToRef

func RewriteSchemaToRef(sp *spec.Swagger, key string, ref spec.Ref) error

RewriteSchemaToRef replaces a schema with a Ref

func UpdateRef

func UpdateRef(sp interface{}, key string, ref spec.Ref) error

UpdateRef replaces a ref by another one

func UpdateRefWithSchema

func UpdateRefWithSchema(sp *spec.Swagger, key string, sch *spec.Schema) error

UpdateRefWithSchema replaces a ref with a schema (i.e. re-inline schema)

Types

type DeepestRefResult

type DeepestRefResult struct {
	Ref      spec.Ref
	Schema   *spec.Schema
	Warnings []string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL