You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to deserialize an OCI manifest into some structs that have &'a str fields, and serde_json is indicating that it can't do that for some specific values. I can fix the issue by using Cow<'a, str> instead, but I'm kinda curious to understand why this is happening. I can understand why this would happen for escape sequences, but I don't seem to have any escape sequences in my JSON! Are there other reasons this might be happening?
invalid type: string "application/vnd.docker.distribution.manifest.v2+json", expected a borrowed string at line 1 column 165
Ok I should have looked closer at the input - I guess the AWS ECR API escapes the forward-slashes?
Maybe a realistic issue here is to make the error message a little clearer. I don't suppose there's a way to have it show the source bytes rather than the string after it's been had its escape sequences resolved?
skeggse
changed the title
Cannot borrow string, but there aren't any escape sequences
Non-obvious error message when unable to borrow string and there aren't obvious escape sequences
Jun 21, 2024
I'm trying to deserialize an OCI manifest into some structs that have
&'a str
fields, andserde_json
is indicating that it can't do that for some specific values. I can fix the issue by usingCow<'a, str>
instead, but I'm kinda curious to understand why this is happening. I can understand why this would happen for escape sequences, but I don't seem to have any escape sequences in my JSON! Are there other reasons this might be happening?References:
The text was updated successfully, but these errors were encountered: