devspace icon indicating copy to clipboard operation
devspace copied to clipboard

Update schema on schemastore.org

Open withinboredom opened this issue 3 years ago • 5 comments

What happened?

Intellij pulls the schema from schemastore.org in order to provide code completion and assistance. The current schema there doesn't recognize version v2beta1 and the IDE thinks everything is wrong.

What did you expect to happen instead?

The schema to recognize v2beta1 and either provide no assistance or updated to reflect the v2beta1 schema.

/kind bug

withinboredom avatar Jul 13 '22 10:07 withinboredom

@withinboredom Could you please add more info? The current schema is added for v2beta1 only. Can you please add screenshots of the error or devspace.yaml?

tukobadnyanoba avatar Jul 13 '22 11:07 tukobadnyanoba

pipelines, images, deployments and many other root level keys are map[string]interface. You have to add a key of your choice and you will get assistance in completing value for that key.

tukobadnyanoba avatar Jul 13 '22 11:07 tukobadnyanoba

The current schema is added for v2beta1 only

Looking a little closer, I think maybe the schema definition might be off ... or the documentation.

Example in the documentation:

image

From IDE:

image

Example in the documentation:

image

From IDE:

image

Documentation:

image

From IDE:

image

Documentation:

image

From IDE:

image

withinboredom avatar Jul 16 '22 07:07 withinboredom

We have valid schema plus schema generator already in docs/hack and schema folder. I'll make sure we generate the newest version and submit to schemastore. Thanks for the contribution in hack/ on the root level but it's not producing the correct output. I'll make sure we get the official schema updated. @FabianKramm for reference not to accept any PRs on this topic since we already have a working script to produce a valid schema.

LukasGentele avatar Jul 17 '22 06:07 LukasGentele

@LukasGentele @tukobadnyanoba It appears that the devspace-schema.json isn't a fully valid representation of the devspace.yaml schema. For example the name variable is required on vars and it doesn't recognize strings as a valid value. It seems that the generator isn't able to pick up on all the nuances built into the UnmarshalYAML methods.

Is there a valid schema somewhere that can be used for development?

dolfelt avatar Jul 18 '22 19:07 dolfelt

@dolfelt not yet, but we will update that very shortly. The following tasks are left todo:

  1. Allow string or object as value for vars, pipelines and commands (and all the others where we have an UnmarshalYAML method)
  2. Remove the ./hack/genjsonschema implementation in favor of /docs/hack/config/schemas/ implementation
  3. Remove the json spec description annotations in the devspace latest version
  4. Update the jsonschema in the schemastore.org

FabianKramm avatar Aug 16 '22 02:08 FabianKramm