Skip to content

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