Skip to content

Conversation

@alexanderwe
Copy link
Contributor

📝 Description

This PR fixes the decoding of the Version type.

While the encoding of this type was using a single value container no explicit decoding init was specified. This led to the fact the default synthesised decoding initialiser is used. But this one will expect the full fletched object to be encoded. This leads to decoding errors, like the following:

Error: typeMismatch(Swift.Dictionary<Swift.String, Any>, Swift.DecodingError.Context(codingPath: [
    CodingKeys(stringValue:"projects", intValue: nil),
    _CodingKey(stringValue: "Index 7", intValue: 7),
    CodingKeys(stringValue: "lastUpgradeCheck", intValue: nil)
],
debugDescription: "Expected to decode Dictionary<String, Any> but found a string instead.",
underlyingError: nil)
)

This PR now implements a custom decoding initialiser matching the encoding.

@alexanderwe alexanderwe changed the title fix: Version Decoding fix: align Version decoding with encoding Feb 19, 2025
Copy link
Member

@fortmarek fortmarek left a comment

Choose a reason for hiding this comment

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

Thanks 🙇

@fortmarek fortmarek changed the title fix: align Version decoding with encoding fix: fix Version decoding Feb 19, 2025
@fortmarek fortmarek merged commit f472992 into tuist:main Feb 19, 2025
7 of 9 checks passed
@alexanderwe
Copy link
Contributor Author

Thanks 🙇

No problem 👍 thank you very much for the fast merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants