[fix] Invalid CarrierFields
structure
#558
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This library was failing to deserialize a
CarrierAccount
from the API due to a failed deserialization ofCarrierFields
.The previous assumption was that the API is returning "fields" in the JSON data for a
CarrierAccount
like so:When in fact, the API is returning "fields" like so:
Specifically, the "credentials" key under "fields" is not a list of dictionaries, but a dictionary of dictionaries, with the type of each credential field being the key in the key-value pair.
This PR updates the
CarrierFields
object structure to match the JSON schema.Because the key for each type of credential field can by dynamic, users will have to access each credential field via a dictionary index:
This PR also adds the missing "logo" property for a
CarrierAccount
.Testing
Pull Request Type
Please select the option(s) that are relevant to this PR.