go-fuego / fuego

Golang Fuego - web framework generating OpenAPI 3 spec from source code
https://go-fuego.github.io/fuego/
MIT License
798 stars 39 forks source link

Controller package generation through the CLI creates a file in a package `controller` instead of `controllers`, in the `controllers` folder #163

Closed biancarosa closed 1 week ago

biancarosa commented 3 weeks ago

To Reproduce Steps to reproduce the behavior:

  1. Run go run github.com/go-fuego/fuego/cmd/fuego@latest controller books
  2. Try to follow documentation steps.
  3. Get an error because package controllers does not exist.

Expected behavior

Screenshots N/A

Framework version (please check if it happens with the last Fuego version before posting): v0.14.0

Go version (please check if it happens with the last Go version before posting): go1.22.6 darwin/amd64

Additional context The docs are partially correct because of this; we need to make a decision whether to keep controllers vs controller and ensure the docs follow this naming convention. If we decide to keep controller as the package name, I'd suggest renaming the folder and we still need to update the example in the docs accordingly.

EwenQuim commented 3 weeks ago

Yes, I agree that the package name should match exactly the folder. I prefer to keep names singular as the Go authors said.

There are other "s" typos to fix in this CLI, I will work on this tomorrow.

Thanks for reporting and sorry for the long delay!

EwenQuim commented 3 weeks ago

Also, don't hesitate to make a PR for this kind of issue. It might be frightening to contribute to open-source but it really isn't!

This kind of issue is perfect for newcomers to try the "open-source workflow". I will tackle this tomorrow if you don't have time today.

Happy coding :)

biancarosa commented 3 weeks ago

I can tackle this for sure! Somewhere in between tomorrow and Sunday.

EwenQuim commented 2 weeks ago

Hi @biancarosa !

Did you have time to work on this?

Don't hesitate to open a draft PR :)