modelina icon indicating copy to clipboard operation
modelina copied to clipboard

Implement PHP generator

Open Leamsi9 opened this issue 2 years ago • 7 comments

Reason/Context

PHP 8.1 has recently added native Enums meaning porting the modelina library should be straightforward. Async PHP and EDAs are growing rapidly in the PHP world, from Fibers being incorporated into the language to implementations like Swoole, Roadrunner, Amp, ReactPHP and RevoltPHP expanding, and the top PHP frameworks (Laravel + Symfony) incorporating async php into their ecosystems.

Given the preponderance of PHP in the web, it would be good to make the adoption of AsyncApi as smooth as possible. While generators for OpenApi exist, I don't think any exist for AsyncApi, so this would be a natural home.

Description

Generator should have possibility to define presets for class, enum type.

Additional: create presets for serialisation/converters from json.

Implementation could follow https://github.com/asyncapi/modelina/issues/49#issuecomment-1022310762

Leamsi9 avatar May 02 '22 16:05 Leamsi9

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.

github-actions[bot] avatar May 02 '22 16:05 github-actions[bot]

Implementation could follow #49 (comment)

Gotta make a dedicated readme for contributing new generators at some point in the future, but I guess that list is good place to start 👍

Is it something you would like to contribute @Leamsi9? Maybe even champion it afterward?

I would be happy to help in any way I can 🙂

jonaslagoni avatar May 02 '22 16:05 jonaslagoni

Very tempted indeed! Some big life changes imminent so not sure about my availability yet, but definitely keen and I can at least make a start, and maybe get some other PHPers onto it. I have a bit of time this week, who knows, maybe I can finish a first draft! And yes I would be very happy to become a language champion and help maintain and mobilise support in the PHP community, as long as I can step back down if life becomes a bit crazy?

Also, yes to the Readme suggestion. Would be good to extract any cross language lessons. I see there's a few issues raised for some other language generators, which would be good to make sure we address in new implementations?

Leamsi9 avatar May 02 '22 17:05 Leamsi9

That would be awesome 🔥

Absolutely, a minimal first draft is all that is needed so it can be improved over time 👍

... as long as I can step back down if life becomes a bit crazy?

Of course, that is all in your control 👍 That aspect is actually not covered in the documentation 🤔 Do you feel like that is missing in the documentation?

Would be good to extract any cross language lessons. I see there's a few issues raised for some other language generators, which would be good to make sure we address in new implementations?

Any specifics you refer to? 🤔

jonaslagoni avatar May 02 '22 17:05 jonaslagoni

Haven't looked in detail, I'm just aware that people have gone before me and I want to build on their learning, but maybe it's all been incorporated into the code I will be porting so that's fine. And yes, I think it would be good to add to the readme something about off-boarding, and what the expectations are in terms of time, otherwise some might assume something more onerous.

For now, count me in! Is there anything I need to do to register/be registered as a champion? Might also be good to have a link listing existing champions in the readme. That could help collaboration and idea sharing. If there are active champions for other languages I'd love to see what they've been up to for inspiration!

Leamsi9 avatar May 02 '22 18:05 Leamsi9

Haven't looked in detail, I'm just aware that people have gone before me and I want to build on their learning, but maybe it's all been incorporated into the code I will be porting so that's fine

You can see all the specific champions in the codeowner file and which areas they are responsible for 🙂 We are also all on Slack if you want more instant messaging 😄

And yes, I think it would be good to add to the readme something about off-boarding, and what the expectations are in terms of time, otherwise some might assume something more onerous.

True, suggested some small updates, feel free to review it 👍

For now, count me in! Is there anything I need to do to register/be registered as a champion? Might also be good to have a link listing existing champions in the readme. That could help collaboration and idea sharing. If there are active champions for other languages I'd love to see what they've been up to for inspiration!

No need to register or anything like that, by contributing and basically championing changes makes you a champion 💪

jonaslagoni avatar May 02 '22 19:05 jonaslagoni

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

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 :heart:

github-actions[bot] avatar Aug 31 '22 00:08 github-actions[bot]

I will try to create PoC for the PHP generator 😄 Feel free to reach out to me

Ferror avatar Nov 16 '22 17:11 Ferror

We have added a specific contribution guideline for how to add generators, see more here: https://github.com/asyncapi/modelina/blob/master/docs/contributing.md#adding-a-new-generator

Feel free to reach out if you need any help!

jonaslagoni avatar Feb 13 '23 01:02 jonaslagoni