swagger-api / swagger-api/swagger-codegen

[swift] query params on put get ignored if URL is a type

Open
#2,978 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Swift help wanted Issue: Bug
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

If the endpoint takes a query param in PUT request the alamofire ignores the parameters

Swagger-codegen version

2.1.6

Swagger declaration file content or url

https://github.com/swagger-api/swagger-codegen/blob/master/samples/client/petstore/swift/default/PetstoreClient/Classes/Swaggers/AlamofireImplementations.swift#L31

Command line used for generation
Steps to reproduce
Related issues

I reported a bug in Alamofire as well https://github.com/Alamofire/Alamofire/issues/1275

Suggest a Fix

use Alamofire.ParameterEncoding.URLEncodedInURL ?

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

Start with the generated Swift client at Classes/Swaggers/AlamofireImplementations.swift, especially line 31, and review the related Alamofire issue linked in the report. Reproduce a PUT request whose endpoint has a query parameter, then verify that the generated request retains the parameter in its URL. Done means the query parameter is no longer ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.