Conversation
|
perfect, i just had issue with this being marked required in the spec 😄 |
|
@timonrieger what use case are you using |
| if (items.length === 0) { | ||
| return []; | ||
| } | ||
|
|
There was a problem hiding this comment.
btw. this duplicates the guard set in https://github.com/immich-app/immich/pull/25143/files#diff-c80282da76df83dbb605192d511162ba1a48cca7c9726828dd1d9297c3a438d2R436
There was a problem hiding this comment.
True but this repo method might be used in other places in the future. The typing for the method itself doesn't preclude sending empty values but the database will throw an error so it's seems like an appropriate place to include it.
You could revert the length change but a check is still needed either way because it can be undefined so let's just leave it as is.
i am building https://github.com/timonrieger/immich-python-client, and currently dealing with the upload endpoint to make it accessible. It's auto generated from the openapi spec, so since metadata is marked as required i faced issues. I manually patched the following error, but server-side is the correct place obv. passing The server does not handle empty values correctly. to reproduce could you test this on the latest main build (i don't have a machine available rn) Note Your PR should fix this insofar as the client would know that this is an optional field now and can omit the metadata field entirly. for the sake of completeness, commenting here nevertheless will file a PR nevertheless |
|
This is bringing up some old memories. I think that because this endpoint uses form data to accept the upload file, you have to send the other data as form fields as well. And, I don't think it's actually possible to natively send a list of json objects in a single form field. You would need to manually stringify it or something. |
yes, form data is always stringified. Sending patch |
|
Oh, I already fixed this in #21594. If you stringify the metadata before sending it, it should just work. |
just figured, my patch is unnecessary, handling weird cases assuming the client is dumb 🤣 . stopping here now…thanks for the fix |
|
btw. i recognized that server-side optional properties are often typed with runtime tells me that these field sometimes don't exists (as expected from optional) Should these be changed to latitude?: number[] and longitude?: number[] to match the spec and runtime, or is there a reason to keep !? |
|
I think those might be dynamic based on that query parameter. Time buckets specifically are a very specialized thing that's only meant to be used with immich-web so I wouldn't rely on them not changing in the future. |
metadataoptional in open api, to match the runtime checksFollow up to #25143