before-interop / anomalieAdresse

Ce protocole permet le traitement d'une demande de création ou de modification d'adresses immeuble dans les IPE
https://before-interop.github.io/anomalieAdresse/
1 stars 6 forks source link

Avoid multiple validation of same property (relatedEntity here) by avoiding redefinition #133

Open hamdan-ahmad-lb opened 3 weeks ago

hamdan-ahmad-lb commented 3 weeks ago

This issue is strictly related to https://github.com/before-interop/common/issues/52 and should be resolved together.

Currently, TroubleTicket, AnomalieAdresseBase, AnomalieAdresseNewBuilding, AnomalieAdresseUpdate, and AnomalieAdresseUpdateNbLogements all defines the relatedEntity property.

If we want to have polymorphism, this leads to have "cascading validation" more than once for the relatedEntity. This will cause the validation to always fail in any interface generated using codegen.

Normally, we should have a single source of truth, and this is highlighted in the official best practices: https://learn.openapis.org/best-practices.html#keep-a-single-source-of-truth

that's why we should remove the definition of relatedEntity from parents and define it only in the "leaves"

richard-olvera commented 1 week ago

Je ne comprend pas cette issue, vous enlevez le typage de l'objet dans common pour corriger votre probleme... alors que RelatedEntity est bien une classe mere je ne comprend pas où est le multi source