openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[HELP][swift5] Set iOS deployment target

Open pabloalonsogonzaleztalentum opened this issue 4 years ago • 2 comments

Description

I want to use responseAs Combine additional property and I've noticed that all combine imports are wrapped with "If canImport". Is there any way to set the deployment target to iOS 13 to avoid this check? On the other hand, AnyCodable (with its canImport) has been added to generator, but I haven't be able to find in changelog when and why it was added. Why is it mandatory to use this library? Can I remove it with any additional property o something like that?

openapi-generator version

5.4.0

Command line used for generation

java -jar openapi-generator-cli.jar generate -i download/people.yml -g swift5 -o generated --additional-properties=modelNameSuffix=DTO,responseAs=Combine

I'm also wondering if AnyCodable can be made optional? The OpenAPI spec I've been given has some empty fields (for testing I guess?) and those are turned into AnyCodables, when they're actually just empty.

I'm in a project where dependencies can't really be added easily - but generated code is fine. Currently, I'm "manually" removing these AnyCodables after generation.

sureshjoshi avatar Aug 10 '22 15:08 sureshjoshi

AnyCodable was removed in the new swift6 generator.

4brunu avatar Oct 18 '24 09:10 4brunu