jsonpointer

package
v0.64.5 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: MIT Imports: 4 Imported by: 8

Documentation

Index

Constants

View Source
const (
	EscapedTilde = "~0"
	EscapedSlash = "~1"
)

Variables

View Source
var (
	ErrJSONPointerInvalidSyntaxNoAnchorSlash     = errors.New("invalid JSON Pointer format - no `#/`")
	ErrJSONPointerInvalidSyntaxNonOneAnchorSlash = errors.New("invalid JSON Pointer format - non-1 `#/`")
)

Functions

func PointerCondense

func PointerCondense(s string) string

PointerCondense removes duplicate slashes.

func PointerSubEscapeAll

func PointerSubEscapeAll(format string, vars ...any) string

PointerSubEscapeAll will substitute vars using `fmt.Sprintf()`. All strings are escaped.

func PropertyNameEscape

func PropertyNameEscape(s string) string

PropertyNameEscape escapes JSON property name using JSON Schema rules.

func PropertyNameUnescape

func PropertyNameUnescape(s string) string

PropertyNameUnescape unescapes JSON property name using JSON Schema rules.

Types

type JSONPointer

type JSONPointer struct {
	Document   string
	String     string
	PathString string
	Path       []string
}

func ParseJSONPointer

func ParseJSONPointer(s string) (JSONPointer, error)

Jump to

Keyboard shortcuts

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