refutil

package
v0.0.0-...-4bbce29 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(ref spec.Ref, tks ...string) spec.Ref

func Last

func Last(ref jsonreference.Ref) string

func NormalizeFileRef

func NormalizeFileRef(ref spec.Ref, base string) (spec.Ref, error)

func Parent

func Parent(ref spec.Ref) spec.Ref

func RResolve

func RResolve(ref spec.Ref, visitedRefs map[string]bool, inputIsRef bool) (*spec.Schema, spec.Ref, map[string]bool, bool, error)

RResolve recursively resolve a schema (pointed by ref) by following its refs until it is a concrete schema (no ref anymore), or until an already visited reference is hit. The 2nd to last return value is used to indicate whether the resolving ends normally (true) or due to hit a cyclic ref (false). Only when it is normally ended, the final schema, its pointing reference and all the visited references are returned. Note that the visited references only include explicitly defined reference during the reference following, which doesn't include the input ref, unless explicitly mark the input is ref via the last param.

func RResolveResponse

func RResolveResponse(ref spec.Ref, visitedRefs map[string]bool, inputIsRef bool) (*spec.Response, spec.Ref, map[string]bool, bool, error)

RResolveResponse recursively resolve a response (pointed by ref) by following its refs until it is a concrete response (no ref anymore), or until an already visited reference is hit. The 2nd to last return value is used to indicate whether the resolving ends normally (true) or due to hit a cyclic ref (false). Only when it is normally ended, the final response, its pointing reference and all the visited references are returned. Note that the visited references only include explicitly defined reference during the reference following, which doesn't include the input ref, unless explicitly mark the input is ref via the last param.

Types

This section is empty.

Jump to

Keyboard shortcuts

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