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

[Question]: Code breaks after updating from 4.25.2 to 4.25.3 #2275

Closed
WilllemThijs opened this issue Apr 19, 2024 · 2 comments · Fixed by #2276
Closed

[Question]: Code breaks after updating from 4.25.2 to 4.25.3 #2275

WilllemThijs opened this issue Apr 19, 2024 · 2 comments · Fixed by #2276
Labels

Comments

@WilllemThijs
Copy link

Version

4.25.3

Question

I got this error after updating from 4.25.2 to 4.25.3 (The error also persists in the newer versions).

Attempted to load class "Constraint" from namespace "Symfony\Component\Validator". Did you forget a "use" statement for "Doctrine\DBAL\Schema\Constraint"?

I figured out that the response part of my code caused the error:

#[OA\Response(response: 200, content: new Model(type: BusinessDto::class))]
public function business(Business $business): JsonResponse
{
....
}

My BusinessDto class look like this:

<?php
declare(strict_types=1);
namespace App\Business\Model;

class BusinessDto
{
    public int $id;
    public string $name;
}

route: /api/doc
Symfony version is 7.0.6

Additional context

No response

DjordyKoert added a commit that referenced this issue Apr 20, 2024
| Q | A |

|---------------|---------------------------------------------------------------------------------------------------------------------------|
| Bug fix? | yes |
| New feature? | no <!-- please update src/**/CHANGELOG.md files --> |
| Deprecations? | no <!-- please update UPGRADE-*.md and
src/**/CHANGELOG.md files --> |
| Issues | Fix #2275 <!-- prefix each issue number with "Fix #", no need
to create an issue if none exists, explain below instead --> |

#2259 accidentally
removed the `class_exists` check for symfony/validator `Constraint`.
This currently causes applications using this bundle to fail because of
the missing symfony/validator dependency
@DjordyKoert
Copy link
Collaborator

Thank you for the issue! It should be fixed in https://github.com/nelmio/NelmioApiDocBundle/releases/tag/v4.26.1

@WilllemThijs
Copy link
Author

Thanks @DjordyKoert! It works.

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

Successfully merging a pull request may close this issue.

2 participants