Skip to content

Code generated for APIs requiring text/plain (etc.) as request content type not useful #109

@wizofaus

Description

@wizofaus

We have a couple of APIs for uploading documents, that in our swagger look like, e.g.:

 "/v1/validateFile": {
      "post": {
        "operationId": "validateFile",
        "consumes": [
          "text/plain"
        ],
        "produces": [
          "application/json"
        ],

But the function generated by swagger-axios-codegen has

     let data = null

      configs.data = data
      axios(configs, resolve, reject)

i.e., there's no way to pass in the actual contents to upload to the API!

Again, I could look at contributing a fix, but is this something you'd come across before?

We also have some APIs that require application/octet-stream as the input (binary file uploads).

Thanks!

Dylan

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions