aiondemand / AIOD-rest-api

A containerized application using FastAPI and SQLAlchemy connected to a MySQL database.
MIT License
10 stars 7 forks source link

`relevant_link` should not be an enum #296

Open PGijsbers opened 3 months ago

PGijsbers commented 3 months ago

Work in progress: https://github.com/aiondemand/AIOD-rest-api/tree/fix/relevant_links Besides it showing as enumerable (a side-effect of being a NamedRelation as they are added through src/routers/enum_routers/__init__.py), there is a more severe error here: the relationship is defined through a FindByNameDeserializerList class which normalizes to lower-case, and the lower case constraint is embedded into the database through the NamedRelation. This is great for enums, but not for URLs, which are case sensitive. The fix in the branch seems to work, but I don't know that it's the best way to go about this. Do we need all the overhead of avoiding duplication in the link table? There are pros and cons to this.