Skip to content

export json uses Go field names instead of schema JSON keys #3

Description

@hypotyposis

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions