Skip to content

How to serialize SDK Output struct? #714

Answered by rcoh
Samrose-Ahmed asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately, we don't currently support serde (although there is an ongoing community contribution to enable that: RFC 30: serde support).

It's possible to get access to the raw response, however, I'd caution you from going that route. The raw response may contain fields serialized in headers—just looking at the body won't necessarily contain everything you need.

I'd probably suggest making your own parallel struct that contains the fields you need. In this case, ListFindingsOutput only contains one meaningful field—finding_arns which is the list of arns.

Please note that this API is actually paginated so ListFindingsOutput isn't what you'd want to serialize anyway.

#[derive(Serialize, D…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Samrose-Ahmed
Comment options

Answer selected by Velfi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants