Skip to content
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

[swift5] fix modelNamePrefix and -suffix for reserved types #14768

Merged
merged 9 commits into from
Mar 13, 2023

Conversation

Jonas1893
Copy link
Contributor

@Jonas1893 Jonas1893 commented Feb 20, 2023

Fixes #11185

We need to check for reserved types which must not be prefixed or suffixed. I added the AnyCodable type to languageSpecificPrimitives which is technically not a language type but a type from dependency. If this is not correct I can add a second array to hold potential reserved public types from dependencies. Please provide feedback what is preferred here

Added a new sample to check for prefix and suffix functionalities

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.sh
    
    Commit all changed files.
  • File the PR against the correct branch: master (6.3.0) (minor release - breaking changes with fallbacks), 7.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)

Declaration

The program was tested solely for our own use cases, which might differ from yours.

Link to provider information

https://github.com/mercedes-benz

@wing328
Copy link
Member

wing328 commented Mar 8, 2023

not sure why but the build failed despite restarting the job:

[INFO] ----------------< io.swagger:Swift5PetstoreClientTests >----------------
[INFO] Building Swift5 Swagger Petstore Client 1.0-SNAPSHOT
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:copy-dependencies (default) @ Swift5PetstoreClientTests ---
[INFO] 
[INFO] --- exec-maven-plugin:1.2.1:exec (xcodebuild-test) @ Swift5PetstoreClientTests ---
error: cyclic dependency declaration found: OpenAPIClient -> OpenAPIClient
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

ref: https://app.bitrise.io/build/06be2061-7dd9-4c06-8ad4-4a12bc4ef4ac

can you please take a look when you've time?

@Jonas1893
Copy link
Contributor Author

@wing328 fixed. swift5 samples currently must not use default package name but must define a custom name instead

@wing328 wing328 added this to the 6.5.0 milestone Mar 13, 2023
Copy link
Contributor

@4brunu 4brunu left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@4brunu 4brunu merged commit f45523d into OpenAPITools:master Mar 13, 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.

[BUG] [swift5] modelNamePrefix gets prepended to AnyCodable
3 participants