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
letstream=tryawaitself.client.query("""SELECT team.id, JSONB_AGG_STRICT( -- DROP NULL VALUES JSON_BUILD_OBJECT( 'name', people.name, 'id', people.id, 'createdAt', people.created_at ) ) AS team_matesFROM profiles.team tJOIN profiles.people pON t.id = p.team_idGROUP BY 1""")letteam=[Team]
for tryawait(teamID, teamMates) in stream.decode((Int,[Person]).self){
team.append(.init(
id: teamID,
peers: teamMates
))}
### Outcome
The program will throw Runtime exception
message=Swift.DecodingError.typeMismatch(Swift.Dictionary<Swift.String, Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Dictionary<String, Any> but found an array instead.", underlyingError: nil))
Instead of outputting
and array of Team
### Additional notes
_No response_
The text was updated successfully, but these errors were encountered:
Describe the issue
Try decoding JSONB_AGG_STRICT fails
Vapor version
N/A
Operating system and version
macOS 15.0
Swift version
Swift Package Manager - Swift 6.0.0-dev
Steps to reproduce
say you one has the followings:
Decoding logic
message=Swift.DecodingError.typeMismatch(Swift.Dictionary<Swift.String, Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Dictionary<String, Any> but found an array instead.", underlyingError: nil))
The text was updated successfully, but these errors were encountered: