@@ -29,38 +29,27 @@ import (
29
29
30
30
// Object represents the object entity from the swagger definition
31
31
type Object struct {
32
- IsArray bool `json:"-"`
33
- GoType reflect. Type `json:"- "`
34
- Name string `json:"- "`
35
- Type string `json:"type "`
36
- Description string `json:"description ,omitempty"`
37
- Format string `json:"format ,omitempty"`
38
- Required [] string `json:"required ,omitempty"`
39
- Properties map [ string ] Property `json:"properties ,omitempty"`
32
+ Name string `json:"-"`
33
+ Type string `json:"type "`
34
+ Description string `json:"description,omitempty "`
35
+ Format string `json:"format,omitempty "`
36
+ Required [] string `json:"required ,omitempty"`
37
+ Properties map [ string ] Property `json:"properties ,omitempty"`
38
+ AdditionalProperties * Property `json:"additionalProperties ,omitempty"`
39
+ Items * Property `json:"items ,omitempty"`
40
40
}
41
41
42
42
// Property represents the property entity from the swagger definition
43
43
type Property struct {
44
- GoType reflect.Type `json:"-"`
45
- Type string `json:"type,omitempty"`
46
- Description string `json:"description,omitempty"`
47
- Enum []string `json:"enum,omitempty"`
48
- Format string `json:"format,omitempty"`
49
- Ref string `json:"$ref,omitempty"`
50
- Example string `json:"example,omitempty"`
51
- Items * Items `json:"items,omitempty"`
52
- AddPropertie * AdditionalProperties `json:"additionalProperties,omitempty"`
53
- }
54
-
55
- type AdditionalProperties struct {
56
- GoType reflect.Type `json:"-"`
57
- Type string `json:"type,omitempty"`
58
- Description string `json:"description,omitempty"`
59
- Enum []string `json:"enum,omitempty"`
60
- Format string `json:"format,omitempty"`
61
- Ref string `json:"$ref,omitempty"`
62
- Example string `json:"example,omitempty"`
63
- Items * Items `json:"items,omitempty"`
44
+ GoType reflect.Type `json:"-"`
45
+ Type string `json:"type,omitempty"`
46
+ Description string `json:"description,omitempty"`
47
+ Enum []string `json:"enum,omitempty"`
48
+ Format string `json:"format,omitempty"`
49
+ Ref string `json:"$ref,omitempty"`
50
+ Example string `json:"example,omitempty"`
51
+ Items * Property `json:"items,omitempty"`
52
+ AdditionalProperties * Property `json:"additionalProperties,omitempty"`
64
53
}
65
54
66
55
// Contact represents the contact entity from the swagger definition; used by Info
@@ -252,7 +241,7 @@ func (a *API) addPath(e *Endpoint) {
252
241
253
242
func (a * API ) addDefinition (e * Endpoint ) {
254
243
if a .Definitions == nil {
255
- a .Definitions = map [string ]Object {}
244
+ a .Definitions = make ( map [string ]Object )
256
245
}
257
246
258
247
if e .Parameters != nil {
0 commit comments