OpenAPITools / OpenAPITools/openapi-generator

[BUG][SWIFT] Error generating podspec

Open
#3,101 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Swift Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

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 }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Generate the Swift client with the listed command, upload it with git_push.sh, and inspect PostmonSwift.podspec at the failing source line. Run pod lib lint and use its validation output to confirm the generated podspec is accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby, swift
Domain
build-system, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.