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

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

Open
hamdan-ahmad-lb opened this issue Oct 4, 2024 · 1 comment · May be fixed by #134
Open

Comments

@hamdan-ahmad-lb
Copy link
Contributor

hamdan-ahmad-lb commented Oct 4, 2024

This issue is strictly related to before-interop/common#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
Copy link
Contributor

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

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