byte-it / openapi-spec-generator

Creates Open API spec for a Laravel JSON:API
3 stars 6 forks source link

PHP 7.4 support #1

Closed bbrala closed 3 years ago

bbrala commented 3 years ago

Hi,

I would love to use your package, but it seems its PHP 8 only. Any chance you would want to support 7.4? I'll make a PR that refactors a bit to enable support.

captnCC commented 3 years ago

I'm currently working on rewrite of the complete package, it will take a few more days.

A planned feature is to use php8 attributes to allow easy customisation off all specs. This collides directly with support for php7. It would be possible to refactor the package for php7.4 without this feature. A way could be to let a 0.x.x version stay with php7 support and branch off for the 1.0.0 with php8 only and support for attributes.

I will come back to you when the rewrite is done and a refactor to php7 can start!

bbrala commented 3 years ago

Ah, good to know, I was actually contemplating rewriting this on my own since I think this is really important for the json:api ecosystem to get this right.

I think it is important for adoption to consider the current set of php versions supported by the laravel-json-api/laravel package and Laravel in general. This would mean in my opinion that removing support for PHP 7.4 is a bit premature right now.

Laravel 8 requires php 7.3+ (supported until januari 2023, https://laravel.com/docs/8.x/releases). Not sure what Laravel 9 will do regarding this. Curerntly the package laravel-json-api/laravel supports Laravel 8

I understand that using PHP 8 will open new doors development wise, but I think if you think about adoption this will result in a smaller number of users. I really believe in JSON:API and the importance of getting interoperability using OpenAPI right.

captnCC commented 3 years ago

Well from this standpoint I have to agree with you. My urge to use the latest and greatest rushed me a bit here.

It would be great to have somebody on board who is a bit more experienced with JSON:API. I'm fairly new to the spec and worked on this package to adopt the Laravel JSON:API ecosystem for new projects, with the ease of a OOTB generated documentation.

bbrala commented 3 years ago

Glad to hear that, if you want some extra eyes on what you are building i'm willing to help. If we get something working well we would add it to our sensible defaults. :)

captnCC commented 3 years ago

Here we go, the first stage has been done. It was more work than I anticipated, but I think it was worth it. I have a sample project under https://github.com/byte-it/laravel-jsonapi-sample to checkout what it does. (Its the dummy included in the JSON API package with some modifications). I'm sorry, that your PR for the php7.4 compatibility is now somewhat obsolet.

From here on I'm open for any suggestions and feedback to the general structure of the generated specs and the code itself!

bbrala commented 3 years ago

Looks pretty awesome, i made a new pr #3 :) Ill make a new issue with a few things i found that seem to go wrong when generating.

captnCC commented 3 years ago

The PR is now merged!