vscode-backstage icon indicating copy to clipboard operation
vscode-backstage copied to clipboard

Feature request: Schema validation for catalog-info

Open ehrnst opened this issue 1 year ago • 3 comments

Hi.

Any plans to introduce schema validation to catalog-info files? I think it would be a great addition :) Schema for backstage can be found here https://json.schemastore.org/catalog-info.json / https://github.com/backstage/backstage/blob/master/packages/catalog-model/src/schema/Entity.schema.json

ehrnst avatar Feb 28 '23 11:02 ehrnst

The YAML extension by RedHat already does this automatically.

Maybe we should recommend it in the readme, or add it to extensionDependencies in the manifest?

h3rmanj avatar Feb 28 '23 11:02 h3rmanj

The YAML extension by RedHat already does this automatically.

Maybe we should recommend it in the readme, or add it to extensionDependencies in the manifest?

I added the schema to my YAML validation in vsCode. It just seems a bit redundant when this plugin exists already :)

ehrnst avatar Mar 01 '23 12:03 ehrnst

I might be mistaken, but it appears that vscode does not inherently provide support for json-schemas with yaml files. To enable YAML validation, a language server needs to be implemented with json schema integration. As @h3rmanj mentioned, RedHat's YAML language support, which is considered the de-facto standard, already has this feature implemented.

With this in mind, I believe that incorporating validation functionality is beyond the scope of the Backstage plugin. I'd rather modify the package.json manifest to include redhat.vscode-yaml as an extensionDependency.

@ehrnst any tips on how to provide this functionality without re-inventing the wheel would be greatly appreciated.

emilkje avatar Mar 13 '23 14:03 emilkje