Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KCL doesn't support all keywords when importing from JSON Schema #1876

Open
anshuishere opened this issue Mar 3, 2025 · 0 comments
Open
Assignees
Labels
enhancement New feature or request tool Issues or PRs related to kcl tools inlucding format, lint, validation, document tools, etc.

Comments

@anshuishere
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step

Import a KCL Schema from a JSON Schema

kcl import values.schema.json

Where json schema has the following keywords

# If then else statements:

    "pullSecret": {
      "type": ["string", "null"],
      "if": {
        "type": "string"
      },
      "then": {
        "default": "",
        "maxLength": 255
      }
    },

# Keywords like "default" and "type" in ref.

    "podPriority.priorityClassName": {
      "type": "object",
      "properties": {
        "priorityClassName": {
          "$ref": "#/$defs/empty.string"
        }
      }
    }

where
    "empty.string": {
      "type": "string",
      "default": ""
    },

2. What did you expect to see?

KCL can import from non trivial JSON Schema

3. What did you see instead

2025/02/21 14:28:15 genkcl_jsonschema.go:663: [WARN] unsupported keyword: if, path: values.schema/global/pullSecret
2025/02/21 14:28:15 genkcl_jsonschema.go:663: [WARN] unsupported keyword: then, path: values.schema/global/pullSecret
failed to merge ref: unsupported keyword default in ref,
failed to merge ref: unsupported keyword type in ref,

4. What is your KCL components version?

kcl version
0.10.10-linux-amd64

@Peefy Peefy added enhancement New feature or request tool Issues or PRs related to kcl tools inlucding format, lint, validation, document tools, etc. labels Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tool Issues or PRs related to kcl tools inlucding format, lint, validation, document tools, etc.
Projects
None yet
Development

No branches or pull requests

3 participants