Skip to content

Conversation

wynioux
Copy link

@wynioux wynioux commented Jul 1, 2025

Summary

This PR fixes a decoding issue in the MetricsInsight model where the referenceVersions field was incorrectly expected to be a String, but the actual API response contained an array.

Error Details

typeMismatch(Swift.String, Swift.DecodingError.Context(
codingPath: [
StringCodingKey(stringValue: "insights", intValue: nil),
StringCodingKey(stringValue: "regressions", intValue: nil),
_CodingKey(stringValue: "Index 0", intValue: 0),
StringCodingKey(stringValue: "referenceVersions", intValue: nil)
],
debugDescription: "Expected to decode String but found an array instead.",
underlyingError: nil
))

Changes

  • Updated the type of referenceVersions in MetricsInsight (or the corresponding nested model) from String to [String] to match the actual response format.

Notes

  • This change prevents decoding failures when processing regression insights that include a list of reference versions.

Copy link
Owner

@AvdLee AvdLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! @polpielladev we might want to release a version for this?

@polpielladev polpielladev self-requested a review July 15, 2025 10:01
Copy link
Collaborator

@polpielladev polpielladev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wynioux I think we need to patch the spec instead of actually modifying the generated code so that we don't lose these changes on new generations.

Would you be able to try and make the changes you need to the spec and then save them as a patch on the patches directory?

Then you can just run:

make update

Bonus points if you can modify the 4.0.0 patch to include your changes, that would be amazing 🙌

Copy link

This PR is stale because it has been open for 30 days with no activity. Remove the Stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Aug 17, 2025
@github-actions github-actions bot closed this Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants