feat: add changeBarcode to ProductOpenerApiV2#782
feat: add changeBarcode to ProductOpenerApiV2#782garvit-bhattt wants to merge 9 commits intoopenfoodfacts:developfrom
Conversation
We should fix this at the OpenAPI layer if possible. Casting to any is never good. |
…to any This addresses the maintainer's feedback about removing the 'as any' cast from the changeBarcode request payload by using the updated OpenAPI schema.
|
@VaiTon I've regenerated the local |
VaiTon
left a comment
There was a problem hiding this comment.
❯ head -n5 src/schemas/server/v2.ts
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
v2.ts is regenerated using the OpenAPI definition stored in the server repository. See redocly.yaml and package.json for details.
|
@VaiTon I've reverted the |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #782 +/- ##
===========================================
- Coverage 74.72% 73.92% -0.81%
===========================================
Files 13 13
Lines 368 372 +4
Branches 82 84 +2
===========================================
Hits 275 275
- Misses 69 73 +4
Partials 24 24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@VaiTon Should I also add lightweight SDK-side checks ( |
src/off-v2.ts
Outdated
| user_id: credentials?.username ?? "", | ||
| password: credentials?.password ?? "", |
There was a problem hiding this comment.
Can't we just use credentials?.username? Are these fields mandatory?
There was a problem hiding this comment.
These fields are not strictly guaranteed to be present on credentials, so the fallback prevents undefined from being sent in the payload. Happy to simplify it.
There was a problem hiding this comment.
I'd like to not even include the fields if the corresponding fields are undefined.
There was a problem hiding this comment.
I'll update the payload to omit these fields when the corresponding credentials values are undefined.
|



What
new_codeby casting the body toany, ensuring absolutely zero interference with other auto-generated schema files.