asyncapi / spec-json-schemas

AsyncAPI schema versions
Apache License 2.0
56 stars 54 forks source link

[BUG] avroSchema does not resolve #545

Open publicvirtualvoid opened 5 months ago

publicvirtualvoid commented 5 months ago

Describe the bug.

The v3 JSON Schema is not valid because one of the $refs doesn't resolve

$ref '/definitions/avroSchema' in 'https://github.com/asyncapi/spec-json-schemas/raw/master/schemas/3.0.0.json' can not be resolved.YAML(768)

http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json gives a 404

Expected behavior

The spec should fully resolve including refs.

Screenshots

not relevant

How to Reproduce

  1. Navigate to http://asyncapi.com/definitions/3.0.0/avroSchema_v1.json
  2. Observe 404

OR:

  1. Install YAML VSCode extension
  2. Add # yaml-language-server: $schema=https://github.com/asyncapi/spec-json-schemas/raw/master/schemas/3.0.0.json as first line
  3. Observe error in Problems list

🥦 Browser

None

👀 Have you checked for similar open issues?

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

No, someone else can work on it

github-actions[bot] commented 5 months ago

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

jonaslagoni commented 5 months ago

@publicvirtualvoid thanks for the issue, use the following instead:

# yaml-language-server: $schema=https://github.com/asyncapi/spec-json-schemas/raw/master/schemas/3.0.0-without-$id.json

The problem is mainly the yaml language server not understanding where to pickup a bundled compound schema. Although the definitions should also be exposed of course.

publicvirtualvoid commented 5 months ago

Perfect, thanks so much!

derberg commented 5 months ago

hmm, but you should not have to put yaml-language-server in your yaml manually 🤔 we publish proper schema in SchemaStore

jonaslagoni commented 5 months ago

@derberg if the filename is not asyncapi.json or a matching one then it wont work automatically 🙂

derberg commented 5 months ago

ah yes, did not figure that is a problem of person that reported the problem

@publicvirtualvoid have a look at https://github.com/asyncapi/spec/tree/master/examples#file-naming

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart: