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

feat(registry-lint): use jv instead of ajv for clear error output #6

Open
wants to merge 1 commit into
base: v1
Choose a base branch
from

Conversation

icefed
Copy link

@icefed icefed commented Aug 2, 2024

If package.yaml is not valid, registry-lint always got error: Unexpected identifier, the output can be clear.

use https://github.com/santhosh-tekuri/jsonschema jv tool.

ex: invalid source type

$ jv -d 7 package.schema.json package.yaml
schema package.schema.json: ok

instance package.yaml: failed
jsonschema validation failed with 'file:///Users/Tom/Downloads/package.schema.json#'
- at '/source': allOf failed
  - at '/source': oneOf failed, none matched
    - at '/source/id': 'pkg:github.com/bufbuild/[email protected]' does not match pattern '^pkg:cargo/.+@.+'
    - at '/source/id': 'pkg:github.com/bufbuild/[email protected]' does not match pattern '^pkg:composer/.+/.+@.+'
    - at '/source/id': 'pkg:github.com/bufbuild/[email protected]' does not match pattern '^pkg:gem/.+@.+'
    - at '/source': oneOf failed, none matched
      - at '/source': validation failed
        - at '/source': missing property 'download'
        - at '/source/id': 'pkg:github.com/bufbuild/[email protected]' does not match pattern '^pkg:generic/.+@.+'
      - at '/source': validation failed
        - at '/source': missing property 'build'
        - at '/source/id': 'pkg:github.com/bufbuild/[email protected]' does not match pattern '^pkg:generic/.+@.+'
    - at '/source': oneOf failed, none matched
      - at '/source/id': 'pkg:github.com/bufbuild/[email protected]' does not match pattern '^pkg:github/.+/.+@.+'
      - at '/source': validation failed
        - at '/source': missing property 'build'
        - at '/source/id': 'pkg:github.com/bufbuild/[email protected]' does not match pattern '^pkg:github/.+/.+@.+'
    - at '/source/id': 'pkg:github.com/bufbuild/[email protected]' does not match pattern '^pkg:golang/.+/.+@.+'
    - at '/source/id': 'pkg:github.com/bufbuild/[email protected]' does not match pattern '^pkg:luarocks/.+@.+'
    - at '/source/id': 'pkg:github.com/bufbuild/[email protected]' does not match pattern '^pkg:npm/.+@.+'
    - at '/source/id': 'pkg:github.com/bufbuild/[email protected]' does not match pattern '^pkg:nuget/.+@.+'
    - at '/source/id': 'pkg:github.com/bufbuild/[email protected]' does not match pattern '^pkg:opam/.+@.+'
    - at '/source': validation failed
      - at '/source': missing property 'download'
      - at '/source/id': 'pkg:github.com/bufbuild/[email protected]' does not match pattern '^pkg:openvsx/.+/.+@.+'
    - at '/source/id': 'pkg:github.com/bufbuild/[email protected]' does not match pattern '^pkg:pypi/.+@.+'

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

Successfully merging this pull request may close these issues.

1 participant