lparkes / swagger-codegen-generators

Apache License 2.0
0 stars 0 forks source link

[Go-server] there is always a root (/) HTTP route installed #7

Closed lparkes closed 1 year ago

lparkes commented 1 year ago

swagger-codegen always generates code for the go-server target that prints "Hello, World!" in response to GET requests to /.

Not only does this pollute the URL namespace with something the developer didn't ask for, but it does this implementing a function called "Index". If the developer also wants to write a function called Index, then they are going to become angry.

This is code that everyone who isn't a hobbyist is going to need to delete. With the exception of example code, swagger-codegen must not be generating code that needs to be modified.[1]

[1] Yes, server stubs are an exception to this. swagger-codegen can't generate the code for the actual application.

lparkes commented 1 year ago

This was fixed by commit eaa71528b97d333a4c1f351bb406c872e0b4b882 which rewrote most of the routing.