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

Discriminator syntax not aligned to the spec OpenApi 3.x Schema composition #955

Closed
dilluz opened this issue Nov 15, 2023 · 6 comments
Closed
Labels
enhancement New feature or request stale

Comments

@dilluz
Copy link

dilluz commented Nov 15, 2023

Actually the AsyncApi spec, under the schemaComposition paragaph, describe and implement the use of Dirscriminator attribute in an old way (imho inherited from swagger 2.0)

It would be great to evolve it as described by openApi 3.0.
This will enable to share and align the same schema definition between the two spec.

@dilluz dilluz added the enhancement New feature or request label Nov 15, 2023
Copy link

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

Technically there is no reason to align as you can define the message payload with OpenAPI schema directly using schemaFormat 🙂

@dilluz
Copy link
Author

dilluz commented Nov 15, 2023

Thanks for Reply!
Just follow my reasoning, walking through the pre-release 3.0.0 doc of AsyncApi, the Message attribute

schemaFormat: application/vnd.oai.openapi+json;version=3.0.0

is supposed to be the default when not provided, and the AscynApi 2.6.0 format is not listed more.

Help me with my doubt so: Is it valid just for a $Ref Schema payload? Or it should be valid also for Object Schema payload? Bcs in my opinion if i try to setup an Object Schema compliant with the OAI3.0.0 Discriminator it should be valid following the default schemaFormat applied

thanks :)

@jonaslagoni
Copy link
Member

Just follow my reasoning, walking through the pre-release 3.0.0 doc of AsyncApi, the Message attribute

schemaFormat: application/vnd.oai.openapi+json;version=3.0.0

is supposed to be the default when not provided, and the AscynApi 2.6.0 format is not listed more.

I don't follow. In v3 we grouped the schema format and schema information in the multi-format schema object. Which still uses the same schema formats as in v2: https://www.asyncapi.com/docs/reference/specification/v3.0.0-next-major-spec.16#multiFormatSchemaFormatTable

I doubt will default to OpenAPI Schema object, but feel free to suggest it.

Help me with my doubt so: Is it valid just for a $Ref Schema payload?

You can use $ref yea.

Or it should be valid also for Object Schema payload?

I don't follow :)

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 Mar 15, 2024
@derberg
Copy link
Member

derberg commented Mar 26, 2024

Closing as looks as answered with no further followup.

@dilluz if you have more questions, please create another issue and not here but in spec repo

@derberg derberg closed this as completed Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

No branches or pull requests

3 participants