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

Schema validation matches @bitnami as a uri-formatted string. #586

Closed
1 of 4 tasks
TBBle opened this issue Nov 12, 2021 · 0 comments
Closed
1 of 4 tasks

Schema validation matches @bitnami as a uri-formatted string. #586

TBBle opened this issue Nov 12, 2021 · 0 comments
Assignees
Labels
Milestone

Comments

@TBBle
Copy link

TBBle commented Nov 12, 2021

Describe the bug

The schema for helm Charts on SchemaStore has the following for the dependencies.repository field:

          "repository": {
            "description": "The repository URL or alias",
            "oneOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "string",
                "pattern": "^@"
              }
            ]
          },

Given a valid Helm Chart.yaml:

apiVersion: v2
name: services
description: Services

type: application

version: 0.1.1

appVersion: 0.1.0

dependencies:
- name: rabbitmq
  repository: '@bitnami'
  version: 8.15.2
- name: mongodb
  repository: '@bitnami'
  version: 8.3.0

validation fails, because the repository string @bitnami appears to match both of the elements of the oneOf.

However, @bitnami is not a valid uri format, as far as I can tell, per the json-schema spec. Per RFC 3986 Secion 4.1 it'd be a valid uri-reference.

It's odd, because it appears yaml-language-server handles this case, but perhaps that logic is not mixing correctly with oneOf? (Or maybe this code isn't code path being used here, and the same logic is missing in some other validation)

Expected Behavior

Valid Helm Chart.yaml validates.

Current Behavior

[{
	"resource": "/C:/Projects/Arsenal/services/charts/premspec-services/Chart.yaml",
	"owner": "_generated_diagnostic_collection_name_#2",
	"severity": 8,
	"message": "Matches multiple schemas when only one must validate.",
	"source": "yaml-schema: Helm Chart.yaml",
	"startLineNumber": 13,
	"startColumn": 15,
	"endLineNumber": 13,
	"endColumn": 16
},{
	"resource": "/C:/Projects/Arsenal/services/charts/premspec-services/Chart.yaml",
	"owner": "_generated_diagnostic_collection_name_#2",
	"severity": 8,
	"message": "Matches multiple schemas when only one must validate.",
	"source": "yaml-schema: Helm Chart.yaml",
	"startLineNumber": 16,
	"startColumn": 15,
	"endLineNumber": 16,
	"endColumn": 16
}]

Steps to Reproduce

  1. Create a Chart.yaml with the above content

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

VSCode 1.62.1, with YAML extension version 1.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants