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
  • #8511
Closed
Open
Issue created Jan 22, 2021 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[BUG][swift5] Closure isn't called anymore in latest snapshot with default configuration

Created by: fl034

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

This project showcases a weird error where callback closure is not called.

  • This happens with the default library selected (URLSession). With Alamofire, everything is fine.
  • In the 5.0.0 stable version, the error is not happening
  • Snapshot Commit: 90ed1290 from 2020-01-22
  • Tested with Xcode 12.3 (12C33) on macOS Catalina 10.15.7 (19H15)
  • Try switching the generator from snapshot to stable pod in Podfile to see the change.
openapi-generator version

5.0.1-snapshot (commit 90ed1290)

OpenAPI declaration file content or url

See test-project: https://github.com/fl034/Test-OAS

Generation Details
  • Swift5 with defaults
Steps to reproduce

Run sample project

Related issues/PRs

Nothing found

Suggest a fix
  • The issue seems to be in URLSessionImplementations.swift in line 137. self seems to be deallocated immediately, because it’s weak.
  • When I remove [weak self] it works again. But this isn’t the root of the problem, since the stable version also has [weak self]
Assignee
Assign to
Time tracking