Having used go-swagger (
https://github.com/go-swagger/go-swagger) at one point, I'd say that these YAML generators are possibly useful for generating documentation from your code. One pain point of the documentation generators, though, is that most require that I create and maintain code objects exclusively for the benefit of doc generation. At that point, I'd rather maintain docs than unused code objects. That's a personal preference, though.
Now, if you're doing any amount of contract negotiation with consumers, attempting to implement an API contract, intending to perform any amount of contract testing, or are targeting any form of contract driven development then these generator tools are a complete inversion of the model you want. If any of the previous statements are true then you should consider finding code generators that consume swagger/OpenAPI documents and generate code skeletons to fill in rather than YAML generators that leverage your code.