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

Gin StrictServer mode generate code with the standard context library

Open wgarunap opened this issue 9 months ago • 0 comments

When using gin server, StrictServer mode generates StrictServerInterface with standard context. This force user to edit the generated file or user has to drop all the gin context features. Following is an example generated with gin strict server.

// StrictServerInterface represents all server handlers.
type StrictServerInterface interface {
	// liveness probe
	// (GET /live)
	Liveness(ctx context.Context, request LivenessRequestObject) (LivenessResponseObject, error)
	// readiness probe
	// (GET /ready)
	Readiness(ctx context.Context, request ReadinessRequestObject) (ReadinessResponseObject, error)
}

wgarunap avatar May 21 '25 22:05 wgarunap