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

Invalid JSON Schema #834

Closed
mhkarimi1383 opened this issue Feb 27, 2024 · 13 comments · Fixed by #893 or #894
Closed

Invalid JSON Schema #834

mhkarimi1383 opened this issue Feb 27, 2024 · 13 comments · Fixed by #893 or #894
Assignees
Labels
bug Something isn't working

Comments

@mhkarimi1383
Copy link
Contributor

Describe the bug
Getting invalid schema error while adding it to schema store neovim plugin

General info (please complete the following information):

  • OS: linux
  • helmwave version 0.34.0

To Reproduce

Configure neovim yamlls like that

  yamlls_config = {
    yaml = {
      schemaStore = {
        enable = false,
        url = '',
      },
      schemas = require('schemastore').yaml.schemas({
        extra = {
          url = "https://github.com/helmwave/helmwave/releases/latest/download/schema.json",
          name = "Helmwave",
          description = "Helmwave configuration",
          fileMatch = "helmwave.yml",
        }
      }),
    },
  },

Expected behavior
A working json schema

Screenshots / Stdout

 ■ Schema 'schema.json' is not valid:  /properties/monitors/items/properties/total_timeout/oneOf/1/type : must be equal to one of the allowed values  /properties/monitors/items/properties/total_timeout/oneOf/1/type : must be array  /properties/monitors/items/properties/total_timeout/oneOf/1/type : must match a schema in anyOf  /properties/monitors/items : must be array  /properties/monitors/items : must match a schema in anyOf

Additional context
Add any other context about the problem here.

@mhkarimi1383 mhkarimi1383 added the bug Something isn't working label Feb 27, 2024
@zhilyaev zhilyaev self-assigned this Feb 27, 2024
@mhkarimi1383
Copy link
Contributor Author

@zhilyaev
Hi, any updates on this problem?

@zhilyaev
Copy link
Member

I have never faced with Neovim. Could you ask the community about the Neovim project?

And if NeoVim provides https://www.schemastore.org. You don't need to specify this.

@zhilyaev
Copy link
Member

image

@mhkarimi1383
Copy link
Contributor Author

I have never faced with Neovim. Could you ask the community about the Neovim project?

And if NeoVim provides https://www.schemastore.org. You don't need to specify this.

NeoVim uses the same thing

But I don't know why I'm having this problem, only with this jsonschema

@mhkarimi1383
Copy link
Contributor Author

@zhilyaev
Hello again

getting the same error on VSCode

Schema 'helmwave - Helmwave is a declarative spec for deploying helm charts (schema.json)' is not valid:
/properties/monitors/items/properties/total_timeout/oneOf/1/type : must be equal to one of the allowed values
/properties/monitors/items/properties/total_timeout/oneOf/1/type : must be array
/properties/monitors/items/properties/total_timeout/oneOf/1/type : must match a schema in anyOf
/properties/monitors/items : must be array
/properties/monitors/items : must match a schema in anyOfYAML(768)

@mhkarimi1383
Copy link
Contributor Author

mhkarimi1383 commented Mar 5, 2024

here is my settings.json

{
  "yaml.schemas": {
    "https://github.com/helmwave/helmwave/releases/latest/download/schema.json": "file:///home/karimi/Projects/myproject/applications/metabase/helmwave.yml"
  }
}

@zhilyaev zhilyaev reopened this Mar 5, 2024
@zhilyaev zhilyaev added invalid This doesn't seem right and removed bug Something isn't working labels Mar 5, 2024
Copy link

repo-ranger bot commented Mar 5, 2024

⚠️ This has been marked to be closed in 7 days.

1 similar comment
Copy link

repo-ranger bot commented Mar 5, 2024

⚠️ This has been marked to be closed in 7 days.

@r3nic1e
Copy link
Member

r3nic1e commented Mar 5, 2024

@zhilyaev The provided error is weird but I found out the root cause.

For some fields we have type=int while jsonschema has type integer. So we need to go through all jsonschema definitions and change int to integer

@r3nic1e r3nic1e added bug Something isn't working and removed invalid This doesn't seem right labels Mar 5, 2024
@zhilyaev
Copy link
Member

zhilyaev commented Mar 9, 2024

#846 well

@mhkarimi1383
Copy link
Contributor Author

Fixed 😁

@mhkarimi1383
Copy link
Contributor Author

@zhilyaev
I have another problem that when I use string values for values or depends on params I get validation errors, Also sometimes objects are getting errors too.

@mhkarimi1383
Copy link
Contributor Author

Incorrect type. Expected "string | object(Values of the release)".yaml-schema: Values of the release
Incorrect type. Expected "object(Values of the release)".yaml-schema: Values of the release

This was linked to pull requests May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants