We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have an OpenAPI spec with the following request:
"/api/files": { "post": { "tags": [ "files" ], "summary": "Create File", "operationId": "create_file_api_files_post", "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/Body_create_file_api_files_post" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JsonCreateFileOutput" } } } }, "422": { "description": "Validation Error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HTTPValidationError" } } } } } }
Where the body is defined as:
"Body_create_file_api_files_post": { "properties": { "file": { "type": "string", "format": "binary", "title": "File" }, "description": { "type": "string", "title": "Description" } }, "type": "object", "required": [ "file", "description" ], "title": "Body_create_file_api_files_post" }
When I give that to elm-open-api it produces:
elm-open-api
-- config.body is "{ body : Bytes.Bytes }" createFileApiFilesPost config = Http.request { method = "POST" , headers = [] , expect = Http.expectJson config.toMsg decodeJsonCreateFileOutput , body = Http.bytesBody "multipart/form-data" config.body , timeout = Nothing , tracker = Nothing , url = "/api/files" }
The text was updated successfully, but these errors were encountered:
Looks like I need to implement https://package.elm-lang.org/packages/elm/http/latest/Http#multipartBody for Content-Type: multipart/form-data.
Content-Type: multipart/form-data
Sorry, something went wrong.
No branches or pull requests
I have an OpenAPI spec with the following request:
Where the body is defined as:
When I give that to
elm-open-api
it produces:The text was updated successfully, but these errors were encountered: