structuredpath

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package structuredpath owns canonical structured-edit path handling.

Decision note:

Deck standardizes internal structured-edit paths on JSON Pointer. The package still accepts legacy dotted, bracketed, and step-id-oriented alias inputs at the boundary so existing ask repair and refine flows continue to work, but every successful parse is normalized to canonical JSON Pointer.

We intentionally keep this parser in-house for now instead of wrapping a separate JSON Pointer or JSONPath library. The remaining behavior we need is small, deterministic, and tightly coupled to deck's compatibility aliases. If future requirements grow beyond exact single-location edits, revisit this decision and evaluate replacing only the canonical pointer parsing layer with a library-backed implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Canonicalize

func Canonicalize(raw string) (string, error)

func ToPointer

func ToPointer(segments []Segment) string

Types

type Segment

type Segment struct {
	Key     string
	Index   int
	IsIndex bool
}

func Parse

func Parse(raw string) ([]Segment, error)

func ParseAlias

func ParseAlias(raw string) ([]Segment, error)

func ParsePointer

func ParsePointer(raw string) ([]Segment, error)

Jump to

Keyboard shortcuts

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