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 zircore/swagger-php 4.0 #1916

Merged
merged 8 commits into from
Dec 11, 2021
Merged

Add support for zircore/swagger-php 4.0 #1916

merged 8 commits into from
Dec 11, 2021

Conversation

alshenetsky
Copy link
Contributor

Which is introducing php 8.1 attributes support

@GuilhemN
Copy link
Collaborator

GuilhemN commented Dec 2, 2021

Thanks for submitting this PR!

It looks like they introduced some more changes, notably @OA\Undefined was moved to Generator::UNDEFINED (see https://github.com/zircote/swagger-php/blob/master/src/Generator.php#L50), and a migration guide is available at https://github.com/zircote/swagger-php/blob/master/docs/Migrating-to-v4.md.

@alshenetsky
Copy link
Contributor Author

alshenetsky commented Dec 2, 2021

@GuilhemN I'm sorry for being flippant at first. Fixed, and all the tests are passing with v4. But the code is backwards incompatible with the v3 version of zircotte/swagger-php. Do I still have to fix it to get it back compatible with v3? Or will nelmio/api-doc-bundle also have a major version? Sorry for probably stupid question, I just haven't yet come up with an elegant solution to support both versions.

@alshenetsky alshenetsky changed the title Add zircore/swagger-php 4.0 to composer.json Add support for zircore/swagger-php 4.0 Dec 2, 2021
@GuilhemN
Copy link
Collaborator

GuilhemN commented Dec 2, 2021

No worry, it is very nice of you to start this pull request, I appreciate it very much :)

I believe bumping our requirement on zircote/swagger-php to 3.2.0 should be enough, isn't it? (changes in the API were normally done in this version, see zircote/swagger-php@c5f0819)

@alshenetsky
Copy link
Contributor Author

@GuilhemN you are right. But I also had to add compatibility layer with 3.2 because of $context property which was moved to another class in 4.0. You can review it now :)

@GuilhemN GuilhemN merged commit 14383f4 into nelmio:master Dec 11, 2021
@GuilhemN
Copy link
Collaborator

Thank you! It's a very promising change :)

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

Successfully merging this pull request may close these issues.

None yet

2 participants