oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

Allow generating multiple `interface`s that build into a single `ServerInterface`

Open jamietanna opened this issue 1 year ago • 2 comments

Via https://github.com/deepmap/oapi-codegen/issues/249#issuecomment-1517859944 and (TODO: add other issue references) we should make it possible to decompose a large API across multiple types.

This would be opt-in, and maybe configurable as to whether to:

  • Provide an interface per operationId
  • Provide an interface per set of tags

This would then allow type embedding to produce a single ServerInterface that consumes each of these smaller interfaces

jamietanna avatar Mar 25 '24 11:03 jamietanna

May I ask if there has been any progress on this feature?

PengLingJun avatar Aug 07 '25 07:08 PengLingJun

I had this exact same idea, I think this would be a really good addition! I think it would make sense to do it per tag, but more granular per operationId can also work.

I think this would very nice to be able to do:

var _ MyPathsInterface = (*MyPathsHandler)(nil)

LarsStegman avatar Nov 21 '25 12:11 LarsStegman