package schemamutation
import "k8s.io/kube-openapi/pkg/schemamutation"
Index ¶
- func ReplaceReferences(walkRef func(ref *spec.Ref) *spec.Ref, sp *spec.Swagger) *spec.Swagger
- type RefCallbackFunc
- type SchemaCallbackFunc
- type Walker
Functions ¶
func ReplaceReferences ¶
ReplaceReferences rewrites the references without mutating the input. The output might share data with the input.
Types ¶
type RefCallbackFunc ¶
var RefCallbackNoop RefCallbackFunc = func(ref *spec.Ref) *spec.Ref { return ref }
type SchemaCallbackFunc ¶
var SchemaCallBackNoop SchemaCallbackFunc = func(schema *spec.Schema) *spec.Schema { return schema }
type Walker ¶
type Walker struct {
// SchemaCallback will be called on each schema, taking the original schema,
// and before any other callbacks of the Walker.
// If the schema needs to be mutated, DO NOT mutate it in-place,
// always create a copy, mutate, and return it.
SchemaCallback func(schema *spec.Schema) *spec.Schema
// RefCallback will be called on each ref.
// If the ref needs to be mutated, DO NOT mutate it in-place,
// always create a copy, mutate, and return it.
RefCallback func(ref *spec.Ref) *spec.Ref
}
Walker runs callback functions on all references of an OpenAPI spec, replacing the values when visiting corresponding types.
func (*Walker) WalkRoot ¶
func (*Walker) WalkSchema ¶
Source Files ¶
walker.go
- Version
- v0.0.0-20250628140032-d90c4fd18f59 (latest)
- Published
- Jun 28, 2025
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 10 months ago –
Tools for package owners.