|
2 | 2 |
|
3 | 3 | // StrictServer implements StrictServerInterface with handlers to be customized. |
4 | 4 | type StrictServer struct { |
5 | | -Authenticator Authenticator |
6 | | -{{range .}}{{.SummaryAsComment }} |
7 | | -// ({{.Method}} {{.Path}}) |
8 | | -{{$opid := .OperationId -}} |
9 | | -{{$opid}}Handler func(ctx context.Context, request {{$opid | ucFirst}}RequestObject) ({{$opid | ucFirst}}ResponseObject, error) |
10 | | -{{end}}{{/* range . */ -}} |
| 5 | + Authenticator Authenticator |
| 6 | + {{range .}}{{.SummaryAsComment }} |
| 7 | + // ({{.Method}} {{.Path}}) |
| 8 | + {{$opid := .OperationId}} |
| 9 | + {{$opid}}Handler func(ctx context.Context, request {{$opid | ucFirst}}RequestObject) ({{$opid | ucFirst}}ResponseObject, error) |
| 10 | + {{end}}{{/* range . */}} |
11 | 11 | } |
12 | 12 |
|
13 | | -{{range .}}{{.SummaryAsComment }} |
14 | | -// ({{.Method}} {{.Path}}) |
15 | | -{{$opid := .OperationId -}} |
16 | | -func (s *StrictServer) {{$opid}}(ctx context.Context, request {{$opid | ucFirst}}RequestObject) ({{$opid | ucFirst}}ResponseObject, error) { |
17 | | - if s.{{$opid}}Handler != nil { |
18 | | - return s.{{$opid}}Handler(ctx, request) |
| 13 | +{{range .}}{{.SummaryAsComment}} |
| 14 | + // ({{.Method}} {{.Path}}) |
| 15 | + {{$opid := .OperationId}} |
| 16 | + func (s *StrictServer) {{$opid}}(ctx context.Context, request {{$opid | ucFirst}}RequestObject) ({{$opid | ucFirst}}ResponseObject, error) { |
| 17 | + if s.{{$opid}}Handler != nil { |
| 18 | + return s.{{$opid}}Handler(ctx, request) |
| 19 | + } |
| 20 | + return nil, errors.New("api {{$opid}} is not implemented") |
19 | 21 | } |
20 | | - return nil, errors.New("api {{$opid}} is not implemented") |
21 | | -} |
22 | 22 | {{end}} |
23 | 23 |
|
24 | 24 | func (s StrictServer) GetAuthenticator() Authenticator { |
|
0 commit comments