goadesign / goa

🌟 Goa: Elevate Go API development! 🚀 Streamlined design, automatic code generation, and seamless HTTP/gRPC support. ✨
https://goa.design
MIT License
5.68k stars 559 forks source link

Generate valid OpenAPI specifications #3454

Closed raphael closed 9 months ago

raphael commented 9 months ago

When security requirements are empty (needs to be empty array and not nil). Also take into consideration metadata set at service level to generate summary.

raphael commented 9 months ago

Note: DeepSource is incorrect in stating that

scopes := []string{}

is equivalent to:

var scopes []string

In the former case the slice is initialized and when serialized to JSON produces [] while in the latter case it's not and when serialized to JSON produces nil which is the bug this PR fixes.