Skip to content

fix: remove duplicate generate schema #5299

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

Merged
merged 2 commits into from
Jun 2, 2025

Conversation

qianlongzt
Copy link
Contributor

@qianlongzt qianlongzt commented Jun 1, 2025

remove duplicate s.GenerateSchema(spec)

Test

To test this pull request, you can run the following commands:

go build
.\updatecli.exe jsonschema

Question

Should I remove one of them?

I checked https://www.schemastore.org/json/, and only policy/manifest exists.

        if err = generateSchema(baseSchemaID, schemaDir, "", config.Spec{}); err != nil {
		return fmt.Errorf("unable to generate schema - %s", err)
	}
	if err = generateSchema(baseSchemaID, schemaDir, "policy/manifest", config.Spec{}); err != nil {
		return fmt.Errorf("unable to generate schema - %s", err)
	}

@olblak
Copy link
Member

olblak commented Jun 2, 2025

Thank you very much, that's a good catch.

        if err = generateSchema(baseSchemaID, schemaDir, "", config.Spec{}); err != nil {
		return fmt.Errorf("unable to generate schema - %s", err)
	}

Can also be removed now, as it is not used anymore
I checked on https://github.com/SchemaStore/schemastore/blame/b741b07dcf60330e07d2d0af9c553a60c6d381f7/src/api/json/catalog.json#L6927 and it currently uses the one named "manifest/config.json"

@olblak olblak added cleanup jsonschema Anything related to updatecli jsonschema labels Jun 2, 2025
@qianlongzt
Copy link
Contributor Author

I remove generateSchema(baseSchemaID, schemaDir, "", config.Spec{})

@olblak olblak enabled auto-merge (squash) June 2, 2025 11:41
@olblak olblak merged commit 79f248b into updatecli:main Jun 2, 2025
6 checks passed
@qianlongzt qianlongzt deleted the remove-duplicate-generate-schema branch June 2, 2025 15:35
@olblak olblak added bug Something isn't working and removed cleanup labels Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jsonschema Anything related to updatecli jsonschema
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants