-
Notifications
You must be signed in to change notification settings - Fork 10
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
refactor: fewer response models #146
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two comments, then I'll approve!
Also the tests fail! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've only reviewed the web folder, but I found some "symptoms" in the generated models, that should be resolved in the backend.
web/src/api/generated/models/delete-todo-by-id-response-model.ts
Outdated
Show resolved
Hide resolved
6696e56
to
a61051c
Compare
I believe the points below are important to address in order to solve this. This PR is growing big, has several breaking changes, unresolved comments are outdated due to force-pushing and many important decision points needs conclusion in order to review it properly, like:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
To respond to some of @olavis points:
- What are the relations between the entities (User and TodoItem)?
There is currently no User entity, is there? But each user can have n
TodoItems, while each TodoItem has one user. (1-n)
- What is the response from DELETE?
Currently { success: boolean }
which works fine.
- Communication between frontend and backend: what are the web client needs from the API and in which format do they communicate
I feel that currently, the communication works well, and since we have typescript in the frontend, it's not too critical how things are structured (details-wise), because we get autocomplete and type hints everywhere.
- What properties should (and should not) the TodoItem type contain in the web client, aka what will be the returned response from the API?
Ah this is a discussion for another day!
I think things are okay for now: @olavis please go over any comments again |
I comment them, please close those that are outdated and we need many of the request models. The camelcase should be done in new PR. |
b0649de
to
4413603
Compare
@eoaksnes the second round of reviewing had almost 40 updated files to go through.. Maybe you could focus on avoiding force-pushing and separating changes into smaller PR's next time? 🙏 It's hard to follow your work, and I'm less confident in my reviews as I fear that I easily could've missed something. |
Okay, had a quick look. I'd say many of my arguments from the first round are still relevant (please explain why you mean they're not worth the attention and I'll appreciate to learn 😸). I also found some new code smells introduced with the update. I think I'll just leave it at this point for now - the changes between each review are big enough to keep this going even longer, and tbh I think it would be more effective to try to move some of this into separate branches and merge them bit by bit, to be able to keep up with the conversations and changes between each round. I see @sebastianvitterso have resolved many of my comments from the first round - if he can vouch for it, good! nothing's better. I think I've come close to the point where I'm not anymore able to review this confidently. |
Why is this pull request needed?
Make it easier to work with the API
Map entity fields to request and response models
Relevant information
What does this pull request change?
filter_fields
decorator that maps from entity to response and request modelsIssues related to this change:
Resolved #155