Summary
ktext export json currently emits Go struct field names for nested objects instead of schema-shaped JSON keys.
Reproduction
From the repo root:
go run ./cmd/ktext export json -file CONTEXT.yaml
Actual behavior
The JSON output contains nested keys like:
identity.Name
identity.URL
constraints[].Content
Expected behavior
The JSON export should follow the documented CONTEXT.yaml schema shape, e.g.:
identity.name
identity.url
constraints[].content
Likely cause
internal/export/json.go marshals schema.Context directly, but many nested structs in internal/schema/context.go only define yaml tags and not matching json tags.
Impact
This breaks machine consumers of ktext export json and makes the JSON export inconsistent with the schema/docs.
Summary
ktext export jsoncurrently emits Go struct field names for nested objects instead of schema-shaped JSON keys.Reproduction
From the repo root:
go run ./cmd/ktext export json -file CONTEXT.yamlActual behavior
The JSON output contains nested keys like:
identity.Nameidentity.URLconstraints[].ContentExpected behavior
The JSON export should follow the documented
CONTEXT.yamlschema shape, e.g.:identity.nameidentity.urlconstraints[].contentLikely cause
internal/export/json.gomarshalsschema.Contextdirectly, but many nested structs ininternal/schema/context.goonly defineyamltags and not matchingjsontags.Impact
This breaks machine consumers of
ktext export jsonand makes the JSON export inconsistent with the schema/docs.