🎨 Deprecate count/start query params and implement limit/offset#3208
Conversation
|
I guess this would be considered a breaking change. I'm still not sure what the release version strategy for changes like this. |
Cool, I can implement the same limit/offset pagination query params for these 3 endpoints, as for the other endpoints.
👍
Indeed. One strategy is just do it! Rip and replace. Alternatively, a better strategy is to announce deprecation before ripping and replacing. So, I can keep the count/start query params in place (just mark as deprecated for the openapi spec), with existing functionality, but also add limit/offset as new query params, which would override count/start if set. People unaware of count/start change won't get any breaking changes. And people aware can start using limit/offset instead. |
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
81956b1 to
da28bc4
Compare
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
Signed-off-by: ff137 <ff137@proton.me>
|
Any status update on this PR so we can raise it in the ACA-Pug meeting tomorrow -- 2024.11.16 @ 8:00 Pacific / 17:00 Central Europe? |
|
I think it's ready for review / good to merge. We're using it on our fork. Essentially deprecates the string Apologies for not joining the regular ACA-Pug sessions - I have routine plans for that time on Tuesdays |
|
Looks like there is a test failing because |
Signed-off-by: ff137 <ff137@proton.me>
|
|
I'll take a swing at reducing the duplication |
|
Oh shucks, I remember why I didn't deduplicate by inheriting from the PaginatedQuerySchema earlier. It's so that there's still backward compatibility, so that limit/offset is not loaded with default values, and it'll stick to existing defaults instead ... It's really much of a muchness to preserve backward compatibility, but I'm going to revert my changes, since it didn't even improve the quality check. Rememberdc this thanks to my note: |
42c2ced to
dbfde34
Compare
|
I'm hoping this one can be merged sometime soon. |
jamshale
left a comment
There was a problem hiding this comment.
Just noticed the marshmallow fields validate functions can take a Range instead of lambda. Other than that we can go ahead with this.
|
…wallet-foundation#3208) * 🎨 Modify count/start query params to be Integers, not Strings Signed-off-by: ff137 <ff137@proton.me> * 📝 Update openapi spec Signed-off-by: ff137 <ff137@proton.me> * ⏪ Revert start/count field to remain String type; mark as deprecated Signed-off-by: ff137 <ff137@proton.me> * ✨ Implement limit/offset alongside deprecated count/start Signed-off-by: ff137 <ff137@proton.me> * 🎨 Standardise naming convention from count/start to limit/offset Signed-off-by: ff137 <ff137@proton.me> * ⏪ Revert start/count field to remain String type; mark as deprecated Signed-off-by: ff137 <ff137@proton.me> * ✨ Implement limit/offset alongside deprecated count/start Signed-off-by: ff137 <ff137@proton.me> * 🎨 Remove unused query string schema from `w3c_creds_list` Signed-off-by: ff137 <ff137@proton.me> * 🎨 Rename args Signed-off-by: ff137 <ff137@proton.me> * 📝 Update openapi specs Signed-off-by: ff137 <ff137@proton.me> * ✅ Signed-off-by: ff137 <ff137@proton.me> * 🎨 Update start/count keywords to offset/limit Signed-off-by: ff137 <ff137@proton.me> * 🎨 Replace validate lambda with Range Signed-off-by: ff137 <ff137@proton.me> --------- Signed-off-by: ff137 <ff137@proton.me> Co-authored-by: Stephen Curran <swcurran@gmail.com> Co-authored-by: jamshale <31809382+jamshale@users.noreply.github.com>
…wallet-foundation#3208) * 🎨 Modify count/start query params to be Integers, not Strings Signed-off-by: ff137 <ff137@proton.me> * 📝 Update openapi spec Signed-off-by: ff137 <ff137@proton.me> * ⏪ Revert start/count field to remain String type; mark as deprecated Signed-off-by: ff137 <ff137@proton.me> * ✨ Implement limit/offset alongside deprecated count/start Signed-off-by: ff137 <ff137@proton.me> * 🎨 Standardise naming convention from count/start to limit/offset Signed-off-by: ff137 <ff137@proton.me> * ⏪ Revert start/count field to remain String type; mark as deprecated Signed-off-by: ff137 <ff137@proton.me> * ✨ Implement limit/offset alongside deprecated count/start Signed-off-by: ff137 <ff137@proton.me> * 🎨 Remove unused query string schema from `w3c_creds_list` Signed-off-by: ff137 <ff137@proton.me> * 🎨 Rename args Signed-off-by: ff137 <ff137@proton.me> * 📝 Update openapi specs Signed-off-by: ff137 <ff137@proton.me> * ✅ Signed-off-by: ff137 <ff137@proton.me> * 🎨 Update start/count keywords to offset/limit Signed-off-by: ff137 <ff137@proton.me> * 🎨 Replace validate lambda with Range Signed-off-by: ff137 <ff137@proton.me> --------- Signed-off-by: ff137 <ff137@proton.me> Co-authored-by: Stephen Curran <swcurran@gmail.com> Co-authored-by: jamshale <31809382+jamshale@users.noreply.github.com>


Affected endpoints:
GET /present-proof/records/{pres_ex_id}/credentials)GET /present-proof-2.0/records/{pres_ex_id}/credentials)GET /credentials)These endpoints have query params:
startandcount.They are of string type, and then cast to integers in method logic.
countalso uses a default value of 10, which was previously just in code, and not in the openapi spec.So this PR modifies those query params to be of int type, with more logical validation, and clearer default value.
❓ Questions:
GET /credentials/w3c) uses the same query schema asGET /credentials, but it does not make use of count or start ... Should that be implemented?Edit: now keeps count/start behavior as previous, but marks it as deprecated. limit/offset is implemented alongside the old query params, and will be used instead, if provided.
So - no breaking changes, but count/start should be dropped in a future release.