immobiliare / immobiliare/RealHTTP
[Bug]: HTTPBody `asString` property always returns `nil`
- Dominant language
- Swift
- Stars
- 292
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
### Platform Version
iOS 17.2
### SDK Version
1.8.3
### Xcode Version
Xcode 15.2
### Steps To Reproduce
Let's suppose we do have a struct representing a form:
```swift
struct MyForm: Encodable {
let numbers: [Int]
}
```
if we create a `HTTPBody` object by passing an instance of `MyForm`:
```swift
let form = try! HTTPBody.form(object: MyForm(numbers: [1, 2, 3]))
```
calling `form.asString` always returns `nil`.
### Expected Behavior
`form.asString` should returns a String representing the `MyForm` instance we have passed.
### Actual Incorrect Behavior
`form.asString` always returns `nil`.
Contributor guide
Research direction
Locate the HTTPBody type and inspect how the asString property is produced, then reproduce the issue with the MyForm example on iOS 17.2 and SDK 1.8.3. Done means form.asString returns a String representing the encoded MyForm value instead of nil, with regression coverage if the project has tests for HTTPBody.
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
- Mostly clear
- Newbie friendliness
- 35/100