package replace
import "github.com/go-openapi/analysis/internal/flatten/replace"
Index ¶
- 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
Functions ¶
func RewriteSchemaToRef ¶
RewriteSchemaToRef replaces a schema with a Ref
func UpdateRef ¶
UpdateRef replaces a ref by another one
func UpdateRefWithSchema ¶
UpdateRefWithSchema replaces a ref with a schema (i.e. re-inline schema)
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.
Source Files ¶
- Version
- v0.23.0 (latest)
- Published
- Mar 9, 2024
- Platform
- js/wasm
- Imports
- 9 packages
- Last checked
- 1 day ago –
Tools for package owners.