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

Clarify what to do if Schema Object contains $schema and message schemaFormat #655

Closed
jonaslagoni opened this issue Nov 17, 2021 · 3 comments
Labels
🤷‍♀️ Ambiguity An issue/PR which identifies or fixes spec ambiguity stale 💭 Strawman (RFC 0) RFC Stage 0 (See CONTRIBUTING.md)

Comments

@jonaslagoni
Copy link
Member

jonaslagoni commented Nov 17, 2021

Currently, in the specification, we dont mention anything about what to do with a payload, if we encounter such a use-case where someone decides to define both keywords.

asyncapi: '2.2.0'
...
channels:
  light/measured:
    publish:
      summary: Inform about environmental lighting conditions for a particular streetlight.
      operationId: onLightMeasured
      message:
        $ref: '#/components/messages/LightMeasured'
components:
  messages:
    LightMeasured: 
      name: LightMeasured
      schemaFormat: application/vnd.aai.asyncapi+yaml;version=2.2.0
      payload:
        $ref: '#/components/schemas/LightMeasurement'
  schemas:
    LightMeasurement:
      $schema: 'http://json-schema.org/draft-04/schema#'

Should tooling follow schemaFormat or $schema?

@jonaslagoni jonaslagoni added 🤷‍♀️ Ambiguity An issue/PR which identifies or fixes spec ambiguity 💭 Strawman (RFC 0) RFC Stage 0 (See CONTRIBUTING.md) labels Nov 17, 2021
@magicmatatjahu
Copy link
Member

If the AsyncAPI Schema Object is a draft-07 superset, then by default its $schema is (or rather should be) defined as draft-07. On the other hand, if one uses a different version of the $schema field than draft 07, then the parser implementation for custom scheme (as plugin) should validate the schema according to the version specified in the $schema field and try to convert the schema to be compatible with draft 07 - just like we do now with AVRO and Raml - we convert it to AsyncAPI Object. Also we should indicates in spec that additional keywords like deprecated, externalDocs and discriminator is also allowed with other than draft-07 schema.

@github-actions
Copy link

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

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 ❤️

@jonaslagoni
Copy link
Member Author

Still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤷‍♀️ Ambiguity An issue/PR which identifies or fixes spec ambiguity stale 💭 Strawman (RFC 0) RFC Stage 0 (See CONTRIBUTING.md)
Projects
None yet
Development

No branches or pull requests

2 participants