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

Do not return annotations merged into an explicit parent in AttributeAnnotationFactory #1279

Merged
merged 1 commit into from
Jul 2, 2022

Conversation

GuilhemN
Copy link
Contributor

@GuilhemN GuilhemN commented Jul 1, 2022

I was looking for a solution to fix nelmio/NelmioApiDocBundle#1993 (explanation of root issue in #1220 (comment)), and I couldn't find an easy one from NelmioApiDocBundle without duplicating a lot of code and making things more likely to break later.

I believe the best solution would be to not return annotations that are already merged in AttributeAnnotationFactory so that these may not be merged again later.
This should have no repercussion on zircote/swagger-php internals as attributes returned by AttributeAnnotationFactory are passed to Analysis::addAnnotations which visits recursively passed annotations and so is able to find merged attributes from their newly defined parents.

What do you think? Would that be an acceptable fix for you?

@DerManoMann
Copy link
Collaborator

I am currently looking into these issues too, but more from a 'how do I track all nested annotations' POV.
Tests pass and this brings it more in line with docblocks, so yeah, fine with me :)

@DerManoMann DerManoMann merged commit 97abe42 into zircote:master Jul 2, 2022
@DerManoMann
Copy link
Collaborator

Thanks @GuilhemN

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.

Multiple @OA\Response() with the same response since 4.9.0
2 participants