package jsonreference
import "github.com/go-openapi/jsonreference"
Index ¶
- type Ref
- func MustCreateRef(ref string) Ref
- func New(jsonReferenceString string) (Ref, error)
- func (r *Ref) GetPointer() *jsonpointer.Pointer
- func (r *Ref) GetURL() *url.URL
- func (r *Ref) Inherits(child Ref) (*Ref, error)
- func (r *Ref) IsCanonical() bool
- func (r *Ref) IsRoot() bool
- func (r *Ref) String() string
Types ¶
type Ref ¶
type Ref struct { HasFullURL bool HasURLPathOnly bool HasFragmentOnly bool HasFileScheme bool HasFullFilePath bool // contains filtered or unexported fields }
Ref represents a json reference object
func MustCreateRef ¶
MustCreateRef parses the ref string and panics when it's invalid. Use the New method for a version that returns an error
func New ¶
New creates a new reference for the given string
func (*Ref) GetPointer ¶
func (r *Ref) GetPointer() *jsonpointer.Pointer
GetPointer gets the json pointer for this reference
func (*Ref) GetURL ¶
GetURL gets the URL for this reference
func (*Ref) Inherits ¶
Inherits creates a new reference from a parent and a child If the child cannot inherit from the parent, an error is returned
func (*Ref) IsCanonical ¶
IsCanonical returns true when this pointer starts with http(s):// or file://
func (*Ref) IsRoot ¶
IsRoot returns true if this reference is a root document
func (*Ref) String ¶
String returns the best version of the url for this reference
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal |
- Version
- v0.21.0 (latest)
- Published
- Mar 9, 2024
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 week ago –
Tools for package owners.