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 #52

Open
hamdan-ahmad-lb opened this issue Oct 4, 2024 · 0 comments · May be fixed by #53
Open

Comments

@hamdan-ahmad-lb
Copy link
Contributor

hamdan-ahmad-lb commented Oct 4, 2024

This issue is strictly related to before-interop/anomalieAdresse#133 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"

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