You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So we have a use-case, where you can create asset resources (inline, upload, import from url, external url).
This endpoint can be called with both application/json and multipart/form-data content types.
But only the latter provides you with the capability to upload actual files as content from your computer.
(We know with base64 encoding application/json could be able to handle it, but it would result in a 33% transfer size increase, so this is why we opted for the multipart/form-data content type.)
Currently, @kubb/plugin-react-query is ignoring the "multipart/form-data" content type, but it should not.
External documents/projects?
No response
What is the feature you are proposing to solve the problem?
@kubb/plugin-react-query should generate additional operations for the different content types.
the application/json could still be viewed as the default resulting in the usual: useCreateOperationName hook name
As for other contentTypes, they could get sensible names, like:
multipart/form-data -> Form
application/x-www-form-urlencoded -> EncodedForm
text/plain -> Text
application/xml - XML
If the content type is not in the predefined list, we could just Pascalcase the content type.
With these names, the resulting hook could be called <basename>With<sensible_name> like useCreateOperationNameWithEncodedForm.
What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered:
What is the problem this feature would solve?
So we have a use-case, where you can create asset resources (inline, upload, import from url, external url).
This endpoint can be called with both
application/json
andmultipart/form-data
content types.But only the latter provides you with the capability to upload actual files as content from your computer.
(We know with base64 encoding
application/json
could be able to handle it, but it would result in a 33% transfer size increase, so this is why we opted for themultipart/form-data
content type.)So our schema looks similar to this:
Currently,
@kubb/plugin-react-query
is ignoring the "multipart/form-data" content type, but it should not.External documents/projects?
No response
What is the feature you are proposing to solve the problem?
@kubb/plugin-react-query
should generate additional operations for the different content types.the
application/json
could still be viewed as the default resulting in the usual:useCreateOperationName
hook nameAs for other contentTypes, they could get sensible names, like:
multipart/form-data
-> Formapplication/x-www-form-urlencoded
-> EncodedFormtext/plain
-> Textapplication/xml
- XMLIf the content type is not in the predefined list, we could just Pascalcase the content type.
With these names, the resulting hook could be called
<basename>With<sensible_name>
likeuseCreateOperationNameWithEncodedForm
.What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: