Skip to content

Conversation

@aaa2000
Copy link
Contributor

@aaa2000 aaa2000 commented Jan 5, 2026

Q A
Branch main for features
License MIT

Adds Symfony validation constraints (Uuid or Ulid) to query parameters whose OpenAPI schema specifies format: uuid or format: ulid

@soyuka soyuka changed the title fix(validator): uuid/ulid parameter validation feat(validator): uuid/ulid parameter validation Jan 5, 2026
@soyuka
Copy link
Member

soyuka commented Jan 5, 2026

I'll fix the CI on the main branch asap.

@aaa2000 aaa2000 force-pushed the add-uuid-ulid-validation-constraint branch from 1711403 to b342dd5 Compare January 9, 2026 09:47
@aaa2000
Copy link
Contributor Author

aaa2000 commented Jan 9, 2026

I think the PR requires changes because the uuid constraint is not add when the UuidFilter is used because the following schema is not supported

{
    "oneOf": [
        {
            "type": "string",
            "format": "uuid"
        },
        {
            "type": "array",
            "items": {
                "type": "string",
                "format": "uuid"
            }
        }
    ]
}

Filtering by an invalid uuid should return a 422 response and not a 400 response

https://github.com/api-platform/core/blob/main/tests/Functional/Uuid/UuidFilterBaseTestCase.php#L151C55-L151C71

@soyuka
Copy link
Member

soyuka commented Jan 9, 2026

sure let me know when I should review

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.

2 participants