Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #11062
Closed
Open
Issue created Dec 07, 2021 by Administrator@rootContributor

[BUG] [swift5] mapFileBinaryToData crashes fatally in URLSessionImplementations.swift

Created by: denizdogan

In URLSessionImplementations.swift, there's a case missing in the switch:

            case let number as NSNumber:

                if let data = number.stringValue.data(using: .utf8) {
                    urlRequest = configureDataUploadRequest(
                        urlRequest: urlRequest,
                        boundary: boundary,
                        name: key,
                        data: data
                    )
                }

            case let data as Data: // <--- this entire case is missing!

                urlRequest = configureDataUploadRequest(
                    urlRequest: urlRequest,
                    boundary: boundary,
                    name: key,
                    data: data
                )

            default:
                fatalError("Unprocessable value \(value) with key \(key)")
            }

The above works for me, I'm not sure there's anything I'm missing here. Without the above case for Data, the entire application crashes fatally. It only happens when used with mapFileBinaryToData: true.

@4brunu

Assignee
Assign to
Time tracking