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

Support of allOf, oneOf or anyOf at payload level #106

Open
M3lkior opened this issue Dec 1, 2021 · 9 comments
Open

Support of allOf, oneOf or anyOf at payload level #106

M3lkior opened this issue Dec 1, 2021 · 9 comments
Labels
enhancement New feature or request

Comments

@M3lkior
Copy link
Collaborator

M3lkior commented Dec 1, 2021

Reason/Context

Please try answering few of those questions

  • Why we need this improvement?
    Today, it is possible to use those properties at message level but not at payload level
  • How will this change help?
    This is useful to set those properties at payload level when the message headers / description / key never change but the payload can
  • What is the motivation?
    this is a technical limitation for my enterprise usage. As a workaround i need to create two similar message definitions: one with a null payload and one with a structured payload and use the property at the message level

Description

Please try answering few of those questions

  • What changes have to be introduced?
    Support those properties during the parsing of the spec
  • Will this be a breaking change?
    No
  • How could it be implemented/designed?
    Like we do for the json way
    The implementation must allow to write this kind of definition:
asyncapi: 2.0.0
info:
  title: My API
  version: '1.0.0'
channels:
  mychannel:
    publish:
      message:
        schemaFormat: application/vnd.apache.avro;version=1.9.0
        payload:
          oneOf:
            - type: "null"
            - $ref: 'schemas/Person-1.9.0-namespace.avsc'
        bindings:
          kafka:
            key:
              $ref: 'schemas/Person-1.9.0-namespace.avsc'
          mqtt:
            x-test:
              type: string
@M3lkior M3lkior added the enhancement New feature or request label Dec 1, 2021
@derberg
Copy link
Member

derberg commented Dec 7, 2021

at payload level, you can only use oneOf, from the spec point of view

@M3lkior
Copy link
Collaborator Author

M3lkior commented Jan 14, 2022

hum the others are not supported ? so we can start supporting at least the oneOf keyword in the avro-parser

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

@github-actions github-actions bot added the stale label May 15, 2022
@M3lkior M3lkior removed the stale label May 16, 2022
@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 ❤️

@github-actions github-actions bot added stale and removed stale labels Sep 14, 2022
@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 ❤️

@github-actions github-actions bot added the stale label Jan 14, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2023
@M3lkior M3lkior reopened this May 15, 2023
@github-actions github-actions bot removed the stale label May 16, 2023
@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 ❤️

@github-actions github-actions bot added the stale label Sep 14, 2023
@derberg
Copy link
Member

derberg commented Sep 27, 2023

Now when I read this issue for the second time, what do you mean by payload.oneOf? if schema format says Avro, you should have Avro. Does Avro support oneOf and other keywords?

@M3lkior
Copy link
Collaborator Author

M3lkior commented Sep 27, 2023

at payload level, you can only use oneOf, from the spec point of view

in some case (for example, when a subscribe mode for kafka is RecordNameStrategy ; the topics payload specification can be

asyncapi: 2.0.0
info:
  title: My API
  version: '1.0.0'
channels:
  mychannel:
    publish:
      message:
        schemaFormat: application/vnd.apache.avro;version=1.9.0
        payload:
          allOf:
            - $ref: 'schemas/Person-1.9.0-namespace.avsc'
            -  $ref: 'schemas/Person-2.0.0-namespace.avsc'
     

Copy link
Member

derberg commented Sep 27, 2023

but payload can only be in a format of given schemaFormat (ignore my previous comment, as I mixed your payload.oneOf with message.oneOf

@github-actions github-actions bot removed the stale label Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants