Skip to content

[BUG][SWIFT] Error generating podspec #3101

Open
@ppaulojr

Description

@ppaulojr

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

The podspec file generated does not pass pod lint

openapi-generator version

4.0.0

OpenAPI declaration file content or url

https://gist.github.com/ppaulojr/31680ccb3a27ebcc30f9aa3559f271c2

Command line used for generation

openapi-generator generate -i openapi.json --generator-name swift4 --additional-properties=projectName=PostmonSwift,podSource=https://github.com/ppaulojr/PostmonSwift.git,podVersion=1.0.0,podAuthors=PPJ,podSocialMediaURL=https://twitter.com/ppaulojr,swiftUseApiNamespace=true,objcCompatible=true

Steps to reproduce
  1. Generate the code using the above command.
  2. Upload to repo using git_push.sh
  3. Run pod lib lint

Error:


 -> PostmonSwift.podspec
    - ERROR | spec: The specification defined in `/Users/ppaulojr/git/contribute/postmon/docs/PostmonSwift.podspec` could not be loaded.


[!] Invalid `PostmonSwift.podspec` file: undefined local variable or method `github' for Pod:Module.

 #  from /Users/ppaulojr/git/contribute/postmon/docs/PostmonSwift.podspec:7
 #  -------------------------------------------
 #    s.version = '1.0.0'
 >    s.source = https://github.com/ppaulojr/PostmonSwift.git
 #    s.authors = 'PPJ'
 #  -------------------------------------------


[!] /Users/ppaulojr/git/contribute/postmon/docs/PostmonSwift.podspec did not pass validation, due to 1 error.
You can use the `--no-clean` option to inspect any issue.
Related issues/PRs

N/A

Suggest a fix

The source seems off usually source is something like:

s.source           = { :git => "https://github.com/ppaulojr/Simplicity.git", :tag => s.version.to_s }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions