Skip to content

[swift] remove unavailable property to fix Xcode 15 compiler error#16504

Merged
4brunu merged 3 commits intoOpenAPITools:masterfrom
barcister:fix-version-7-swift
Sep 14, 2023
Merged

[swift] remove unavailable property to fix Xcode 15 compiler error#16504
4brunu merged 3 commits intoOpenAPITools:masterfrom
barcister:fix-version-7-swift

Conversation

@barcister
Copy link
Contributor

…h @available on version 7.0.0

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • In case you are adding a new generator, run the following additional script :
    ./bin/utils/ensure-up-to-date
    
    Commit all changed files.
  • File the PR against the correct branch: master (7.0.1 - patch release), 7.1.x (minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Fixing issue: issue link

@wing328
Copy link
Member

wing328 commented Sep 5, 2023

@barcister thanks for the PR. I've updated the samples and the CI tests passed:

cc Swift technical committee to see if they've any question/feedback on this change.

@jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) @4brunu (2019/11) @dydus0x14 (2023/06)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@barcister Hi, thanks for creating this PR.
This property no longer works, that's why I marked it as unavailable.
Marking it as deprecated can be misleading since this no longer works.
Maybe we should consider deleting this property instead.
@wing328 Could we delete this property? This property no longer works, since it's unavailable it shows a build error, could we delete it ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@barcister can you please elaborate on your use cases on why you will need this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to test this locally, but I can't reproduce the error you are having @barcister, it compiles in my side.
Can you please post the error here?
Are you reference the taskCompletionShouldRetry property?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@4brunu I just updated our project to use the new 7.0.0 version generator, went onto build it and then got the Stored properties cannot be marked with @available on Xcode 14.3.1 and Xcode 15 as well. Only the removal of the availability check or the deprecated refactor made the error go away.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird, I can't reproduce that.
Removing the @available or replacing unavailable with deprecated will lead people into thinking that they can use taskCompletionShouldRetry, but they can't since it doesn't work anymore.
I think we should comment the taskCompletionShouldRetry and the @available and leave it commented as doc/tip for the people that need to migrate from taskCompletionShouldRetry to execute() method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I think we shouldn't mark this as deprecated, I think we should remove this property entirely.
Currently this property doesn't do anything, it's not used at all, it's just there to ease the migration, because it show's a compiler error.
But since it's creating problems, I think we should remove it entirely.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm gonna remove the property and update the MR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.
Can you please update the sample projects?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done and done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, merged!

@barcister barcister changed the title [swift] fix stored properties cannot be potentionally unavailable wit… [swift] remove unavailable property to fix Xcode 15 compiler error Sep 14, 2023
@4brunu 4brunu merged commit e75e5a2 into OpenAPITools:master Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants