Documentation
¶
Index ¶
- func AreTypesCompatible(typeA, typeB string) bool
- func CanLiteralMatchType(literal, paramType string) bool
- func CheckPaths(pathA, pathB string, paramsA, paramsB map[string]string) bool
- func CompareSegments(segsA, segsB []Segment) bool
- func ConvertInterfaceMapKeys(input interface{}) interface{}
- func DiveIntoValidationError(e *jsonschema.ValidationError, causes *[]string, location string)
- func HashString(s string) string
- func Intern(s string) string
- func WrapBackticks(slice []any) string
- func WrapBackticksString(s []string) string
- type Segment
- type TemplateSegment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AreTypesCompatible ¶ added in v0.0.60
AreTypesCompatible reports whether two JSON Schema scalar types overlap for path ambiguity purposes.
func CanLiteralMatchType ¶ added in v0.0.60
CanLiteralMatchType reports whether a literal path segment could be accepted by a path parameter of the supplied JSON Schema type.
func CheckPaths ¶ added in v0.0.60
CheckPaths reports whether two OpenAPI path templates are ambiguous.
func CompareSegments ¶ added in v0.0.60
CompareSegments reports whether two parsed path templates are ambiguous.
func ConvertInterfaceMapKeys ¶
func ConvertInterfaceMapKeys(input interface{}) interface{}
ConvertInterfaceMapKeys takes an arbitrary interface{} and converts any map[interface{}]interface{} it finds into map[string]interface{}. It does this recursively, so nested maps and slices are also processed YAML is great and annoying, and JSON encoding gets very upset sometimes.
func DiveIntoValidationError ¶
func DiveIntoValidationError(e *jsonschema.ValidationError, causes *[]string, location string)
DiveIntoValidationError recursively dives into the validation error and collects all the causes, nicely printed and formatted in a string slice
func HashString ¶
func WrapBackticks ¶
WrapBackticks wraps each s in backticks and joins with ", ".
func WrapBackticksString ¶
Types ¶
type TemplateSegment ¶ added in v0.0.60
type TemplateSegment struct {
Raw string
Operator string
Name string
Explode bool
Prefix int
IsVariable bool
}
TemplateSegment represents a parsed RFC 6570 URI template expression.
func ParseTemplateSegment ¶ added in v0.0.60
func ParseTemplateSegment(segment string) TemplateSegment
ParseTemplateSegment parses a single URI template segment.