oapi-codegen
oapi-codegen copied to clipboard
Replace interface checks by unimplemented embedded struct types.
Since this pattern var _ StrictServerInterface = (*PetStore)(nil) should be use on very rare cases. Instead of doing so, the code generator could generate an unimplemented struct type that could be embedded into the final user implementation like protoc does with Go generated code based on a .proto file.
That way is by far much more idiomatic than using interfaces, since in practice there is gonna be only one single implementation for such server type.
Technically speaking there is not need for defining an interface for those swagger server types.