@@ -29,6 +29,7 @@ type Config struct {
29
29
PersistAuthorization bool
30
30
Layout SwaggerLayout
31
31
DefaultModelsExpandDepth ModelsExpandDepthType
32
+ ShowExtensions bool
32
33
}
33
34
34
35
// URL presents the url pointing to API definition (normally swagger.json or swagger.yaml).
@@ -141,6 +142,14 @@ func DefaultModelsExpandDepth(defaultModelsExpandDepth ModelsExpandDepthType) fu
141
142
}
142
143
}
143
144
145
+ // ShowExtensions controls the display of vendor extension (x-) fields and values for Operations,
146
+ // Parameters, Responses, and Schema.
147
+ func ShowExtensions (showExtensions bool ) func (config * Config ) {
148
+ return func (c * Config ) {
149
+ c .ShowExtensions = showExtensions
150
+ }
151
+ }
152
+
144
153
func newConfig (configFns ... func (* Config )) * Config {
145
154
config := Config {
146
155
URL : "doc.json" ,
@@ -151,6 +160,7 @@ func newConfig(configFns ...func(*Config)) *Config {
151
160
PersistAuthorization : false ,
152
161
Layout : StandaloneLayout ,
153
162
DefaultModelsExpandDepth : ShowModel ,
163
+ ShowExtensions : false ,
154
164
}
155
165
156
166
for _ , fn := range configFns {
@@ -321,7 +331,8 @@ window.onload = function() {
321
331
{{$k}}: {{$v}},
322
332
{{- end}}
323
333
layout: "{{$.Layout}}",
324
- defaultModelsExpandDepth: {{.DefaultModelsExpandDepth}}
334
+ defaultModelsExpandDepth: {{.DefaultModelsExpandDepth}},
335
+ showExtensions: {{.ShowExtensions}}
325
336
})
326
337
327
338
window.ui = ui
0 commit comments