@@ -94,6 +94,10 @@ type Config struct {
94
94
// or any of the models will result in spec generation failure.
95
95
GetDefinitions GetOpenAPIDefinitions
96
96
97
+ // Provides the definition for all models used by routes. One of GetDefinitions or Definitions must be defined to generate a spec.
98
+ // This takes precedent over the GetDefinitions function
99
+ Definitions map [string ]OpenAPIDefinition
100
+
97
101
// GetOperationIDAndTags returns operation id and tags for a restful route. It is an optional function to customize operation IDs.
98
102
//
99
103
// Deprecated: GetOperationIDAndTagsFromRoute should be used instead. This cannot be specified if using the new Route
@@ -141,8 +145,13 @@ type OpenAPIV3Config struct {
141
145
142
146
// OpenAPIDefinitions should provide definition for all models used by routes. Failure to provide this map
143
147
// or any of the models will result in spec generation failure.
148
+ // One of GetDefinitions or Definitions must be defined to generate a spec.
144
149
GetDefinitions GetOpenAPIDefinitions
145
150
151
+ // Provides the definition for all models used by routes. One of GetDefinitions or Definitions must be defined to generate a spec.
152
+ // This takes precedent over the GetDefinitions function
153
+ Definitions map [string ]OpenAPIDefinition
154
+
146
155
// GetOperationIDAndTags returns operation id and tags for a restful route. It is an optional function to customize operation IDs.
147
156
//
148
157
// Deprecated: GetOperationIDAndTagsFromRoute should be used instead. This cannot be specified if using the new Route
@@ -176,12 +185,13 @@ func ConvertConfigToV3(config *Config) *OpenAPIV3Config {
176
185
GetOperationIDAndTags : config .GetOperationIDAndTags ,
177
186
GetOperationIDAndTagsFromRoute : config .GetOperationIDAndTagsFromRoute ,
178
187
GetDefinitionName : config .GetDefinitionName ,
188
+ Definitions : config .Definitions ,
179
189
SecuritySchemes : make (spec3.SecuritySchemes ),
180
190
DefaultSecurity : config .DefaultSecurity ,
181
191
DefaultResponse : openapiconv .ConvertResponse (config .DefaultResponse , []string {"application/json" }),
182
192
183
- CommonResponses : make (map [int ]* spec3.Response ),
184
- ResponseDefinitions : make (map [string ]* spec3.Response ),
193
+ CommonResponses : make (map [int ]* spec3.Response ),
194
+ ResponseDefinitions : make (map [string ]* spec3.Response ),
185
195
}
186
196
187
197
if config .SecurityDefinitions != nil {
0 commit comments