surpher / surpher/PactSwift

Bug: Cannot upload or parse Data(binary) object

Open
#127 3 comments 1 reaction 1 assignee View on GitHub

@surpher is already working on this.

Since Feb 4, 2025.

bug
Dominant language
Swift
Stars
56
Forks
21
PR merge metrics
No merged PRs in 30d

Description

🌎 Environment

  • Xcode: 16.1
  • Platform: iOS
  • Version/Release: latest

💬 Description

This is related to my other Question below in the "issues" section because we can't upload a Multipart form(binary) and we currently cannot parse Data(binary) objects either. We receive an error:

"failed - Error preparing pact! A key or value in the structure does not conform to 'Encodable' protocol. The element attempted to encode: 1 bytes"

Data does not conform to Encodable, which makes sense since it's binary and does not need to be translated, however, it shouldn't have that check. Is this something y'all are looking into?

I believe it's this file that is causing the issue since it's always trying to encode the body:
Sources/Model/Response.swift

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.