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

AsyncAPI v3 shows warning in Studio and IntelliJ plugin when referencing a json schema #494

Closed
2 tasks done
ignacio-nyt opened this issue Mar 8, 2024 · 6 comments · Fixed by #495
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@ignacio-nyt
Copy link

ignacio-nyt commented Mar 8, 2024

Describe the bug.

AsyncAPI v3 shows warning in Studio and IntelliJ plugin when referencing a json schema file. The actual AsyncAPI document is rendered correctly but the warning in the editor persists.

Expected behavior

AsyncAPI v3 should be able to reference external json schema files without warnings.

Screenshots

image (6)
image (5)

How to Reproduce

  1. I first created a valid JSON schema
  2. I then created an AsyncAPI v3 doc referencing a JSON schema
  3. Then I see the AsyncAPIv3 document rendering the JSON schema correctly but still showing warnings

Please rename the attached AsyncAPI v3 doc test.txt to test.yaml
test.txt
invoice_posted.schema.json

🥦 Browser

None

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

None

@ignacio-nyt ignacio-nyt added the bug Something isn't working label Mar 8, 2024
Copy link

github-actions bot commented Mar 8, 2024

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
Copy link
Member

jonaslagoni commented Mar 8, 2024

I think we have a problem with the JSON Schema files that describe payloads.

Payloads are defined with AnySchema:

"$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json"

AnySchema is defined with either schema or multiFormatSchema: https://github.com/asyncapi/spec-json-schemas/blob/master/definitions/3.0.0/anySchema.json#L8
Schema is basically just JSON Schema:
"$ref": "http://json-schema.org/draft-07/schema#"

For multiFormatSchema references should work if you dont define a schemaFormat:
For multiFormatSchema references should work for AsyncAPI Schema formats:
Same for all the other schema formats.

Looks like this is JUST a problem with AnySchema and Schema not adding reference type 🤔 Might be something to do with this:

"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json"

@Pakisan
Copy link
Member

Pakisan commented Mar 10, 2024

@jonaslagoni yo, man, didn't see this thread

I digged into schema and found this - asyncapi/jasyncapi-idea-plugin#49 (comment)

Only schemeFormat = AsyncAPI or Schema broke validation

Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Mar 10, 2024
Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Mar 10, 2024
…erencing a a json schema

Fix missing queue definition for SQS channel binding

asyncapi#494
asyncapi/jasyncapi-idea-plugin#49
@Pakisan
Copy link
Member

Pakisan commented Mar 10, 2024

@jonaslagoni we must double check schemas generation

I found missing deadLetterQueue in SQS channel binding and fixed reference for queue

https://github.com/asyncapi/spec-json-schemas/blob/master/schemas/3.0.0-without-%24id.json#L5622

I created MR with example changes, which must me moved to generator + re-check bindings

I'm sure that more issues with validation will appear soon

@Pakisan
Copy link
Member

Pakisan commented Mar 10, 2024

@ignacio-nyt I have checked your specification and no more validation errors

wait for fix from our side

@ignacio-nyt
Copy link
Author

@ignacio-nyt I have checked your specification and no more validation errors

wait for fix from our side

Thank you!

Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Mar 11, 2024
…erencing a a json schema

- Revert changes from auto generated schema
- Change allOf to anyOf in multiFormatSchema

asyncapi#494
asyncapi/jasyncapi-idea-plugin#49
Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Mar 12, 2024
…erencing a json schema

Include internal definitions from bindings to composed schema

asyncapi#494
asyncapi/jasyncapi-idea-plugin#49
Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Mar 12, 2024
Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Mar 12, 2024
Pakisan added a commit to asyncapi/jasyncapi-idea-plugin that referenced this issue Mar 14, 2024
v2:
- 2.0.0
- 2.1.0
- 2.2.0
- 2.3.0
- 2.4.0
- 2.5.0
- 2.6.0
v3:
- 3.0.0

asyncapi/spec-json-schemas#494
#49
Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Mar 19, 2024
Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Mar 19, 2024
Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Mar 22, 2024
Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Mar 25, 2024
Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Mar 25, 2024
Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Mar 28, 2024
Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Mar 28, 2024
Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Mar 29, 2024
@ignacio-nyt ignacio-nyt changed the title AsyncAPI v3 shows warning in Studio and IntelliJ plugin when referencing a a json schema AsyncAPI v3 shows warning in Studio and IntelliJ plugin when referencing a json schema Mar 29, 2024
Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Apr 2, 2024
Pakisan added a commit to Pakisan/spec-json-schemas that referenced this issue Apr 2, 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