cyclosproject / ng-openapi-gen

An OpenAPI 3.0 codegen for Angular
MIT License
394 stars 132 forks source link

[Bug] Wrong `File` type #146

Closed Roman991 closed 3 years ago

Roman991 commented 3 years ago

swagger.json

        "/app/api/mws/jobs/add-skus-list-to-csv": {
            "post": {
                "operationId": "MatchCsvInAmz",
                "requestBody": {
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "csv_to_match": {
HERE==>>>>                              "type": "file",
                                        "description": "file di testo con campi isbn10 o isbn13"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },

generates >>> api/services/name_service.ts

  matchCsvInAmz(params?: {
    body?: { 'csv_to_match'?: file }
  }): Observable<string> {

file should be just be with the first letter capital

the working one

  matchCsvInAmz(params?: {
    body?: { 'csv_to_match'?: File }
  }): Observable<string> {
luisfpg commented 3 years ago

OpenApi 3, in contrast to Swagger 2, has no type = file. See https://swagger.io/docs/specification/describing-request-body/file-upload/