{"modulePath":"github.com/stainless-api/stainless-api-cli","version":"v0.1.0-alpha.58","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package jsonflag\n\n## Functions\n\n```go\nfunc ApplyMutations(body, query, header []byte) ([]byte, []byte, []byte, error)\n```\nApplyMutations applies all registered mutations to the provided JSON data\n\n```go\nfunc ClearMutations()\n```\nClearMutations removes all registered mutations from the global registry\n\n```go\nfunc Mutate(kind MutationKind, path string, value any)\n```\nMutate adds a mutation that will be applied to the specified kind of data\n\n## Types\n\n```go\ntype JSONAnyFlag = cli.FlagBase[any, JSONConfig, JSONValueCreator[any]]\n```\n\n```go\ntype JSONBoolFlag = cli.FlagBase[bool, JSONConfig, JSONValueCreator[bool]]\n```\n\n```go\ntype JSONConfig struct {\n\tKind MutationKind\n\tPath string\n\t// For boolean flags that set a specific value when present\n\tSetValue any\n}\n```\n\n```go\ntype JSONDateFlag = cli.FlagBase[time.Time, JSONConfig, JSONDateValueCreator]\n```\n\n```go\ntype JSONDateValueCreator struct{}\n```\nJSONDateValueCreator is a specialized creator for date-only values\n\n```go\nfunc (c JSONDateValueCreator) Create(val time.Time, dest *time.Time, config JSONConfig) cli.Value\n```\n\n```go\nfunc (c JSONDateValueCreator) ToString(val time.Time) string\n```\n\n```go\ntype JSONDatetimeFlag = cli.FlagBase[time.Time, JSONConfig, JSONValueCreator[time.Time]]\n```\n\n```go\ntype JSONFloatFlag = cli.FlagBase[float64, JSONConfig, JSONValueCreator[float64]]\n```\n\n```go\ntype JSONIntFlag = cli.FlagBase[int, JSONConfig, JSONValueCreator[int]]\n```\n\n```go\ntype JSONStringFlag = cli.FlagBase[string, JSONConfig, JSONValueCreator[string]]\n```\n\n```go\ntype JSONValueCreator[T any] struct{}\n```\n\n```go\nfunc (c JSONValueCreator[T]) Create(val T, dest *T, config JSONConfig) cli.Value\n```\n\n```go\nfunc (c JSONValueCreator[T]) ToString(val T) string\n```\n\n```go\ntype Mutation struct {\n\tKind  MutationKind\n\tPath  string\n\tValue any\n}\n```\n\n```go\nfunc ListMutations() []Mutation\n```\nListMutations returns a copy of all currently registered mutations\n\n```go\ntype MutationKind string\n```\n\n```go\nconst (\n\tBody   MutationKind = \"body\"\n\tQuery  MutationKind = \"query\"\n\tHeader MutationKind = \"header\"\n)\n```\n\n","path":"github.com/stainless-api/stainless-api-cli/pkg/jsonflag","name":"jsonflag","synopsis":"","isRedistributable":true}
