Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Cannot upload or parse Data(binary) object #127

Open
MikeBenton2 opened this issue Dec 4, 2024 · 2 comments
Open

Bug: Cannot upload or parse Data(binary) object #127

MikeBenton2 opened this issue Dec 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@MikeBenton2
Copy link

MikeBenton2 commented Dec 4, 2024

🌎 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

@MikeBenton2 MikeBenton2 added the bug Something isn't working label Dec 4, 2024
@surpher
Copy link
Owner

surpher commented Dec 4, 2024

That… makes sense. Thanks for raising it.

There’s major refactoring happened a while back already but hasn’t been cleaned up and made release “worthy” due to lack of time. But that’s changed these days and I’ll have time to have a look and hopefully bring that refactoring piece of work closer to new version release.
Most of the Pact generation responsibility will be pushed down to pact_ffi (core pact functionality written in Rust) and potentially should allow such tests.

I’d love your help verifying some of these use cases work in the upcoming few weeks. I’ll make myself more available in the Pact Foundation slack.

@MikeBenton2
Copy link
Author

Sounds great! I'm going on holiday and won't be back for a month, but happy to test once I'm back :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants