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: schemaFormat and additional specifications #1075

Open
char0n opened this issue Jan 17, 2022 · 1 comment
Open

AsyncAPI: schemaFormat and additional specifications #1075

char0n opened this issue Jan 17, 2022 · 1 comment
Labels

Comments

@char0n
Copy link
Member

char0n commented Jan 17, 2022

Message Object and Message Trait Object can defined a field called schemaFormat. This allows to define a format/language for a payload field. AsyncAPI 2.2.x spec mandates that we MUST support following formats:

  • AsyncAPI 2.2.0 Schema Object
  • JSON Schema Draft 07

The specification further specify that it RECOMMENDS to support following formats:

  • Avro 1.9.0 schema
  • OpenAPI 3.0.0 Schema Object
  • RAML 1.0 data type

We currently only support AsyncAPI 2.2.0 Schema Object. If other schemaFormat is specified the result of parsing is generic ApiDOM object element.

@char0n
Copy link
Member Author

char0n commented Mar 14, 2022

We should introduce support for JSON Schema Draft 07. The question is how to do it. I suggest following as a POC:

Introduce JSON Schema Draft 07 as a separate namespace. This namespace will be able to parse, refract, dereference and resolve itself. Then we hook this namespace to AsyncAPI 2.3 namespace. Other RECOMMENDED AsyncAPI 2.3 schema formats can be adopted in the same way, if this proves as a way to go.

The benefit of this will be that we will have independent namespaces for different JSON Schema versions which we can then incorporate into another namespaces. We can extract OpenAPI 3.1 schema object (2020-12) into separate namespace and then incorporate it back. This will allow us to reuse the JSON Schema 2020-12 in AsyncAPI 2.3 as well.

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

1 participant