Skip to content

[BUG] [SWIFT] Stored properties cannot be marked potentially unavailable with '@available' with 7.0.0 #16479

Description

@barcister

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

Upon updating our projects to 7.0.0 we've noticed a build error in Xcode in URLSessionImplementations.swift on line 55:
@available(*, unavailable, message: "Please override execute() method to intercept and handle errors like authorization or retry the request. Check the Wiki for more info. https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-do-i-implement-bearer-token-authentication-with-urlsession-on-the-swift-api-client")

openapi-generator version

7.0.0 (works fine on 6.6.0)

Steps to reproduce

Generate a base client to Swift using 7.0.0 version and try to run the project.

Xcode version: 14.3.1 and 15.0

Suggest a fix

As an interim fix, we created our own moustache file without the available check and that resolved our build issues.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions