-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix(server): more asset upload validation and docs #1720
fix(server): more asset upload validation and docs #1720
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
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.
The new validation looks great! Thanks for the contribution, just a few comments about some possible simplification.
Regarding the issue with the enum. This looks to be specifically related to our enum/object type being used in a form. I'd really rather not do another custom patch, if it can be avoided. I'm happy to have this enum be |
Seems related: OpenAPITools/openapi-generator#13880 |
Are you on the immich discord by chance? |
Looking at the patch some more, I think it's an actual bug in the generator that should be fixed in the upstream repo. I'm fine either way (patch or reverting to inline-enum), but it would be nice to get this fixed upstream if possible. |
An upstream fix would be the ideal solution, but the amount of open issues and PRs are scary. The bug seems to be introduced in OpenAPITools/openapi-generator#7816 as suggested. I tried using the template file before that PR got merged, but several other improvements and fixes have been made since so it's not worth it IMO. I'm good with leaving it like this, unless you want the custom template removed. |
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.
Also happy with it 👍
Looks good, can you help resolve the conflict in this PR? |
This reverts commit 0e00805.
…asset-upload-validation-docs
Done |
I've made some changes to the
/asset/upload
endpoint in order to add proper validation. Before these changes, theassetType
enum could be set to an arbitrary value and theassetData
was allowed to be empty. Now,assetType
will only accept values defined in the enum andassetData
will be required. I've also added missing API documentation to the endpoint.This was my first time working with NestJS, so feedback is welcome.