Skip to content

[swift6] Add typed throws to Validation functions #20903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

x-sheep
Copy link
Contributor

@x-sheep x-sheep commented Mar 16, 2025

Swift 6 allows for the throws keyword to specify the type of error being thrown. In the case of Validation, this will save one unboxing/casting operation and make the result easier to use.

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 || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in Git BASH)
    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*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • File the PR against the correct branch: master (upcoming 7.x.0 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.
    @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) @4brunu (2019/11) @dydus0x14 (2023/06)

@wing328
Copy link
Member

wing328 commented Mar 17, 2025

https://app.bitrise.io/build/50334c36-d425-407b-85ff-43f35bf4f9fc

can you please review the build failure when you've time?

@x-sheep
Copy link
Contributor Author

x-sheep commented Mar 17, 2025

The alamofireLibrary project is already broken on the master branch, I think?

@4brunu
Copy link
Contributor

4brunu commented Mar 17, 2025

The alamofireLibrary is locked into an old version prior to Alomofire migrating to Swift 6, which work with the openapi generator Swift 6 client, so it should not affect the pipelines.

@4brunu 4brunu closed this Mar 17, 2025
@4brunu 4brunu reopened this Mar 17, 2025
@4brunu
Copy link
Contributor

4brunu commented Mar 17, 2025

I closed and reopened this PR to try to trigger the pipelines again.

@4brunu
Copy link
Contributor

4brunu commented Mar 17, 2025

CI is still failing, but I think this is not related to this PR. I will investigate a bit more.

@4brunu
Copy link
Contributor

4brunu commented Mar 17, 2025

I have built this project locally and it works.
The issue seams to be related to server where the tests are executed.
I'm going to merge this PR, as the CI failure are not related to it.

@4brunu 4brunu merged commit 1eb8c58 into OpenAPITools:master Mar 17, 2025
26 of 27 checks passed
@x-sheep x-sheep deleted the swift6-validation-typed-throws branch March 17, 2025 15:36
@wing328 wing328 added this to the 7.13.0 milestone Apr 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants