Skip to content

📦 Use forked class-validator package#696

Merged
douglasduteil merged 2 commits intomainfrom
use-forked-class-validator
Nov 14, 2025
Merged

📦 Use forked class-validator package#696
douglasduteil merged 2 commits intomainfrom
use-forked-class-validator

Conversation

@rdubigny
Copy link
Contributor

@rdubigny rdubigny commented Nov 14, 2025

Problem
They are inheritance issues in class-validator (see issue:
typestack/class-validator#633).

We updated a PR to fix this problem:
typestack/class-validator#2641.

However, the chances of it ever being merged are low, as the repository
no longer appears to be actively maintained.

Proposal
Use the patched package and import it via an "ugly" github link.
This should push us toward eventually migrating to another validation
library such as Zod.

@rdubigny rdubigny force-pushed the use-forked-class-validator branch 4 times, most recently from c458704 to 661e419 Compare November 14, 2025 10:47
**Problem**
They are inheritance issues in `class-validator` (see issue:
typestack/class-validator#633).

We updated a PR to fix this problem:
typestack/class-validator#2641.

However, the chances of it ever being merged are low, as the repository
no longer appears to be actively maintained.

**Proposal**
Use the patched package and import it via an "ugly" github link.
This should push us toward eventually migrating to another validation
library such as Zod.
@rdubigny rdubigny force-pushed the use-forked-class-validator branch from 661e419 to 5151c10 Compare November 14, 2025 11:03
**Problem**
Since `class-validator` inheritance was broken, we duplicated several
field declarations in the identity DTOs and `UserSession` ended up being
mistyped in some controllers.

**Proposal**
Use DTO inheritance to avoid this issues.
@rdubigny rdubigny marked this pull request as ready for review November 14, 2025 12:02
"body-parser": "^2.2.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.2",
"class-validator": "proconnect-gouv/class-validator#build-0.14.2-proconnect.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: good good

Copy link
Contributor

@douglasduteil douglasduteil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@douglasduteil douglasduteil merged commit 428670e into main Nov 14, 2025
14 checks passed
@douglasduteil douglasduteil deleted the use-forked-class-validator branch November 14, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants