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

Generating the openapi.json offline #442

Closed ant1g closed 2 months ago

ant1g commented 2 months ago

Hello,

I was looking for a way to generate the openapi.json "offline" without having to start the server and hitting the /openapi.json endpoint...

Is that possible?

Thanks!

danielgtaylor commented 2 months ago

@ant1g yep it's totally possible:

Just be careful if you connect to a DB or other dependencies requiring credentials that you do so on server startup so that the OpenAPI command doesn't require credentials to be run!

ant1g commented 2 months ago

Thanks a lot, I will have a look!