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

KclvmService.GetSchemaType API: missing default value #653

Closed
amyXia1994 opened this issue Aug 11, 2023 · 0 comments · Fixed by #658
Closed

KclvmService.GetSchemaType API: missing default value #653

amyXia1994 opened this issue Aug 11, 2023 · 0 comments · Fixed by #658
Assignees
Labels
api Issues or PRs related to kcl rust native APIs and multi-lang APIs bug Something isn't working

Comments

@amyXia1994
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

make sure you have konfig repo locally in path , then create a getschema.json file with content(replace the to the real path):

{
    "file": "<path-to-konfig>/base/pkg/kusion_models/kube/frontend/server.k"
}

2. What did you expect to see? (Required)

the property workloadType should have default value: "Deployment"

{
	"error": "",
	"result": {
		"schema_type_list": [
			{
				"type": "schema",
				"schema_name": "Server",
				"schema_doc": "Server is abstaction of Deployment and StatefulSet.",
				"properties": {
					// -- snip --
					"workloadType": {
						"type": "union",
						"union_types": [
							{
								"type": "str(Deployment)"
							},
							{
								"type": "str(StatefulSet)"
							}
						],
						"line": 2,
						"description": "Application workload type, default to 'Deployment'",
						"default": "Deployment"
					}
					// -- snip --
				}// -- snip --
			}
		]
	}
}

3. What did you see instead (Required)

{
	"error": "",
	"result": {
		"schema_type_list": [
			{
				"type": "schema",
				"schema_name": "Server",
				"schema_doc": "Server is abstaction of Deployment and StatefulSet.",
				"properties": {
					// -- snip --
					"workloadType": {
						"type": "union",
						"union_types": [
							{
								"type": "str(Deployment)"
							},
							{
								"type": "str(StatefulSet)"
							}
						],
						"line": 2,
						"description": "Application workload type, default to 'Deployment'"
					}
					// -- snip --
				}// -- snip --
			}
		]
	}
}

4. What is your KCL components version? (Required)

➜  ~ kcl -v
Version: 0.5.3-20ab3eb4b9179219d6837a57f5d35286
Platform: aarch64-apple-darwin
GitCommit: 6481ce567bbad01214f842f7903b5f01ae89324c
➜  ~ kcl-go -v
kcl-go version v0.5.3
@amyXia1994 amyXia1994 added bug Something isn't working api Issues or PRs related to kcl rust native APIs and multi-lang APIs labels Aug 11, 2023
@Peefy Peefy self-assigned this Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues or PRs related to kcl rust native APIs and multi-lang APIs bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants