swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
16.89k stars 6.03k forks source link

Podspec missing summary and homepage variables [Swift3][Swift4] #8543

Open csimmons0 opened 6 years ago

csimmons0 commented 6 years ago
Description

The Podspec file in a generated Swift3 or Swift4 client lacks summary and homepage variables, which causes "pod install" to fail.

Swagger-codegen version

2.3.1

Command line used for generation

swagger-codegen generate -i ~/Downloads/swagger-yaml-client-generated/swagger.yaml -l swift4 -o ./server-sdk

Steps to reproduce

Generate a swift3 or swift4 client. Attempt to integrate the client into an app via Cocoapods. "Pod install" will fail.

$ pod install
Analyzing dependencies
Fetching podspec for `SwaggerClient` from `./server-sdk`
[!] The `SwaggerClient` pod failed to validate due to 2 errors:
    - ERROR | attributes: Missing required attribute `homepage`.
    - ERROR | attributes: Missing required attribute `summary`.
    - WARN  | source: The version should be included in the Git tag.
    - WARN  | source: Git SSH URLs will NOT work for people behind firewalls configured to only allow HTTP, therefore HTTPS is preferred.
Related issues/PRs

This is the same issue as #3844 but for Swift3/Swift4.

Suggest a fix/enhancement

Probably the same as #3850

RyanLii commented 5 years ago

@wing328 is there any fixing on swift3 and swift 4?

wing328 commented 5 years ago

@RyanLii Thanks for tagging me but I'm no longer involved in this project. I hope others will be able to help you out. Good luck.

(To be clear, I didn't work on the Swagger Codegen 3.x branch/release. My previous involvement was only with 2.x branches/releases)

4brunu commented 4 years ago

I had the same issue, but actually those fields are configurable. First you need to create a configuration file in json like:

https://github.com/swagger-api/swagger-codegen/blob/552bdf5b3676e6ed2d1573591ec5e62fd90d3754/bin/swift4-petstore.json#L1-L6

And then you set the path to the configuration file swagger-codegen generate ... -c path/to/configuration-file.json.