File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -511,15 +511,6 @@ func (r ResponseContentDefinition) IsJSON() bool {
511511 return util .IsMediaTypeJson (r .ContentType )
512512}
513513
514- // __BEGIN_CYLONIX_MOD__
515- // IsArray returns whether this is an array type response.
516- func (r ResponseContentDefinition ) IsArray () bool {
517- return r .Schema .ArrayType != nil ||
518- (r .Schema .OAPISchema != nil && r .Schema .OAPISchema .Type != nil &&
519- r .Schema .OAPISchema .Type .Is ("array" ))
520- }
521- // __END_CYLONIX_MOD__
522-
523514type ResponseHeaderDefinition struct {
524515 Name string
525516 GoName string
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ type strictHandler struct {
2727 options StrictHTTPServerOptions
2828}
2929
30- const SecurityAuthContextKey = " Secutiry-Auth"
30+ type StrictHTTPContextKeyType string
31+ const SecurityAuthContextKey = StrictHTTPContextKeyType(" Secutiry-Auth" )
3132
3233{{range . }}
3334 {{$opid := .OperationId }}
Original file line number Diff line number Diff line change 8989 {{$hasBodyVar := or ($hasHeaders ) (not $fixedStatusCode ) (not .IsSupported )}}
9090 {{if .IsJSON -}}
9191 {{$hasUnionElements := ne 0 (len .Schema.UnionElements )}}
92- {{/* __BEGIN_CYLONIX_MOD__ */ }}
93- {{/* Workaround for golang json encoding nil slice or array to 'null' value: */ }}
94- {{/* https://github.com/golang/go/issues/27589 */ }}
95- {{/* */ }}
96- {{if .IsArray -}}
97- if response == nil {
98- response = {{$receiverTypeName }}{}
99- }
100- {{end -}}
101- {{/* __END_CYLONIX_MOD__ */ }}
10292 return json.NewEncoder (w).Encode (response{{if $hasBodyVar }}.Body {{end }}{{if $hasUnionElements }}.union {{end }})
10393 {{else if eq .NameTag " Text" -}}
10494 _, err := w.Write ([]byte({{if $hasBodyVar }}response.Body {{else }}response{{end }}))
You can’t perform that action at this time.
0 commit comments