package replace

import "github.com/go-openapi/analysis/internal/flatten/replace"

Index

Functions

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.

NOTE: all external $ref's are assumed to be already expanded at this stage.

Source Files

replace.go

Version
v0.21.4
Published
Jul 22, 2022
Platform
windows/amd64
Imports
8 packages
Last checked
5 days ago

Tools for package owners.