feature discussion: share schema model between frontend and backend #1337
-
First Check
Commit to Help
Example Code
DescriptionI have a feature request/discussion topic that I would like the opinion of others (particularly contributors of this repo). I have noticed repetition between the backend and frontend model definitions: I suggest to combine these 2 definitions into one, perhaps using something like protobuf or a json schema (looks like already done for frontend). This would save some mindless copy/paste time waste and reduce errors and typo issues. It would also make the schema definition cleaner and consistent. Implementation should be fairly straightforward (nothing new) and easily testable. Operating SystemmacOS Operating System Detailsn/a Python Versionn/a Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There shouldn't be two different definitions. |
Beta Was this translation helpful? Give feedback.
-
ah got it - thanks. i must have missed that in the documentation. assuming it is this? |
Beta Was this translation helpful? Give feedback.
There shouldn't be two different definitions.
Everything in
frontend/src/client/
is (/should be) generated based on the defined endpoints of the backend. Therefore the models used in the fronted are already based on the models defined and used in the backend.