swagger-api / swagger-api/swagger-codegen

Swift 4 Cannot invoke 'encode' with an argument list of type '(Any, forKey: String)'

Open
#8,637 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Error "Cannot invoke 'encode' with an argument list of type '(Any, forKey: String)'" in every request file

Swagger-codegen version

2.3.1

Command line used for generation

swagger-codegen genrate -i swagger.json -l swift4 -o api

Steps to reproduce

Xcode 10
Swift 4
Just import the files to the project and build

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

Reproduce the failure by generating a Swift 4 client with the command in the issue and building the generated request files in Xcode 10. Then inspect the Swift 4 generator templates and compare the generated encode calls with Swift 4's expected types. Done means the generated client builds without the reported error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.