danielgtaylor / huma

Huma REST/HTTP API Framework for Golang with OpenAPI 3.1
https://huma.rocks/
MIT License
1.71k stars 134 forks source link

Returning nil as response body causes 500 #484

Open outofthisworld opened 1 month ago

outofthisworld commented 1 month ago

Some package level serialisation/reflection issue (I believe potentially to do with the SchemaLinkTransformer) is making a return of nil cause a 500 error as a response body.

Personally, I think this should be handled internally by the package to Serialise to null, to avoid redundant and unnecessary checking in every handler.