Ideas for v2 #279
ChillFish8
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Thank you so much for these suggestions! 🙂
You can use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I've noticed there is a v2 beta/alpha 👀
We're using poem in quite a few big systems and noticed a couple of things that would be nice to change (in my opinion) but would have been breaking changes:
/foo/:bar
with a path value that attempts to get the case into say an integer (Path<u64>
) I think it would possibly be a better idea to have this return a 404 rather than a 400 status code, this tripped up some devs when linking it up with the frontend and during testing because they would think their parameters or body is invalid, not the fact that the URL is incorrect.Specifically, this gets confusing when you have routes that overlap i.e
/foo/bar
and/foo/:id
because if you miss type/foo/bar
with/foo/bars
it'll go down the/foo/:id
route and return a 400 if it can't convert the value.Option<T>
along the lines ofNonRequired<T>
with varientsSome(T)
andMissing
where the variant is onlyMissing
if the field is not included at all.This came out of running into a time where we had editable fields but some fields were also nullable, which meant we couldn't just have them be Options or default and I think it's probably common enough to be worth being in some sort of utils pack?
Those are really the only pain points I've run into overall in the some 20,000 LOC worth of API routes.
Obviously these are just my two cents but as aways this framework is great ❤️
Beta Was this translation helpful? Give feedback.
All reactions