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

Add support for AsyncAPI newer versions #503

Closed
EricWittmann opened this issue Aug 16, 2022 · 19 comments
Closed

Add support for AsyncAPI newer versions #503

EricWittmann opened this issue Aug 16, 2022 · 19 comments

Comments

@EricWittmann
Copy link
Member

The most recent version (as of writing this issue) of AsyncAPI is 2.4.0:

https://www.asyncapi.com/docs/reference/specification/v2.4.0

We implemented initial support for AsyncAPI when it was still 2.0. We need to update our support to handle the newer versions.

@Yuutakasan
Copy link

Hi Eric

Thanks for the good conversation on apicurio registry.

Schema converter support
Apicurio/apicurio-registry#2675

Is 2.0.0 fully supported?
Also, if you could make a task list for supporting 2.4.0, we might be able to develop it.

@EricWittmann
Copy link
Member Author

Thanks for the offer @Yuutakasan ! We're working on some things now (in apicurio-data-models) that should make adding support for new versions of the OpenAPI and AsyncAPI specs easier. It's probably best to wait for that work to complete before specifically working on new versions of AsyncAPI.

@Yuutakasan
Copy link

@EricWittmann
Understood! Thank you! When do you think you will be able to fix it?
It's hard to support OpenAPI generator and AsyncAPI generator, and I'm thinking that it would be possible to generate API automatically from data model.
By the way, well done Apicuro!

@EricWittmann
Copy link
Member Author

We're actively working on the next generation of apicurio-data-models now. But it would probably be at least a couple of weeks before we had a preview of that work ready. Stay tuned!

Also note that we do have this project as well: https://github.com/Apicurio/apicurio-codegen/

It's an opinionated code generator for generating JAX-RS interfaces and java beans. It uses the data models project to analyze an OpenAPI definition and generated server stubs.

@Yuutakasan
Copy link

Thank you very much. We'll be waiting for you!

I knew about apicurio-generator, but actually, due to the fact that I want to use a spring project, I am using openapi generator to automatically generate stub programs. (I have developed and generated a custom template)

@Yuutakasan
Copy link

@EricWittmann

By any chance, since you are correcting the data model now, would you like to support openapi spec 3.1.0 as well?

@EricWittmann
Copy link
Member Author

That is the plan! We will be adding support for all async API versions and all missing open API versions. We might even get crazy and start supporting JSON schema as well.

@Yuutakasan
Copy link

@EricWittmann
I would like to use it and I am waiting for the next version.
I'm looking forward to it!

@Yuutakasan
Copy link

That's great! It sure would make dealing with the new format a lot easier!
https://github.com/Apicurio/apicurio-data-models/commits/data-models-2.0-validate-models

@EricWittmann
Copy link
Member Author

Update: we're actively working on the next major version of data models. Progress is being made. It's a significant change and upgrade, so please be patient. :)

@Yuutakasan
Copy link

Yuutakasan commented Nov 15, 2022

@EricWittmann
Thanks for the reply. I'm looking forward to this tremendously!
Will this implementation change affect Apicurio Studio or Apicurio Registry?
Do you think you will be able to release it by the end of this year?

@Yuutakasan
Copy link

@EricWittmann
I am planning to develop a program using AyncAPI using Apicurio Studio, and when I decided to design AsyncAPI using ApicurioStudio now, I realized that there are many features that are not yet supported.
I think I'll start with apicurio-data-models, but when will you be releasing the second series of programs?

@EricWittmann
Copy link
Member Author

Have a look at the current work being done on Data Models 2.0 here:

https://github.com/Apicurio/apicurio-data-models/tree/2.0

A good amount of the work is done. We're moving away from a manually maintained data model to one where we generate a lot of the code using a custom codegen implementation. Have a look at the above branch to see the current status. This will allow us to more easily maintain the data models project over time, especially as OpenAPI and AsyncAPI release new versions.

I am working on migrating existing functionality from 1.0 over to 2.0. Currently all of the I/O tests pass and all of the NodePath tests pass. I will need to migrate additional functionality such as all of the Commands/Operations and all of the validation. The hard part is, I think, done. But there is still some tedious porting of existing code, and some missing features from the codegen (e.g. the code generator currently doesn't support union types).

@EricWittmann
Copy link
Member Author

I would expect a Beta release in early January of Data Models 2.0. It's a lot of work that I think will pay dividends in the future. Thanks for your patience.

@EricWittmann
Copy link
Member Author

Also to answer an earlier question you had - this work will impact Registry for sure. It should also become the new core of whatever we end up doing with the OpenAPI and AsyncAPI editors (e.g. either keep maintaining the current Angular editors or hopefully rewrite them in React, if I can find the bandwidth).

@Yuutakasan
Copy link

Yuutakasan commented Dec 11, 2022

@EricWittmann
Eric's work is excellent, I'm waiting for early January.
I'd like to go from Angular to react too, but I've done quite a bit of customization and it's going to be a struggle if I want to migrate.

I have a customized implementation of this area.
・Adding rules for my own OpenAPI spec
・Customized tags such as x-audience, x-limiting-ramain, etc.
・Add a function to display Async API documents automatically.
・Add Open Api Generator that automatically generates API from Open Api Spec created by Apiocurio Strudio.
・Added a function to automatically generate Path and Operation from DataType according to the company's own rules.
etc

It is fun to develop because there are various parts that span Apicurio studio, data-models, and apicurio registry.

@EricWittmann
Copy link
Member Author

OK good news (albeit rather late) is that we've released Apicurio Data Models 2.0.0.RC1. This is a brand new version of the library and uses a code generation approach to managing the nodes, visitors, traversers, I/O, etc.

This new approach makes it really easy for us to implement support for new versions of these specifications (and hopefully new specifications as well!). The old version required quite a lot of manual coding whenever a new version of a spec was released. Now the code generator does all the heavy lifting.

Please have a look at the new version of data models! We're definitely at the point where we would be very happy to have contributions. Especially in the validation and command layers.

#168 (comment)

@Yuutakasan
Copy link

@EricWittmann

I'll be sure to check that out!
Sorry Eric, we're in the middle of development right now in February and March, so I'll take it up in April and help with development a bit!

@EricWittmann
Copy link
Member Author

This has been addressed in data-models 2.x - all versions of AsyncAPI and OpenAPI are supported. We've taken a new approach to the library to make adding support for new versions of these specs easier so we won't lag behind as easily anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants