github.com/AngusLu/go-swagger@v0.28.0/generator/moreschemavalidation_fixtures_test.go (about) 1 // Copyright 2015 go-swagger maintainers 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package generator 16 17 func initFixture2494() { 18 f := newModelFixture("../fixtures/bugs/2494/fixture-2494.yaml", "map of nullable array") 19 flattenRun := f.AddRun(false).WithMinimalFlatten(true) 20 21 flattenRun.AddExpectations("port_map.go", []string{ 22 `type PortMap map[string][]PortBinding`, 23 }, todo, noLines, noLines) 24 25 flattenRun.AddExpectations("port_list.go", []string{ 26 `type PortList [][]*PortBinding`, 27 }, todo, noLines, noLines) 28 } 29 30 func initFixture2444() { 31 f := newModelFixture("../fixtures/enhancements/2444/fixture-2244.yaml", "min/maxProperties") 32 flattenRun := f.AddRun(false).WithMinimalFlatten(true) 33 34 flattenRun.AddExpectations("all_of_with_min_max_properties.go", []string{ 35 `func (m *AllOfWithMinMaxProperties) Validate(formats strfmt.Registry) error {`, 36 ` if err := m.AllOfWithMinMaxPropertiesAO0P0.Validate(formats); err != nil {`, 37 `func (m *AllOfWithMinMaxPropertiesAO0P0) Validate(formats strfmt.Registry) error {`, 38 ` if m == nil {`, 39 ` return errors.TooFewProperties("", "body", 3)`, 40 ` props := make(map[string]json.RawMessage, 1+10)`, 41 ` j, err := swag.WriteJSON(m)`, 42 ` if err = swag.ReadJSON(j, &props); err != nil {`, 43 ` nprops := len(props)`, 44 ` if nprops < 3 {`, 45 ` return errors.TooFewProperties("", "body", 3)`, 46 ` if nprops > 5 {`, 47 ` return errors.TooManyProperties("", "body", 5)`, 48 ` if err := m.validateUID(formats); err != nil {`, 49 ` for k := range m.AllOfWithMinMaxPropertiesAO0P0 {`, 50 ` if err := validate.MaximumUint(k, "body", uint64(m.AllOfWithMinMaxPropertiesAO0P0[k]), 100, false); err != nil {`, 51 }, todo, noLines, noLines) 52 53 flattenRun.AddExpectations("array_items_with_min_max_properties.go", []string{ 54 `type ArrayItemsWithMinMaxProperties []map[string]interface{}`, 55 `func (m ArrayItemsWithMinMaxProperties) Validate(formats strfmt.Registry) error {`, 56 ` for i := 0; i < len(m); i++ {`, 57 ` nprops := len(m[i])`, 58 ` if nprops < 3 {`, 59 ` return errors.TooFewProperties(strconv.Itoa(i), "body", 3)`, 60 ` if nprops > 5 {`, 61 ` return errors.TooManyProperties(strconv.Itoa(i), "body", 5)`, 62 }, todo, noLines, noLines) 63 64 flattenRun.AddExpectations("has_max_properties.go", []string{ 65 ` HasMaxPropertiesAdditionalProperties map[string]interface{}`, 66 ` props := make(map[string]json.RawMessage, 1+10)`, 67 ` j, err := swag.WriteJSON(m)`, 68 ` if err = swag.ReadJSON(j, &props); err != nil {`, 69 ` nprops := len(props)`, 70 ` if nprops > 2 {`, 71 ` return errors.TooManyProperties("", "body", 2)`, 72 }, todo, noLines, noLines) 73 74 flattenRun.AddExpectations("has_min_max_properties.go", []string{ 75 ` HasMinMaxPropertiesAdditionalProperties map[string]interface{}`, 76 ` if m == nil {`, 77 ` return errors.TooFewProperties("", "body", 3)`, 78 ` props := make(map[string]json.RawMessage, 1+10)`, 79 ` j, err := swag.WriteJSON(m)`, 80 ` if err = swag.ReadJSON(j, &props); err != nil {`, 81 ` nprops := len(props)`, 82 ` if nprops < 3 {`, 83 ` return errors.TooFewProperties("", "body", 3)`, 84 ` if nprops > 5 {`, 85 ` return errors.TooManyProperties("", "body", 5)`, 86 }, todo, noLines, noLines) 87 88 flattenRun.AddExpectations("has_min_properties.go", []string{ 89 `HasMinPropertiesAdditionalProperties map[string]interface{}`, 90 ` if m == nil {`, 91 ` return errors.TooFewProperties("", "body", 2)`, 92 ` props := make(map[string]json.RawMessage, 1+10)`, 93 ` j, err := swag.WriteJSON(m)`, 94 ` if err = swag.ReadJSON(j, &props); err != nil {`, 95 ` nprops := len(props)`, 96 ` if nprops < 2 {`, 97 ` return errors.TooFewProperties("", "body", 2)`, 98 ` if err := m.validateA(formats); err != nil {`, 99 }, todo, noLines, noLines) 100 101 flattenRun.AddExpectations("map_of_arrays_with_min_max_properties.go", []string{ 102 `type MapOfArraysWithMinMaxProperties map[string][]HasMaxProperties`, 103 ` nprops := len(m)`, 104 ` if nprops < 3 {`, 105 ` return errors.TooFewProperties("", "body", 3)`, 106 ` if nprops > 5 {`, 107 ` return errors.TooManyProperties("", "body", 5)`, 108 ` for k := range m {`, 109 ` if err := validate.Required(k, "body", m[k]); err != nil {`, 110 ` for i := 0; i < len(m[k]); i++ {`, 111 ` if err := m[k][i].Validate(formats); err != nil {`, 112 ` if ve, ok := err.(*errors.Validation); ok {`, 113 ` return ve.ValidateName(k + "." + strconv.Itoa(i))`, 114 }, todo, noLines, noLines) 115 116 flattenRun.AddExpectations("map_of_integers_with_min_max_properties.go", []string{ 117 `type MapOfIntegersWithMinMaxProperties map[string]int64`, 118 ` nprops := len(m)`, 119 ` if nprops < 3 {`, 120 ` return errors.TooFewProperties("", "body", 3)`, 121 ` if nprops > 5 {`, 122 ` return errors.TooManyProperties("", "body", 5)`, 123 }, todo, noLines, noLines) 124 125 flattenRun.AddExpectations("map_of_objects_with_min_max_properties.go", []string{ 126 `type MapOfObjectsWithMinMaxProperties map[string]HasMaxProperties`, 127 ` nprops := len(m)`, 128 ` if nprops < 3 {`, 129 ` return errors.TooFewProperties("", "body", 3)`, 130 ` if nprops > 5 {`, 131 ` return errors.TooManyProperties("", "body", 5)`, 132 ` for k := range m {`, 133 ` if err := validate.Required(k, "body", m[k]); err != nil {`, 134 ` if val, ok := m[k]; ok {`, 135 ` if err := val.Validate(formats); err != nil {`, 136 }, todo, noLines, noLines) 137 138 flattenRun.AddExpectations("map_with_min_max_properties.go", []string{ 139 `type MapWithMinMaxProperties map[string]interface{}`, 140 ` nprops := len(m)`, 141 ` if nprops < 3 {`, 142 ` return errors.TooFewProperties("", "body", 3)`, 143 ` if nprops > 5 {`, 144 ` return errors.TooManyProperties("", "body", 5)`, 145 }, todo, noLines, noLines) 146 147 flattenRun.AddExpectations("object_with_min_max_properties.go", []string{ 148 ` ObjectWithMinMaxProperties map[string]*HasMaxProperties`, 149 ` if m == nil {`, 150 ` return errors.TooFewProperties("", "body", 3)`, 151 ` props := make(map[string]json.RawMessage, 2+10)`, 152 ` j, err := swag.WriteJSON(m)`, 153 ` if err = swag.ReadJSON(j, &props); err != nil {`, 154 ` nprops := len(props)`, 155 ` if nprops < 3 {`, 156 ` return errors.TooFewProperties("", "body", 3)`, 157 ` if nprops > 5 {`, 158 ` return errors.TooManyProperties("", "body", 5)`, 159 ` if err := m.validateB(formats); err != nil {`, 160 ` if err := m.validateID(formats); err != nil {`, 161 ` for k := range m.ObjectWithMinMaxProperties {`, 162 ` if err := validate.Required(k, "body", m.ObjectWithMinMaxProperties[k]); err != nil {`, 163 ` if val, ok := m.ObjectWithMinMaxProperties[k]; ok {`, 164 ` if val != nil {`, 165 ` if err := val.Validate(formats); err != nil {`, 166 }, todo, noLines, noLines) 167 168 flattenRun.AddExpectations("untyped_with_min_max_properties.go", []string{ 169 `type UntypedWithMinMaxProperties map[string]interface{}`, 170 ` nprops := len(m)`, 171 ` if nprops < 3 {`, 172 ` return errors.TooFewProperties("", "body", 3)`, 173 ` if nprops > 5 {`, 174 ` return errors.TooManyProperties("", "body", 5)`, 175 }, todo, noLines, noLines) 176 } 177 178 func initFixtureGuardFormats() { 179 f := newModelFixture("../fixtures/enhancements/guard-formats/fixture-guard-formats.yaml", "guard format validations") 180 flattenRun := f.AddRun(false).WithMinimalFlatten(true) 181 182 flattenRun.AddExpectations("aliased_date.go", []string{ 183 `type AliasedDate strfmt.Date`, 184 `func (m AliasedDate) Validate(formats strfmt.Registry) error {`, 185 `if err := validate.MinLength("", "body", strfmt.Date(m).String(), 16); err != nil {`, 186 `if err := validate.MaxLength("", "body", strfmt.Date(m).String(), 20); err != nil {`, 187 "if err := validate.Pattern(\"\", \"body\", strfmt.Date(m).String(), `(\\d+)/(\\d+)`); err != nil {", 188 `if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`, 189 }, todo, noLines, noLines) 190 191 flattenRun.AddExpectations("aliased_reader.go", 192 []string{ 193 `type AliasedReader io.ReadCloser`, 194 }, 195 // no validations for binary 196 []string{ 197 `validate.MinLength(`, 198 `validate.MaxLength(`, 199 `validate.Pattern(`, 200 `validate.FormatOf(`, 201 }, 202 []string{ 203 // disable log assertions (dodgy with parallel tests) 204 // `warning: validation pattern`, 205 // `warning: validation minLength (value: 16) not compatible with type for format "binary". Skipped`, 206 // `warning: validation maxLength (value: 20) not compatible with type for format "binary". Skipped`, 207 }, noLines, 208 ) 209 210 flattenRun.AddExpectations("aliased_string.go", []string{ 211 `type AliasedString string`, 212 `func (m AliasedString) Validate(formats strfmt.Registry) error {`, 213 `if err := validate.MinLength("", "body", string(m), 16); err != nil {`, 214 `if err := validate.MaxLength("", "body", string(m), 20); err != nil {`, 215 "if err := validate.Pattern(\"\", \"body\", string(m), `(\\d+)/(\\d+)`); err != nil {", 216 }, todo, noLines, noLines) 217 218 flattenRun.AddExpectations("object.go", []string{ 219 `func (m *Object) Validate(formats strfmt.Registry) error {`, 220 `if err := m.validateP0(formats); err != nil {`, 221 `if err := m.validateP1(formats); err != nil {`, 222 `if err := m.validateP10(formats); err != nil {`, 223 `if err := m.validateP11(formats); err != nil {`, 224 `if err := m.validateP1Nullable(formats); err != nil {`, 225 `if err := m.validateP2(formats); err != nil {`, 226 `if err := m.validateP3(formats); err != nil {`, 227 `if err := m.validateP4(formats); err != nil {`, 228 `if err := m.validateP5(formats); err != nil {`, 229 `if err := m.validateP6(formats); err != nil {`, 230 `if err := m.validateP7(formats); err != nil {`, 231 `if err := m.validateP8(formats); err != nil {`, 232 `if err := m.validateP9(formats); err != nil {`, 233 `func (m *Object) validateP0(formats strfmt.Registry) error {`, 234 `if err := validate.Required("p0", "body", m.P0); err != nil {`, 235 `if err := validate.MinLength("p0", "body", *m.P0, 12); err != nil {`, 236 `if err := validate.MaxLength("p0", "body", *m.P0, 16); err != nil {`, 237 "if err := validate.Pattern(\"p0\", \"body\", *m.P0, `(\\d+)-(\\d+)`); err != nil {", 238 `func (m *Object) validateP1(formats strfmt.Registry) error {`, 239 `if err := validate.Required("p1", "body", m.P1); err != nil {`, 240 `if err := validate.MinLength("p1", "body", m.P1.String(), 12); err != nil {`, 241 `if err := validate.MaxLength("p1", "body", m.P1.String(), 16); err != nil {`, 242 "if err := validate.Pattern(\"p1\", \"body\", m.P1.String(), `(\\d+)/(\\d+)`); err != nil {", 243 `if err := validate.FormatOf("p1", "body", "date", m.P1.String(), formats); err != nil {`, 244 `func (m *Object) validateP10(formats strfmt.Registry) error {`, 245 `if err := validate.RequiredString("p10", "body", m.P10); err != nil {`, 246 `if err := validate.MinLength("p10", "body", m.P10, 12); err != nil {`, 247 `if err := validate.MaxLength("p10", "body", m.P10, 16); err != nil {`, 248 "if err := validate.Pattern(\"p10\", \"body\", m.P10, `(\\d+)-(\\d+)`); err != nil {", 249 `func (m *Object) validateP11(formats strfmt.Registry) error {`, 250 ` if err := validate.Required("p11", "body", m.P11); err != nil {`, 251 ` if err := validate.Required("p11", "body", m.P11); err != nil {`, 252 ` if m.P11 != nil {`, 253 ` if err := m.P11.Validate(formats); err != nil {`, 254 ` if ve, ok := err.(*errors.Validation); ok {`, 255 ` return ve.ValidateName("p11")`, 256 `func (m *Object) validateP1Nullable(formats strfmt.Registry) error {`, 257 ` if swag.IsZero(m.P1Nullable) {`, 258 ` if err := validate.MinLength("p1Nullable", "body", m.P1Nullable.String(), 12); err != nil {`, 259 ` if err := validate.MaxLength("p1Nullable", "body", m.P1Nullable.String(), 16); err != nil {`, 260 " if err := validate.Pattern(\"p1Nullable\", \"body\", m.P1Nullable.String(), `(\\d+)/(\\d+)`); err != nil {", 261 ` if err := validate.FormatOf("p1Nullable", "body", "date", m.P1Nullable.String(), formats); err != nil {`, 262 `func (m *Object) validateP2(formats strfmt.Registry) error {`, 263 ` if swag.IsZero(m.P2) {`, 264 ` if err := validate.MinLength("p2", "body", m.P2.String(), 12); err != nil {`, 265 ` if err := validate.MaxLength("p2", "body", m.P2.String(), 16); err != nil {`, 266 " if err := validate.Pattern(\"p2\", \"body\", m.P2.String(), `(\\d+)-(\\d+)`); err != nil {", 267 ` if err := validate.FormatOf("p2", "body", "uuid", m.P2.String(), formats); err != nil {`, 268 `func (m *Object) validateP3(formats strfmt.Registry) error {`, 269 ` if swag.IsZero(m.P3) {`, 270 ` if err := validate.MinLength("p3", "body", m.P3.String(), 12); err != nil {`, 271 ` if err := validate.MaxLength("p3", "body", m.P3.String(), 16); err != nil {`, 272 " if err := validate.Pattern(\"p3\", \"body\", m.P3.String(), `(\\d+)-(\\d+)`); err != nil {", 273 ` if err := validate.FormatOf("p3", "body", "datetime", m.P3.String(), formats); err != nil {`, 274 `func (m *Object) validateP4(formats strfmt.Registry) error {`, 275 ` if swag.IsZero(m.P4) {`, 276 ` if err := validate.MinLength("p4", "body", m.P4.String(), 12); err != nil {`, 277 ` if err := validate.MaxLength("p4", "body", m.P4.String(), 16); err != nil {`, 278 " if err := validate.Pattern(\"p4\", \"body\", m.P4.String(), `(\\d+)-(\\d+)`); err != nil {", 279 ` if err := validate.FormatOf("p4", "body", "bsonobjectid", m.P4.String(), formats); err != nil {`, 280 `func (m *Object) validateP5(formats strfmt.Registry) error {`, 281 ` if swag.IsZero(m.P5) {`, 282 ` if err := validate.MinLength("p5", "body", m.P5.String(), 12); err != nil {`, 283 ` if err := validate.MaxLength("p5", "body", m.P5.String(), 16); err != nil {`, 284 " if err := validate.Pattern(\"p5\", \"body\", m.P5.String(), `(\\d+)-(\\d+)`); err != nil {", 285 ` if err := validate.FormatOf("p5", "body", "duration", m.P5.String(), formats); err != nil {`, 286 `func (m *Object) validateP6(formats strfmt.Registry) error {`, 287 ` if swag.IsZero(m.P6) {`, 288 ` if err := validate.MinLength("p6", "body", m.P6.String(), 12); err != nil {`, 289 ` if err := validate.MaxLength("p6", "body", m.P6.String(), 16); err != nil {`, 290 " if err := validate.Pattern(\"p6\", \"body\", m.P6.String(), `(\\d+)-(\\d+)`); err != nil {", 291 `func (m *Object) validateP7(formats strfmt.Registry) error {`, 292 ` if err := validate.Required("p7", "body", io.ReadCloser(m.P7)); err != nil {`, 293 `func (m *Object) validateP8(formats strfmt.Registry) error {`, 294 ` if err := validate.Required("p8", "body", m.P8); err != nil {`, 295 ` if err := validate.Required("p8", "body", m.P8); err != nil {`, 296 ` if m.P8 != nil {`, 297 ` if err := m.P8.Validate(formats); err != nil {`, 298 ` if ve, ok := err.(*errors.Validation); ok {`, 299 ` return ve.ValidateName("p8")`, 300 `func (m *Object) validateP9(formats strfmt.Registry) error {`, 301 ` if err := validate.Required("p9", "body", AliasedReader(m.P9)); err != nil {`, 302 }, todo, 303 []string{ 304 // disable log assertions (dodgy with parallel tests) 305 // warnings about no validations for binary 306 // `warning: validation minLength (value: 12) not compatible with type for format "binary". Skipped`, 307 // `warning: validation maxLength (value: 16) not compatible with type for format "binary". Skipped`, 308 // `warning: validation pattern`, 309 }, noLines) 310 } 311 312 func initFixture2448() { 313 f := newModelFixture("../fixtures/bugs/2448/fixture-2448.yaml", "numerical validations") 314 flattenRun := f.AddRun(false).WithMinimalFlatten(true) 315 316 flattenRun.AddExpectations("integers.go", []string{ 317 `if err := validate.MinimumInt("i0", "body", m.I0, 10, true); err != nil {`, 318 `if err := validate.MaximumInt("i0", "body", m.I0, 100, true); err != nil {`, 319 `if err := validate.MultipleOfInt("i0", "body", m.I0, 10); err != nil {`, 320 `if err := validate.MinimumInt("i1", "body", int64(m.I1), 10, true); err != nil {`, 321 `if err := validate.MaximumInt("i1", "body", int64(m.I1), 100, true); err != nil {`, 322 `if err := validate.MultipleOfInt("i1", "body", int64(m.I1), 10); err != nil {`, 323 `if err := validate.MinimumInt("i2", "body", m.I2, 10, true); err != nil {`, 324 `if err := validate.MaximumInt("i2", "body", m.I2, 100, true); err != nil {`, 325 `if err := validate.MultipleOfInt("i2", "body", m.I2, 10); err != nil {`, 326 `if err := validate.MinimumInt("i3", "body", int64(m.I3), 10, true); err != nil {`, 327 `if err := validate.MaximumInt("i3", "body", int64(m.I3), 100, true); err != nil {`, 328 `if err := validate.MultipleOfInt("i3", "body", int64(m.I3), 10); err != nil {`, 329 `if err := validate.MultipleOf("i4", "body", float64(m.I4), 10.5); err != nil {`, 330 `if err := validate.MinimumUint("ui1", "body", uint64(m.Ui1), 10, true); err != nil {`, 331 `if err := validate.MaximumUint("ui1", "body", uint64(m.Ui1), 100, true); err != nil {`, 332 `if err := validate.MultipleOfUint("ui1", "body", uint64(m.Ui1), 10); err != nil {`, 333 `if err := validate.MinimumUint("ui2", "body", m.Ui2, 10, true); err != nil {`, 334 `if err := validate.MaximumUint("ui2", "body", m.Ui2, 100, true); err != nil {`, 335 `if err := validate.MultipleOfUint("ui2", "body", m.Ui2, 10); err != nil {`, 336 `if err := validate.MinimumUint("ui3", "body", uint64(m.Ui3), 10, true); err != nil {`, 337 `if err := validate.MaximumUint("ui3", "body", uint64(m.Ui3), 100, true); err != nil {`, 338 `if err := validate.MultipleOfUint("ui3", "body", uint64(m.Ui3), 10); err != nil {`, 339 `if err := validate.MultipleOf("ui4", "body", float64(m.Ui4), 10.5); err != nil {`, 340 }, todo, noLines, noLines) 341 342 flattenRun.AddExpectations("numbers.go", []string{ 343 `if err := validate.Minimum("f0", "body", m.F0, 10, true); err != nil {`, 344 `if err := validate.Maximum("f0", "body", m.F0, 100, true); err != nil {`, 345 `if err := validate.MultipleOf("f0", "body", m.F0, 10); err != nil {`, 346 `if err := validate.Minimum("f1", "body", float64(m.F1), 10, true); err != nil {`, 347 `if err := validate.Maximum("f1", "body", float64(m.F1), 100, true); err != nil {`, 348 `if err := validate.MultipleOf("f1", "body", float64(m.F1), 10); err != nil {`, 349 `if err := validate.Minimum("f2", "body", m.F2, 10, true); err != nil {`, 350 `if err := validate.Maximum("f2", "body", m.F2, 100, true); err != nil {`, 351 `if err := validate.MultipleOf("f2", "body", m.F2, 10); err != nil {`, 352 }, todo, noLines, noLines) 353 } 354 func initFixture2400() { 355 f := newModelFixture("../fixtures/bugs/2400/fixture-2400.yaml", "required aliased primitive") 356 flattenRun := f.AddRun(false).WithMinimalFlatten(true) 357 358 flattenRun.AddExpectations("signup_request.go", []string{ 359 `type SignupRequest struct {`, 360 `Email *string`, 361 }, todo, noLines, noLines) 362 flattenRun.AddExpectations("signup_request2.go", []string{ 363 `type SignupRequest2 struct {`, 364 `Email *Email`, 365 }, todo, noLines, noLines) 366 } 367 368 func initFixture2381() { 369 f := newModelFixture("../fixtures/bugs/2381/fixture-2381.yaml", "required $ref primitive") 370 flattenRun := f.AddRun(false).WithMinimalFlatten(true) 371 expandRun := f.AddRun(true) 372 373 flattenRun.AddExpectations("my_object.go", []string{ 374 `RequiredReferencedObject MyObjectRef`, // this is an interface{} 375 `RequiredReferencedString *MyStringRef`, // alias to primitive 376 `RequiredString *string`, // unaliased primitive 377 `RequiredReferencedArray MyArrayRef`, // no need to use a pointer 378 `RequiredReferencedMap MyMapRef`, // no need to use a pointer 379 `RequiredReferencedStruct *MyStructRef`, // pointer to struct 380 `func (m *MyObject) validateRequiredReferencedObject(formats strfmt.Registry) error {`, 381 ` if m.RequiredReferencedObject == nil {`, 382 ` return errors.Required("required_referenced_object", "body", nil)`, 383 `func (m *MyObject) validateRequiredReferencedString(formats strfmt.Registry) error {`, 384 ` if err := validate.Required("required_referenced_string", "body", m.RequiredReferencedString); err != nil {`, 385 ` if err := m.RequiredReferencedString.Validate(formats); err != nil {`, 386 ` if ve, ok := err.(*errors.Validation); ok {`, 387 ` return ve.ValidateName("required_referenced_string")`, 388 `func (m *MyObject) validateRequiredString(formats strfmt.Registry) error {`, 389 ` if err := validate.Required("required_string", "body", m.RequiredString); err != nil {`, 390 `func (m *MyObject) validateRequiredReferencedStruct(formats strfmt.Registry) error {`, 391 `if err := validate.Required("required_referenced_struct", "body", m.RequiredReferencedStruct); err != nil {`, 392 `func (m *MyObject) validateRequiredReferencedArray(formats strfmt.Registry) error {`, 393 `if err := validate.Required("required_referenced_array", "body", m.RequiredReferencedArray); err != nil {`, 394 `func (m *MyObject) validateRequiredReferencedMap(formats strfmt.Registry) error {`, 395 `if err := validate.Required("required_referenced_map", "body", m.RequiredReferencedMap); err != nil {`, 396 }, todo, noLines, noLines) 397 398 expandRun.AddExpectations("my_object.go", []string{ 399 `func (m *MyObject) validateRequiredReferencedObject(formats strfmt.Registry) error {`, 400 ` if m.RequiredReferencedObject == nil {`, 401 ` return errors.Required("required_referenced_object", "body", nil)`, 402 `func (m *MyObject) validateRequiredReferencedString(formats strfmt.Registry) error {`, 403 ` if err := validate.Required("required_referenced_string", "body", m.RequiredReferencedString); err != nil {`, 404 `func (m *MyObject) validateRequiredString(formats strfmt.Registry) error {`, 405 ` if err := validate.Required("required_string", "body", m.RequiredString); err != nil {`, 406 }, todo, noLines, noLines) 407 } 408 409 func initFixture2300() { 410 f := newModelFixture("../fixtures/bugs/2300/fixture-2300.yaml", "required interface{} is validated with against nil") 411 flattenRun := f.AddRun(false).WithMinimalFlatten(true) 412 413 // test behaviour with all structs made anonymous (inlined) 414 expandRun := f.AddRun(true) 415 416 flattenRun.AddExpectations("obj.go", []string{ 417 `func (m *Obj) validateReq1(formats strfmt.Registry) error {`, 418 ` if m.Req1 == nil {`, 419 ` return errors.Required("req1", "body", nil)`, 420 `func (m *Obj) validateReq2(formats strfmt.Registry) error {`, 421 ` if m.Req2 == nil {`, 422 ` return errors.Required("req2", "body", nil)`, 423 `func (m *Obj) validateReq3(formats strfmt.Registry) error {`, 424 ` if m.Req3 == nil {`, 425 ` return errors.Required("req3", "body", nil)`, 426 `func (m *Obj) validateReq4(formats strfmt.Registry) error {`, 427 ` if err := validate.Required("req4", "body", m.Req4); err != nil {`, 428 ` if m.Req4 != nil {`, 429 ` if err := m.Req4.Validate(formats); err != nil {`, 430 `func (m *Obj) validateReq5(formats strfmt.Registry) error {`, 431 ` if err := validate.Required("req5", "body", m.Req5); err != nil {`, 432 ` if m.Req5 != nil {`, 433 ` if err := m.Req5.Validate(formats); err != nil {`, 434 }, todo, noLines, noLines) 435 436 // on anonymous 437 expandRun.AddExpectations("obj.go", []string{ 438 `Req4 map[string]interface{}`, 439 `func (m *Obj) validateReq1(formats strfmt.Registry) error {`, 440 ` if m.Req1 == nil {`, 441 ` return errors.Required("req1", "body", nil)`, 442 `func (m *Obj) validateReq2(formats strfmt.Registry) error {`, 443 ` if m.Req2 == nil {`, 444 ` return errors.Required("req2", "body", nil)`, 445 `func (m *Obj) validateReq3(formats strfmt.Registry) error {`, 446 ` if m.Req3 == nil {`, 447 ` return errors.Required("req3", "body", nil)`, 448 `func (m *Obj) validateReq4(formats strfmt.Registry) error {`, 449 `if err := validate.Required("req4", "body", m.Req4); err != nil {`, 450 `for k := range m.Req4 {`, 451 `if err := validate.Required("req4"+"."+k, "body", m.Req4[k]); err != nil {`, 452 `func (m *Obj) validateReq5(formats strfmt.Registry) error {`, 453 ` if err := validate.Required("req5", "body", m.Req5); err != nil {`, 454 ` if m.Req5 != nil {`, 455 ` if err := m.Req5.Validate(formats); err != nil {`, 456 }, todo, noLines, noLines) 457 } 458 459 func initFixture2081() { 460 f := newModelFixture("../fixtures/bugs/2081/fixture-2081.yaml", "required interface{} is validated with against nil") 461 flattenRun := f.AddRun(false).WithMinimalFlatten(true) 462 463 // interface{} 464 flattenRun.AddExpectations("event.go", []string{ 465 `func (m *Event) validateValue(formats strfmt.Registry) error {`, 466 `if m.Value == nil {`, 467 `return errors.Required("value", "body", nil)`, 468 }, todo, noLines, noLines) 469 470 flattenRun.AddExpectations("events.go", []string{ 471 `func (m *EventsItems0) validateA(formats strfmt.Registry) error {`, 472 `if m.A == nil {`, 473 `return errors.Required("a", "body", nil)`, 474 }, todo, noLines, noLines) 475 } 476 477 func initFixture936ReadOnly() { 478 f := newModelFixture("../fixtures/enhancements/936/fixture-936.yml", "check ReadOnly ContextValidate is generated properly") 479 flattenRun := f.AddRun(false).WithMinimalFlatten(true) 480 481 // object simple has 2 read only feilds 482 flattenRun.AddExpectations("object1.go", []string{ 483 // object1 484 `func (m *Object1) ContextValidate(ctx context.Context, formats strfmt.Registry)`, 485 `m.contextValidateID(ctx, formats)`, 486 `m.contextValidateName(ctx, formats)`, 487 `) contextValidateID(ctx context.Context, formats strfmt.Registry)`, 488 `) contextValidateName(ctx context.Context, formats strfmt.Registry)`, 489 `validate.ReadOnly(ctx`, 490 }, todo, noLines, noLines) 491 492 // object2 composed of object1 493 flattenRun.AddExpectations("object2.go", []string{ 494 `) ContextValidate(ctx context.Context, formats strfmt.Registry)`, 495 `contextValidateObjectRef(ctx, formats)`, 496 `) contextValidateObjectRef(ctx context.Context, formats strfmt.Registry) `, 497 `m.ObjectRef.ContextValidate(ctx, formats)`, 498 }, todo, noLines, noLines) 499 500 // object3 has inline object 501 flattenRun.AddExpectations("object3.go", []string{ 502 `) ContextValidate(ctx context.Context, formats strfmt.Registry)`, 503 `contextValidateName(ctx, formats)`, 504 `) contextValidateName(ctx context.Context, formats strfmt.Registry)`, 505 `validate.ReadOnly(ctx`, 506 }, todo, noLines, noLines) 507 508 // object4 is array with readonly string element 509 flattenRun.AddExpectations("object4.go", []string{ 510 `) ContextValidate(ctx context.Context, formats strfmt.Registry)`, 511 `for i := 0; i < len(m); i++`, 512 `validate.ReadOnly(ctx`, 513 }, todo, noLines, noLines) 514 515 // object5 is string alias 516 flattenRun.AddExpectations("object5.go", []string{ 517 `) ContextValidate(ctx context.Context, formats strfmt.Registry)`, 518 `validate.ReadOnly(ctx`, 519 }, todo, noLines, noLines) 520 521 // object6 is array of object5 522 flattenRun.AddExpectations("object6.go", []string{ 523 `) ContextValidate(ctx context.Context, formats strfmt.Registry)`, 524 `for i := 0; i < len(m); i++`, 525 `m[i].ContextValidate(ctx, formats)`, 526 }, todo, noLines, noLines) 527 528 // object7 is all of object5 and object4 and fields 529 flattenRun.AddExpectations("object7.go", []string{ 530 `) ContextValidate(ctx context.Context, formats strfmt.Registry)`, 531 `m.Object5.ContextValidate(ctx, formats)`, 532 `m.Object4.ContextValidate(ctx, formats)`, 533 // field one 534 `m.contextValidateObject7Field1(ctx, formats)`, 535 `contextValidateObject7Field1(ctx context.Context, formats strfmt.Registry)`, 536 // field two should missing since not readOnly 537 // field three 538 `m.contextValidateObject7Field3(ctx, formats)`, 539 `contextValidateObject7Field3(ctx context.Context, formats strfmt.Registry)`, 540 `m.Object7Field3.ContextValidate(ctx, formats)`, 541 }, todo, noLines, 542 []string{ 543 `m.contextValidateObject7Field2(ctx, formats)`, 544 }) 545 // x go type 546 flattenRun.AddExpectations("time.go", []string{ 547 `) ContextValidate(ctx context.Context, formats strfmt.Registry) error`, 548 `var f interface{} = m.Time`, 549 }, todo, noLines, noLines) 550 // additional properties 551 flattenRun.AddExpectations("object8.go", []string{ 552 `) ContextValidate(ctx context.Context, formats strfmt.Registry) error`, 553 `for k := range m`, 554 `validate.ReadOnly(ctx`, 555 }, todo, noLines, noLines) 556 flattenRun.AddExpectations("object9.go", []string{ 557 `) ContextValidate(ctx context.Context, formats strfmt.Registry) error`, 558 `m.contextValidateObject9Field1(ctx, formats)`, 559 `validate.ReadOnly(ctx`, 560 }, todo, noLines, noLines) 561 } 562 563 func initFixture2220() { 564 // NOTE(fred): this test merely asserts that template refactoring (essentially dealing with hite space gobbling etc) 565 // properly runs against the case of base type with additionalProperties. 566 // 567 // TODO(fred): should actually fix the problem in base type model rendering 568 f := newModelFixture("../fixtures/bugs/2220/fixture-2220.yaml", "check base type with additional properties") 569 flattenRun := f.AddRun(false).WithMinimalFlatten(true) 570 571 flattenRun.AddExpectations("object.go", []string{ 572 // This asserts our template announcement about forthcoming fix (used to be a func commented out of luck) 573 `// AdditionalProperties in base type shoud be handled just like regular properties`, 574 `// At this moment, the base type property is pushed down to the subtype`, 575 }, todo, noLines, noLines) 576 577 flattenRun.AddExpectations("component.go", []string{ 578 // This asserts the current schema layout, which works but does not honour inheritance from the base type 579 "ObjectAdditionalProperties map[string]interface{} `json:\"-\"`", 580 }, todo, noLines, noLines) 581 } 582 583 func initFixture2116() { 584 f := newModelFixture("../fixtures/bugs/2116/fixture-2116.yaml", "check x-omitempty and x-nullable with $ref") 585 flattenRun := f.AddRun(false).WithMinimalFlatten(true) 586 587 flattenRun.AddExpectations("case1_fail_omitempty_false_not_hoisted_by_ref.go", []string{ 588 "Body *ObjectWithOmitemptyFalse `json:\"Body\"`", 589 }, todo, noLines, noLines) 590 591 flattenRun.AddExpectations("case2_fail_omitempty_false_not_overridden_by_ref_sibling.go", []string{ 592 "Body *ObjectWithOmitemptyTrue `json:\"Body,omitempty\"`", 593 }, todo, noLines, noLines) 594 595 flattenRun.AddExpectations("case3_pass_object_nullable_false_hoisted_by_ref.go", []string{ 596 "Body ObjectWithNullableFalse `json:\"Body,omitempty\"`", 597 }, todo, noLines, noLines) 598 599 flattenRun.AddExpectations("case4_pass_object_nullable_false_overriden_by_ref_sibling.go", []string{ 600 "Body *ObjectWithNullableTrue `json:\"Body,omitempty\"`", 601 }, todo, noLines, noLines) 602 603 flattenRun.AddExpectations("array_with_default.go", []string{ 604 "type ArrayWithDefault []string", 605 }, append(todo, "omitempty"), noLines, noLines) 606 607 flattenRun.AddExpectations("array_with_no_omit_empty.go", []string{ 608 "type ArrayWithNoOmitEmpty []string", 609 }, append(todo, "omitempty"), noLines, noLines) 610 611 flattenRun.AddExpectations("array_with_nullable.go", []string{ 612 "type ArrayWithNullable []string", 613 }, todo, noLines, noLines) 614 615 flattenRun.AddExpectations("array_with_nullable_items.go", []string{ 616 "type ArrayWithNullableItems []*string", 617 }, todo, noLines, noLines) 618 619 flattenRun.AddExpectations("array_with_omit_empty.go", []string{ 620 "type ArrayWithOmitEmpty []string", 621 }, append(todo, "omitempty"), noLines, noLines) 622 623 flattenRun.AddExpectations("object_with_arrays.go", []string{ 624 "Array0 ArrayWithDefault `json:\"array0,omitempty\"`", 625 "Array1 []string `json:\"array1\"`", 626 "Array11 []string `json:\"array11,omitempty\"`", 627 "Array12 []string `json:\"array12\"`", 628 "Array2 ArrayWithOmitEmpty `json:\"array2,omitempty\"`", 629 "Array3 ArrayWithNoOmitEmpty `json:\"array3\"`", 630 }, todo, noLines, noLines) 631 632 flattenRun.AddExpectations("object_with_nullable_false.go", []string{ 633 "Data interface{} `json:\"Data,omitempty\"`", 634 }, todo, noLines, noLines) 635 636 flattenRun.AddExpectations("object_with_nullable_true.go", []string{ 637 "Data interface{} `json:\"Data,omitempty\"`", 638 }, todo, noLines, noLines) 639 640 flattenRun.AddExpectations("object_with_omitempty_false.go", []string{ 641 "Data interface{} `json:\"Data,omitempty\"`", 642 }, todo, noLines, noLines) 643 644 flattenRun.AddExpectations("object_with_omitempty_true.go", []string{ 645 "Data interface{} `json:\"Data,omitempty\"`", 646 }, todo, noLines, noLines) 647 648 flattenRun.AddExpectations("array_with_omit_empty_items.go", []string{ 649 "type ArrayWithOmitEmptyItems []string", 650 }, append(todo, "omitempty"), noLines, noLines) 651 } 652 653 func initFixture2071() { 654 f := newModelFixture("../fixtures/bugs/2071/fixture-2071.yaml", "check allOf serializer when x-go-name is present") 655 flattenRun := f.AddRun(false).WithMinimalFlatten(true) 656 flattenRun.AddExpectations("cat.go", []string{ 657 "var dataAO1 struct {\n\t\tSomeAbility *string `json:\"ability,omitempty\"`", 658 }, 659 // not expected 660 append(todo, "SomeAbility *string `json:\"SomeAbility,omitempty\"`"), 661 // output in log 662 noLines, 663 noLines) 664 } 665 666 func initFixture1479Part() { 667 // testing ../fixtures/bugs/1479/fixture-1479-part.yaml with flatten and expand (--skip-flatten) 668 669 /* 670 The breakage with allOf occurs when a schema with an allOf has itself a 671 property which is an allOf construct 672 */ 673 674 f := newModelFixture("../fixtures/bugs/1479/fixture-1479-part.yaml", "check nested AllOf validations (from Pouch Engine API)") 675 flattenRun := f.AddRun(false) 676 expandRun := f.AddRun(true) 677 678 // load expectations for model: container_create_config_all_of1.go 679 flattenRun.AddExpectations("container_create_config_all_of1.go", []string{ 680 `type ContainerCreateConfigAllOf1 struct {`, 681 " HostConfig *HostConfig `json:\"HostConfig,omitempty\"`", 682 " NetworkingConfig *NetworkingConfig `json:\"NetworkingConfig,omitempty\"`", 683 `func (m *ContainerCreateConfigAllOf1) Validate(formats strfmt.Registry) error {`, 684 ` if err := m.validateHostConfig(formats); err != nil {`, 685 ` if err := m.validateNetworkingConfig(formats); err != nil {`, 686 ` return errors.CompositeValidationError(res...`, 687 `func (m *ContainerCreateConfigAllOf1) validateHostConfig(formats strfmt.Registry) error {`, 688 ` if swag.IsZero(m.HostConfig) {`, 689 ` if m.HostConfig != nil {`, 690 ` if err := m.HostConfig.Validate(formats); err != nil {`, 691 ` if ve, ok := err.(*errors.Validation); ok {`, 692 ` return ve.ValidateName("HostConfig"`, 693 `func (m *ContainerCreateConfigAllOf1) validateNetworkingConfig(formats strfmt.Registry) error {`, 694 ` if swag.IsZero(m.NetworkingConfig) {`, 695 ` if m.NetworkingConfig != nil {`, 696 ` if err := m.NetworkingConfig.Validate(formats); err != nil {`, 697 ` if ve, ok := err.(*errors.Validation); ok {`, 698 ` return ve.ValidateName("NetworkingConfig"`, 699 }, 700 // not expected 701 todo, 702 // output in log 703 noLines, 704 noLines) 705 706 // load expectations for model: container_config.go 707 flattenRun.AddExpectations("container_config.go", []string{ 708 `type ContainerConfig struct {`, 709 " ArgsEscaped bool `json:\"ArgsEscaped,omitempty\"`", 710 " AttachStderr bool `json:\"AttachStderr,omitempty\"`", 711 " AttachStdin bool `json:\"AttachStdin,omitempty\"`", 712 " AttachStdout bool `json:\"AttachStdout,omitempty\"`", 713 " Cmd []string `json:\"Cmd\"`", 714 " DiskQuota map[string]string `json:\"DiskQuota,omitempty\"`", 715 " Domainname string `json:\"Domainname,omitempty\"`", 716 " Entrypoint []string `json:\"Entrypoint\"`", 717 " Env []string `json:\"Env\"`", 718 " ExposedPorts map[string]interface{} `json:\"ExposedPorts,omitempty\"`", 719 " Hostname strfmt.Hostname `json:\"Hostname,omitempty\"`", 720 " Image string `json:\"Image\"`", 721 " InitScript string `json:\"InitScript,omitempty\"`", 722 " Labels map[string]string `json:\"Labels,omitempty\"`", 723 " MacAddress string `json:\"MacAddress,omitempty\"`", 724 " NetworkDisabled bool `json:\"NetworkDisabled,omitempty\"`", 725 " OnBuild []string `json:\"OnBuild\"`", 726 " OpenStdin bool `json:\"OpenStdin,omitempty\"`", 727 " QuotaID string `json:\"QuotaID,omitempty\"`", 728 " Rich bool `json:\"Rich,omitempty\"`", 729 " RichMode string `json:\"RichMode,omitempty\"`", 730 " Shell []string `json:\"Shell\"`", 731 " SpecAnnotation map[string]string `json:\"SpecAnnotation,omitempty\"`", 732 " StdinOnce bool `json:\"StdinOnce,omitempty\"`", 733 " StopSignal string `json:\"StopSignal,omitempty\"`", 734 " StopTimeout *int64 `json:\"StopTimeout,omitempty\"`", 735 " Tty bool `json:\"Tty,omitempty\"`", 736 " User string `json:\"User,omitempty\"`", 737 " Volumes map[string]interface{} `json:\"Volumes,omitempty\"`", 738 " WorkingDir string `json:\"WorkingDir,omitempty\"`", 739 `func (m *ContainerConfig) Validate(formats strfmt.Registry) error {`, 740 ` if err := m.validateExposedPorts(formats); err != nil {`, 741 ` if err := m.validateHostname(formats); err != nil {`, 742 ` if err := m.validateImage(formats); err != nil {`, 743 ` if err := m.validateRichMode(formats); err != nil {`, 744 ` if err := m.validateVolumes(formats); err != nil {`, 745 ` return errors.CompositeValidationError(res...`, 746 `var containerConfigExposedPortsValueEnum []interface{`, 747 ` var res []interface{`, 748 " if err := json.Unmarshal([]byte(`[{}]`), &res); err != nil {", 749 ` for _, v := range res {`, 750 ` containerConfigExposedPortsValueEnum = append(containerConfigExposedPortsValueEnum, v`, 751 `func (m *ContainerConfig) validateExposedPortsValueEnum(path, location string, value interface{}) error {`, 752 ` if err := validate.EnumCase(path, location, value, containerConfigExposedPortsValueEnum, true); err != nil {`, 753 `func (m *ContainerConfig) validateExposedPorts(formats strfmt.Registry) error {`, 754 ` if swag.IsZero(m.ExposedPorts) {`, 755 ` for k := range m.ExposedPorts {`, 756 ` if err := m.validateExposedPortsValueEnum("ExposedPorts"+"."+k, "body", m.ExposedPorts[k]); err != nil {`, 757 `func (m *ContainerConfig) validateHostname(formats strfmt.Registry) error {`, 758 ` if swag.IsZero(m.Hostname) {`, 759 ` if err := validate.MinLength("Hostname", "body", m.Hostname.String(), 1); err != nil {`, 760 ` if err := validate.FormatOf("Hostname", "body", "hostname", m.Hostname.String(), formats); err != nil {`, 761 `func (m *ContainerConfig) validateImage(formats strfmt.Registry) error {`, 762 ` if err := validate.RequiredString("Image", "body", m.Image); err != nil {`, 763 `var containerConfigTypeRichModePropEnum []interface{`, 764 ` var res []string`, 765 " if err := json.Unmarshal([]byte(`[\"dumb-init\",\"sbin-init\",\"systemd\"]`), &res); err != nil {", 766 ` for _, v := range res {`, 767 ` containerConfigTypeRichModePropEnum = append(containerConfigTypeRichModePropEnum, v`, 768 ` ContainerConfigRichModeDumbDashInit string = "dumb-init"`, 769 ` ContainerConfigRichModeSbinDashInit string = "sbin-init"`, 770 ` ContainerConfigRichModeSystemd string = "systemd"`, 771 `func (m *ContainerConfig) validateRichModeEnum(path, location string, value string) error {`, 772 ` if err := validate.EnumCase(path, location, value, containerConfigTypeRichModePropEnum, true); err != nil {`, 773 `func (m *ContainerConfig) validateRichMode(formats strfmt.Registry) error {`, 774 ` if swag.IsZero(m.RichMode) {`, 775 ` if err := m.validateRichModeEnum("RichMode", "body", m.RichMode); err != nil {`, 776 `var containerConfigVolumesValueEnum []interface{`, 777 ` var res []interface{`, 778 " if err := json.Unmarshal([]byte(`[{}]`), &res); err != nil {", 779 ` for _, v := range res {`, 780 ` containerConfigVolumesValueEnum = append(containerConfigVolumesValueEnum, v`, 781 `func (m *ContainerConfig) validateVolumesValueEnum(path, location string, value interface{}) error {`, 782 ` if err := validate.EnumCase(path, location, value, containerConfigVolumesValueEnum, true); err != nil {`, 783 `func (m *ContainerConfig) validateVolumes(formats strfmt.Registry) error {`, 784 ` if swag.IsZero(m.Volumes) {`, 785 ` for k := range m.Volumes {`, 786 ` if err := m.validateVolumesValueEnum("Volumes"+"."+k, "body", m.Volumes[k]); err != nil {`, 787 }, 788 // not expected 789 todo, 790 // output in log 791 noLines, 792 noLines) 793 794 expandRun.AddExpectations("container_config.go", flattenRun.ExpectedFor("ContainerConfig").ExpectedLines, todo, noLines, noLines) 795 796 // load expectations for model: host_config_all_of0_log_config.go 797 flattenRun.AddExpectations("host_config_all_of0_log_config.go", []string{ 798 `type HostConfigAllOf0LogConfig struct {`, 799 " Config map[string]string `json:\"Config,omitempty\"`", 800 " Type string `json:\"Type,omitempty\"`", 801 `func (m *HostConfigAllOf0LogConfig) Validate(formats strfmt.Registry) error {`, 802 ` if err := m.validateType(formats); err != nil {`, 803 ` return errors.CompositeValidationError(res...`, 804 `var hostConfigAllOf0LogConfigTypeTypePropEnum []interface{`, 805 ` var res []string`, 806 " if err := json.Unmarshal([]byte(`[\"json-file\",\"syslog\",\"journald\",\"gelf\",\"fluentd\",\"awslogs\",\"splunk\",\"etwlogs\",\"none\"]`), &res); err != nil {", 807 ` for _, v := range res {`, 808 ` hostConfigAllOf0LogConfigTypeTypePropEnum = append(hostConfigAllOf0LogConfigTypeTypePropEnum, v`, 809 ` HostConfigAllOf0LogConfigTypeJSONDashFile string = "json-file"`, 810 ` HostConfigAllOf0LogConfigTypeSyslog string = "syslog"`, 811 ` HostConfigAllOf0LogConfigTypeJournald string = "journald"`, 812 ` HostConfigAllOf0LogConfigTypeGelf string = "gelf"`, 813 ` HostConfigAllOf0LogConfigTypeFluentd string = "fluentd"`, 814 ` HostConfigAllOf0LogConfigTypeAwslogs string = "awslogs"`, 815 ` HostConfigAllOf0LogConfigTypeSplunk string = "splunk"`, 816 ` HostConfigAllOf0LogConfigTypeEtwlogs string = "etwlogs"`, 817 ` HostConfigAllOf0LogConfigTypeNone string = "none"`, 818 `func (m *HostConfigAllOf0LogConfig) validateTypeEnum(path, location string, value string) error {`, 819 ` if err := validate.EnumCase(path, location, value, hostConfigAllOf0LogConfigTypeTypePropEnum, true); err != nil {`, 820 `func (m *HostConfigAllOf0LogConfig) validateType(formats strfmt.Registry) error {`, 821 ` if swag.IsZero(m.Type) {`, 822 ` if err := m.validateTypeEnum("Type", "body", m.Type); err != nil {`, 823 }, 824 // not expected 825 todo, 826 // output in log 827 noLines, 828 noLines) 829 830 // load expectations for model: restart_policy.go 831 flattenRun.AddExpectations("restart_policy.go", []string{ 832 `type RestartPolicy struct {`, 833 " MaximumRetryCount int64 `json:\"MaximumRetryCount,omitempty\"`", 834 " Name string `json:\"Name,omitempty\"`", 835 // empty validation 836 "func (m *RestartPolicy) Validate(formats strfmt.Registry) error {\n return nil\n}", 837 }, 838 // not expected 839 todo, 840 // output in log 841 noLines, 842 noLines) 843 844 expandRun.AddExpectations("restart_policy.go", flattenRun.ExpectedFor("RestartPolicy").ExpectedLines, todo, noLines, noLines) 845 846 // load expectations for model: endpoint_ip_a_m_config.go 847 flattenRun.AddExpectations("endpoint_ip_a_m_config.go", []string{ 848 `type EndpointIPAMConfig struct {`, 849 " IPV4Address string `json:\"IPv4Address,omitempty\"`", 850 " IPV6Address string `json:\"IPv6Address,omitempty\"`", 851 " LinkLocalIPs []string `json:\"LinkLocalIPs\"`", 852 // empty validation 853 "func (m *EndpointIPAMConfig) Validate(formats strfmt.Registry) error {\n return nil\n}", 854 }, 855 // not expected 856 todo, 857 // output in log 858 noLines, 859 noLines) 860 861 expandRun.AddExpectations("endpoint_ip_a_m_config.go", flattenRun.ExpectedFor("EndpointIPAMConfig").ExpectedLines, todo, noLines, noLines) 862 863 // load expectations for model: host_config_all_of0.go 864 flattenRun.AddExpectations("host_config_all_of0.go", []string{ 865 `type HostConfigAllOf0 struct {`, 866 " AutoRemove bool `json:\"AutoRemove,omitempty\"`", 867 " Binds []string `json:\"Binds\"`", 868 " CapAdd []string `json:\"CapAdd\"`", 869 " CapDrop []string `json:\"CapDrop\"`", 870 " Cgroup string `json:\"Cgroup,omitempty\"`", 871 " ConsoleSize []*int64 `json:\"ConsoleSize\"`", 872 " ContainerIDFile string `json:\"ContainerIDFile,omitempty\"`", 873 " DNS []string `json:\"Dns\"`", 874 " DNSOptions []string `json:\"DnsOptions\"`", 875 " DNSSearch []string `json:\"DnsSearch\"`", 876 " EnableLxcfs bool `json:\"EnableLxcfs,omitempty\"`", 877 " ExtraHosts []string `json:\"ExtraHosts\"`", 878 " GroupAdd []string `json:\"GroupAdd\"`", 879 " InitScript string `json:\"InitScript,omitempty\"`", 880 " IpcMode string `json:\"IpcMode,omitempty\"`", 881 " Isolation string `json:\"Isolation,omitempty\"`", 882 " Links []string `json:\"Links\"`", 883 " LogConfig *HostConfigAllOf0LogConfig `json:\"LogConfig,omitempty\"`", 884 " NetworkMode string `json:\"NetworkMode,omitempty\"`", 885 " OomScoreAdj int64 `json:\"OomScoreAdj,omitempty\"`", 886 " PidMode string `json:\"PidMode,omitempty\"`", 887 " Privileged bool `json:\"Privileged,omitempty\"`", 888 " PublishAllPorts bool `json:\"PublishAllPorts,omitempty\"`", 889 " ReadonlyRootfs bool `json:\"ReadonlyRootfs,omitempty\"`", 890 " RestartPolicy *RestartPolicy `json:\"RestartPolicy,omitempty\"`", 891 " Rich bool `json:\"Rich,omitempty\"`", 892 " RichMode string `json:\"RichMode,omitempty\"`", 893 " Runtime string `json:\"Runtime,omitempty\"`", 894 " SecurityOpt []string `json:\"SecurityOpt\"`", 895 " ShmSize *int64 `json:\"ShmSize,omitempty\"`", 896 " StorageOpt map[string]string `json:\"StorageOpt,omitempty\"`", 897 " Sysctls map[string]string `json:\"Sysctls,omitempty\"`", 898 " Tmpfs map[string]string `json:\"Tmpfs,omitempty\"`", 899 " UTSMode string `json:\"UTSMode,omitempty\"`", 900 " UsernsMode string `json:\"UsernsMode,omitempty\"`", 901 " VolumeDriver string `json:\"VolumeDriver,omitempty\"`", 902 " VolumesFrom []string `json:\"VolumesFrom\"`", 903 `func (m *HostConfigAllOf0) Validate(formats strfmt.Registry) error {`, 904 ` if err := m.validateConsoleSize(formats); err != nil {`, 905 ` if err := m.validateIsolation(formats); err != nil {`, 906 ` if err := m.validateLogConfig(formats); err != nil {`, 907 ` if err := m.validateOomScoreAdj(formats); err != nil {`, 908 ` if err := m.validateRestartPolicy(formats); err != nil {`, 909 ` if err := m.validateRichMode(formats); err != nil {`, 910 ` if err := m.validateShmSize(formats); err != nil {`, 911 ` return errors.CompositeValidationError(res...`, 912 `func (m *HostConfigAllOf0) validateConsoleSize(formats strfmt.Registry) error {`, 913 ` if swag.IsZero(m.ConsoleSize) {`, 914 ` iConsoleSizeSize := int64(len(m.ConsoleSize)`, 915 ` if err := validate.MinItems("ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`, 916 ` if err := validate.MaxItems("ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`, 917 ` for i := 0; i < len(m.ConsoleSize); i++ {`, 918 // do we need...? 919 ` if swag.IsZero(m.ConsoleSize[i]) {`, 920 ` if err := validate.MinimumInt("ConsoleSize"+"."+strconv.Itoa(i), "body", *m.ConsoleSize[i], 0, false); err != nil {`, 921 `var hostConfigAllOf0TypeIsolationPropEnum []interface{`, 922 ` var res []string`, 923 " if err := json.Unmarshal([]byte(`[\"default\",\"process\",\"hyperv\"]`), &res); err != nil {", 924 ` for _, v := range res {`, 925 ` hostConfigAllOf0TypeIsolationPropEnum = append(hostConfigAllOf0TypeIsolationPropEnum, v`, 926 ` HostConfigAllOf0IsolationDefault string = "default"`, 927 ` HostConfigAllOf0IsolationProcess string = "process"`, 928 ` HostConfigAllOf0IsolationHyperv string = "hyperv"`, 929 `func (m *HostConfigAllOf0) validateIsolationEnum(path, location string, value string) error {`, 930 ` if err := validate.EnumCase(path, location, value, hostConfigAllOf0TypeIsolationPropEnum, true); err != nil {`, 931 `func (m *HostConfigAllOf0) validateIsolation(formats strfmt.Registry) error {`, 932 ` if swag.IsZero(m.Isolation) {`, 933 ` if err := m.validateIsolationEnum("Isolation", "body", m.Isolation); err != nil {`, 934 `func (m *HostConfigAllOf0) validateLogConfig(formats strfmt.Registry) error {`, 935 ` if swag.IsZero(m.LogConfig) {`, 936 ` if m.LogConfig != nil {`, 937 ` if err := m.LogConfig.Validate(formats); err != nil {`, 938 ` if ve, ok := err.(*errors.Validation); ok {`, 939 ` return ve.ValidateName("LogConfig"`, 940 `func (m *HostConfigAllOf0) validateOomScoreAdj(formats strfmt.Registry) error {`, 941 ` if swag.IsZero(m.OomScoreAdj) {`, 942 ` if err := validate.MinimumInt("OomScoreAdj", "body", m.OomScoreAdj, -1000, false); err != nil {`, 943 ` if err := validate.MaximumInt("OomScoreAdj", "body", m.OomScoreAdj, 1000, false); err != nil {`, 944 `func (m *HostConfigAllOf0) validateRestartPolicy(formats strfmt.Registry) error {`, 945 ` if swag.IsZero(m.RestartPolicy) {`, 946 ` if m.RestartPolicy != nil {`, 947 ` if err := m.RestartPolicy.Validate(formats); err != nil {`, 948 ` if ve, ok := err.(*errors.Validation); ok {`, 949 ` return ve.ValidateName("RestartPolicy"`, 950 `var hostConfigAllOf0TypeRichModePropEnum []interface{`, 951 ` var res []string`, 952 " if err := json.Unmarshal([]byte(`[\"dumb-init\",\"sbin-init\",\"systemd\"]`), &res); err != nil {", 953 ` for _, v := range res {`, 954 ` hostConfigAllOf0TypeRichModePropEnum = append(hostConfigAllOf0TypeRichModePropEnum, v`, 955 ` HostConfigAllOf0RichModeDumbDashInit string = "dumb-init"`, 956 ` HostConfigAllOf0RichModeSbinDashInit string = "sbin-init"`, 957 ` HostConfigAllOf0RichModeSystemd string = "systemd"`, 958 `func (m *HostConfigAllOf0) validateRichModeEnum(path, location string, value string) error {`, 959 ` if err := validate.EnumCase(path, location, value, hostConfigAllOf0TypeRichModePropEnum, true); err != nil {`, 960 `func (m *HostConfigAllOf0) validateRichMode(formats strfmt.Registry) error {`, 961 ` if swag.IsZero(m.RichMode) {`, 962 ` if err := m.validateRichModeEnum("RichMode", "body", m.RichMode); err != nil {`, 963 `func (m *HostConfigAllOf0) validateShmSize(formats strfmt.Registry) error {`, 964 ` if swag.IsZero(m.ShmSize) {`, 965 ` if err := validate.MinimumInt("ShmSize", "body", *m.ShmSize, 0, false); err != nil {`, 966 }, 967 // not expected 968 todo, 969 // output in log 970 noLines, 971 noLines) 972 973 // load expectations for model: host_config.go 974 flattenRun.AddExpectations("host_config.go", []string{ 975 `type HostConfig struct {`, 976 ` HostConfigAllOf0`, 977 ` Resources`, 978 `func (m *HostConfig) Validate(formats strfmt.Registry) error {`, 979 ` if err := m.HostConfigAllOf0.Validate(formats); err != nil {`, 980 ` if err := m.Resources.Validate(formats); err != nil {`, 981 ` return errors.CompositeValidationError(res...`, 982 }, 983 // not expected 984 todo, 985 // output in log 986 noLines, 987 noLines) 988 989 expandRun.AddExpectations("host_config.go", []string{ 990 `type HostConfig struct {`, 991 " AutoRemove bool `json:\"AutoRemove,omitempty\"`", 992 " Binds []string `json:\"Binds\"`", 993 " CapAdd []string `json:\"CapAdd\"`", 994 " CapDrop []string `json:\"CapDrop\"`", 995 " Cgroup string `json:\"Cgroup,omitempty\"`", 996 " ConsoleSize []*int64 `json:\"ConsoleSize\"`", 997 " ContainerIDFile string `json:\"ContainerIDFile,omitempty\"`", 998 " DNS []string `json:\"Dns\"`", 999 " DNSOptions []string `json:\"DnsOptions\"`", 1000 " DNSSearch []string `json:\"DnsSearch\"`", 1001 " EnableLxcfs bool `json:\"EnableLxcfs,omitempty\"`", 1002 " ExtraHosts []string `json:\"ExtraHosts\"`", 1003 " GroupAdd []string `json:\"GroupAdd\"`", 1004 " InitScript string `json:\"InitScript,omitempty\"`", 1005 " IpcMode string `json:\"IpcMode,omitempty\"`", 1006 " Isolation string `json:\"Isolation,omitempty\"`", 1007 " Links []string `json:\"Links\"`", 1008 " LogConfig *HostConfigAO0LogConfig `json:\"LogConfig,omitempty\"`", 1009 " NetworkMode string `json:\"NetworkMode,omitempty\"`", 1010 " OomScoreAdj int64 `json:\"OomScoreAdj,omitempty\"`", 1011 " PidMode string `json:\"PidMode,omitempty\"`", 1012 " Privileged bool `json:\"Privileged,omitempty\"`", 1013 " PublishAllPorts bool `json:\"PublishAllPorts,omitempty\"`", 1014 " ReadonlyRootfs bool `json:\"ReadonlyRootfs,omitempty\"`", 1015 " RestartPolicy *HostConfigAO0RestartPolicy `json:\"RestartPolicy,omitempty\"`", 1016 " Rich bool `json:\"Rich,omitempty\"`", 1017 " RichMode string `json:\"RichMode,omitempty\"`", 1018 " Runtime string `json:\"Runtime,omitempty\"`", 1019 " SecurityOpt []string `json:\"SecurityOpt\"`", 1020 " ShmSize *int64 `json:\"ShmSize,omitempty\"`", 1021 " StorageOpt map[string]string `json:\"StorageOpt,omitempty\"`", 1022 " Sysctls map[string]string `json:\"Sysctls,omitempty\"`", 1023 " Tmpfs map[string]string `json:\"Tmpfs,omitempty\"`", 1024 " UTSMode string `json:\"UTSMode,omitempty\"`", 1025 " UsernsMode string `json:\"UsernsMode,omitempty\"`", 1026 " VolumeDriver string `json:\"VolumeDriver,omitempty\"`", 1027 " VolumesFrom []string `json:\"VolumesFrom\"`", 1028 " BlkioWeight uint16 `json:\"BlkioWeight,omitempty\"`", 1029 " CgroupParent string `json:\"CgroupParent,omitempty\"`", 1030 " CPUShares int64 `json:\"CpuShares,omitempty\"`", 1031 " Memory int64 `json:\"Memory,omitempty\"`", 1032 `func (m *HostConfig) Validate(formats strfmt.Registry) error {`, 1033 ` if err := m.validateConsoleSize(formats); err != nil {`, 1034 ` if err := m.validateIsolation(formats); err != nil {`, 1035 ` if err := m.validateLogConfig(formats); err != nil {`, 1036 ` if err := m.validateOomScoreAdj(formats); err != nil {`, 1037 ` if err := m.validateRestartPolicy(formats); err != nil {`, 1038 ` if err := m.validateRichMode(formats); err != nil {`, 1039 ` if err := m.validateShmSize(formats); err != nil {`, 1040 ` if err := m.validateBlkioWeight(formats); err != nil {`, 1041 ` return errors.CompositeValidationError(res...`, 1042 `func (m *HostConfig) validateConsoleSize(formats strfmt.Registry) error {`, 1043 ` if swag.IsZero(m.ConsoleSize) {`, 1044 ` iConsoleSizeSize := int64(len(m.ConsoleSize)`, 1045 ` if err := validate.MinItems("ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`, 1046 ` if err := validate.MaxItems("ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`, 1047 ` for i := 0; i < len(m.ConsoleSize); i++ {`, 1048 // do we need... 1049 ` if swag.IsZero(m.ConsoleSize[i]) {`, 1050 ` if err := validate.MinimumInt("ConsoleSize"+"."+strconv.Itoa(i), "body", *m.ConsoleSize[i], 0, false); err != nil {`, 1051 `var hostConfigTypeIsolationPropEnum []interface{`, 1052 ` var res []string`, 1053 " if err := json.Unmarshal([]byte(`[\"default\",\"process\",\"hyperv\"]`), &res); err != nil {", 1054 ` for _, v := range res {`, 1055 ` hostConfigTypeIsolationPropEnum = append(hostConfigTypeIsolationPropEnum, v`, 1056 `func (m *HostConfig) validateIsolationEnum(path, location string, value string) error {`, 1057 ` if err := validate.EnumCase(path, location, value, hostConfigTypeIsolationPropEnum, true); err != nil {`, 1058 `func (m *HostConfig) validateIsolation(formats strfmt.Registry) error {`, 1059 ` if swag.IsZero(m.Isolation) {`, 1060 ` if err := m.validateIsolationEnum("Isolation", "body", m.Isolation); err != nil {`, 1061 `func (m *HostConfig) validateLogConfig(formats strfmt.Registry) error {`, 1062 ` if swag.IsZero(m.LogConfig) {`, 1063 ` if m.LogConfig != nil {`, 1064 ` if err := m.LogConfig.Validate(formats); err != nil {`, 1065 ` if ve, ok := err.(*errors.Validation); ok {`, 1066 ` return ve.ValidateName("LogConfig"`, 1067 `func (m *HostConfig) validateOomScoreAdj(formats strfmt.Registry) error {`, 1068 ` if swag.IsZero(m.OomScoreAdj) {`, 1069 ` if err := validate.MinimumInt("OomScoreAdj", "body", m.OomScoreAdj, -1000, false); err != nil {`, 1070 ` if err := validate.MaximumInt("OomScoreAdj", "body", m.OomScoreAdj, 1000, false); err != nil {`, 1071 `func (m *HostConfig) validateRestartPolicy(formats strfmt.Registry) error {`, 1072 ` if swag.IsZero(m.RestartPolicy) {`, 1073 ` if m.RestartPolicy != nil {`, 1074 ` if err := m.RestartPolicy.Validate(formats); err != nil {`, 1075 ` if ve, ok := err.(*errors.Validation); ok {`, 1076 ` return ve.ValidateName("RestartPolicy"`, 1077 `var hostConfigTypeRichModePropEnum []interface{`, 1078 ` var res []string`, 1079 " if err := json.Unmarshal([]byte(`[\"dumb-init\",\"sbin-init\",\"systemd\"]`), &res); err != nil {", 1080 ` for _, v := range res {`, 1081 ` hostConfigTypeRichModePropEnum = append(hostConfigTypeRichModePropEnum, v`, 1082 `func (m *HostConfig) validateRichModeEnum(path, location string, value string) error {`, 1083 ` if err := validate.EnumCase(path, location, value, hostConfigTypeRichModePropEnum, true); err != nil {`, 1084 `func (m *HostConfig) validateRichMode(formats strfmt.Registry) error {`, 1085 ` if swag.IsZero(m.RichMode) {`, 1086 ` if err := m.validateRichModeEnum("RichMode", "body", m.RichMode); err != nil {`, 1087 `func (m *HostConfig) validateShmSize(formats strfmt.Registry) error {`, 1088 ` if swag.IsZero(m.ShmSize) {`, 1089 ` if err := validate.MinimumInt("ShmSize", "body", *m.ShmSize, 0, false); err != nil {`, 1090 `func (m *HostConfig) validateBlkioWeight(formats strfmt.Registry) error {`, 1091 ` if swag.IsZero(m.BlkioWeight) {`, 1092 ` if err := validate.MinimumUint("BlkioWeight", "body", uint64(m.BlkioWeight), 0, false); err != nil {`, 1093 ` if err := validate.MaximumUint("BlkioWeight", "body", uint64(m.BlkioWeight), 1000, false); err != nil {`, 1094 `type HostConfigAO0LogConfig struct {`, 1095 " Config map[string]string `json:\"Config,omitempty\"`", 1096 " Type string `json:\"Type,omitempty\"`", 1097 `func (m *HostConfigAO0LogConfig) Validate(formats strfmt.Registry) error {`, 1098 ` if err := m.validateType(formats); err != nil {`, 1099 ` return errors.CompositeValidationError(res...`, 1100 `var hostConfigAO0LogConfigTypeTypePropEnum []interface{`, 1101 ` var res []string`, 1102 " if err := json.Unmarshal([]byte(`[\"json-file\",\"syslog\",\"journald\",\"gelf\",\"fluentd\",\"awslogs\",\"splunk\",\"etwlogs\",\"none\"]`), &res); err != nil {", 1103 ` for _, v := range res {`, 1104 ` hostConfigAO0LogConfigTypeTypePropEnum = append(hostConfigAO0LogConfigTypeTypePropEnum, v`, 1105 ` HostConfigAO0LogConfigTypeJSONDashFile string = "json-file"`, 1106 ` HostConfigAO0LogConfigTypeSyslog string = "syslog"`, 1107 ` HostConfigAO0LogConfigTypeJournald string = "journald"`, 1108 ` HostConfigAO0LogConfigTypeGelf string = "gelf"`, 1109 ` HostConfigAO0LogConfigTypeFluentd string = "fluentd"`, 1110 ` HostConfigAO0LogConfigTypeAwslogs string = "awslogs"`, 1111 ` HostConfigAO0LogConfigTypeSplunk string = "splunk"`, 1112 ` HostConfigAO0LogConfigTypeEtwlogs string = "etwlogs"`, 1113 ` HostConfigAO0LogConfigTypeNone string = "none"`, 1114 `func (m *HostConfigAO0LogConfig) validateTypeEnum(path, location string, value string) error {`, 1115 ` if err := validate.EnumCase(path, location, value, hostConfigAO0LogConfigTypeTypePropEnum, true); err != nil {`, 1116 `func (m *HostConfigAO0LogConfig) validateType(formats strfmt.Registry) error {`, 1117 ` if swag.IsZero(m.Type) {`, 1118 ` if err := m.validateTypeEnum("LogConfig"+"."+"Type", "body", m.Type); err != nil {`, 1119 `type HostConfigAO0RestartPolicy struct {`, 1120 " MaximumRetryCount int64 `json:\"MaximumRetryCount,omitempty\"`", 1121 " Name string `json:\"Name,omitempty\"`", 1122 `func (m *HostConfigAO0RestartPolicy) Validate(formats strfmt.Registry) error {`, 1123 ` return errors.CompositeValidationError(res...`, 1124 }, 1125 // not expected 1126 todo, 1127 // output in log 1128 noLines, 1129 noLines) 1130 1131 // load expectations for model: container_create_config.go 1132 flattenRun.AddExpectations("container_create_config.go", []string{ 1133 `type ContainerCreateConfig struct {`, 1134 ` ContainerConfig`, 1135 ` ContainerCreateConfigAllOf1`, 1136 `func (m *ContainerCreateConfig) Validate(formats strfmt.Registry) error {`, 1137 ` if err := m.ContainerConfig.Validate(formats); err != nil {`, 1138 ` if err := m.ContainerCreateConfigAllOf1.Validate(formats); err != nil {`, 1139 ` return errors.CompositeValidationError(res...`, 1140 }, 1141 // not expected 1142 todo, 1143 // output in log 1144 noLines, 1145 noLines) 1146 1147 expandRun.AddExpectations("container_create_config.go", []string{ 1148 `type ContainerCreateConfig struct {`, 1149 " ArgsEscaped bool `json:\"ArgsEscaped,omitempty\"`", 1150 " AttachStderr bool `json:\"AttachStderr,omitempty\"`", 1151 " AttachStdin bool `json:\"AttachStdin,omitempty\"`", 1152 " AttachStdout bool `json:\"AttachStdout,omitempty\"`", 1153 " Cmd []string `json:\"Cmd\"`", 1154 " DiskQuota map[string]string `json:\"DiskQuota,omitempty\"`", 1155 " Domainname string `json:\"Domainname,omitempty\"`", 1156 " Entrypoint []string `json:\"Entrypoint\"`", 1157 " Env []string `json:\"Env\"`", 1158 " ExposedPorts map[string]interface{} `json:\"ExposedPorts,omitempty\"`", 1159 " Hostname strfmt.Hostname `json:\"Hostname,omitempty\"`", 1160 " Image string `json:\"Image\"`", 1161 " InitScript string `json:\"InitScript,omitempty\"`", 1162 " Labels map[string]string `json:\"Labels,omitempty\"`", 1163 " MacAddress string `json:\"MacAddress,omitempty\"`", 1164 " NetworkDisabled bool `json:\"NetworkDisabled,omitempty\"`", 1165 " OnBuild []string `json:\"OnBuild\"`", 1166 " OpenStdin bool `json:\"OpenStdin,omitempty\"`", 1167 " QuotaID string `json:\"QuotaID,omitempty\"`", 1168 " Rich bool `json:\"Rich,omitempty\"`", 1169 " RichMode string `json:\"RichMode,omitempty\"`", 1170 " Shell []string `json:\"Shell\"`", 1171 " SpecAnnotation map[string]string `json:\"SpecAnnotation,omitempty\"`", 1172 " StdinOnce bool `json:\"StdinOnce,omitempty\"`", 1173 " StopSignal string `json:\"StopSignal,omitempty\"`", 1174 " StopTimeout *int64 `json:\"StopTimeout,omitempty\"`", 1175 " Tty bool `json:\"Tty,omitempty\"`", 1176 " User string `json:\"User,omitempty\"`", 1177 " Volumes map[string]interface{} `json:\"Volumes,omitempty\"`", 1178 " WorkingDir string `json:\"WorkingDir,omitempty\"`", 1179 ` HostConfig struct {`, 1180 " AutoRemove bool `json:\"AutoRemove,omitempty\"`", 1181 " Binds []string `json:\"Binds\"`", 1182 " CapAdd []string `json:\"CapAdd\"`", 1183 " CapDrop []string `json:\"CapDrop\"`", 1184 " Cgroup string `json:\"Cgroup,omitempty\"`", 1185 " ConsoleSize []*int64 `json:\"ConsoleSize\"`", 1186 " ContainerIDFile string `json:\"ContainerIDFile,omitempty\"`", 1187 " DNS []string `json:\"Dns\"`", 1188 " DNSOptions []string `json:\"DnsOptions\"`", 1189 " DNSSearch []string `json:\"DnsSearch\"`", 1190 " EnableLxcfs bool `json:\"EnableLxcfs,omitempty\"`", 1191 " ExtraHosts []string `json:\"ExtraHosts\"`", 1192 " GroupAdd []string `json:\"GroupAdd\"`", 1193 " InitScript string `json:\"InitScript,omitempty\"`", 1194 " IpcMode string `json:\"IpcMode,omitempty\"`", 1195 " Isolation string `json:\"Isolation,omitempty\"`", 1196 " Links []string `json:\"Links\"`", 1197 " LogConfig *ContainerCreateConfigHostConfigAO0LogConfig `json:\"LogConfig,omitempty\"`", 1198 " NetworkMode string `json:\"NetworkMode,omitempty\"`", 1199 " OomScoreAdj int64 `json:\"OomScoreAdj,omitempty\"`", 1200 " PidMode string `json:\"PidMode,omitempty\"`", 1201 " Privileged bool `json:\"Privileged,omitempty\"`", 1202 " PublishAllPorts bool `json:\"PublishAllPorts,omitempty\"`", 1203 " ReadonlyRootfs bool `json:\"ReadonlyRootfs,omitempty\"`", 1204 " RestartPolicy *ContainerCreateConfigHostConfigAO0RestartPolicy `json:\"RestartPolicy,omitempty\"`", 1205 " Rich bool `json:\"Rich,omitempty\"`", 1206 " RichMode string `json:\"RichMode,omitempty\"`", 1207 " Runtime string `json:\"Runtime,omitempty\"`", 1208 " SecurityOpt []string `json:\"SecurityOpt\"`", 1209 " ShmSize *int64 `json:\"ShmSize,omitempty\"`", 1210 " StorageOpt map[string]string `json:\"StorageOpt,omitempty\"`", 1211 " Sysctls map[string]string `json:\"Sysctls,omitempty\"`", 1212 " Tmpfs map[string]string `json:\"Tmpfs,omitempty\"`", 1213 " UTSMode string `json:\"UTSMode,omitempty\"`", 1214 " UsernsMode string `json:\"UsernsMode,omitempty\"`", 1215 " VolumeDriver string `json:\"VolumeDriver,omitempty\"`", 1216 " VolumesFrom []string `json:\"VolumesFrom\"`", 1217 " BlkioWeight uint16 `json:\"BlkioWeight,omitempty\"`", 1218 " CgroupParent string `json:\"CgroupParent,omitempty\"`", 1219 " CPUShares int64 `json:\"CpuShares,omitempty\"`", 1220 " Memory int64 `json:\"Memory,omitempty\"`", 1221 " } `json:\"HostConfig,omitempty\"`", 1222 " NetworkingConfig *ContainerCreateConfigAO1NetworkingConfig `json:\"NetworkingConfig,omitempty\"`", 1223 `func (m *ContainerCreateConfig) Validate(formats strfmt.Registry) error {`, 1224 ` if err := m.validateExposedPorts(formats); err != nil {`, 1225 ` if err := m.validateHostname(formats); err != nil {`, 1226 ` if err := m.validateImage(formats); err != nil {`, 1227 ` if err := m.validateRichMode(formats); err != nil {`, 1228 ` if err := m.validateVolumes(formats); err != nil {`, 1229 ` if err := m.validateHostConfig(formats); err != nil {`, 1230 ` if err := m.validateNetworkingConfig(formats); err != nil {`, 1231 ` return errors.CompositeValidationError(res...`, 1232 `var containerCreateConfigExposedPortsValueEnum []interface{`, 1233 ` var res []interface{`, 1234 " if err := json.Unmarshal([]byte(`[{}]`), &res); err != nil {", 1235 ` for _, v := range res {`, 1236 ` containerCreateConfigExposedPortsValueEnum = append(containerCreateConfigExposedPortsValueEnum, v`, 1237 `func (m *ContainerCreateConfig) validateExposedPortsValueEnum(path, location string, value interface{}) error {`, 1238 ` if err := validate.EnumCase(path, location, value, containerCreateConfigExposedPortsValueEnum, true); err != nil {`, 1239 `func (m *ContainerCreateConfig) validateExposedPorts(formats strfmt.Registry) error {`, 1240 ` if swag.IsZero(m.ExposedPorts) {`, 1241 ` for k := range m.ExposedPorts {`, 1242 ` if err := m.validateExposedPortsValueEnum("ExposedPorts"+"."+k, "body", m.ExposedPorts[k]); err != nil {`, 1243 `func (m *ContainerCreateConfig) validateHostname(formats strfmt.Registry) error {`, 1244 ` if swag.IsZero(m.Hostname) {`, 1245 ` if err := validate.MinLength("Hostname", "body", m.Hostname.String(), 1); err != nil {`, 1246 ` if err := validate.FormatOf("Hostname", "body", "hostname", m.Hostname.String(), formats); err != nil {`, 1247 `func (m *ContainerCreateConfig) validateImage(formats strfmt.Registry) error {`, 1248 ` if err := validate.RequiredString("Image", "body", m.Image); err != nil {`, 1249 `var containerCreateConfigTypeRichModePropEnum []interface{`, 1250 ` var res []string`, 1251 " if err := json.Unmarshal([]byte(`[\"dumb-init\",\"sbin-init\",\"systemd\"]`), &res); err != nil {", 1252 ` for _, v := range res {`, 1253 ` containerCreateConfigTypeRichModePropEnum = append(containerCreateConfigTypeRichModePropEnum, v`, 1254 `func (m *ContainerCreateConfig) validateRichModeEnum(path, location string, value string) error {`, 1255 ` if err := validate.EnumCase(path, location, value, containerCreateConfigTypeRichModePropEnum, true); err != nil {`, 1256 `func (m *ContainerCreateConfig) validateRichMode(formats strfmt.Registry) error {`, 1257 ` if swag.IsZero(m.RichMode) {`, 1258 ` if err := m.validateRichModeEnum("RichMode", "body", m.RichMode); err != nil {`, 1259 `var containerCreateConfigVolumesValueEnum []interface{`, 1260 ` var res []interface{`, 1261 " if err := json.Unmarshal([]byte(`[{}]`), &res); err != nil {", 1262 ` for _, v := range res {`, 1263 ` containerCreateConfigVolumesValueEnum = append(containerCreateConfigVolumesValueEnum, v`, 1264 `func (m *ContainerCreateConfig) validateVolumesValueEnum(path, location string, value interface{}) error {`, 1265 ` if err := validate.EnumCase(path, location, value, containerCreateConfigVolumesValueEnum, true); err != nil {`, 1266 `func (m *ContainerCreateConfig) validateVolumes(formats strfmt.Registry) error {`, 1267 ` if swag.IsZero(m.Volumes) {`, 1268 ` for k := range m.Volumes {`, 1269 ` if err := m.validateVolumesValueEnum("Volumes"+"."+k, "body", m.Volumes[k]); err != nil {`, 1270 `func (m *ContainerCreateConfig) validateHostConfig(formats strfmt.Registry) error {`, 1271 ` if swag.IsZero(m.HostConfig) {`, 1272 ` iConsoleSizeSize := int64(len(m.HostConfig.ConsoleSize)`, 1273 ` if err := validate.MinItems("HostConfig"+"."+"ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`, 1274 ` if err := validate.MaxItems("HostConfig"+"."+"ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`, 1275 ` for i := 0; i < len(m.HostConfig.ConsoleSize); i++ {`, 1276 // do we need... ? 1277 ` if swag.IsZero(m.HostConfig.ConsoleSize[i]) {`, 1278 ` if err := validate.MinimumInt("HostConfig"+"."+"ConsoleSize"+"."+strconv.Itoa(i), "body", *m.HostConfig.ConsoleSize[i], 0, false); err != nil {`, 1279 // TODO: enum if anonymous allOf is not honored (missing func) 1280 // => will do that with Enum refactoring 1281 ` if err := m.validateIsolationEnum("HostConfig"+"."+"Isolation", "body", m.HostConfig.Isolation); err != nil {`, 1282 ` if m.HostConfig.LogConfig != nil {`, 1283 ` if err := m.HostConfig.LogConfig.Validate(formats); err != nil {`, 1284 ` if ve, ok := err.(*errors.Validation); ok {`, 1285 ` return ve.ValidateName("HostConfig" + "." + "LogConfig"`, 1286 ` if err := validate.MinimumInt("HostConfig"+"."+"OomScoreAdj", "body", m.HostConfig.OomScoreAdj, -1000, false); err != nil {`, 1287 ` if err := validate.MaximumInt("HostConfig"+"."+"OomScoreAdj", "body", m.HostConfig.OomScoreAdj, 1000, false); err != nil {`, 1288 ` if m.HostConfig.RestartPolicy != nil {`, 1289 ` if err := m.HostConfig.RestartPolicy.Validate(formats); err != nil {`, 1290 ` if ve, ok := err.(*errors.Validation); ok {`, 1291 ` return ve.ValidateName("HostConfig" + "." + "RestartPolicy"`, 1292 ` if err := m.validateRichModeEnum("HostConfig"+"."+"RichMode", "body", m.HostConfig.RichMode); err != nil {`, 1293 ` if err := validate.MinimumInt("HostConfig"+"."+"ShmSize", "body", *m.HostConfig.ShmSize, 0, false); err != nil {`, 1294 ` if err := validate.MinimumUint("HostConfig"+"."+"BlkioWeight", "body", uint64(m.HostConfig.BlkioWeight), 0, false); err != nil {`, 1295 ` if err := validate.MaximumUint("HostConfig"+"."+"BlkioWeight", "body", uint64(m.HostConfig.BlkioWeight), 1000, false); err != nil {`, 1296 `func (m *ContainerCreateConfig) validateNetworkingConfig(formats strfmt.Registry) error {`, 1297 ` if swag.IsZero(m.NetworkingConfig) {`, 1298 ` if m.NetworkingConfig != nil {`, 1299 ` if err := m.NetworkingConfig.Validate(formats); err != nil {`, 1300 ` if ve, ok := err.(*errors.Validation); ok {`, 1301 ` return ve.ValidateName("NetworkingConfig"`, 1302 `type ContainerCreateConfigAO1NetworkingConfig struct {`, 1303 " EndpointsConfig map[string]ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnon `json:\"EndpointsConfig,omitempty\"`", 1304 `func (m *ContainerCreateConfigAO1NetworkingConfig) Validate(formats strfmt.Registry) error {`, 1305 ` if err := m.validateEndpointsConfig(formats); err != nil {`, 1306 ` return errors.CompositeValidationError(res...`, 1307 `func (m *ContainerCreateConfigAO1NetworkingConfig) validateEndpointsConfig(formats strfmt.Registry) error {`, 1308 ` if swag.IsZero(m.EndpointsConfig) {`, 1309 ` for k := range m.EndpointsConfig {`, 1310 ` if swag.IsZero(m.EndpointsConfig[k]) {`, 1311 ` if val, ok := m.EndpointsConfig[k]; ok {`, 1312 // NOTE: fixed incorrect IsNullable status in map element 1313 ` if err := val.Validate(formats); err != nil {`, 1314 `type ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnon struct {`, 1315 " Aliases []string `json:\"Aliases\"`", 1316 " DriverOpts map[string]string `json:\"DriverOpts,omitempty\"`", 1317 " EndpointID string `json:\"EndpointID,omitempty\"`", 1318 " Gateway string `json:\"Gateway,omitempty\"`", 1319 " GlobalIPV6Address string `json:\"GlobalIPv6Address,omitempty\"`", 1320 " GlobalIPV6PrefixLen int64 `json:\"GlobalIPv6PrefixLen,omitempty\"`", 1321 " IPAMConfig *ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnonIPAMConfig `json:\"IPAMConfig,omitempty\"`", 1322 " IPAddress string `json:\"IPAddress,omitempty\"`", 1323 " IPPrefixLen int64 `json:\"IPPrefixLen,omitempty\"`", 1324 " IPV6Gateway string `json:\"IPv6Gateway,omitempty\"`", 1325 " Links []string `json:\"Links\"`", 1326 " MacAddress string `json:\"MacAddress,omitempty\"`", 1327 " NetworkID string `json:\"NetworkID,omitempty\"`", 1328 `func (m *ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnon) Validate(formats strfmt.Registry) error {`, 1329 ` if err := m.validateIPAMConfig(formats); err != nil {`, 1330 ` return errors.CompositeValidationError(res...`, 1331 `func (m *ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnon) validateIPAMConfig(formats strfmt.Registry) error {`, 1332 ` if swag.IsZero(m.IPAMConfig) {`, 1333 ` if m.IPAMConfig != nil {`, 1334 ` if err := m.IPAMConfig.Validate(formats); err != nil {`, 1335 ` if ve, ok := err.(*errors.Validation); ok {`, 1336 ` return ve.ValidateName("IPAMConfig"`, 1337 `type ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnonIPAMConfig struct {`, 1338 " IPV4Address string `json:\"IPv4Address,omitempty\"`", 1339 " IPV6Address string `json:\"IPv6Address,omitempty\"`", 1340 " LinkLocalIPs []string `json:\"LinkLocalIPs\"`", 1341 `func (m *ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnonIPAMConfig) Validate(formats strfmt.Registry) error {`, 1342 ` return errors.CompositeValidationError(res...`, 1343 `type ContainerCreateConfigHostConfigAO0LogConfig struct {`, 1344 " Config map[string]string `json:\"Config,omitempty\"`", 1345 " Type string `json:\"Type,omitempty\"`", 1346 `func (m *ContainerCreateConfigHostConfigAO0LogConfig) Validate(formats strfmt.Registry) error {`, 1347 ` if err := m.validateType(formats); err != nil {`, 1348 ` return errors.CompositeValidationError(res...`, 1349 `var containerCreateConfigHostConfigAO0LogConfigTypeTypePropEnum []interface{`, 1350 ` var res []string`, 1351 " if err := json.Unmarshal([]byte(`[\"json-file\",\"syslog\",\"journald\",\"gelf\",\"fluentd\",\"awslogs\",\"splunk\",\"etwlogs\",\"none\"]`), &res); err != nil {", 1352 ` for _, v := range res {`, 1353 ` containerCreateConfigHostConfigAO0LogConfigTypeTypePropEnum = append(containerCreateConfigHostConfigAO0LogConfigTypeTypePropEnum, v`, 1354 ` ContainerCreateConfigHostConfigAO0LogConfigTypeJSONDashFile string = "json-file"`, 1355 ` ContainerCreateConfigHostConfigAO0LogConfigTypeSyslog string = "syslog"`, 1356 ` ContainerCreateConfigHostConfigAO0LogConfigTypeJournald string = "journald"`, 1357 ` ContainerCreateConfigHostConfigAO0LogConfigTypeGelf string = "gelf"`, 1358 ` ContainerCreateConfigHostConfigAO0LogConfigTypeFluentd string = "fluentd"`, 1359 ` ContainerCreateConfigHostConfigAO0LogConfigTypeAwslogs string = "awslogs"`, 1360 ` ContainerCreateConfigHostConfigAO0LogConfigTypeSplunk string = "splunk"`, 1361 ` ContainerCreateConfigHostConfigAO0LogConfigTypeEtwlogs string = "etwlogs"`, 1362 ` ContainerCreateConfigHostConfigAO0LogConfigTypeNone string = "none"`, 1363 `func (m *ContainerCreateConfigHostConfigAO0LogConfig) validateTypeEnum(path, location string, value string) error {`, 1364 ` if err := validate.EnumCase(path, location, value, containerCreateConfigHostConfigAO0LogConfigTypeTypePropEnum, true); err != nil {`, 1365 `func (m *ContainerCreateConfigHostConfigAO0LogConfig) validateType(formats strfmt.Registry) error {`, 1366 ` if swag.IsZero(m.Type) {`, 1367 ` if err := m.validateTypeEnum("HostConfig"+"."+"LogConfig"+"."+"Type", "body", m.Type); err != nil {`, 1368 `type ContainerCreateConfigHostConfigAO0RestartPolicy struct {`, 1369 " MaximumRetryCount int64 `json:\"MaximumRetryCount,omitempty\"`", 1370 " Name string `json:\"Name,omitempty\"`", 1371 `func (m *ContainerCreateConfigHostConfigAO0RestartPolicy) Validate(formats strfmt.Registry) error {`, 1372 ` return errors.CompositeValidationError(res...`, 1373 }, []string{ 1374 // not expected 1375 ` if val != nil {`, 1376 }, 1377 // output in log 1378 noLines, 1379 noLines) 1380 1381 // load expectations for model: resources.go 1382 flattenRun.AddExpectations("resources.go", []string{ 1383 `type Resources struct {`, 1384 " BlkioWeight uint16 `json:\"BlkioWeight,omitempty\"`", 1385 " CgroupParent string `json:\"CgroupParent,omitempty\"`", 1386 " CPUShares int64 `json:\"CpuShares,omitempty\"`", 1387 " Memory int64 `json:\"Memory,omitempty\"`", 1388 `func (m *Resources) Validate(formats strfmt.Registry) error {`, 1389 ` if err := m.validateBlkioWeight(formats); err != nil {`, 1390 ` return errors.CompositeValidationError(res...`, 1391 `func (m *Resources) validateBlkioWeight(formats strfmt.Registry) error {`, 1392 ` if swag.IsZero(m.BlkioWeight) {`, 1393 ` if err := validate.MinimumUint("BlkioWeight", "body", uint64(m.BlkioWeight), 0, false); err != nil {`, 1394 ` if err := validate.MaximumUint("BlkioWeight", "body", uint64(m.BlkioWeight), 1000, false); err != nil {`, 1395 }, 1396 // not expected 1397 todo, 1398 // output in log 1399 noLines, 1400 noLines) 1401 1402 expandRun.AddExpectations("resources.go", flattenRun.ExpectedFor("Resources").ExpectedLines, todo, noLines, noLines) 1403 1404 // load expectations for model: networking_config.go 1405 flattenRun.AddExpectations("networking_config.go", []string{ 1406 `type NetworkingConfig struct {`, 1407 // maps are now simple types 1408 " EndpointsConfig map[string]*EndpointSettings `json:\"EndpointsConfig,omitempty\"`", 1409 `func (m *NetworkingConfig) Validate(formats strfmt.Registry) error {`, 1410 ` if err := m.validateEndpointsConfig(formats); err != nil {`, 1411 ` return errors.CompositeValidationError(res...`, 1412 `func (m *NetworkingConfig) validateEndpointsConfig(formats strfmt.Registry) error {`, 1413 ` if swag.IsZero(m.EndpointsConfig) {`, 1414 ` for k := range m.EndpointsConfig {`, 1415 ` if err := validate.Required("EndpointsConfig"+"."+k, "body", m.EndpointsConfig[k]); err != nil {`, 1416 ` if val, ok := m.EndpointsConfig[k]; ok {`, 1417 ` if err := val.Validate(formats); err != nil {`, 1418 }, 1419 // not expected 1420 todo, 1421 // output in log 1422 noLines, 1423 noLines) 1424 1425 // NOTE(fredbi): maps are now simple types: this definition disappears 1426 1427 // load expectations for model: endpoint_settings.go 1428 flattenRun.AddExpectations("endpoint_settings.go", []string{ 1429 `type EndpointSettings struct {`, 1430 " Aliases []string `json:\"Aliases\"`", 1431 " DriverOpts map[string]string `json:\"DriverOpts,omitempty\"`", 1432 " EndpointID string `json:\"EndpointID,omitempty\"`", 1433 " Gateway string `json:\"Gateway,omitempty\"`", 1434 " GlobalIPV6Address string `json:\"GlobalIPv6Address,omitempty\"`", 1435 " GlobalIPV6PrefixLen int64 `json:\"GlobalIPv6PrefixLen,omitempty\"`", 1436 " IPAMConfig *EndpointIPAMConfig `json:\"IPAMConfig,omitempty\"`", 1437 " IPAddress string `json:\"IPAddress,omitempty\"`", 1438 " IPPrefixLen int64 `json:\"IPPrefixLen,omitempty\"`", 1439 " IPV6Gateway string `json:\"IPv6Gateway,omitempty\"`", 1440 " Links []string `json:\"Links\"`", 1441 " MacAddress string `json:\"MacAddress,omitempty\"`", 1442 " NetworkID string `json:\"NetworkID,omitempty\"`", 1443 `func (m *EndpointSettings) Validate(formats strfmt.Registry) error {`, 1444 ` if err := m.validateIPAMConfig(formats); err != nil {`, 1445 ` return errors.CompositeValidationError(res...`, 1446 `func (m *EndpointSettings) validateIPAMConfig(formats strfmt.Registry) error {`, 1447 ` if swag.IsZero(m.IPAMConfig) {`, 1448 ` if m.IPAMConfig != nil {`, 1449 ` if err := m.IPAMConfig.Validate(formats); err != nil {`, 1450 ` if ve, ok := err.(*errors.Validation); ok {`, 1451 ` return ve.ValidateName("IPAMConfig"`, 1452 }, 1453 // not expected 1454 todo, 1455 // output in log 1456 noLines, 1457 noLines) 1458 1459 expandRun.AddExpectations("endpoint_settings.go", []string{ 1460 `type EndpointSettings struct {`, 1461 " Aliases []string `json:\"Aliases\"`", 1462 " DriverOpts map[string]string `json:\"DriverOpts,omitempty\"`", 1463 " EndpointID string `json:\"EndpointID,omitempty\"`", 1464 " Gateway string `json:\"Gateway,omitempty\"`", 1465 " GlobalIPV6Address string `json:\"GlobalIPv6Address,omitempty\"`", 1466 " GlobalIPV6PrefixLen int64 `json:\"GlobalIPv6PrefixLen,omitempty\"`", 1467 " IPAMConfig *EndpointSettingsIPAMConfig `json:\"IPAMConfig,omitempty\"`", 1468 " IPAddress string `json:\"IPAddress,omitempty\"`", 1469 " IPPrefixLen int64 `json:\"IPPrefixLen,omitempty\"`", 1470 " IPV6Gateway string `json:\"IPv6Gateway,omitempty\"`", 1471 " Links []string `json:\"Links\"`", 1472 " MacAddress string `json:\"MacAddress,omitempty\"`", 1473 " NetworkID string `json:\"NetworkID,omitempty\"`", 1474 `func (m *EndpointSettings) Validate(formats strfmt.Registry) error {`, 1475 ` if err := m.validateIPAMConfig(formats); err != nil {`, 1476 ` return errors.CompositeValidationError(res...`, 1477 `func (m *EndpointSettings) validateIPAMConfig(formats strfmt.Registry) error {`, 1478 ` if swag.IsZero(m.IPAMConfig) {`, 1479 ` if m.IPAMConfig != nil {`, 1480 ` if err := m.IPAMConfig.Validate(formats); err != nil {`, 1481 ` if ve, ok := err.(*errors.Validation); ok {`, 1482 ` return ve.ValidateName("IPAMConfig"`, 1483 `type EndpointSettingsIPAMConfig struct {`, 1484 " IPV4Address string `json:\"IPv4Address,omitempty\"`", 1485 " IPV6Address string `json:\"IPv6Address,omitempty\"`", 1486 " LinkLocalIPs []string `json:\"LinkLocalIPs\"`", 1487 `func (m *EndpointSettingsIPAMConfig) Validate(formats strfmt.Registry) error {`, 1488 ` return errors.CompositeValidationError(res...`, 1489 }, 1490 // not expected 1491 noLines, 1492 // output in log 1493 noLines, 1494 noLines) 1495 1496 // load expectations for model: networking_config_endpoints_config.go 1497 // NOTE(fredbi): maps are now simple types - this definition disappears 1498 } 1499 func initFixtureSimpleAllOf() { 1500 // testing ../fixtures/bugs/1487/fixture-simple-allOf.yaml with flatten and expand (--skip-flatten) 1501 1502 /* we test various composition combinations, including nested, and nested isolated with a properties (e.g. issue #1479) */ 1503 1504 f := newModelFixture("../fixtures/bugs/1487/fixture-simple-allOf.yaml", "fixture for nested allOf with ref") 1505 flattenRun := f.AddRun(false) 1506 expandRun := f.AddRun(true) 1507 1508 // load expectations for model: not_really_composed_thing_all_of0.go 1509 flattenRun.AddExpectations("not_really_composed_thing_all_of0.go", []string{ 1510 `type NotReallyComposedThingAllOf0 struct {`, 1511 " Prop0 strfmt.UUID `json:\"prop0,omitempty\"`", 1512 `func (m *NotReallyComposedThingAllOf0) Validate(formats strfmt.Registry) error {`, 1513 ` if err := m.validateProp0(formats); err != nil {`, 1514 ` return errors.CompositeValidationError(res...`, 1515 `func (m *NotReallyComposedThingAllOf0) validateProp0(formats strfmt.Registry) error {`, 1516 ` if swag.IsZero(m.Prop0) {`, 1517 ` if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`, 1518 }, 1519 // not expected 1520 todo, 1521 // output in log 1522 noLines, 1523 noLines) 1524 1525 // load expectations for model: not_really_composed_thing.go 1526 expandRun.AddExpectations("not_really_composed_thing.go", []string{ 1527 `type NotReallyComposedThing struct {`, 1528 " Prop0 strfmt.UUID `json:\"prop0,omitempty\"`", 1529 `func (m *NotReallyComposedThing) UnmarshalJSON(raw []byte) error {`, 1530 ` var dataAO0 struct {`, 1531 " Prop0 strfmt.UUID `json:\"prop0,omitempty\"`", 1532 ` if err := swag.ReadJSON(raw, &dataAO0); err != nil {`, 1533 ` m.Prop0 = dataAO0.Prop0`, 1534 `func (m NotReallyComposedThing) MarshalJSON() ([]byte, error) {`, 1535 ` _parts := make([][]byte, 0, 1`, 1536 ` var dataAO0 struct {`, 1537 " Prop0 strfmt.UUID `json:\"prop0,omitempty\"`", 1538 ` dataAO0.Prop0 = m.Prop0`, 1539 ` jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`, 1540 ` if errAO0 != nil {`, 1541 ` return nil, errAO0`, 1542 ` _parts = append(_parts, jsonDataAO0`, 1543 ` return swag.ConcatJSON(_parts...), nil`, 1544 `func (m *NotReallyComposedThing) Validate(formats strfmt.Registry) error {`, 1545 ` if err := m.validateProp0(formats); err != nil {`, 1546 ` return errors.CompositeValidationError(res...`, 1547 `func (m *NotReallyComposedThing) validateProp0(formats strfmt.Registry) error {`, 1548 ` if swag.IsZero(m.Prop0) {`, 1549 ` if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`, 1550 `func (m *NotReallyComposedThing) MarshalBinary() ([]byte, error) {`, 1551 ` if m == nil {`, 1552 ` return nil, nil`, 1553 ` return swag.WriteJSON(m`, 1554 `func (m *NotReallyComposedThing) UnmarshalBinary(b []byte) error {`, 1555 ` var res NotReallyComposedThing`, 1556 ` if err := swag.ReadJSON(b, &res); err != nil {`, 1557 ` *m = res`, 1558 }, 1559 // not expected 1560 noLines, 1561 // output in log 1562 noLines, 1563 noLines) 1564 1565 // load expectations for model: simple_nested_object_all_of1.go 1566 flattenRun.AddExpectations("simple_nested_object_all_of1.go", []string{ 1567 `type SimpleNestedObjectAllOf1 struct {`, 1568 " Prop3 strfmt.UUID `json:\"prop3,omitempty\"`", 1569 `func (m *SimpleNestedObjectAllOf1) Validate(formats strfmt.Registry) error {`, 1570 ` if err := m.validateProp3(formats); err != nil {`, 1571 ` return errors.CompositeValidationError(res...`, 1572 `func (m *SimpleNestedObjectAllOf1) validateProp3(formats strfmt.Registry) error {`, 1573 ` if swag.IsZero(m.Prop3) {`, 1574 ` if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`, 1575 }, 1576 // not expected 1577 todo, 1578 // output in log 1579 noLines, 1580 noLines) 1581 1582 // load expectations for model: break_nested_object_all_of1_prop7.go 1583 flattenRun.AddExpectations("break_nested_object_all_of1_prop7.go", []string{ 1584 `type BreakNestedObjectAllOf1Prop7 struct {`, 1585 ` BreakNestedObjectAllOf1Prop7AllOf0`, 1586 ` BreakNestedObjectAllOf1Prop7AllOf1`, 1587 `func (m *BreakNestedObjectAllOf1Prop7) Validate(formats strfmt.Registry) error {`, 1588 ` if err := m.BreakNestedObjectAllOf1Prop7AllOf0.Validate(formats); err != nil {`, 1589 ` if err := m.BreakNestedObjectAllOf1Prop7AllOf1.Validate(formats); err != nil {`, 1590 ` return errors.CompositeValidationError(res...`, 1591 }, 1592 // not expected 1593 todo, 1594 // output in log 1595 noLines, 1596 noLines) 1597 1598 // load expectations for model: composed_thing.go 1599 flattenRun.AddExpectations("composed_thing.go", []string{ 1600 `type ComposedThing struct {`, 1601 ` ComposedThingAllOf0`, 1602 ` ComposedThingAllOf1`, 1603 `func (m *ComposedThing) Validate(formats strfmt.Registry) error {`, 1604 ` if err := m.ComposedThingAllOf0.Validate(formats); err != nil {`, 1605 ` if err := m.ComposedThingAllOf1.Validate(formats); err != nil {`, 1606 ` return errors.CompositeValidationError(res...`, 1607 }, 1608 // not expected 1609 todo, 1610 // output in log 1611 noLines, 1612 noLines) 1613 1614 // load expectations for model: composed_thing.go 1615 expandRun.AddExpectations("composed_thing.go", []string{ 1616 `type ComposedThing struct {`, 1617 " Prop1 strfmt.UUID `json:\"prop1,omitempty\"`", 1618 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 1619 `func (m *ComposedThing) UnmarshalJSON(raw []byte) error {`, 1620 ` var dataAO0 struct {`, 1621 " Prop1 strfmt.UUID `json:\"prop1,omitempty\"`", 1622 ` if err := swag.ReadJSON(raw, &dataAO0); err != nil {`, 1623 ` m.Prop1 = dataAO0.Prop1`, 1624 ` var dataAO1 struct {`, 1625 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 1626 ` if err := swag.ReadJSON(raw, &dataAO1); err != nil {`, 1627 ` m.Prop2 = dataAO1.Prop2`, 1628 `func (m ComposedThing) MarshalJSON() ([]byte, error) {`, 1629 ` _parts := make([][]byte, 0, 2`, 1630 ` var dataAO0 struct {`, 1631 " Prop1 strfmt.UUID `json:\"prop1,omitempty\"`", 1632 ` dataAO0.Prop1 = m.Prop1`, 1633 ` jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`, 1634 ` if errAO0 != nil {`, 1635 ` return nil, errAO0`, 1636 ` _parts = append(_parts, jsonDataAO0`, 1637 ` var dataAO1 struct {`, 1638 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 1639 ` dataAO1.Prop2 = m.Prop2`, 1640 ` jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`, 1641 ` if errAO1 != nil {`, 1642 ` return nil, errAO1`, 1643 ` _parts = append(_parts, jsonDataAO1`, 1644 ` return swag.ConcatJSON(_parts...), nil`, 1645 `func (m *ComposedThing) Validate(formats strfmt.Registry) error {`, 1646 ` if err := m.validateProp1(formats); err != nil {`, 1647 ` if err := m.validateProp2(formats); err != nil {`, 1648 ` return errors.CompositeValidationError(res...`, 1649 `func (m *ComposedThing) validateProp1(formats strfmt.Registry) error {`, 1650 ` if swag.IsZero(m.Prop1) {`, 1651 ` if err := validate.FormatOf("prop1", "body", "uuid", m.Prop1.String(), formats); err != nil {`, 1652 `func (m *ComposedThing) validateProp2(formats strfmt.Registry) error {`, 1653 ` if swag.IsZero(m.Prop2) {`, 1654 ` if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`, 1655 `func (m *ComposedThing) MarshalBinary() ([]byte, error) {`, 1656 ` if m == nil {`, 1657 ` return nil, nil`, 1658 ` return swag.WriteJSON(m`, 1659 `func (m *ComposedThing) UnmarshalBinary(b []byte) error {`, 1660 ` var res ComposedThing`, 1661 ` if err := swag.ReadJSON(b, &res); err != nil {`, 1662 ` *m = res`, 1663 }, 1664 // not expected 1665 noLines, 1666 // output in log 1667 noLines, 1668 noLines) 1669 1670 // load expectations for model: break_nested_object.go 1671 flattenRun.AddExpectations("break_nested_object.go", []string{ 1672 `type BreakNestedObject struct {`, 1673 ` SimpleNestedObject`, 1674 ` BreakNestedObjectAllOf1`, 1675 `func (m *BreakNestedObject) Validate(formats strfmt.Registry) error {`, 1676 ` if err := m.SimpleNestedObject.Validate(formats); err != nil {`, 1677 ` if err := m.BreakNestedObjectAllOf1.Validate(formats); err != nil {`, 1678 ` return errors.CompositeValidationError(res...`, 1679 }, 1680 // not expected 1681 todo, 1682 // output in log 1683 noLines, 1684 noLines) 1685 1686 // load expectations for model: break_nested_object.go 1687 expandRun.AddExpectations("break_nested_object.go", []string{ 1688 `type BreakNestedObject struct {`, 1689 ` BreakNestedObjectAllOf0`, 1690 " Prop6 strfmt.UUID `json:\"prop6,omitempty\"`", 1691 ` Prop7 struct {`, 1692 " Prop8 int64 `json:\"prop8,omitempty\"`", 1693 " Prop9 int64 `json:\"prop9,omitempty\"`", 1694 " } `json:\"prop7,omitempty\"`", 1695 `func (m *BreakNestedObject) UnmarshalJSON(raw []byte) error {`, 1696 ` var aO0 BreakNestedObjectAllOf0`, 1697 ` if err := swag.ReadJSON(raw, &aO0); err != nil {`, 1698 ` m.BreakNestedObjectAllOf0 = aO0`, 1699 ` var dataAO1 struct {`, 1700 " Prop6 strfmt.UUID `json:\"prop6,omitempty\"`", 1701 ` Prop7 struct {`, 1702 " Prop8 int64 `json:\"prop8,omitempty\"`", 1703 " Prop9 int64 `json:\"prop9,omitempty\"`", 1704 " } `json:\"prop7,omitempty\"`", 1705 ` if err := swag.ReadJSON(raw, &dataAO1); err != nil {`, 1706 ` m.Prop6 = dataAO1.Prop6`, 1707 ` m.Prop7 = dataAO1.Prop7`, 1708 `func (m BreakNestedObject) MarshalJSON() ([]byte, error) {`, 1709 ` _parts := make([][]byte, 0, 2`, 1710 ` aO0, err := swag.WriteJSON(m.BreakNestedObjectAllOf0`, 1711 ` if err != nil {`, 1712 ` return nil, err`, 1713 ` _parts = append(_parts, aO0`, 1714 ` var dataAO1 struct {`, 1715 " Prop6 strfmt.UUID `json:\"prop6,omitempty\"`", 1716 ` Prop7 struct {`, 1717 " Prop8 int64 `json:\"prop8,omitempty\"`", 1718 " Prop9 int64 `json:\"prop9,omitempty\"`", 1719 " } `json:\"prop7,omitempty\"`", 1720 ` dataAO1.Prop6 = m.Prop6`, 1721 ` dataAO1.Prop7 = m.Prop7`, 1722 ` jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`, 1723 ` if errAO1 != nil {`, 1724 ` return nil, errAO1`, 1725 ` _parts = append(_parts, jsonDataAO1`, 1726 ` return swag.ConcatJSON(_parts...), nil`, 1727 `func (m *BreakNestedObject) Validate(formats strfmt.Registry) error {`, 1728 ` if err := m.BreakNestedObjectAllOf0.Validate(formats); err != nil {`, 1729 ` if err := m.validateProp6(formats); err != nil {`, 1730 ` if err := m.validateProp7(formats); err != nil {`, 1731 ` return errors.CompositeValidationError(res...`, 1732 `func (m *BreakNestedObject) validateProp6(formats strfmt.Registry) error {`, 1733 ` if swag.IsZero(m.Prop6) {`, 1734 ` if err := validate.FormatOf("prop6", "body", "uuid", m.Prop6.String(), formats); err != nil {`, 1735 `func (m *BreakNestedObject) validateProp7(formats strfmt.Registry) error {`, 1736 ` if swag.IsZero(m.Prop7) {`, 1737 ` if err := validate.MinimumInt("prop7"+"."+"prop8", "body", m.Prop7.Prop8, 12, false); err != nil {`, 1738 ` if err := validate.MaximumInt("prop7"+"."+"prop9", "body", m.Prop7.Prop9, 12, false); err != nil {`, 1739 `func (m *BreakNestedObject) MarshalBinary() ([]byte, error) {`, 1740 ` if m == nil {`, 1741 ` return nil, nil`, 1742 ` return swag.WriteJSON(m`, 1743 `func (m *BreakNestedObject) UnmarshalBinary(b []byte) error {`, 1744 ` var res BreakNestedObject`, 1745 ` if err := swag.ReadJSON(b, &res); err != nil {`, 1746 ` *m = res`, 1747 `type BreakNestedObjectAllOf0 struct {`, 1748 ` BreakNestedObjectAllOf0AllOf0`, 1749 " Prop3 strfmt.UUID `json:\"prop3,omitempty\"`", 1750 `func (m *BreakNestedObjectAllOf0) UnmarshalJSON(raw []byte) error {`, 1751 ` var aO0 BreakNestedObjectAllOf0AllOf0`, 1752 ` if err := swag.ReadJSON(raw, &aO0); err != nil {`, 1753 ` m.BreakNestedObjectAllOf0AllOf0 = aO0`, 1754 ` var dataAO1 struct {`, 1755 " Prop3 strfmt.UUID `json:\"prop3,omitempty\"`", 1756 ` if err := swag.ReadJSON(raw, &dataAO1); err != nil {`, 1757 ` m.Prop3 = dataAO1.Prop3`, 1758 `func (m BreakNestedObjectAllOf0) MarshalJSON() ([]byte, error) {`, 1759 ` _parts := make([][]byte, 0, 2`, 1760 ` aO0, err := swag.WriteJSON(m.BreakNestedObjectAllOf0AllOf0`, 1761 ` if err != nil {`, 1762 ` return nil, err`, 1763 ` _parts = append(_parts, aO0`, 1764 ` var dataAO1 struct {`, 1765 " Prop3 strfmt.UUID `json:\"prop3,omitempty\"`", 1766 ` dataAO1.Prop3 = m.Prop3`, 1767 ` jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`, 1768 ` if errAO1 != nil {`, 1769 ` return nil, errAO1`, 1770 ` _parts = append(_parts, jsonDataAO1`, 1771 ` return swag.ConcatJSON(_parts...), nil`, 1772 `func (m *BreakNestedObjectAllOf0) Validate(formats strfmt.Registry) error {`, 1773 ` if err := m.BreakNestedObjectAllOf0AllOf0.Validate(formats); err != nil {`, 1774 ` if err := m.validateProp3(formats); err != nil {`, 1775 ` return errors.CompositeValidationError(res...`, 1776 `func (m *BreakNestedObjectAllOf0) validateProp3(formats strfmt.Registry) error {`, 1777 ` if swag.IsZero(m.Prop3) {`, 1778 ` if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`, 1779 `func (m *BreakNestedObjectAllOf0) MarshalBinary() ([]byte, error) {`, 1780 ` if m == nil {`, 1781 ` return nil, nil`, 1782 ` return swag.WriteJSON(m`, 1783 `func (m *BreakNestedObjectAllOf0) UnmarshalBinary(b []byte) error {`, 1784 ` var res BreakNestedObjectAllOf0`, 1785 ` if err := swag.ReadJSON(b, &res); err != nil {`, 1786 ` *m = res`, 1787 `type BreakNestedObjectAllOf0AllOf0 struct {`, 1788 " Prop1 strfmt.UUID `json:\"prop1,omitempty\"`", 1789 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 1790 `func (m *BreakNestedObjectAllOf0AllOf0) UnmarshalJSON(raw []byte) error {`, 1791 ` var dataAO0 struct {`, 1792 " Prop1 strfmt.UUID `json:\"prop1,omitempty\"`", 1793 ` if err := swag.ReadJSON(raw, &dataAO0); err != nil {`, 1794 ` m.Prop1 = dataAO0.Prop1`, 1795 ` var dataAO1 struct {`, 1796 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 1797 ` if err := swag.ReadJSON(raw, &dataAO1); err != nil {`, 1798 ` m.Prop2 = dataAO1.Prop2`, 1799 `func (m BreakNestedObjectAllOf0AllOf0) MarshalJSON() ([]byte, error) {`, 1800 ` _parts := make([][]byte, 0, 2`, 1801 ` var dataAO0 struct {`, 1802 " Prop1 strfmt.UUID `json:\"prop1,omitempty\"`", 1803 ` dataAO0.Prop1 = m.Prop1`, 1804 ` jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`, 1805 ` if errAO0 != nil {`, 1806 ` return nil, errAO0`, 1807 ` _parts = append(_parts, jsonDataAO0`, 1808 ` var dataAO1 struct {`, 1809 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 1810 ` dataAO1.Prop2 = m.Prop2`, 1811 ` jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`, 1812 ` if errAO1 != nil {`, 1813 ` return nil, errAO1`, 1814 ` _parts = append(_parts, jsonDataAO1`, 1815 ` return swag.ConcatJSON(_parts...), nil`, 1816 `func (m *BreakNestedObjectAllOf0AllOf0) Validate(formats strfmt.Registry) error {`, 1817 ` if err := m.validateProp1(formats); err != nil {`, 1818 ` if err := m.validateProp2(formats); err != nil {`, 1819 ` return errors.CompositeValidationError(res...`, 1820 `func (m *BreakNestedObjectAllOf0AllOf0) validateProp1(formats strfmt.Registry) error {`, 1821 ` if swag.IsZero(m.Prop1) {`, 1822 ` if err := validate.FormatOf("prop1", "body", "uuid", m.Prop1.String(), formats); err != nil {`, 1823 `func (m *BreakNestedObjectAllOf0AllOf0) validateProp2(formats strfmt.Registry) error {`, 1824 ` if swag.IsZero(m.Prop2) {`, 1825 ` if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`, 1826 `func (m *BreakNestedObjectAllOf0AllOf0) MarshalBinary() ([]byte, error) {`, 1827 ` if m == nil {`, 1828 ` return nil, nil`, 1829 ` return swag.WriteJSON(m`, 1830 `func (m *BreakNestedObjectAllOf0AllOf0) UnmarshalBinary(b []byte) error {`, 1831 ` var res BreakNestedObjectAllOf0AllOf0`, 1832 ` if err := swag.ReadJSON(b, &res); err != nil {`, 1833 ` *m = res`, 1834 }, 1835 // not expected 1836 noLines, 1837 // output in log 1838 noLines, 1839 noLines) 1840 1841 // load expectations for model: deep_nested_object_all_of1_all_of1.go 1842 flattenRun.AddExpectations("deep_nested_object_all_of1_all_of1.go", []string{ 1843 `type DeepNestedObjectAllOf1AllOf1 struct {`, 1844 " Prop5 strfmt.Date `json:\"prop5,omitempty\"`", 1845 `func (m *DeepNestedObjectAllOf1AllOf1) Validate(formats strfmt.Registry) error {`, 1846 ` if err := m.validateProp5(formats); err != nil {`, 1847 ` return errors.CompositeValidationError(res...`, 1848 `func (m *DeepNestedObjectAllOf1AllOf1) validateProp5(formats strfmt.Registry) error {`, 1849 ` if swag.IsZero(m.Prop5) {`, 1850 ` if err := validate.FormatOf("prop5", "body", "date", m.Prop5.String(), formats); err != nil {`, 1851 }, 1852 // not expected 1853 todo, 1854 // output in log 1855 noLines, 1856 noLines) 1857 1858 // load expectations for model: deep_nested_object.go 1859 flattenRun.AddExpectations("deep_nested_object.go", []string{ 1860 `type DeepNestedObject struct {`, 1861 ` SimpleNestedObject`, 1862 ` DeepNestedObjectAllOf1`, 1863 `func (m *DeepNestedObject) Validate(formats strfmt.Registry) error {`, 1864 ` if err := m.SimpleNestedObject.Validate(formats); err != nil {`, 1865 ` if err := m.DeepNestedObjectAllOf1.Validate(formats); err != nil {`, 1866 ` return errors.CompositeValidationError(res...`, 1867 }, 1868 // not expected 1869 todo, 1870 // output in log 1871 noLines, 1872 noLines) 1873 1874 // load expectations for model: deep_nested_object.go 1875 expandRun.AddExpectations("deep_nested_object.go", []string{ 1876 `type DeepNestedObject struct {`, 1877 ` DeepNestedObjectAllOf0`, 1878 ` DeepNestedObjectAllOf1`, 1879 `func (m *DeepNestedObject) UnmarshalJSON(raw []byte) error {`, 1880 ` var aO0 DeepNestedObjectAllOf0`, 1881 ` if err := swag.ReadJSON(raw, &aO0); err != nil {`, 1882 ` m.DeepNestedObjectAllOf0 = aO0`, 1883 ` var aO1 DeepNestedObjectAllOf1`, 1884 ` if err := swag.ReadJSON(raw, &aO1); err != nil {`, 1885 ` m.DeepNestedObjectAllOf1 = aO1`, 1886 `func (m DeepNestedObject) MarshalJSON() ([]byte, error) {`, 1887 ` _parts := make([][]byte, 0, 2`, 1888 ` aO0, err := swag.WriteJSON(m.DeepNestedObjectAllOf0`, 1889 ` if err != nil {`, 1890 ` return nil, err`, 1891 ` _parts = append(_parts, aO0`, 1892 ` aO1, err := swag.WriteJSON(m.DeepNestedObjectAllOf1`, 1893 ` if err != nil {`, 1894 ` return nil, err`, 1895 ` _parts = append(_parts, aO1`, 1896 ` return swag.ConcatJSON(_parts...), nil`, 1897 `func (m *DeepNestedObject) Validate(formats strfmt.Registry) error {`, 1898 ` if err := m.DeepNestedObjectAllOf0.Validate(formats); err != nil {`, 1899 ` if err := m.DeepNestedObjectAllOf1.Validate(formats); err != nil {`, 1900 ` return errors.CompositeValidationError(res...`, 1901 `func (m *DeepNestedObject) MarshalBinary() ([]byte, error) {`, 1902 ` if m == nil {`, 1903 ` return nil, nil`, 1904 ` return swag.WriteJSON(m`, 1905 `func (m *DeepNestedObject) UnmarshalBinary(b []byte) error {`, 1906 ` var res DeepNestedObject`, 1907 ` if err := swag.ReadJSON(b, &res); err != nil {`, 1908 ` *m = res`, 1909 `type DeepNestedObjectAllOf0 struct {`, 1910 ` DeepNestedObjectAllOf0AllOf0`, 1911 " Prop3 strfmt.UUID `json:\"prop3,omitempty\"`", 1912 `func (m *DeepNestedObjectAllOf0) UnmarshalJSON(raw []byte) error {`, 1913 ` var aO0 DeepNestedObjectAllOf0AllOf0`, 1914 ` if err := swag.ReadJSON(raw, &aO0); err != nil {`, 1915 ` m.DeepNestedObjectAllOf0AllOf0 = aO0`, 1916 ` var dataAO1 struct {`, 1917 " Prop3 strfmt.UUID `json:\"prop3,omitempty\"`", 1918 ` if err := swag.ReadJSON(raw, &dataAO1); err != nil {`, 1919 ` m.Prop3 = dataAO1.Prop3`, 1920 `func (m DeepNestedObjectAllOf0) MarshalJSON() ([]byte, error) {`, 1921 ` _parts := make([][]byte, 0, 2`, 1922 ` aO0, err := swag.WriteJSON(m.DeepNestedObjectAllOf0AllOf0`, 1923 ` if err != nil {`, 1924 ` return nil, err`, 1925 ` _parts = append(_parts, aO0`, 1926 ` var dataAO1 struct {`, 1927 " Prop3 strfmt.UUID `json:\"prop3,omitempty\"`", 1928 ` dataAO1.Prop3 = m.Prop3`, 1929 ` jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`, 1930 ` if errAO1 != nil {`, 1931 ` return nil, errAO1`, 1932 ` _parts = append(_parts, jsonDataAO1`, 1933 ` return swag.ConcatJSON(_parts...), nil`, 1934 `func (m *DeepNestedObjectAllOf0) Validate(formats strfmt.Registry) error {`, 1935 ` if err := m.DeepNestedObjectAllOf0AllOf0.Validate(formats); err != nil {`, 1936 ` if err := m.validateProp3(formats); err != nil {`, 1937 ` return errors.CompositeValidationError(res...`, 1938 `func (m *DeepNestedObjectAllOf0) validateProp3(formats strfmt.Registry) error {`, 1939 ` if swag.IsZero(m.Prop3) {`, 1940 ` if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`, 1941 `func (m *DeepNestedObjectAllOf0) MarshalBinary() ([]byte, error) {`, 1942 ` if m == nil {`, 1943 ` return nil, nil`, 1944 ` return swag.WriteJSON(m`, 1945 `func (m *DeepNestedObjectAllOf0) UnmarshalBinary(b []byte) error {`, 1946 ` var res DeepNestedObjectAllOf0`, 1947 ` if err := swag.ReadJSON(b, &res); err != nil {`, 1948 ` *m = res`, 1949 `type DeepNestedObjectAllOf0AllOf0 struct {`, 1950 " Prop1 strfmt.UUID `json:\"prop1,omitempty\"`", 1951 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 1952 `func (m *DeepNestedObjectAllOf0AllOf0) UnmarshalJSON(raw []byte) error {`, 1953 ` var dataAO0 struct {`, 1954 " Prop1 strfmt.UUID `json:\"prop1,omitempty\"`", 1955 ` if err := swag.ReadJSON(raw, &dataAO0); err != nil {`, 1956 ` m.Prop1 = dataAO0.Prop1`, 1957 ` var dataAO1 struct {`, 1958 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 1959 ` if err := swag.ReadJSON(raw, &dataAO1); err != nil {`, 1960 ` m.Prop2 = dataAO1.Prop2`, 1961 `func (m DeepNestedObjectAllOf0AllOf0) MarshalJSON() ([]byte, error) {`, 1962 ` _parts := make([][]byte, 0, 2`, 1963 ` var dataAO0 struct {`, 1964 " Prop1 strfmt.UUID `json:\"prop1,omitempty\"`", 1965 ` dataAO0.Prop1 = m.Prop1`, 1966 ` jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`, 1967 ` if errAO0 != nil {`, 1968 ` return nil, errAO0`, 1969 ` _parts = append(_parts, jsonDataAO0`, 1970 ` var dataAO1 struct {`, 1971 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 1972 ` dataAO1.Prop2 = m.Prop2`, 1973 ` jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`, 1974 ` if errAO1 != nil {`, 1975 ` return nil, errAO1`, 1976 ` _parts = append(_parts, jsonDataAO1`, 1977 ` return swag.ConcatJSON(_parts...), nil`, 1978 `func (m *DeepNestedObjectAllOf0AllOf0) Validate(formats strfmt.Registry) error {`, 1979 ` if err := m.validateProp1(formats); err != nil {`, 1980 ` if err := m.validateProp2(formats); err != nil {`, 1981 ` return errors.CompositeValidationError(res...`, 1982 `func (m *DeepNestedObjectAllOf0AllOf0) validateProp1(formats strfmt.Registry) error {`, 1983 ` if swag.IsZero(m.Prop1) {`, 1984 ` if err := validate.FormatOf("prop1", "body", "uuid", m.Prop1.String(), formats); err != nil {`, 1985 `func (m *DeepNestedObjectAllOf0AllOf0) validateProp2(formats strfmt.Registry) error {`, 1986 ` if swag.IsZero(m.Prop2) {`, 1987 ` if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`, 1988 `func (m *DeepNestedObjectAllOf0AllOf0) MarshalBinary() ([]byte, error) {`, 1989 ` if m == nil {`, 1990 ` return nil, nil`, 1991 ` return swag.WriteJSON(m`, 1992 `func (m *DeepNestedObjectAllOf0AllOf0) UnmarshalBinary(b []byte) error {`, 1993 ` var res DeepNestedObjectAllOf0AllOf0`, 1994 ` if err := swag.ReadJSON(b, &res); err != nil {`, 1995 ` *m = res`, 1996 `type DeepNestedObjectAllOf1 struct {`, 1997 " Prop4 strfmt.UUID `json:\"prop4,omitempty\"`", 1998 " Prop5 strfmt.Date `json:\"prop5,omitempty\"`", 1999 `func (m *DeepNestedObjectAllOf1) UnmarshalJSON(raw []byte) error {`, 2000 ` var dataAO0 struct {`, 2001 " Prop4 strfmt.UUID `json:\"prop4,omitempty\"`", 2002 ` if err := swag.ReadJSON(raw, &dataAO0); err != nil {`, 2003 ` m.Prop4 = dataAO0.Prop4`, 2004 ` var dataAO1 struct {`, 2005 " Prop5 strfmt.Date `json:\"prop5,omitempty\"`", 2006 ` if err := swag.ReadJSON(raw, &dataAO1); err != nil {`, 2007 ` m.Prop5 = dataAO1.Prop5`, 2008 `func (m DeepNestedObjectAllOf1) MarshalJSON() ([]byte, error) {`, 2009 ` _parts := make([][]byte, 0, 2`, 2010 ` var dataAO0 struct {`, 2011 " Prop4 strfmt.UUID `json:\"prop4,omitempty\"`", 2012 ` dataAO0.Prop4 = m.Prop4`, 2013 ` jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`, 2014 ` if errAO0 != nil {`, 2015 ` return nil, errAO0`, 2016 ` _parts = append(_parts, jsonDataAO0`, 2017 ` var dataAO1 struct {`, 2018 " Prop5 strfmt.Date `json:\"prop5,omitempty\"`", 2019 ` dataAO1.Prop5 = m.Prop5`, 2020 ` jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`, 2021 ` if errAO1 != nil {`, 2022 ` return nil, errAO1`, 2023 ` _parts = append(_parts, jsonDataAO1`, 2024 ` return swag.ConcatJSON(_parts...), nil`, 2025 `func (m *DeepNestedObjectAllOf1) Validate(formats strfmt.Registry) error {`, 2026 ` if err := m.validateProp4(formats); err != nil {`, 2027 ` if err := m.validateProp5(formats); err != nil {`, 2028 ` return errors.CompositeValidationError(res...`, 2029 `func (m *DeepNestedObjectAllOf1) validateProp4(formats strfmt.Registry) error {`, 2030 ` if swag.IsZero(m.Prop4) {`, 2031 ` if err := validate.FormatOf("prop4", "body", "uuid", m.Prop4.String(), formats); err != nil {`, 2032 `func (m *DeepNestedObjectAllOf1) validateProp5(formats strfmt.Registry) error {`, 2033 ` if swag.IsZero(m.Prop5) {`, 2034 ` if err := validate.FormatOf("prop5", "body", "date", m.Prop5.String(), formats); err != nil {`, 2035 `func (m *DeepNestedObjectAllOf1) MarshalBinary() ([]byte, error) {`, 2036 ` if m == nil {`, 2037 ` return nil, nil`, 2038 ` return swag.WriteJSON(m`, 2039 `func (m *DeepNestedObjectAllOf1) UnmarshalBinary(b []byte) error {`, 2040 ` var res DeepNestedObjectAllOf1`, 2041 ` if err := swag.ReadJSON(b, &res); err != nil {`, 2042 ` *m = res`, 2043 }, 2044 // not expected 2045 noLines, 2046 // output in log 2047 noLines, 2048 noLines) 2049 2050 // load expectations for model: break_nested_object_all_of1.go 2051 flattenRun.AddExpectations("break_nested_object_all_of1.go", []string{ 2052 `type BreakNestedObjectAllOf1 struct {`, 2053 " Prop6 strfmt.UUID `json:\"prop6,omitempty\"`", 2054 " Prop7 *BreakNestedObjectAllOf1Prop7 `json:\"prop7,omitempty\"`", 2055 `func (m *BreakNestedObjectAllOf1) Validate(formats strfmt.Registry) error {`, 2056 ` if err := m.validateProp6(formats); err != nil {`, 2057 ` if err := m.validateProp7(formats); err != nil {`, 2058 ` return errors.CompositeValidationError(res...`, 2059 `func (m *BreakNestedObjectAllOf1) validateProp6(formats strfmt.Registry) error {`, 2060 ` if swag.IsZero(m.Prop6) {`, 2061 ` if err := validate.FormatOf("prop6", "body", "uuid", m.Prop6.String(), formats); err != nil {`, 2062 `func (m *BreakNestedObjectAllOf1) validateProp7(formats strfmt.Registry) error {`, 2063 ` if swag.IsZero(m.Prop7) {`, 2064 ` if m.Prop7 != nil {`, 2065 ` if err := m.Prop7.Validate(formats); err != nil {`, 2066 ` if ve, ok := err.(*errors.Validation); ok {`, 2067 ` return ve.ValidateName("prop7"`, 2068 }, 2069 // not expected 2070 todo, 2071 // output in log 2072 noLines, 2073 noLines) 2074 2075 // load expectations for model: not_really_composed_thing.go 2076 flattenRun.AddExpectations("not_really_composed_thing.go", []string{ 2077 `type NotReallyComposedThing struct {`, 2078 ` NotReallyComposedThingAllOf0`, 2079 `func (m *NotReallyComposedThing) Validate(formats strfmt.Registry) error {`, 2080 ` if err := m.NotReallyComposedThingAllOf0.Validate(formats); err != nil {`, 2081 ` return errors.CompositeValidationError(res...`, 2082 }, 2083 // not expected 2084 todo, 2085 // output in log 2086 noLines, 2087 noLines) 2088 2089 expandRun.AddExpectations("not_really_composed_thing.go", []string{ 2090 `type NotReallyComposedThing struct {`, 2091 " Prop0 strfmt.UUID `json:\"prop0,omitempty\"`", 2092 `func (m *NotReallyComposedThing) Validate(formats strfmt.Registry) error {`, 2093 ` if err := m.validateProp0(formats); err != nil {`, 2094 ` return errors.CompositeValidationError(res...`, 2095 `func (m *NotReallyComposedThing) validateProp0(formats strfmt.Registry) error {`, 2096 ` if swag.IsZero(m.Prop0) {`, 2097 ` if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`, 2098 }, 2099 // not expected 2100 noLines, 2101 // output in log 2102 noLines, 2103 noLines) 2104 2105 // load expectations for model: simple_nested_object.go 2106 flattenRun.AddExpectations("simple_nested_object.go", []string{ 2107 `type SimpleNestedObject struct {`, 2108 ` ComposedThing`, 2109 ` SimpleNestedObjectAllOf1`, 2110 `func (m *SimpleNestedObject) Validate(formats strfmt.Registry) error {`, 2111 ` if err := m.ComposedThing.Validate(formats); err != nil {`, 2112 ` if err := m.SimpleNestedObjectAllOf1.Validate(formats); err != nil {`, 2113 ` return errors.CompositeValidationError(res...`, 2114 }, 2115 // not expected 2116 todo, 2117 // output in log 2118 noLines, 2119 noLines) 2120 2121 // load expectations for model: simple_nested_object.go 2122 expandRun.AddExpectations("simple_nested_object.go", []string{ 2123 `type SimpleNestedObject struct {`, 2124 ` SimpleNestedObjectAllOf0`, 2125 " Prop3 strfmt.UUID `json:\"prop3,omitempty\"`", 2126 `func (m *SimpleNestedObject) UnmarshalJSON(raw []byte) error {`, 2127 ` var aO0 SimpleNestedObjectAllOf0`, 2128 ` if err := swag.ReadJSON(raw, &aO0); err != nil {`, 2129 ` m.SimpleNestedObjectAllOf0 = aO0`, 2130 ` var dataAO1 struct {`, 2131 " Prop3 strfmt.UUID `json:\"prop3,omitempty\"`", 2132 ` if err := swag.ReadJSON(raw, &dataAO1); err != nil {`, 2133 ` m.Prop3 = dataAO1.Prop3`, 2134 `func (m SimpleNestedObject) MarshalJSON() ([]byte, error) {`, 2135 ` _parts := make([][]byte, 0, 2`, 2136 ` aO0, err := swag.WriteJSON(m.SimpleNestedObjectAllOf0`, 2137 ` if err != nil {`, 2138 ` return nil, err`, 2139 ` _parts = append(_parts, aO0`, 2140 ` var dataAO1 struct {`, 2141 " Prop3 strfmt.UUID `json:\"prop3,omitempty\"`", 2142 ` dataAO1.Prop3 = m.Prop3`, 2143 ` jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`, 2144 ` if errAO1 != nil {`, 2145 ` return nil, errAO1`, 2146 ` _parts = append(_parts, jsonDataAO1`, 2147 ` return swag.ConcatJSON(_parts...), nil`, 2148 `func (m *SimpleNestedObject) Validate(formats strfmt.Registry) error {`, 2149 ` if err := m.SimpleNestedObjectAllOf0.Validate(formats); err != nil {`, 2150 ` if err := m.validateProp3(formats); err != nil {`, 2151 ` return errors.CompositeValidationError(res...`, 2152 `func (m *SimpleNestedObject) validateProp3(formats strfmt.Registry) error {`, 2153 ` if swag.IsZero(m.Prop3) {`, 2154 ` if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`, 2155 `func (m *SimpleNestedObject) MarshalBinary() ([]byte, error) {`, 2156 ` if m == nil {`, 2157 ` return nil, nil`, 2158 ` return swag.WriteJSON(m`, 2159 `func (m *SimpleNestedObject) UnmarshalBinary(b []byte) error {`, 2160 ` var res SimpleNestedObject`, 2161 ` if err := swag.ReadJSON(b, &res); err != nil {`, 2162 ` *m = res`, 2163 `type SimpleNestedObjectAllOf0 struct {`, 2164 " Prop1 strfmt.UUID `json:\"prop1,omitempty\"`", 2165 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 2166 `func (m *SimpleNestedObjectAllOf0) UnmarshalJSON(raw []byte) error {`, 2167 ` var dataAO0 struct {`, 2168 " Prop1 strfmt.UUID `json:\"prop1,omitempty\"`", 2169 ` if err := swag.ReadJSON(raw, &dataAO0); err != nil {`, 2170 ` m.Prop1 = dataAO0.Prop1`, 2171 ` var dataAO1 struct {`, 2172 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 2173 ` if err := swag.ReadJSON(raw, &dataAO1); err != nil {`, 2174 ` m.Prop2 = dataAO1.Prop2`, 2175 `func (m SimpleNestedObjectAllOf0) MarshalJSON() ([]byte, error) {`, 2176 ` _parts := make([][]byte, 0, 2`, 2177 ` var dataAO0 struct {`, 2178 " Prop1 strfmt.UUID `json:\"prop1,omitempty\"`", 2179 ` dataAO0.Prop1 = m.Prop1`, 2180 ` jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`, 2181 ` if errAO0 != nil {`, 2182 ` return nil, errAO0`, 2183 ` _parts = append(_parts, jsonDataAO0`, 2184 ` var dataAO1 struct {`, 2185 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 2186 ` dataAO1.Prop2 = m.Prop2`, 2187 ` jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`, 2188 ` if errAO1 != nil {`, 2189 ` return nil, errAO1`, 2190 ` _parts = append(_parts, jsonDataAO1`, 2191 ` return swag.ConcatJSON(_parts...), nil`, 2192 `func (m *SimpleNestedObjectAllOf0) Validate(formats strfmt.Registry) error {`, 2193 ` if err := m.validateProp1(formats); err != nil {`, 2194 ` if err := m.validateProp2(formats); err != nil {`, 2195 ` return errors.CompositeValidationError(res...`, 2196 `func (m *SimpleNestedObjectAllOf0) validateProp1(formats strfmt.Registry) error {`, 2197 ` if swag.IsZero(m.Prop1) {`, 2198 ` if err := validate.FormatOf("prop1", "body", "uuid", m.Prop1.String(), formats); err != nil {`, 2199 `func (m *SimpleNestedObjectAllOf0) validateProp2(formats strfmt.Registry) error {`, 2200 ` if swag.IsZero(m.Prop2) {`, 2201 ` if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`, 2202 `func (m *SimpleNestedObjectAllOf0) MarshalBinary() ([]byte, error) {`, 2203 ` if m == nil {`, 2204 ` return nil, nil`, 2205 ` return swag.WriteJSON(m`, 2206 `func (m *SimpleNestedObjectAllOf0) UnmarshalBinary(b []byte) error {`, 2207 ` var res SimpleNestedObjectAllOf0`, 2208 ` if err := swag.ReadJSON(b, &res); err != nil {`, 2209 ` *m = res`, 2210 }, 2211 // not expected 2212 noLines, 2213 // output in log 2214 noLines, 2215 noLines) 2216 2217 // load expectations for model: break_nested_object_all_of1_prop7_all_of0.go 2218 flattenRun.AddExpectations("break_nested_object_all_of1_prop7_all_of0.go", []string{ 2219 `type BreakNestedObjectAllOf1Prop7AllOf0 struct {`, 2220 " Prop8 int64 `json:\"prop8,omitempty\"`", 2221 `func (m *BreakNestedObjectAllOf1Prop7AllOf0) Validate(formats strfmt.Registry) error {`, 2222 ` if err := m.validateProp8(formats); err != nil {`, 2223 ` return errors.CompositeValidationError(res...`, 2224 `func (m *BreakNestedObjectAllOf1Prop7AllOf0) validateProp8(formats strfmt.Registry) error {`, 2225 ` if swag.IsZero(m.Prop8) {`, 2226 ` if err := validate.MinimumInt("prop8", "body", m.Prop8, 12, false); err != nil {`, 2227 }, 2228 // not expected 2229 todo, 2230 // output in log 2231 noLines, 2232 noLines) 2233 2234 // load expectations for model: deep_nested_object_all_of1_all_of0.go 2235 flattenRun.AddExpectations("deep_nested_object_all_of1_all_of0.go", []string{ 2236 `type DeepNestedObjectAllOf1AllOf0 struct {`, 2237 " Prop4 strfmt.UUID `json:\"prop4,omitempty\"`", 2238 `func (m *DeepNestedObjectAllOf1AllOf0) Validate(formats strfmt.Registry) error {`, 2239 ` if err := m.validateProp4(formats); err != nil {`, 2240 ` return errors.CompositeValidationError(res...`, 2241 `func (m *DeepNestedObjectAllOf1AllOf0) validateProp4(formats strfmt.Registry) error {`, 2242 ` if swag.IsZero(m.Prop4) {`, 2243 ` if err := validate.FormatOf("prop4", "body", "uuid", m.Prop4.String(), formats); err != nil {`, 2244 }, 2245 // not expected 2246 todo, 2247 // output in log 2248 noLines, 2249 noLines) 2250 2251 // load expectations for model: break_nested_object_all_of1_prop7_all_of1.go 2252 flattenRun.AddExpectations("break_nested_object_all_of1_prop7_all_of1.go", []string{ 2253 `type BreakNestedObjectAllOf1Prop7AllOf1 struct {`, 2254 " Prop9 int64 `json:\"prop9,omitempty\"`", 2255 `func (m *BreakNestedObjectAllOf1Prop7AllOf1) Validate(formats strfmt.Registry) error {`, 2256 ` if err := m.validateProp9(formats); err != nil {`, 2257 ` return errors.CompositeValidationError(res...`, 2258 `func (m *BreakNestedObjectAllOf1Prop7AllOf1) validateProp9(formats strfmt.Registry) error {`, 2259 ` if swag.IsZero(m.Prop9) {`, 2260 ` if err := validate.MaximumInt("prop9", "body", m.Prop9, 12, false); err != nil {`, 2261 }, 2262 // not expected 2263 todo, 2264 // output in log 2265 noLines, 2266 noLines) 2267 2268 // load expectations for model: composed_thing_all_of0.go 2269 flattenRun.AddExpectations("composed_thing_all_of0.go", []string{ 2270 `type ComposedThingAllOf0 struct {`, 2271 " Prop1 strfmt.UUID `json:\"prop1,omitempty\"`", 2272 `func (m *ComposedThingAllOf0) Validate(formats strfmt.Registry) error {`, 2273 ` if err := m.validateProp1(formats); err != nil {`, 2274 ` return errors.CompositeValidationError(res...`, 2275 `func (m *ComposedThingAllOf0) validateProp1(formats strfmt.Registry) error {`, 2276 ` if swag.IsZero(m.Prop1) {`, 2277 ` if err := validate.FormatOf("prop1", "body", "uuid", m.Prop1.String(), formats); err != nil {`, 2278 }, 2279 // not expected 2280 todo, 2281 // output in log 2282 noLines, 2283 noLines) 2284 2285 // load expectations for model: composed_thing_all_of1.go 2286 flattenRun.AddExpectations("composed_thing_all_of1.go", []string{ 2287 `type ComposedThingAllOf1 struct {`, 2288 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 2289 `func (m *ComposedThingAllOf1) Validate(formats strfmt.Registry) error {`, 2290 ` if err := m.validateProp2(formats); err != nil {`, 2291 ` return errors.CompositeValidationError(res...`, 2292 `func (m *ComposedThingAllOf1) validateProp2(formats strfmt.Registry) error {`, 2293 ` if swag.IsZero(m.Prop2) {`, 2294 ` if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`, 2295 }, 2296 // not expected 2297 todo, 2298 // output in log 2299 noLines, 2300 noLines) 2301 2302 // load expectations for model: deep_nested_object_all_of1.go 2303 flattenRun.AddExpectations("deep_nested_object_all_of1.go", []string{ 2304 `type DeepNestedObjectAllOf1 struct {`, 2305 ` DeepNestedObjectAllOf1AllOf0`, 2306 ` DeepNestedObjectAllOf1AllOf1`, 2307 `func (m *DeepNestedObjectAllOf1) Validate(formats strfmt.Registry) error {`, 2308 ` if err := m.DeepNestedObjectAllOf1AllOf0.Validate(formats); err != nil {`, 2309 ` if err := m.DeepNestedObjectAllOf1AllOf1.Validate(formats); err != nil {`, 2310 ` return errors.CompositeValidationError(res...`, 2311 }, 2312 // not expected 2313 todo, 2314 // output in log 2315 noLines, 2316 noLines) 2317 2318 } 2319 2320 func initFixtureComplexAllOf() { 2321 // testing ../fixtures/bugs/1487/fixture-complex-allOf.yaml with flatten and expand (--skip-flatten) 2322 2323 /* 2324 */ 2325 f := newModelFixture("../fixtures/bugs/1487/fixture-complex-allOf.yaml", "fixture for nested allOf with ref") 2326 flattenRun := f.AddRun(false) 2327 expandRun := f.AddRun(true) 2328 2329 // load expectations for model: aliased_date.go 2330 flattenRun.AddExpectations("aliased_date.go", []string{ 2331 `type AliasedDate strfmt.Date`, 2332 `func (m AliasedDate) Validate(formats strfmt.Registry) error {`, 2333 ` if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`, 2334 ` return errors.CompositeValidationError(res...`, 2335 }, 2336 // not expected 2337 todo, 2338 // output in log 2339 noLines, 2340 noLines) 2341 2342 expandRun.AddExpectations("aliased_date.go", flattenRun.ExpectedFor("AliasedDate").ExpectedLines, todo, noLines, noLines) 2343 2344 // load expectations for model: object_mix_all_of2.go 2345 flattenRun.AddExpectations("object_mix_all_of2.go", []string{ 2346 `type ObjectMixAllOf2 struct {`, 2347 " Prop2 *ObjectMixAllOf2Prop2 `json:\"prop2,omitempty\"`", 2348 `func (m *ObjectMixAllOf2) Validate(formats strfmt.Registry) error {`, 2349 ` if err := m.validateProp2(formats); err != nil {`, 2350 ` return errors.CompositeValidationError(res...`, 2351 `func (m *ObjectMixAllOf2) validateProp2(formats strfmt.Registry) error {`, 2352 ` if swag.IsZero(m.Prop2) {`, 2353 ` if m.Prop2 != nil {`, 2354 ` if err := m.Prop2.Validate(formats); err != nil {`, 2355 ` if ve, ok := err.(*errors.Validation); ok {`, 2356 ` return ve.ValidateName("prop2"`, 2357 }, 2358 // not expected 2359 todo, 2360 // output in log 2361 noLines, 2362 noLines) 2363 2364 // load expectations for model: object_mix.go 2365 flattenRun.AddExpectations("object_mix.go", []string{ 2366 `type ObjectMix struct {`, 2367 ` ObjectMixAllOf1`, 2368 ` ObjectMixAllOf2`, 2369 `func (m *ObjectMix) Validate(formats strfmt.Registry) error {`, 2370 ` if err := m.ObjectMixAllOf1.Validate(formats); err != nil {`, 2371 ` if err := m.ObjectMixAllOf2.Validate(formats); err != nil {`, 2372 ` return errors.CompositeValidationError(res...`, 2373 }, 2374 // not expected 2375 todo, 2376 // output in log 2377 noLines, 2378 noLines) 2379 2380 expandRun.AddExpectations("object_mix.go", []string{ 2381 `type ObjectMix struct {`, 2382 ` Prop1 struct {`, 2383 ` ObjectMixProp1AllOf0`, 2384 ` ObjectMixProp1AllOf1`, 2385 " } `json:\"prop1,omitempty\"`", 2386 ` Prop2 struct {`, 2387 ` ObjectMixProp2AllOf0`, 2388 ` ObjectMixProp2AllOf1`, 2389 " } `json:\"prop2,omitempty\"`", 2390 `func (m *ObjectMix) Validate(formats strfmt.Registry) error {`, 2391 ` if err := m.validateProp1(formats); err != nil {`, 2392 ` if err := m.validateProp2(formats); err != nil {`, 2393 ` return errors.CompositeValidationError(res...`, 2394 `func (m *ObjectMix) validateProp1(formats strfmt.Registry) error {`, 2395 ` if swag.IsZero(m.Prop1) {`, 2396 `func (m *ObjectMix) validateProp2(formats strfmt.Registry) error {`, 2397 ` if swag.IsZero(m.Prop2) {`, 2398 `type ObjectMixProp1AllOf0 strfmt.Date`, 2399 `func (m ObjectMixProp1AllOf0) Validate(formats strfmt.Registry) error {`, 2400 ` if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`, 2401 ` return errors.CompositeValidationError(res...`, 2402 `type ObjectMixProp1AllOf1 strfmt.Date`, 2403 `func (m ObjectMixProp1AllOf1) Validate(formats strfmt.Registry) error {`, 2404 ` if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`, 2405 ` return errors.CompositeValidationError(res...`, 2406 `type ObjectMixProp2AllOf0 strfmt.Date`, 2407 `func (m ObjectMixProp2AllOf0) Validate(formats strfmt.Registry) error {`, 2408 ` if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`, 2409 ` return errors.CompositeValidationError(res...`, 2410 `type ObjectMixProp2AllOf1 strfmt.Date`, 2411 `func (m ObjectMixProp2AllOf1) Validate(formats strfmt.Registry) error {`, 2412 ` if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`, 2413 ` return errors.CompositeValidationError(res...`, 2414 }, 2415 // not expected 2416 noLines, 2417 // output in log 2418 noLines, 2419 noLines) 2420 2421 // load expectations for model: all_of_slices_of_aliases.go 2422 flattenRun.AddExpectations("all_of_slices_of_aliases.go", []string{ 2423 `type AllOfSlicesOfAliases struct {`, 2424 ` AllOfSlicesOfAliasesAllOf0`, 2425 ` AllOfSlicesOfAliasesAllOf1`, 2426 `func (m *AllOfSlicesOfAliases) Validate(formats strfmt.Registry) error {`, 2427 ` if err := m.AllOfSlicesOfAliasesAllOf0.Validate(formats); err != nil {`, 2428 ` if err := m.AllOfSlicesOfAliasesAllOf1.Validate(formats); err != nil {`, 2429 ` return errors.CompositeValidationError(res...`, 2430 }, 2431 // not expected 2432 todo, 2433 // output in log 2434 noLines, 2435 noLines) 2436 2437 expandRun.AddExpectations("all_of_slices_of_aliases.go", []string{ 2438 `type AllOfSlicesOfAliases struct {`, 2439 " Prop1 []strfmt.Date `json:\"prop1\"`", 2440 " Prop2 []*strfmt.Date `json:\"prop2\"`", 2441 `func (m *AllOfSlicesOfAliases) Validate(formats strfmt.Registry) error {`, 2442 ` if err := m.validateProp1(formats); err != nil {`, 2443 ` if err := m.validateProp2(formats); err != nil {`, 2444 ` return errors.CompositeValidationError(res...`, 2445 `func (m *AllOfSlicesOfAliases) validateProp1(formats strfmt.Registry) error {`, 2446 ` if swag.IsZero(m.Prop1) {`, 2447 ` iProp1Size := int64(len(m.Prop1)`, 2448 ` if err := validate.MaxItems("prop1", "body", iProp1Size, 10); err != nil {`, 2449 ` for i := 0; i < len(m.Prop1); i++ {`, 2450 ` if err := validate.FormatOf("prop1"+"."+strconv.Itoa(i), "body", "date", m.Prop1[i].String(), formats); err != nil {`, 2451 `func (m *AllOfSlicesOfAliases) validateProp2(formats strfmt.Registry) error {`, 2452 ` if swag.IsZero(m.Prop2) {`, 2453 ` iProp2Size := int64(len(m.Prop2)`, 2454 ` if err := validate.MaxItems("prop2", "body", iProp2Size, 20); err != nil {`, 2455 ` for i := 0; i < len(m.Prop2); i++ {`, 2456 // do we need Required when item is nullable? 2457 // nullable not required: 2458 ` if swag.IsZero(m.Prop2[i]) {`, 2459 // nullable required: 2460 ` if err := validate.FormatOf("prop2"+"."+strconv.Itoa(i), "body", "date", m.Prop2[i].String(), formats); err != nil {`, 2461 }, 2462 // not expected 2463 noLines, 2464 // output in log 2465 noLines, 2466 noLines) 2467 2468 // load expectations for model: all_of_aliases.go 2469 flattenRun.AddExpectations("all_of_aliases.go", []string{ 2470 `type AllOfAliases struct {`, 2471 ` AliasedDate`, 2472 ` AliasedNullableDate`, 2473 `func (m *AllOfAliases) Validate(formats strfmt.Registry) error {`, 2474 ` if err := m.AliasedDate.Validate(formats); err != nil {`, 2475 ` if err := m.AliasedNullableDate.Validate(formats); err != nil {`, 2476 ` return errors.CompositeValidationError(res...`, 2477 }, 2478 // not expected 2479 todo, 2480 // output in log 2481 noLines, 2482 noLines) 2483 2484 expandRun.AddExpectations("all_of_aliases.go", []string{ 2485 `type AllOfAliases struct {`, 2486 ` AllOfAliasesAllOf0`, 2487 ` AllOfAliasesAllOf1`, 2488 `func (m *AllOfAliases) Validate(formats strfmt.Registry) error {`, 2489 ` if err := m.AllOfAliasesAllOf0.Validate(formats); err != nil {`, 2490 ` if err := m.AllOfAliasesAllOf1.Validate(formats); err != nil {`, 2491 ` return errors.CompositeValidationError(res...`, 2492 `type AllOfAliasesAllOf0 strfmt.Date`, 2493 `func (m AllOfAliasesAllOf0) Validate(formats strfmt.Registry) error {`, 2494 ` if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`, 2495 ` return errors.CompositeValidationError(res...`, 2496 // NOTE: the x-nullable has not been honored here 2497 // so we don't have: `type AllOfAliasesAllOf1 *strfmt.Date`, 2498 // this is by design, since nullability is honored by the container of the alias, not the 2499 // alias itself. An allOf branch container is composing types, not pointers. 2500 `type AllOfAliasesAllOf1 strfmt.Date`, 2501 `func (m AllOfAliasesAllOf1) Validate(formats strfmt.Registry) error {`, 2502 ` if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`, 2503 ` return errors.CompositeValidationError(res...`, 2504 }, 2505 // not expected 2506 noLines, 2507 // output in log 2508 noLines, 2509 noLines) 2510 2511 // load expectations for model: object_mix_all_of1.go 2512 flattenRun.AddExpectations("object_mix_all_of1.go", []string{ 2513 `type ObjectMixAllOf1 struct {`, 2514 " Prop1 *ObjectMixAllOf1Prop1 `json:\"prop1,omitempty\"`", 2515 `func (m *ObjectMixAllOf1) Validate(formats strfmt.Registry) error {`, 2516 ` if err := m.validateProp1(formats); err != nil {`, 2517 ` return errors.CompositeValidationError(res...`, 2518 `func (m *ObjectMixAllOf1) validateProp1(formats strfmt.Registry) error {`, 2519 ` if swag.IsZero(m.Prop1) {`, 2520 ` if m.Prop1 != nil {`, 2521 ` if err := m.Prop1.Validate(formats); err != nil {`, 2522 ` if ve, ok := err.(*errors.Validation); ok {`, 2523 ` return ve.ValidateName("prop1"`, 2524 }, 2525 // not expected 2526 todo, 2527 // output in log 2528 noLines, 2529 noLines) 2530 2531 // load expectations for model: all_of_slices_of_aliases_all_of0.go 2532 flattenRun.AddExpectations("all_of_slices_of_aliases_all_of0.go", []string{ 2533 `type AllOfSlicesOfAliasesAllOf0 struct {`, 2534 " Prop1 []AliasedDate `json:\"prop1\"`", 2535 `func (m *AllOfSlicesOfAliasesAllOf0) Validate(formats strfmt.Registry) error {`, 2536 ` if err := m.validateProp1(formats); err != nil {`, 2537 ` return errors.CompositeValidationError(res...`, 2538 `func (m *AllOfSlicesOfAliasesAllOf0) validateProp1(formats strfmt.Registry) error {`, 2539 ` if swag.IsZero(m.Prop1) {`, 2540 ` iProp1Size := int64(len(m.Prop1)`, 2541 ` if err := validate.MaxItems("prop1", "body", iProp1Size, 10); err != nil {`, 2542 ` for i := 0; i < len(m.Prop1); i++ {`, 2543 ` if err := m.Prop1[i].Validate(formats); err != nil {`, 2544 ` if ve, ok := err.(*errors.Validation); ok {`, 2545 ` return ve.ValidateName("prop1" + "." + strconv.Itoa(i)`, 2546 }, 2547 // not expected 2548 todo, 2549 // output in log 2550 noLines, 2551 noLines) 2552 2553 // load expectations for model: slice_of_all_of.go 2554 flattenRun.AddExpectations("slice_of_all_of.go", []string{ 2555 `type SliceOfAllOf []*SliceOfAllOfItems`, 2556 `func (m SliceOfAllOf) Validate(formats strfmt.Registry) error {`, 2557 ` if err := validate.UniqueItems("", "body", m); err != nil {`, 2558 ` for i := 0; i < len(m); i++ {`, 2559 // do we need Required when item is nullable? 2560 // nullable not required: 2561 ` if swag.IsZero(m[i]) {`, 2562 // nullable required: 2563 ` if m[i] != nil {`, 2564 ` if err := m[i].Validate(formats); err != nil {`, 2565 ` if ve, ok := err.(*errors.Validation); ok {`, 2566 ` return ve.ValidateName(strconv.Itoa(i)`, 2567 ` return errors.CompositeValidationError(res...`, 2568 }, 2569 // not expected 2570 todo, 2571 // output in log 2572 noLines, 2573 noLines) 2574 2575 expandRun.AddExpectations("slice_of_all_of.go", []string{ 2576 `type SliceOfAllOf []*SliceOfAllOfItems0`, 2577 `func (m SliceOfAllOf) Validate(formats strfmt.Registry) error {`, 2578 ` if err := validate.UniqueItems("", "body", m); err != nil {`, 2579 ` for i := 0; i < len(m); i++ {`, 2580 // do we need Required when item is nullable? 2581 // nullable not required: 2582 ` if swag.IsZero(m[i]) {`, 2583 // nullable required: 2584 ` if m[i] != nil {`, 2585 ` if err := m[i].Validate(formats); err != nil {`, 2586 ` if ve, ok := err.(*errors.Validation); ok {`, 2587 ` return ve.ValidateName(strconv.Itoa(i)`, 2588 ` return errors.CompositeValidationError(res...`, 2589 `type SliceOfAllOfItems0 struct {`, 2590 " Prop0 strfmt.UUID `json:\"prop0,omitempty\"`", 2591 ` SliceOfAllOfItems0AllOf1`, 2592 `func (m *SliceOfAllOfItems0) Validate(formats strfmt.Registry) error {`, 2593 ` if err := m.validateProp0(formats); err != nil {`, 2594 ` return errors.CompositeValidationError(res...`, 2595 `func (m *SliceOfAllOfItems0) validateProp0(formats strfmt.Registry) error {`, 2596 ` if swag.IsZero(m.Prop0) {`, 2597 ` if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`, 2598 `type SliceOfAllOfItems0AllOf1 []interface{`, 2599 // empty validation 2600 "func (m SliceOfAllOfItems0AllOf1) Validate(formats strfmt.Registry) error {\n return nil\n}", 2601 }, 2602 // not expected 2603 noLines, 2604 // output in log 2605 noLines, 2606 noLines) 2607 2608 // load expectations for model: object_mix_all_of2_prop2.go 2609 flattenRun.AddExpectations("object_mix_all_of2_prop2.go", []string{ 2610 `type ObjectMixAllOf2Prop2 struct {`, 2611 ` AliasedDate`, 2612 ` AliasedNullableDate`, 2613 `func (m *ObjectMixAllOf2Prop2) Validate(formats strfmt.Registry) error {`, 2614 ` if err := m.AliasedDate.Validate(formats); err != nil {`, 2615 ` if err := m.AliasedNullableDate.Validate(formats); err != nil {`, 2616 ` return errors.CompositeValidationError(res...`, 2617 }, 2618 // not expected 2619 todo, 2620 // output in log 2621 noLines, 2622 noLines) 2623 2624 // load expectations for model: slice_of_all_of_items_all_of0.go 2625 flattenRun.AddExpectations("slice_of_all_of_items_all_of0.go", []string{ 2626 `type SliceOfAllOfItemsAllOf0 struct {`, 2627 " Prop0 strfmt.UUID `json:\"prop0,omitempty\"`", 2628 `func (m *SliceOfAllOfItemsAllOf0) Validate(formats strfmt.Registry) error {`, 2629 ` if err := m.validateProp0(formats); err != nil {`, 2630 ` return errors.CompositeValidationError(res...`, 2631 `func (m *SliceOfAllOfItemsAllOf0) validateProp0(formats strfmt.Registry) error {`, 2632 ` if swag.IsZero(m.Prop0) {`, 2633 ` if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`, 2634 }, 2635 // not expected 2636 todo, 2637 // output in log 2638 noLines, 2639 noLines) 2640 2641 // load expectations for model: slice_of_interfaces.go 2642 flattenRun.AddExpectations("slice_of_interfaces.go", []string{ 2643 `type SliceOfInterfaces []interface{`, 2644 // empty validation 2645 "func (m SliceOfInterfaces) Validate(formats strfmt.Registry) error {\n return nil\n}", 2646 }, 2647 // not expected 2648 todo, 2649 // output in log 2650 noLines, 2651 noLines) 2652 2653 expandRun.AddExpectations("slice_of_interfaces.go", flattenRun.ExpectedFor("SliceOfInterfaces").ExpectedLines, todo, noLines, noLines) 2654 2655 // load expectations for model: slice_of_interfaces_with_validation.go 2656 flattenRun.AddExpectations("slice_of_interfaces_with_validation.go", []string{ 2657 `type SliceOfInterfacesWithValidation []interface{`, 2658 `func (m SliceOfInterfacesWithValidation) Validate(formats strfmt.Registry) error {`, 2659 ` iSliceOfInterfacesWithValidationSize := int64(len(m)`, 2660 ` if err := validate.MaxItems("", "body", iSliceOfInterfacesWithValidationSize, 10); err != nil {`, 2661 ` return errors.CompositeValidationError(res...`, 2662 }, 2663 // not expected 2664 todo, 2665 // output in log 2666 noLines, 2667 noLines) 2668 2669 expandRun.AddExpectations("slice_of_interfaces_with_validation.go", flattenRun.ExpectedFor("SliceOfInterfacesWithValidation").ExpectedLines, todo, noLines, noLines) 2670 2671 // load expectations for model: aliased_nullable_date.go 2672 flattenRun.AddExpectations("aliased_nullable_date.go", []string{ 2673 `type AliasedNullableDate strfmt.Date`, 2674 `func (m AliasedNullableDate) Validate(formats strfmt.Registry) error {`, 2675 ` if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`, 2676 ` return errors.CompositeValidationError(res...`, 2677 }, 2678 // not expected 2679 todo, 2680 // output in log 2681 noLines, 2682 noLines) 2683 2684 expandRun.AddExpectations("aliased_nullable_date.go", flattenRun.ExpectedFor("AliasedNullableDate").ExpectedLines, todo, noLines, noLines) 2685 2686 // load expectations for model: slice_mix.go 2687 flattenRun.AddExpectations("slice_mix.go", []string{ 2688 `type SliceMix struct {`, 2689 ` SliceOfAllOf`, 2690 ` SliceOfInterfaces`, 2691 `func (m *SliceMix) Validate(formats strfmt.Registry) error {`, 2692 ` if err := m.SliceOfAllOf.Validate(formats); err != nil {`, 2693 ` if err := m.SliceOfInterfaces.Validate(formats); err != nil {`, 2694 ` return errors.CompositeValidationError(res...`, 2695 }, 2696 // not expected 2697 todo, 2698 // disable log assertions (dodgy with parallel tests) 2699 // output in log 2700 // warning, 2701 noLines, 2702 noLines) 2703 2704 expandRun.AddExpectations("slice_mix.go", []string{ 2705 `type SliceMix struct {`, 2706 ` SliceMixAllOf0`, 2707 ` SliceMixAllOf1`, 2708 `func (m *SliceMix) Validate(formats strfmt.Registry) error {`, 2709 ` if err := m.SliceMixAllOf0.Validate(formats); err != nil {`, 2710 ` return errors.CompositeValidationError(res...`, 2711 `type SliceMixAllOf0 []*SliceMixAllOf0Items0`, 2712 `func (m SliceMixAllOf0) Validate(formats strfmt.Registry) error {`, 2713 ` if err := validate.UniqueItems("", "body", m); err != nil {`, 2714 ` for i := 0; i < len(m); i++ {`, 2715 // do we need Required when item is nullable? 2716 // nullable not required: 2717 ` if swag.IsZero(m[i]) {`, 2718 // nullable required: 2719 ` if m[i] != nil {`, 2720 ` if err := m[i].Validate(formats); err != nil {`, 2721 ` if ve, ok := err.(*errors.Validation); ok {`, 2722 ` return ve.ValidateName(strconv.Itoa(i)`, 2723 ` return errors.CompositeValidationError(res...`, 2724 `type SliceMixAllOf0Items0 struct {`, 2725 " Prop0 strfmt.UUID `json:\"prop0,omitempty\"`", 2726 ` SliceMixAllOf0Items0AllOf1`, 2727 `func (m *SliceMixAllOf0Items0) Validate(formats strfmt.Registry) error {`, 2728 ` if err := m.validateProp0(formats); err != nil {`, 2729 ` return errors.CompositeValidationError(res...`, 2730 `func (m *SliceMixAllOf0Items0) validateProp0(formats strfmt.Registry) error {`, 2731 ` if swag.IsZero(m.Prop0) {`, 2732 ` if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`, 2733 `type SliceMixAllOf0Items0AllOf1 []interface{`, 2734 `type SliceMixAllOf1 []interface{`, 2735 // empty validation 2736 "func (m SliceMixAllOf0Items0AllOf1) Validate(formats strfmt.Registry) error {\n return nil\n}", 2737 }, 2738 // not expected 2739 noLines, 2740 // output in log 2741 noLines, 2742 noLines) 2743 2744 // load expectations for model: object_mix_all_of1_prop1.go 2745 flattenRun.AddExpectations("object_mix_all_of1_prop1.go", []string{ 2746 `type ObjectMixAllOf1Prop1 struct {`, 2747 ` AliasedDate`, 2748 ` AliasedNullableDate`, 2749 `func (m *ObjectMixAllOf1Prop1) Validate(formats strfmt.Registry) error {`, 2750 ` if err := m.AliasedDate.Validate(formats); err != nil {`, 2751 ` if err := m.AliasedNullableDate.Validate(formats); err != nil {`, 2752 ` return errors.CompositeValidationError(res...`, 2753 }, 2754 // not expected 2755 todo, 2756 // output in log 2757 noLines, 2758 noLines) 2759 2760 // load expectations for model: slice_of_all_of_items.go 2761 flattenRun.AddExpectations("slice_of_all_of_items.go", []string{ 2762 `type SliceOfAllOfItems struct {`, 2763 ` SliceOfAllOfItemsAllOf0`, 2764 ` SliceOfInterfaces`, 2765 `func (m *SliceOfAllOfItems) Validate(formats strfmt.Registry) error {`, 2766 ` if err := m.SliceOfAllOfItemsAllOf0.Validate(formats); err != nil {`, 2767 ` if err := m.SliceOfInterfaces.Validate(formats); err != nil {`, 2768 ` return errors.CompositeValidationError(res...`, 2769 }, 2770 // not expected 2771 todo, 2772 // output in log 2773 noLines, 2774 noLines) 2775 2776 // load expectations for model: all_of_slices_of_aliases_all_of1.go 2777 flattenRun.AddExpectations("all_of_slices_of_aliases_all_of1.go", []string{ 2778 `type AllOfSlicesOfAliasesAllOf1 struct {`, 2779 " Prop2 []*AliasedNullableDate `json:\"prop2\"`", 2780 `func (m *AllOfSlicesOfAliasesAllOf1) Validate(formats strfmt.Registry) error {`, 2781 ` if err := m.validateProp2(formats); err != nil {`, 2782 ` return errors.CompositeValidationError(res...`, 2783 `func (m *AllOfSlicesOfAliasesAllOf1) validateProp2(formats strfmt.Registry) error {`, 2784 ` if swag.IsZero(m.Prop2) {`, 2785 ` iProp2Size := int64(len(m.Prop2)`, 2786 ` if err := validate.MaxItems("prop2", "body", iProp2Size, 20); err != nil {`, 2787 ` for i := 0; i < len(m.Prop2); i++ {`, 2788 // do we need Required when item is nullable? 2789 // nullable not required: 2790 ` if swag.IsZero(m.Prop2[i]) {`, 2791 // nullable required: 2792 ` if m.Prop2[i] != nil {`, 2793 ` if err := m.Prop2[i].Validate(formats); err != nil {`, 2794 ` if ve, ok := err.(*errors.Validation); ok {`, 2795 ` return ve.ValidateName("prop2" + "." + strconv.Itoa(i)`, 2796 }, 2797 // not expected 2798 todo, 2799 // output in log 2800 noLines, 2801 noLines) 2802 2803 } 2804 2805 func initFixtureIsNullable() { 2806 // testing ../fixtures/bugs/1487/fixture-is-nullable.yaml with flatten and expand (--skip-flatten) 2807 2808 /* just an elementary check with the x-nullable tag 2809 */ 2810 f := newModelFixture("../fixtures/bugs/1487/fixture-is-nullable.yaml", "fixture for x-nullable flag") 2811 flattenRun := f.AddRun(false) 2812 expandRun := f.AddRun(true) 2813 2814 // load expectations for model: thing_with_nullable_dates.go 2815 flattenRun.AddExpectations("thing_with_nullable_dates.go", []string{ 2816 `type ThingWithNullableDates struct {`, 2817 " Prop1 strfmt.Date `json:\"prop1,omitempty\"`", 2818 " Prop2 *strfmt.Date `json:\"prop2,omitempty\"`", 2819 `func (m *ThingWithNullableDates) Validate(formats strfmt.Registry) error {`, 2820 ` if err := m.validateProp1(formats); err != nil {`, 2821 ` if err := m.validateProp2(formats); err != nil {`, 2822 ` return errors.CompositeValidationError(res...`, 2823 `func (m *ThingWithNullableDates) validateProp1(formats strfmt.Registry) error {`, 2824 ` if swag.IsZero(m.Prop1) {`, 2825 ` if err := validate.FormatOf("prop1", "body", "date", m.Prop1.String(), formats); err != nil {`, 2826 `func (m *ThingWithNullableDates) validateProp2(formats strfmt.Registry) error {`, 2827 ` if swag.IsZero(m.Prop2) {`, 2828 ` if err := validate.FormatOf("prop2", "body", "date", m.Prop2.String(), formats); err != nil {`, 2829 }, 2830 // not expected 2831 todo, 2832 // output in log 2833 noLines, 2834 noLines) 2835 2836 expandRun.AddExpectations("thing_with_nullable_dates.go", flattenRun.ExpectedFor("ThingWithNullableDates").ExpectedLines, todo, noLines, noLines) 2837 2838 } 2839 2840 func initFixtureItching() { 2841 // testing ../fixtures/bugs/1487/fixture-itching.yaml with flatten and expand (--skip-flatten) 2842 2843 /* 2844 This one regroups a number of itching cases, essentially around additionalProperties. 2845 In particular, we test some things with empty objects (no properties) which have additionalProperties of diverse sorts. 2846 We also added here some funny models using the special types Files, string format: binary and interface{} 2847 These special cases do not correspond to actual API specs: we use them to verify the internal behavior of the general. 2848 */ 2849 f := newModelFixture("../fixtures/bugs/1487/fixture-itching.yaml", "fixture for additionalProperties") 2850 flattenRun := f.AddRun(false) 2851 expandRun := f.AddRun(true) 2852 2853 // load expectations for model: top_level_format_issue_my_alternate_file.go 2854 flattenRun.AddExpectations("top_level_format_issue_my_alternate_file.go", []string{ 2855 `import "io"`, 2856 `type TopLevelFormatIssueMyAlternateFile io.ReadCloser`, 2857 }, 2858 // not expected 2859 todo, 2860 // output in log 2861 noLines, 2862 noLines) 2863 2864 // load expectations for model: not_validated_additional_props.go 2865 flattenRun.AddExpectations("not_validated_additional_props.go", []string{ 2866 `type NotValidatedAdditionalProps struct {`, 2867 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 2868 " NotValidatedAdditionalProps map[string]map[string]map[string]string `json:\"-\"`", 2869 `func (m *NotValidatedAdditionalProps) Validate(formats strfmt.Registry) error {`, 2870 ` if err := m.validateProp2(formats); err != nil {`, 2871 ` return errors.CompositeValidationError(res...`, 2872 `func (m *NotValidatedAdditionalProps) validateProp2(formats strfmt.Registry) error {`, 2873 ` if swag.IsZero(m.Prop2) {`, 2874 ` if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`, 2875 }, 2876 // not expected 2877 todo, 2878 // output in log 2879 noLines, 2880 noLines) 2881 2882 expandRun.AddExpectations("not_validated_additional_props.go", flattenRun.ExpectedFor("NotValidatedAdditionalProps").ExpectedLines, todo, noLines, noLines) 2883 2884 // load expectations for model: aliased_nullable_file.go 2885 flattenRun.AddExpectations("aliased_nullable_file.go", []string{ 2886 `import "io"`, 2887 `type AliasedNullableFile io.ReadCloser`, 2888 }, 2889 // not expected 2890 todo, 2891 // output in log 2892 noLines, 2893 noLines) 2894 2895 expandRun.AddExpectations("aliased_nullable_file.go", flattenRun.ExpectedFor("AliasedNullableFile").ExpectedLines, todo, noLines, noLines) 2896 2897 // load expectations for model: empty_object_with_additional_nullable_primitive.go 2898 flattenRun.AddExpectations("empty_object_with_additional_nullable_primitive.go", []string{ 2899 `type EmptyObjectWithAdditionalNullablePrimitive map[string]*strfmt.Date`, 2900 `func (m EmptyObjectWithAdditionalNullablePrimitive) Validate(formats strfmt.Registry) error {`, 2901 ` for k := range m {`, 2902 ` if swag.IsZero(m[k]) {`, 2903 ` if err := validate.FormatOf(k, "body", "date", m[k].String(), formats); err != nil {`, 2904 ` return errors.CompositeValidationError(res...`, 2905 }, 2906 // not expected 2907 todo, 2908 // output in log 2909 noLines, 2910 noLines) 2911 2912 expandRun.AddExpectations("empty_object_with_additional_nullable_primitive.go", flattenRun.ExpectedFor("EmptyObjectWithAdditionalNullablePrimitive").ExpectedLines, todo, noLines, noLines) 2913 2914 // load expectations for model: empty_object_with_additional_alias.go 2915 flattenRun.AddExpectations("empty_object_with_additional_alias.go", []string{ 2916 `type EmptyObjectWithAdditionalAlias map[string]AliasedThing`, 2917 `func (m EmptyObjectWithAdditionalAlias) Validate(formats strfmt.Registry) error {`, 2918 ` for k := range m {`, 2919 ` if err := validate.Required(k, "body", m[k]); err != nil {`, 2920 ` if val, ok := m[k]; ok {`, 2921 ` if err := val.Validate(formats); err != nil {`, 2922 ` return errors.CompositeValidationError(res...`, 2923 }, 2924 // not expected 2925 todo, 2926 // output in log 2927 noLines, 2928 noLines) 2929 2930 expandRun.AddExpectations("empty_object_with_additional_alias.go", []string{ 2931 `type EmptyObjectWithAdditionalAlias map[string]EmptyObjectWithAdditionalAliasAnon`, 2932 `func (m EmptyObjectWithAdditionalAlias) Validate(formats strfmt.Registry) error {`, 2933 ` for k := range m {`, 2934 ` if swag.IsZero(m[k]) {`, 2935 ` if val, ok := m[k]; ok {`, 2936 ` if err := val.Validate(formats); err != nil {`, 2937 ` return errors.CompositeValidationError(res...`, 2938 `type EmptyObjectWithAdditionalAliasAnon struct {`, 2939 " Prop1 strfmt.Date `json:\"prop1,omitempty\"`", 2940 `func (m *EmptyObjectWithAdditionalAliasAnon) Validate(formats strfmt.Registry) error {`, 2941 ` if err := m.validateProp1(formats); err != nil {`, 2942 ` return errors.CompositeValidationError(res...`, 2943 `func (m *EmptyObjectWithAdditionalAliasAnon) validateProp1(formats strfmt.Registry) error {`, 2944 ` if swag.IsZero(m.Prop1) {`, 2945 ` if err := validate.FormatOf("prop1", "body", "date", m.Prop1.String(), formats); err != nil {`, 2946 }, 2947 // not expected 2948 noLines, 2949 // output in log 2950 noLines, 2951 noLines) 2952 2953 // load expectations for model: nullable_thing.go 2954 flattenRun.AddExpectations("nullable_thing.go", []string{ 2955 `type NullableThing strfmt.Date`, 2956 `func (m NullableThing) Validate(formats strfmt.Registry) error {`, 2957 ` if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`, 2958 ` return errors.CompositeValidationError(res...`, 2959 }, 2960 // not expected 2961 todo, 2962 // output in log 2963 noLines, 2964 noLines) 2965 2966 expandRun.AddExpectations("nullable_thing.go", flattenRun.ExpectedFor("NullableThing").ExpectedLines, todo, noLines, noLines) 2967 2968 // load expectations for model: slice_of_aliased_files.go 2969 flattenRun.AddExpectations("slice_of_aliased_files.go", []string{ 2970 `type SliceOfAliasedFiles []AliasedFile`, 2971 `func (m SliceOfAliasedFiles) Validate(formats strfmt.Registry) error {`, 2972 ` iSliceOfAliasedFilesSize := int64(len(m)`, 2973 ` if err := validate.MinItems("", "body", iSliceOfAliasedFilesSize, 4); err != nil {`, 2974 ` return errors.CompositeValidationError(res...`, 2975 }, 2976 // not expected 2977 todo, 2978 // output in log 2979 noLines, 2980 noLines) 2981 2982 expandRun.AddExpectations("slice_of_aliased_files.go", []string{ 2983 `type SliceOfAliasedFiles []io.ReadCloser`, 2984 `func (m SliceOfAliasedFiles) Validate(formats strfmt.Registry) error {`, 2985 ` iSliceOfAliasedFilesSize := int64(len(m)`, 2986 ` if err := validate.MinItems("", "body", iSliceOfAliasedFilesSize, 4); err != nil {`, 2987 ` return errors.CompositeValidationError(res...`, 2988 }, 2989 // not expected 2990 noLines, 2991 // output in log 2992 noLines, 2993 noLines) 2994 2995 // load expectations for model: empty_object_with_additional_non_nullable_primitive.go 2996 flattenRun.AddExpectations("empty_object_with_additional_non_nullable_primitive.go", []string{ 2997 `type EmptyObjectWithAdditionalNonNullablePrimitive map[string]strfmt.Date`, 2998 `func (m EmptyObjectWithAdditionalNonNullablePrimitive) Validate(formats strfmt.Registry) error {`, 2999 ` for k := range m {`, 3000 // fix undue IsZero call 3001 ` if err := validate.FormatOf(k, "body", "date", m[k].String(), formats); err != nil {`, 3002 ` return errors.CompositeValidationError(res...`, 3003 }, 3004 // not expected 3005 todo, 3006 // output in log 3007 noLines, 3008 noLines) 3009 3010 expandRun.AddExpectations("empty_object_with_additional_non_nullable_primitive.go", flattenRun.ExpectedFor("EmptyObjectWithAdditionalNonNullablePrimitive").ExpectedLines, todo, noLines, noLines) 3011 3012 // load expectations for model: good_old_format_issue.go 3013 flattenRun.AddExpectations("good_old_format_issue.go", []string{ 3014 `type GoodOldFormatIssue struct {`, 3015 " AlternateFile GoodOldFormatIssueAlternateFile `json:\"alternateFile,omitempty\"`", 3016 " AnotherFile io.ReadCloser `json:\"anotherFile,omitempty\"`", 3017 " MyBytes strfmt.Base64 `json:\"myBytes,omitempty\"`", 3018 " MyFile io.ReadCloser `json:\"myFile\"`", 3019 " ThisAliasedFile AliasedFile `json:\"thisAliasedFile,omitempty\"`", 3020 " ThisAlternateAliasedFile AliasedTypeFile `json:\"thisAlternateAliasedFile,omitempty\"`", 3021 " ThisNullableAliasedFile *AliasedNullableFile `json:\"thisNullableAliasedFile,omitempty\"`", 3022 " ThisNullableAlternateAliasedFile *AliasedTypeNullableFile `json:\"thisNullableAlternateAliasedFile,omitempty\"`", 3023 `func (m *GoodOldFormatIssue) Validate(formats strfmt.Registry) error {`, 3024 ` if err := m.validateMyFile(formats); err != nil {`, 3025 ` return errors.CompositeValidationError(res...`, 3026 `func (m *GoodOldFormatIssue) validateMyFile(formats strfmt.Registry) error {`, 3027 ` if err := validate.Required("myFile", "body", io.ReadCloser(m.MyFile)); err != nil {`, 3028 }, 3029 // not expected 3030 []string{ 3031 ` if err := m.validateMyBytes(formats); err != nil {`, 3032 `func (m *GoodOldFormatIssue) validateMyBytes(formats strfmt.Registry) error {`, 3033 ` if err := validate.FormatOf("myBytes", "body", "byte", m.MyBytes.String(), formats); err != nil {`, 3034 }, 3035 // output in log 3036 noLines, 3037 noLines) 3038 3039 expandRun.AddExpectations("good_old_format_issue.go", []string{ 3040 `type GoodOldFormatIssue struct {`, 3041 " AlternateFile io.ReadCloser `json:\"alternateFile,omitempty\"`", 3042 " AnotherFile io.ReadCloser `json:\"anotherFile,omitempty\"`", 3043 " MyBytes strfmt.Base64 `json:\"myBytes,omitempty\"`", 3044 " MyFile io.ReadCloser `json:\"myFile\"`", 3045 " ThisAliasedFile io.ReadCloser `json:\"thisAliasedFile,omitempty\"`", 3046 " ThisAlternateAliasedFile io.ReadCloser `json:\"thisAlternateAliasedFile,omitempty\"`", 3047 " ThisNullableAliasedFile io.ReadCloser `json:\"thisNullableAliasedFile,omitempty\"`", 3048 " ThisNullableAlternateAliasedFile io.ReadCloser `json:\"thisNullableAlternateAliasedFile,omitempty\"`", 3049 `func (m *GoodOldFormatIssue) Validate(formats strfmt.Registry) error {`, 3050 ` if err := m.validateMyFile(formats); err != nil {`, 3051 ` return errors.CompositeValidationError(res...`, 3052 `func (m *GoodOldFormatIssue) validateMyFile(formats strfmt.Registry) error {`, 3053 ` if err := validate.Required("myFile", "body", io.ReadCloser(m.MyFile)); err != nil {`, 3054 }, 3055 // not expected 3056 []string{ 3057 ` if err := m.validateMyBytes(formats); err != nil {`, 3058 `func (m *GoodOldFormatIssue) validateMyBytes(formats strfmt.Registry) error {`, 3059 ` if err := validate.FormatOf("myBytes", "body", "byte", m.MyBytes.String(), formats); err != nil {`, 3060 }, 3061 // output in log 3062 noLines, 3063 noLines) 3064 3065 // load expectations for model: empty_object_with_additional_slice_additional_properties_items.go 3066 flattenRun.AddExpectations("empty_object_with_additional_slice_additional_properties_items.go", []string{ 3067 `type EmptyObjectWithAdditionalSliceAdditionalPropertiesItems struct {`, 3068 " DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`", 3069 `func (m *EmptyObjectWithAdditionalSliceAdditionalPropertiesItems) Validate(formats strfmt.Registry) error {`, 3070 ` if err := m.validateDummyProp1(formats); err != nil {`, 3071 ` return errors.CompositeValidationError(res...`, 3072 `func (m *EmptyObjectWithAdditionalSliceAdditionalPropertiesItems) validateDummyProp1(formats strfmt.Registry) error {`, 3073 ` if swag.IsZero(m.DummyProp1) {`, 3074 ` if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`, 3075 }, 3076 // not expected 3077 todo, 3078 // output in log 3079 noLines, 3080 noLines) 3081 3082 // load expectations for model: not_validated_additional_props_slice.go 3083 flattenRun.AddExpectations("not_validated_additional_props_slice.go", []string{ 3084 `type NotValidatedAdditionalPropsSlice struct {`, 3085 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 3086 " NotValidatedAdditionalPropsSlice map[string][]map[string]map[string]string `json:\"-\"`", 3087 `func (m *NotValidatedAdditionalPropsSlice) Validate(formats strfmt.Registry) error {`, 3088 ` if err := m.validateProp2(formats); err != nil {`, 3089 ` return errors.CompositeValidationError(res...`, 3090 `func (m *NotValidatedAdditionalPropsSlice) validateProp2(formats strfmt.Registry) error {`, 3091 ` if swag.IsZero(m.Prop2) {`, 3092 ` if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`, 3093 }, 3094 // not expected 3095 todo, 3096 // output in log 3097 noLines, 3098 noLines) 3099 3100 // load expectations for model: aliased_type_file.go 3101 flattenRun.AddExpectations("aliased_type_file.go", []string{ 3102 `import "io"`, 3103 `type AliasedTypeFile io.ReadCloser`, 3104 }, 3105 // not expected 3106 todo, 3107 // output in log 3108 noLines, 3109 noLines) 3110 3111 expandRun.AddExpectations("aliased_type_file.go", flattenRun.ExpectedFor("AliasedTypeFile").ExpectedLines, todo, noLines, noLines) 3112 3113 // load expectations for model: object_with_empty_object.go 3114 flattenRun.AddExpectations("object_with_empty_object.go", []string{ 3115 `type ObjectWithEmptyObject struct {`, 3116 " EmptyObj EmptyObjectWithAdditionalAlias `json:\"emptyObj,omitempty\"`", 3117 " NonEmptyObj *NullableThing `json:\"nonEmptyObj,omitempty\"`", 3118 `func (m *ObjectWithEmptyObject) Validate(formats strfmt.Registry) error {`, 3119 ` if err := m.validateEmptyObj(formats); err != nil {`, 3120 ` if err := m.validateNonEmptyObj(formats); err != nil {`, 3121 ` return errors.CompositeValidationError(res...`, 3122 `func (m *ObjectWithEmptyObject) validateEmptyObj(formats strfmt.Registry) error {`, 3123 ` if swag.IsZero(m.EmptyObj) {`, 3124 ` if err := m.EmptyObj.Validate(formats); err != nil {`, 3125 ` if ve, ok := err.(*errors.Validation); ok {`, 3126 ` return ve.ValidateName("emptyObj"`, 3127 `func (m *ObjectWithEmptyObject) validateNonEmptyObj(formats strfmt.Registry) error {`, 3128 ` if swag.IsZero(m.NonEmptyObj) {`, 3129 ` if m.NonEmptyObj != nil {`, 3130 ` if err := m.NonEmptyObj.Validate(formats); err != nil {`, 3131 ` if ve, ok := err.(*errors.Validation); ok {`, 3132 ` return ve.ValidateName("nonEmptyObj"`, 3133 }, 3134 // not expected 3135 todo, 3136 // output in log 3137 noLines, 3138 noLines) 3139 3140 expandRun.AddExpectations("object_with_empty_object.go", []string{ 3141 `type ObjectWithEmptyObject struct {`, 3142 " EmptyObj map[string]ObjectWithEmptyObjectEmptyObjAnon `json:\"emptyObj,omitempty\"`", 3143 " NonEmptyObj *strfmt.Date `json:\"nonEmptyObj,omitempty\"`", 3144 `func (m *ObjectWithEmptyObject) Validate(formats strfmt.Registry) error {`, 3145 ` if err := m.validateEmptyObj(formats); err != nil {`, 3146 ` if err := m.validateNonEmptyObj(formats); err != nil {`, 3147 ` return errors.CompositeValidationError(res...`, 3148 `func (m *ObjectWithEmptyObject) validateEmptyObj(formats strfmt.Registry) error {`, 3149 ` if swag.IsZero(m.EmptyObj) {`, 3150 ` for k := range m.EmptyObj {`, 3151 ` if swag.IsZero(m.EmptyObj[k]) {`, 3152 ` if val, ok := m.EmptyObj[k]; ok {`, 3153 ` if err := val.Validate(formats); err != nil {`, 3154 `func (m *ObjectWithEmptyObject) validateNonEmptyObj(formats strfmt.Registry) error {`, 3155 ` if swag.IsZero(m.NonEmptyObj) {`, 3156 ` if err := validate.FormatOf("nonEmptyObj", "body", "date", m.NonEmptyObj.String(), formats); err != nil {`, 3157 `type ObjectWithEmptyObjectEmptyObjAnon struct {`, 3158 " Prop1 strfmt.Date `json:\"prop1,omitempty\"`", 3159 `func (m *ObjectWithEmptyObjectEmptyObjAnon) Validate(formats strfmt.Registry) error {`, 3160 ` if err := m.validateProp1(formats); err != nil {`, 3161 ` return errors.CompositeValidationError(res...`, 3162 `func (m *ObjectWithEmptyObjectEmptyObjAnon) validateProp1(formats strfmt.Registry) error {`, 3163 ` if swag.IsZero(m.Prop1) {`, 3164 ` if err := validate.FormatOf("prop1", "body", "date", m.Prop1.String(), formats); err != nil {`, 3165 }, 3166 // not expected 3167 noLines, 3168 // output in log 3169 noLines, 3170 noLines) 3171 3172 // load expectations for model: aliased_file.go 3173 flattenRun.AddExpectations("aliased_file.go", []string{ 3174 `import "io"`, 3175 `type AliasedFile io.ReadCloser`, 3176 }, 3177 // not expected 3178 todo, 3179 // output in log 3180 noLines, 3181 noLines) 3182 3183 expandRun.AddExpectations("aliased_file.go", flattenRun.ExpectedFor("AliasedFile").ExpectedLines, todo, noLines, noLines) 3184 3185 // load expectations for model: empty_object_with_additional_slice.go 3186 flattenRun.AddExpectations("empty_object_with_additional_slice.go", []string{ 3187 `type EmptyObjectWithAdditionalSlice map[string][]EmptyObjectWithAdditionalSliceAdditionalPropertiesItems`, 3188 `func (m EmptyObjectWithAdditionalSlice) Validate(formats strfmt.Registry) error {`, 3189 // fixed undue Required on this aliased type 3190 ` for k := range m {`, 3191 ` if err := validate.Required(k, "body", m[k]); err != nil {`, 3192 ` for i := 0; i < len(m[k]); i++ {`, 3193 ` if err := m[k][i].Validate(formats); err != nil {`, 3194 ` if ve, ok := err.(*errors.Validation); ok {`, 3195 ` return ve.ValidateName(k + "." + strconv.Itoa(i)`, 3196 ` return errors.CompositeValidationError(res...`, 3197 }, 3198 // not expected 3199 todo, 3200 // output in log 3201 noLines, 3202 noLines) 3203 3204 expandRun.AddExpectations("empty_object_with_additional_slice.go", []string{ 3205 `type EmptyObjectWithAdditionalSlice map[string][]EmptyObjectWithAdditionalSliceItems0`, 3206 `func (m EmptyObjectWithAdditionalSlice) Validate(formats strfmt.Registry) error {`, 3207 // fixed undue Required on this aliased type 3208 ` for k := range m {`, 3209 ` if err := validate.Required(k, "body", m[k]); err != nil {`, 3210 ` for i := 0; i < len(m[k]); i++ {`, 3211 ` if err := m[k][i].Validate(formats); err != nil {`, 3212 ` if ve, ok := err.(*errors.Validation); ok {`, 3213 ` return ve.ValidateName(k + "." + strconv.Itoa(i)`, 3214 ` return errors.CompositeValidationError(res...`, 3215 `type EmptyObjectWithAdditionalSliceItems0 struct {`, 3216 " DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`", 3217 `func (m *EmptyObjectWithAdditionalSliceItems0) Validate(formats strfmt.Registry) error {`, 3218 ` if err := m.validateDummyProp1(formats); err != nil {`, 3219 ` return errors.CompositeValidationError(res...`, 3220 `func (m *EmptyObjectWithAdditionalSliceItems0) validateDummyProp1(formats strfmt.Registry) error {`, 3221 ` if swag.IsZero(m.DummyProp1) {`, 3222 ` if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`, 3223 }, 3224 // not expected 3225 noLines, 3226 // output in log 3227 noLines, 3228 noLines) 3229 3230 // load expectations for model: additional_aliased_file.go 3231 flattenRun.AddExpectations("additional_aliased_file.go", []string{ 3232 `type AdditionalAliasedFile interface{`, 3233 }, 3234 // not expected 3235 todo, 3236 // output in log 3237 noLines, 3238 noLines) 3239 3240 expandRun.AddExpectations("additional_aliased_file.go", flattenRun.ExpectedFor("AdditionalAliasedFile").ExpectedLines, todo, noLines, noLines) 3241 3242 // load expectations for model: good_old_format_issue_alternate_file.go 3243 flattenRun.AddExpectations("good_old_format_issue_alternate_file.go", []string{ 3244 `import "io"`, 3245 `type GoodOldFormatIssueAlternateFile io.ReadCloser`, 3246 }, 3247 // not expected 3248 todo, 3249 // output in log 3250 noLines, 3251 noLines) 3252 3253 // load expectations for model: empty_object_with_additional_nested_slice_additional_properties_items_items_items.go 3254 flattenRun.AddExpectations("empty_object_with_additional_nested_slice_additional_properties_items_items_items.go", []string{ 3255 `type EmptyObjectWithAdditionalNestedSliceAdditionalPropertiesItemsItemsItems struct {`, 3256 " DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`", 3257 `func (m *EmptyObjectWithAdditionalNestedSliceAdditionalPropertiesItemsItemsItems) Validate(formats strfmt.Registry) error {`, 3258 ` if err := m.validateDummyProp1(formats); err != nil {`, 3259 ` return errors.CompositeValidationError(res...`, 3260 `func (m *EmptyObjectWithAdditionalNestedSliceAdditionalPropertiesItemsItemsItems) validateDummyProp1(formats strfmt.Registry) error {`, 3261 ` if swag.IsZero(m.DummyProp1) {`, 3262 ` if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`, 3263 }, 3264 // not expected 3265 todo, 3266 // output in log 3267 noLines, 3268 noLines) 3269 3270 // load expectations for model: aliased_thing.go 3271 flattenRun.AddExpectations("aliased_thing.go", []string{ 3272 `type AliasedThing struct {`, 3273 " Prop1 strfmt.Date `json:\"prop1,omitempty\"`", 3274 `func (m *AliasedThing) Validate(formats strfmt.Registry) error {`, 3275 ` if err := m.validateProp1(formats); err != nil {`, 3276 ` return errors.CompositeValidationError(res...`, 3277 `func (m *AliasedThing) validateProp1(formats strfmt.Registry) error {`, 3278 ` if swag.IsZero(m.Prop1) {`, 3279 ` if err := validate.FormatOf("prop1", "body", "date", m.Prop1.String(), formats); err != nil {`, 3280 }, 3281 // not expected 3282 todo, 3283 // output in log 3284 noLines, 3285 noLines) 3286 3287 expandRun.AddExpectations("aliased_thing.go", flattenRun.ExpectedFor("AliasedThing").ExpectedLines, todo, noLines, noLines) 3288 3289 // load expectations for model: additional_file.go 3290 flattenRun.AddExpectations("additional_file.go", []string{ 3291 `type AdditionalFile struct {`, 3292 " DirName string `json:\"dirName,omitempty\"`", 3293 " AdditionalFile map[string]io.ReadCloser `json:\"-\"`", 3294 // empty validation 3295 "func (m *AdditionalFile) Validate(formats strfmt.Registry) error {\n return nil\n}", 3296 }, 3297 // not expected 3298 todo, 3299 // output in log 3300 noLines, 3301 noLines) 3302 3303 expandRun.AddExpectations("additional_file.go", flattenRun.ExpectedFor("AdditionalFile").ExpectedLines, todo, noLines, noLines) 3304 3305 // load expectations for model: aliased_type_nullable_file.go 3306 flattenRun.AddExpectations("aliased_type_nullable_file.go", []string{ 3307 `import "io"`, 3308 `type AliasedTypeNullableFile io.ReadCloser`, 3309 }, 3310 // not expected 3311 validatable, 3312 // output in log 3313 noLines, 3314 noLines) 3315 3316 expandRun.AddExpectations("aliased_type_nullable_file.go", flattenRun.ExpectedFor("AliasedTypeNullableFile").ExpectedLines, validatable, noLines, noLines) 3317 3318 // load expectations for model: top_level_format_issue.go 3319 flattenRun.AddExpectations("top_level_format_issue.go", []string{ 3320 `type TopLevelFormatIssue struct {`, 3321 " MyAlternateFile TopLevelFormatIssueMyAlternateFile `json:\"myAlternateFile,omitempty\"`", 3322 " MyFile io.ReadCloser `json:\"myFile,omitempty\"`", 3323 // empty validation 3324 "func (m *TopLevelFormatIssue) Validate(formats strfmt.Registry) error {\n return nil\n}", 3325 }, 3326 // not expected 3327 todo, 3328 // output in log 3329 noLines, 3330 noLines) 3331 3332 expandRun.AddExpectations("top_level_format_issue.go", []string{ 3333 `type TopLevelFormatIssue struct {`, 3334 " MyAlternateFile io.ReadCloser `json:\"myAlternateFile,omitempty\"`", 3335 " MyFile io.ReadCloser `json:\"myFile,omitempty\"`", 3336 // empty validation 3337 "func (m *TopLevelFormatIssue) Validate(formats strfmt.Registry) error {\n return nil\n}", 3338 }, 3339 // not expected 3340 noLines, 3341 // output in log 3342 noLines, 3343 noLines) 3344 3345 // load expectations for model: enums_with_additional_props.go 3346 flattenRun.AddExpectations("enums_with_additional_props.go", []string{ 3347 `type EnumsWithAdditionalProps map[string]interface{`, 3348 `var enumsWithAdditionalPropsEnum []interface{`, 3349 ` var res []EnumsWithAdditionalProps`, 3350 " if err := json.Unmarshal([]byte(`[\"{ \\\"a\\\": 1, \\\"b\\\": 2 }\",\"{ \\\"a\\\": 3, \\\"b\\\": 4 }\"]`), &res); err != nil {", 3351 ` for _, v := range res {`, 3352 ` enumsWithAdditionalPropsEnum = append(enumsWithAdditionalPropsEnum, v`, 3353 `func (m *EnumsWithAdditionalProps) validateEnumsWithAdditionalPropsEnum(path, location string, value EnumsWithAdditionalProps) error {`, 3354 ` if err := validate.EnumCase(path, location, value, enumsWithAdditionalPropsEnum, true); err != nil {`, 3355 `var enumsWithAdditionalPropsValueEnum []interface{`, 3356 ` var res []interface{`, 3357 " if err := json.Unmarshal([]byte(`[\"{ \\\"b\\\": 2 }\",\"{ \\\"b\\\": 4 }\"]`), &res); err != nil {", 3358 ` for _, v := range res {`, 3359 ` enumsWithAdditionalPropsValueEnum = append(enumsWithAdditionalPropsValueEnum, v`, 3360 `func (m *EnumsWithAdditionalProps) validateEnumsWithAdditionalPropsValueEnum(path, location string, value interface{}) error {`, 3361 ` if err := validate.EnumCase(path, location, value, enumsWithAdditionalPropsValueEnum, true); err != nil {`, 3362 `func (m EnumsWithAdditionalProps) Validate(formats strfmt.Registry) error {`, 3363 ` for k := range m {`, 3364 ` if err := m.validateEnumsWithAdditionalPropsValueEnum(k, "body", m[k]); err != nil {`, 3365 ` if err := m.validateEnumsWithAdditionalPropsEnum("", "body", m); err != nil {`, 3366 ` return errors.CompositeValidationError(res...`, 3367 }, 3368 // not expected 3369 todo, 3370 // output in log 3371 noLines, 3372 noLines) 3373 3374 expandRun.AddExpectations("enums_with_additional_props.go", flattenRun.ExpectedFor("EnumsWithAdditionalProps").ExpectedLines, todo, noLines, noLines) 3375 3376 // load expectations for model: empty_object_with_additional_nested_slice.go 3377 flattenRun.AddExpectations("empty_object_with_additional_nested_slice.go", []string{ 3378 `type EmptyObjectWithAdditionalNestedSlice map[string][][][]EmptyObjectWithAdditionalNestedSliceAdditionalPropertiesItemsItemsItems`, 3379 `func (m EmptyObjectWithAdditionalNestedSlice) Validate(formats strfmt.Registry) error {`, 3380 ` for k := range m {`, 3381 ` if err := validate.Required(k, "body", m[k]); err != nil {`, 3382 ` for i := 0; i < len(m[k]); i++ {`, 3383 ` for ii := 0; ii < len(m[k][i]); ii++ {`, 3384 ` for iii := 0; iii < len(m[k][i][ii]); iii++ {`, 3385 ` if err := m[k][i][ii][iii].Validate(formats); err != nil {`, 3386 ` if ve, ok := err.(*errors.Validation); ok {`, 3387 ` return ve.ValidateName(k + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii) + "." + strconv.Itoa(iii)`, 3388 ` return errors.CompositeValidationError(res...`, 3389 }, 3390 // not expected 3391 todo, 3392 // output in log 3393 noLines, 3394 noLines) 3395 3396 expandRun.AddExpectations("empty_object_with_additional_nested_slice.go", []string{ 3397 `type EmptyObjectWithAdditionalNestedSlice map[string][][][]EmptyObjectWithAdditionalNestedSliceItems0`, 3398 `func (m EmptyObjectWithAdditionalNestedSlice) Validate(formats strfmt.Registry) error {`, 3399 ` for k := range m {`, 3400 ` if err := validate.Required(k, "body", m[k]); err != nil {`, 3401 ` for i := 0; i < len(m[k]); i++ {`, 3402 ` for ii := 0; ii < len(m[k][i]); ii++ {`, 3403 ` for iii := 0; iii < len(m[k][i][ii]); iii++ {`, 3404 ` if err := m[k][i][ii][iii].Validate(formats); err != nil {`, 3405 ` if ve, ok := err.(*errors.Validation); ok {`, 3406 ` return ve.ValidateName(k + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii) + "." + strconv.Itoa(iii)`, 3407 ` return errors.CompositeValidationError(res...`, 3408 `type EmptyObjectWithAdditionalNestedSliceItems0 struct {`, 3409 " DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`", 3410 `func (m *EmptyObjectWithAdditionalNestedSliceItems0) Validate(formats strfmt.Registry) error {`, 3411 ` if err := m.validateDummyProp1(formats); err != nil {`, 3412 ` return errors.CompositeValidationError(res...`, 3413 `func (m *EmptyObjectWithAdditionalNestedSliceItems0) validateDummyProp1(formats strfmt.Registry) error {`, 3414 ` if swag.IsZero(m.DummyProp1) {`, 3415 ` if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`, 3416 }, 3417 // not expected 3418 noLines, 3419 // output in log 3420 noLines, 3421 noLines) 3422 3423 // load expectations for model: empty_object_with_additional_nullable.go 3424 // fixed nullability of aliased type 3425 flattenRun.AddExpectations("empty_object_with_additional_nullable.go", []string{ 3426 `type EmptyObjectWithAdditionalNullable map[string]*NullableThing`, 3427 `func (m EmptyObjectWithAdditionalNullable) Validate(formats strfmt.Registry) error {`, 3428 ` for k := range m {`, 3429 ` if swag.IsZero(m[k]) {`, 3430 ` if val, ok := m[k]; ok {`, 3431 ` if err := val.Validate(formats); err != nil {`, 3432 ` return errors.CompositeValidationError(res...`, 3433 }, 3434 // not expected 3435 todo, 3436 // output in log 3437 noLines, 3438 noLines) 3439 3440 expandRun.AddExpectations("empty_object_with_additional_nullable.go", []string{ 3441 `type EmptyObjectWithAdditionalNullable map[string]*strfmt.Date`, 3442 `func (m EmptyObjectWithAdditionalNullable) Validate(formats strfmt.Registry) error {`, 3443 ` for k := range m {`, 3444 ` if swag.IsZero(m[k]) {`, 3445 ` if err := validate.FormatOf(k, "body", "date", m[k].String(), formats); err != nil {`, 3446 ` return errors.CompositeValidationError(res...`, 3447 }, 3448 // not expected 3449 noLines, 3450 // output in log 3451 noLines, 3452 noLines) 3453 3454 // load expectations for model: not_validated_at_all.go 3455 flattenRun.AddExpectations("not_validated_at_all.go", []string{ 3456 `type NotValidatedAtAll struct {`, 3457 " Prop2 string `json:\"prop2,omitempty\"`", 3458 " NotValidatedAtAll map[string][]map[string]map[string]string `json:\"-\"`", 3459 // empty validation 3460 "func (m *NotValidatedAtAll) Validate(formats strfmt.Registry) error {\n return nil\n}", 3461 }, 3462 // not expected 3463 todo, 3464 // output in log 3465 noLines, 3466 noLines) 3467 3468 expandRun.AddExpectations("not_validated_at_all.go", flattenRun.ExpectedFor("NotValidatedAtAll").ExpectedLines, todo, noLines, noLines) 3469 } 3470 3471 func initFixtureAdditionalProps() { 3472 // testing ../fixtures/bugs/1487/fixture-additionalProps.yaml with flatten and expand (--skip-flatten) 3473 3474 /* 3475 various patterns of additionalProperties 3476 */ 3477 f := newModelFixture("../fixtures/bugs/1487/fixture-additionalProps.yaml", "fixture for additionalProperties") 3478 flattenRun := f.AddRun(false) 3479 expandRun := f.AddRun(true) 3480 3481 // load expectations for model: additional_object_with_formated_thing.go 3482 flattenRun.AddExpectations("additional_object_with_formated_thing.go", []string{ 3483 `type AdditionalObjectWithFormatedThing struct {`, 3484 " Blob *int64 `json:\"blob\"`", 3485 " AdditionalObjectWithFormatedThing map[string]strfmt.Date `json:\"-\"`", 3486 `func (m *AdditionalObjectWithFormatedThing) Validate(formats strfmt.Registry) error {`, 3487 ` if err := m.validateBlob(formats); err != nil {`, 3488 ` for k := range m.AdditionalObjectWithFormatedThing {`, 3489 // removed undue IZero call 3490 ` if err := validate.FormatOf(k, "body", "date", m.AdditionalObjectWithFormatedThing[k].String(), formats); err != nil {`, 3491 ` return errors.CompositeValidationError(res...`, 3492 `func (m *AdditionalObjectWithFormatedThing) validateBlob(formats strfmt.Registry) error {`, 3493 ` if err := validate.Required("blob", "body", m.Blob); err != nil {`, 3494 ` if err := validate.MinimumInt("blob", "body", *m.Blob, 1, false); err != nil {`, 3495 }, 3496 // not expected 3497 todo, 3498 // output in log 3499 noLines, 3500 noLines) 3501 3502 expandRun.AddExpectations("additional_object_with_formated_thing.go", flattenRun.ExpectedFor("AdditionalObjectWithFormatedThing").ExpectedLines, todo, noLines, noLines) 3503 3504 // load expectations for model: aliased_date.go 3505 flattenRun.AddExpectations("aliased_date.go", []string{ 3506 `type AliasedDate strfmt.Date`, 3507 `func (m AliasedDate) Validate(formats strfmt.Registry) error {`, 3508 ` if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`, 3509 ` return errors.CompositeValidationError(res...`, 3510 }, 3511 // not expected 3512 todo, 3513 // output in log 3514 noLines, 3515 noLines) 3516 3517 expandRun.AddExpectations("aliased_date.go", flattenRun.ExpectedFor("AliasedDate").ExpectedLines, todo, noLines, noLines) 3518 3519 // load expectations for model: additional_array_of_refed_thing.go 3520 flattenRun.AddExpectations("additional_array_of_refed_thing.go", []string{ 3521 `type AdditionalArrayOfRefedThing struct {`, 3522 " ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`", 3523 " AdditionalArrayOfRefedThing map[string][]AliasedDate `json:\"-\"`", 3524 `func (m *AdditionalArrayOfRefedThing) Validate(formats strfmt.Registry) error {`, 3525 ` if err := m.validateThisOneNotRequired(formats); err != nil {`, 3526 ` for k := range m.AdditionalArrayOfRefedThing {`, 3527 // removed undue IsZero call 3528 ` if err := validate.UniqueItems(k, "body", m.AdditionalArrayOfRefedThing[k]); err != nil {`, 3529 ` for i := 0; i < len(m.AdditionalArrayOfRefedThing[k]); i++ {`, 3530 ` if err := m.AdditionalArrayOfRefedThing[k][i].Validate(formats); err != nil {`, 3531 ` if ve, ok := err.(*errors.Validation); ok {`, 3532 ` return ve.ValidateName(k + "." + strconv.Itoa(i)`, 3533 ` return errors.CompositeValidationError(res...`, 3534 `func (m *AdditionalArrayOfRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`, 3535 ` if swag.IsZero(m.ThisOneNotRequired) {`, 3536 ` if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`, 3537 }, 3538 // not expected 3539 todo, 3540 // output in log 3541 noLines, 3542 noLines) 3543 3544 expandRun.AddExpectations("additional_array_of_refed_thing.go", []string{ 3545 `type AdditionalArrayOfRefedThing struct {`, 3546 " ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`", 3547 " AdditionalArrayOfRefedThing map[string][]strfmt.Date `json:\"-\"`", 3548 `func (m *AdditionalArrayOfRefedThing) Validate(formats strfmt.Registry) error {`, 3549 ` if err := m.validateThisOneNotRequired(formats); err != nil {`, 3550 ` for k := range m.AdditionalArrayOfRefedThing {`, 3551 // removed undue IsZero() call 3552 ` if err := validate.UniqueItems(k, "body", m.AdditionalArrayOfRefedThing[k]); err != nil {`, 3553 ` for i := 0; i < len(m.AdditionalArrayOfRefedThing[k]); i++ {`, 3554 ` if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "date", m.AdditionalArrayOfRefedThing[k][i].String(), formats); err != nil {`, 3555 ` return errors.CompositeValidationError(res...`, 3556 `func (m *AdditionalArrayOfRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`, 3557 ` if swag.IsZero(m.ThisOneNotRequired) {`, 3558 ` if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`, 3559 }, 3560 // not expected 3561 todo, 3562 // output in log 3563 noLines, 3564 noLines) 3565 3566 // load expectations for model: additional_object_with_nullable_thing.go 3567 flattenRun.AddExpectations("additional_object_with_nullable_thing.go", []string{ 3568 `type AdditionalObjectWithNullableThing struct {`, 3569 " Blob int64 `json:\"blob,omitempty\"`", 3570 " AdditionalObjectWithNullableThing map[string]*AliasedNullableDate `json:\"-\"`", 3571 `func (m *AdditionalObjectWithNullableThing) Validate(formats strfmt.Registry) error {`, 3572 ` if err := m.validateBlob(formats); err != nil {`, 3573 ` for k := range m.AdditionalObjectWithNullableThing {`, 3574 ` if swag.IsZero(m.AdditionalObjectWithNullableThing[k]) {`, 3575 ` if val, ok := m.AdditionalObjectWithNullableThing[k]; ok {`, 3576 ` if val != nil {`, 3577 ` if err := val.Validate(formats); err != nil {`, 3578 ` return errors.CompositeValidationError(res...`, 3579 `func (m *AdditionalObjectWithNullableThing) validateBlob(formats strfmt.Registry) error {`, 3580 ` if swag.IsZero(m.Blob) {`, 3581 ` if err := validate.MinimumInt("blob", "body", m.Blob, 1, false); err != nil {`, 3582 }, 3583 // not expected 3584 todo, 3585 // output in log 3586 noLines, 3587 noLines) 3588 3589 expandRun.AddExpectations("additional_object_with_nullable_thing.go", []string{ 3590 `type AdditionalObjectWithNullableThing struct {`, 3591 " Blob int64 `json:\"blob,omitempty\"`", 3592 " AdditionalObjectWithNullableThing map[string]*strfmt.Date `json:\"-\"`", 3593 `func (m *AdditionalObjectWithNullableThing) Validate(formats strfmt.Registry) error {`, 3594 ` if err := m.validateBlob(formats); err != nil {`, 3595 ` for k := range m.AdditionalObjectWithNullableThing {`, 3596 ` if swag.IsZero(m.AdditionalObjectWithNullableThing[k]) {`, 3597 ` if err := validate.FormatOf(k, "body", "date", m.AdditionalObjectWithNullableThing[k].String(), formats); err != nil {`, 3598 ` return errors.CompositeValidationError(res...`, 3599 `func (m *AdditionalObjectWithNullableThing) validateBlob(formats strfmt.Registry) error {`, 3600 ` if swag.IsZero(m.Blob) {`, 3601 ` if err := validate.MinimumInt("blob", "body", m.Blob, 1, false); err != nil {`, 3602 }, 3603 // not expected 3604 todo, 3605 // output in log 3606 noLines, 3607 noLines) 3608 3609 // load expectations for model: additional_things.go 3610 flattenRun.AddExpectations("additional_things.go", []string{ 3611 `type AdditionalThings struct {`, 3612 " Origin *string `json:\"origin\"`", 3613 " Status string `json:\"status,omitempty\"`", 3614 " AdditionalThings map[string]string `json:\"-\"`", 3615 `var additionalThingsValueEnum []interface{`, 3616 ` var res []string`, 3617 " if err := json.Unmarshal([]byte(`[\"bookshop\",\"amazon\",\"library\"]`), &res); err != nil {", 3618 ` for _, v := range res {`, 3619 ` additionalThingsValueEnum = append(additionalThingsValueEnum, v`, 3620 `func (m *AdditionalThings) validateAdditionalThingsValueEnum(path, location string, value string) error {`, 3621 ` if err := validate.EnumCase(path, location, value, additionalThingsValueEnum, true); err != nil {`, 3622 `func (m *AdditionalThings) Validate(formats strfmt.Registry) error {`, 3623 ` if err := m.validateOrigin(formats); err != nil {`, 3624 ` if err := m.validateStatus(formats); err != nil {`, 3625 ` for k := range m.AdditionalThings {`, 3626 // removed undue IsZero call 3627 ` if err := m.validateAdditionalThingsValueEnum(k, "body", m.AdditionalThings[k]); err != nil {`, 3628 ` return errors.CompositeValidationError(res...`, 3629 `var additionalThingsTypeOriginPropEnum []interface{`, 3630 ` var res []string`, 3631 " if err := json.Unmarshal([]byte(`[\"print\",\"e-book\",\"collection\",\"museum\"]`), &res); err != nil {", 3632 ` for _, v := range res {`, 3633 ` additionalThingsTypeOriginPropEnum = append(additionalThingsTypeOriginPropEnum, v`, 3634 ` AdditionalThingsOriginPrint string = "print"`, 3635 ` AdditionalThingsOriginEDashBook string = "e-book"`, 3636 ` AdditionalThingsOriginCollection string = "collection"`, 3637 ` AdditionalThingsOriginMuseum string = "museum"`, 3638 `func (m *AdditionalThings) validateOriginEnum(path, location string, value string) error {`, 3639 ` if err := validate.EnumCase(path, location, value, additionalThingsTypeOriginPropEnum, true); err != nil {`, 3640 `func (m *AdditionalThings) validateOrigin(formats strfmt.Registry) error {`, 3641 ` if err := validate.Required("origin", "body", m.Origin); err != nil {`, 3642 ` if err := m.validateOriginEnum("origin", "body", *m.Origin); err != nil {`, 3643 `var additionalThingsTypeStatusPropEnum []interface{`, 3644 ` var res []string`, 3645 " if err := json.Unmarshal([]byte(`[\"OK\",\"KO\"]`), &res); err != nil {", 3646 ` for _, v := range res {`, 3647 ` additionalThingsTypeStatusPropEnum = append(additionalThingsTypeStatusPropEnum, v`, 3648 ` AdditionalThingsStatusOK string = "OK"`, 3649 ` AdditionalThingsStatusKO string = "KO"`, 3650 `func (m *AdditionalThings) validateStatusEnum(path, location string, value string) error {`, 3651 ` if err := validate.EnumCase(path, location, value, additionalThingsTypeStatusPropEnum, true); err != nil {`, 3652 `func (m *AdditionalThings) validateStatus(formats strfmt.Registry) error {`, 3653 ` if swag.IsZero(m.Status) {`, 3654 ` if err := m.validateStatusEnum("status", "body", m.Status); err != nil {`, 3655 }, 3656 // not expected 3657 todo, 3658 // output in log 3659 noLines, 3660 noLines) 3661 3662 expandRun.AddExpectations("additional_things.go", flattenRun.ExpectedFor("AdditionalThings").ExpectedLines, todo, noLines, noLines) 3663 3664 // load expectations for model: transitive_refed_thing_additional_properties.go 3665 flattenRun.AddExpectations("transitive_refed_thing_additional_properties.go", []string{ 3666 `type TransitiveRefedThingAdditionalProperties struct {`, 3667 " A1 strfmt.DateTime `json:\"a1,omitempty\"`", 3668 " TransitiveRefedThingAdditionalProperties map[string]*NoValidationThing `json:\"-\"`", 3669 `func (m *TransitiveRefedThingAdditionalProperties) Validate(formats strfmt.Registry) error {`, 3670 ` if err := m.validateA1(formats); err != nil {`, 3671 ` for k := range m.TransitiveRefedThingAdditionalProperties {`, 3672 ` if val, ok := m.TransitiveRefedThingAdditionalProperties[k]; ok {`, 3673 ` if val != nil {`, 3674 ` if err := val.Validate(formats); err != nil {`, 3675 ` return errors.CompositeValidationError(res...`, 3676 `func (m *TransitiveRefedThingAdditionalProperties) validateA1(formats strfmt.Registry) error {`, 3677 ` if swag.IsZero(m.A1) {`, 3678 ` if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`, 3679 }, 3680 // not expected 3681 todo, 3682 // output in log 3683 noLines, 3684 noLines) 3685 3686 // load expectations for model: additional_object.go 3687 flattenRun.AddExpectations("additional_object.go", []string{ 3688 `type AdditionalObject struct {`, 3689 " MockID float64 `json:\"mockId,omitempty\"`", 3690 " AdditionalObject map[string]*AdditionalObjectAdditionalProperties `json:\"-\"`", 3691 `func (m *AdditionalObject) Validate(formats strfmt.Registry) error {`, 3692 ` for k := range m.AdditionalObject {`, 3693 ` if val, ok := m.AdditionalObject[k]; ok {`, 3694 ` if val != nil {`, 3695 ` if err := val.Validate(formats); err != nil {`, 3696 ` return errors.CompositeValidationError(res...`, 3697 }, 3698 // not expected 3699 todo, 3700 // output in log 3701 noLines, 3702 noLines) 3703 3704 expandRun.AddExpectations("additional_object.go", []string{ 3705 `type AdditionalObject struct {`, 3706 " MockID float64 `json:\"mockId,omitempty\"`", 3707 " AdditionalObject map[string]*AdditionalObjectAnon `json:\"-\"`", 3708 `func (m *AdditionalObject) Validate(formats strfmt.Registry) error {`, 3709 ` for k := range m.AdditionalObject {`, 3710 ` if val, ok := m.AdditionalObject[k]; ok {`, 3711 ` if val != nil {`, 3712 ` if err := val.Validate(formats); err != nil {`, 3713 ` return errors.CompositeValidationError(res...`, 3714 `type AdditionalObjectAnon struct {`, 3715 " MockA string `json:\"mockA,omitempty\"`", 3716 " MockB *string `json:\"mockB\"`", 3717 " MockC float64 `json:\"mockC,omitempty\"`", 3718 `func (m *AdditionalObjectAnon) Validate(formats strfmt.Registry) error {`, 3719 ` if err := m.validateMockA(formats); err != nil {`, 3720 ` if err := m.validateMockB(formats); err != nil {`, 3721 ` return errors.CompositeValidationError(res...`, 3722 `func (m *AdditionalObjectAnon) validateMockA(formats strfmt.Registry) error {`, 3723 ` if swag.IsZero(m.MockA) {`, 3724 " if err := validate.Pattern(\"mockA\", \"body\", m.MockA, `^[A-Z]$`); err != nil {", 3725 `func (m *AdditionalObjectAnon) validateMockB(formats strfmt.Registry) error {`, 3726 ` if err := validate.Required("mockB", "body", m.MockB); err != nil {`, 3727 ` if err := validate.MinLength("mockB", "body", *m.MockB, 1); err != nil {`, 3728 }, 3729 // not expected 3730 todo, 3731 // output in log 3732 noLines, 3733 noLines) 3734 3735 // load expectations for model: additional_slice_of_objects_additional_properties_items.go 3736 flattenRun.AddExpectations("additional_slice_of_objects_additional_properties_items.go", []string{ 3737 `type AdditionalSliceOfObjectsAdditionalPropertiesItems struct {`, 3738 " Prop2 int64 `json:\"prop2,omitempty\"`", 3739 // empty validation 3740 "func (m *AdditionalSliceOfObjectsAdditionalPropertiesItems) Validate(formats strfmt.Registry) error {\n return nil\n}", 3741 }, 3742 // not expected 3743 todo, 3744 // output in log 3745 noLines, 3746 noLines) 3747 3748 // load expectations for model: additional_slice_of_aliased_nullable_primitives.go 3749 flattenRun.AddExpectations("additional_slice_of_aliased_nullable_primitives.go", []string{ 3750 `type AdditionalSliceOfAliasedNullablePrimitives struct {`, 3751 " Prop3 strfmt.UUID `json:\"prop3,omitempty\"`", 3752 " AdditionalSliceOfAliasedNullablePrimitives map[string][]*AliasedNullableDate `json:\"-\"`", 3753 `func (m *AdditionalSliceOfAliasedNullablePrimitives) Validate(formats strfmt.Registry) error {`, 3754 ` if err := m.validateProp3(formats); err != nil {`, 3755 ` for k := range m.AdditionalSliceOfAliasedNullablePrimitives {`, 3756 // removed undue IsSzero call 3757 ` iAdditionalSliceOfAliasedNullablePrimitivesSize := int64(len(m.AdditionalSliceOfAliasedNullablePrimitives[k])`, 3758 ` if err := validate.MinItems(k, "body", iAdditionalSliceOfAliasedNullablePrimitivesSize, 10); err != nil {`, 3759 ` for i := 0; i < len(m.AdditionalSliceOfAliasedNullablePrimitives[k]); i++ {`, 3760 // do we need Required when item is nullable? 3761 // nullable not required: 3762 ` if swag.IsZero(m.AdditionalSliceOfAliasedNullablePrimitives[k][i]) {`, 3763 // nullable required: 3764 ` if m.AdditionalSliceOfAliasedNullablePrimitives[k][i] != nil {`, 3765 ` if err := m.AdditionalSliceOfAliasedNullablePrimitives[k][i].Validate(formats); err != nil {`, 3766 ` if ve, ok := err.(*errors.Validation); ok {`, 3767 ` return ve.ValidateName(k + "." + strconv.Itoa(i)`, 3768 ` return errors.CompositeValidationError(res...`, 3769 `func (m *AdditionalSliceOfAliasedNullablePrimitives) validateProp3(formats strfmt.Registry) error {`, 3770 ` if swag.IsZero(m.Prop3) {`, 3771 ` if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`, 3772 }, 3773 // not expected 3774 todo, 3775 // output in log 3776 noLines, 3777 noLines) 3778 3779 expandRun.AddExpectations("additional_slice_of_aliased_nullable_primitives.go", []string{ 3780 `type AdditionalSliceOfAliasedNullablePrimitives struct {`, 3781 " Prop3 strfmt.UUID `json:\"prop3,omitempty\"`", 3782 " AdditionalSliceOfAliasedNullablePrimitives map[string][]*strfmt.Date `json:\"-\"`", 3783 `func (m *AdditionalSliceOfAliasedNullablePrimitives) Validate(formats strfmt.Registry) error {`, 3784 ` if err := m.validateProp3(formats); err != nil {`, 3785 ` for k := range m.AdditionalSliceOfAliasedNullablePrimitives {`, 3786 ` iAdditionalSliceOfAliasedNullablePrimitivesSize := int64(len(m.AdditionalSliceOfAliasedNullablePrimitives[k])`, 3787 ` if err := validate.MinItems(k, "body", iAdditionalSliceOfAliasedNullablePrimitivesSize, 10); err != nil {`, 3788 ` for i := 0; i < len(m.AdditionalSliceOfAliasedNullablePrimitives[k]); i++ {`, 3789 // do we need Required when item is nullable? 3790 // nullable not required: 3791 ` if swag.IsZero(m.AdditionalSliceOfAliasedNullablePrimitives[k][i]) {`, 3792 // nullable required: 3793 ` if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "date", m.AdditionalSliceOfAliasedNullablePrimitives[k][i].String(), formats); err != nil {`, 3794 ` return errors.CompositeValidationError(res...`, 3795 `func (m *AdditionalSliceOfAliasedNullablePrimitives) validateProp3(formats strfmt.Registry) error {`, 3796 ` if swag.IsZero(m.Prop3) {`, 3797 ` if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`, 3798 }, 3799 // not expected 3800 todo, 3801 // output in log 3802 noLines, 3803 noLines) 3804 3805 // load expectations for model: additional_slice_of_slice.go 3806 flattenRun.AddExpectations("additional_slice_of_slice.go", []string{ 3807 `type AdditionalSliceOfSlice struct {`, 3808 " Prop4 strfmt.UUID `json:\"prop4,omitempty\"`", 3809 " AdditionalSliceOfSlice map[string][][]*AdditionalSliceOfSliceAdditionalPropertiesItemsItems `json:\"-\"`", 3810 `func (m *AdditionalSliceOfSlice) Validate(formats strfmt.Registry) error {`, 3811 ` if err := m.validateProp4(formats); err != nil {`, 3812 ` for k := range m.AdditionalSliceOfSlice {`, 3813 ` if err := validate.Required(k, "body", m.AdditionalSliceOfSlice[k]); err != nil {`, 3814 ` for i := 0; i < len(m.AdditionalSliceOfSlice[k]); i++ {`, 3815 ` iiAdditionalSliceOfSliceSize := int64(len(m.AdditionalSliceOfSlice[k][i])`, 3816 ` if err := validate.MaxItems(k+"."+strconv.Itoa(i), "body", iiAdditionalSliceOfSliceSize, 10); err != nil {`, 3817 ` for ii := 0; ii < len(m.AdditionalSliceOfSlice[k][i]); ii++ {`, 3818 // do we need Required when item is nullable? 3819 // nullable not required: 3820 ` if swag.IsZero(m.AdditionalSliceOfSlice[k][i][ii]) {`, 3821 // nullable not required: 3822 ` if m.AdditionalSliceOfSlice[k][i][ii] != nil {`, 3823 ` if err := m.AdditionalSliceOfSlice[k][i][ii].Validate(formats); err != nil {`, 3824 ` if ve, ok := err.(*errors.Validation); ok {`, 3825 ` return ve.ValidateName(k + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)`, 3826 ` return errors.CompositeValidationError(res...`, 3827 `func (m *AdditionalSliceOfSlice) validateProp4(formats strfmt.Registry) error {`, 3828 ` if swag.IsZero(m.Prop4) {`, 3829 ` if err := validate.FormatOf("prop4", "body", "uuid", m.Prop4.String(), formats); err != nil {`, 3830 }, 3831 // not expected 3832 todo, 3833 // output in log 3834 noLines, 3835 noLines) 3836 3837 expandRun.AddExpectations("additional_slice_of_slice.go", []string{ 3838 `type AdditionalSliceOfSlice struct {`, 3839 " Prop4 strfmt.UUID `json:\"prop4,omitempty\"`", 3840 " AdditionalSliceOfSlice map[string][][]*AdditionalSliceOfSliceItems0 `json:\"-\"`", 3841 `func (m *AdditionalSliceOfSlice) Validate(formats strfmt.Registry) error {`, 3842 ` if err := m.validateProp4(formats); err != nil {`, 3843 ` for k := range m.AdditionalSliceOfSlice {`, 3844 ` if err := validate.Required(k, "body", m.AdditionalSliceOfSlice[k]); err != nil {`, 3845 ` for i := 0; i < len(m.AdditionalSliceOfSlice[k]); i++ {`, 3846 ` iiAdditionalSliceOfSliceSize := int64(len(m.AdditionalSliceOfSlice[k][i])`, 3847 ` if err := validate.MaxItems(k+"."+strconv.Itoa(i), "body", iiAdditionalSliceOfSliceSize, 10); err != nil {`, 3848 ` for ii := 0; ii < len(m.AdditionalSliceOfSlice[k][i]); ii++ {`, 3849 // do we need Required when item is nullable? 3850 // nullable not required: 3851 ` if swag.IsZero(m.AdditionalSliceOfSlice[k][i][ii]) {`, 3852 // nullable required: 3853 ` if m.AdditionalSliceOfSlice[k][i][ii] != nil {`, 3854 ` if err := m.AdditionalSliceOfSlice[k][i][ii].Validate(formats); err != nil {`, 3855 ` if ve, ok := err.(*errors.Validation); ok {`, 3856 ` return ve.ValidateName(k + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)`, 3857 ` return errors.CompositeValidationError(res...`, 3858 `func (m *AdditionalSliceOfSlice) validateProp4(formats strfmt.Registry) error {`, 3859 ` if swag.IsZero(m.Prop4) {`, 3860 ` if err := validate.FormatOf("prop4", "body", "uuid", m.Prop4.String(), formats); err != nil {`, 3861 `type AdditionalSliceOfSliceItems0 struct {`, 3862 " Prop5 int64 `json:\"prop5,omitempty\"`", 3863 `func (m *AdditionalSliceOfSliceItems0) Validate(formats strfmt.Registry) error {`, 3864 ` if err := m.validateProp5(formats); err != nil {`, 3865 ` return errors.CompositeValidationError(res...`, 3866 `func (m *AdditionalSliceOfSliceItems0) validateProp5(formats strfmt.Registry) error {`, 3867 ` if swag.IsZero(m.Prop5) {`, 3868 ` if err := validate.MaximumInt("prop5", "body", m.Prop5, 10, false); err != nil {`, 3869 }, 3870 // not expected 3871 todo, 3872 // output in log 3873 noLines, 3874 noLines) 3875 3876 // load expectations for model: additional_object_with_aliased_thing.go 3877 flattenRun.AddExpectations("additional_object_with_aliased_thing.go", []string{ 3878 `type AdditionalObjectWithAliasedThing struct {`, 3879 " Blob int64 `json:\"blob,omitempty\"`", 3880 " AdditionalObjectWithAliasedThing map[string]AliasedDate `json:\"-\"`", 3881 `func (m *AdditionalObjectWithAliasedThing) Validate(formats strfmt.Registry) error {`, 3882 ` if err := m.validateBlob(formats); err != nil {`, 3883 ` for k := range m.AdditionalObjectWithAliasedThing {`, 3884 // removed undue IsZero call 3885 ` if val, ok := m.AdditionalObjectWithAliasedThing[k]; ok {`, 3886 ` if err := val.Validate(formats); err != nil {`, 3887 ` return errors.CompositeValidationError(res...`, 3888 `func (m *AdditionalObjectWithAliasedThing) validateBlob(formats strfmt.Registry) error {`, 3889 ` if swag.IsZero(m.Blob) {`, 3890 ` if err := validate.MinimumInt("blob", "body", m.Blob, 1, false); err != nil {`, 3891 }, 3892 // not expected 3893 todo, 3894 // output in log 3895 noLines, 3896 noLines) 3897 3898 expandRun.AddExpectations("additional_object_with_aliased_thing.go", []string{ 3899 `type AdditionalObjectWithAliasedThing struct {`, 3900 " Blob int64 `json:\"blob,omitempty\"`", 3901 " AdditionalObjectWithAliasedThing map[string]strfmt.Date `json:\"-\"`", 3902 `func (m *AdditionalObjectWithAliasedThing) Validate(formats strfmt.Registry) error {`, 3903 ` if err := m.validateBlob(formats); err != nil {`, 3904 ` for k := range m.AdditionalObjectWithAliasedThing {`, 3905 ` if err := validate.FormatOf(k, "body", "date", m.AdditionalObjectWithAliasedThing[k].String(), formats); err != nil {`, 3906 ` return errors.CompositeValidationError(res...`, 3907 `func (m *AdditionalObjectWithAliasedThing) validateBlob(formats strfmt.Registry) error {`, 3908 ` if swag.IsZero(m.Blob) {`, 3909 ` if err := validate.MinimumInt("blob", "body", m.Blob, 1, false); err != nil {`, 3910 }, 3911 // not expected 3912 todo, 3913 // output in log 3914 noLines, 3915 noLines) 3916 3917 // load expectations for model: additional_things_nested_additional_properties.go 3918 flattenRun.AddExpectations("additional_things_nested_additional_properties.go", []string{ 3919 `type AdditionalThingsNestedAdditionalProperties struct {`, 3920 " PrinterAddress string `json:\"printerAddress,omitempty\"`", 3921 " PrinterCountry string `json:\"printerCountry,omitempty\"`", 3922 " PrinterDate strfmt.Date `json:\"printerDate,omitempty\"`", 3923 " AdditionalThingsNestedAdditionalProperties map[string]*AdditionalThingsNestedAdditionalPropertiesAdditionalProperties `json:\"-\"`", 3924 `func (m *AdditionalThingsNestedAdditionalProperties) Validate(formats strfmt.Registry) error {`, 3925 ` if err := m.validatePrinterCountry(formats); err != nil {`, 3926 ` if err := m.validatePrinterDate(formats); err != nil {`, 3927 ` for k := range m.AdditionalThingsNestedAdditionalProperties {`, 3928 ` if val, ok := m.AdditionalThingsNestedAdditionalProperties[k]; ok {`, 3929 ` if val != nil {`, 3930 ` if err := val.Validate(formats); err != nil {`, 3931 ` return errors.CompositeValidationError(res...`, 3932 `var additionalThingsNestedAdditionalPropertiesTypePrinterCountryPropEnum []interface{`, 3933 ` var res []string`, 3934 " if err := json.Unmarshal([]byte(`[\"US\",\"FR\",\"UK\",\"BE\",\"CA\",\"DE\"]`), &res); err != nil {", 3935 ` for _, v := range res {`, 3936 ` additionalThingsNestedAdditionalPropertiesTypePrinterCountryPropEnum = append(additionalThingsNestedAdditionalPropertiesTypePrinterCountryPropEnum, v`, 3937 ` AdditionalThingsNestedAdditionalPropertiesPrinterCountryUS string = "US"`, 3938 ` AdditionalThingsNestedAdditionalPropertiesPrinterCountryFR string = "FR"`, 3939 ` AdditionalThingsNestedAdditionalPropertiesPrinterCountryUK string = "UK"`, 3940 ` AdditionalThingsNestedAdditionalPropertiesPrinterCountryBE string = "BE"`, 3941 ` AdditionalThingsNestedAdditionalPropertiesPrinterCountryCA string = "CA"`, 3942 ` AdditionalThingsNestedAdditionalPropertiesPrinterCountryDE string = "DE"`, 3943 `func (m *AdditionalThingsNestedAdditionalProperties) validatePrinterCountryEnum(path, location string, value string) error {`, 3944 ` if err := validate.EnumCase(path, location, value, additionalThingsNestedAdditionalPropertiesTypePrinterCountryPropEnum, true); err != nil {`, 3945 `func (m *AdditionalThingsNestedAdditionalProperties) validatePrinterCountry(formats strfmt.Registry) error {`, 3946 ` if swag.IsZero(m.PrinterCountry) {`, 3947 ` if err := m.validatePrinterCountryEnum("printerCountry", "body", m.PrinterCountry); err != nil {`, 3948 `func (m *AdditionalThingsNestedAdditionalProperties) validatePrinterDate(formats strfmt.Registry) error {`, 3949 ` if swag.IsZero(m.PrinterDate) {`, 3950 ` if err := validate.FormatOf("printerDate", "body", "date", m.PrinterDate.String(), formats); err != nil {`, 3951 }, 3952 // not expected 3953 todo, 3954 // output in log 3955 noLines, 3956 noLines) 3957 3958 // load expectations for model: empty_object_with_additional_slice_additional_properties_items.go 3959 flattenRun.AddExpectations("empty_object_with_additional_slice_additional_properties_items.go", []string{ 3960 `type EmptyObjectWithAdditionalSliceAdditionalPropertiesItems struct {`, 3961 " DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`", 3962 `func (m *EmptyObjectWithAdditionalSliceAdditionalPropertiesItems) Validate(formats strfmt.Registry) error {`, 3963 ` if err := m.validateDummyProp1(formats); err != nil {`, 3964 ` return errors.CompositeValidationError(res...`, 3965 `func (m *EmptyObjectWithAdditionalSliceAdditionalPropertiesItems) validateDummyProp1(formats strfmt.Registry) error {`, 3966 ` if swag.IsZero(m.DummyProp1) {`, 3967 ` if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`, 3968 }, 3969 // not expected 3970 todo, 3971 // output in log 3972 noLines, 3973 noLines) 3974 3975 // load expectations for model: additional_things_nested_additional_properties_additional_properties.go 3976 flattenRun.AddExpectations("additional_things_nested_additional_properties_additional_properties.go", []string{ 3977 `type AdditionalThingsNestedAdditionalPropertiesAdditionalProperties struct {`, 3978 " AverageDelay strfmt.Duration `json:\"averageDelay,omitempty\"`", 3979 `func (m *AdditionalThingsNestedAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {`, 3980 ` if err := m.validateAverageDelay(formats); err != nil {`, 3981 ` return errors.CompositeValidationError(res...`, 3982 `func (m *AdditionalThingsNestedAdditionalPropertiesAdditionalProperties) validateAverageDelay(formats strfmt.Registry) error {`, 3983 ` if swag.IsZero(m.AverageDelay) {`, 3984 ` if err := validate.FormatOf("averageDelay", "body", "duration", m.AverageDelay.String(), formats); err != nil {`, 3985 }, 3986 // not expected 3987 todo, 3988 // output in log 3989 noLines, 3990 noLines) 3991 3992 // load expectations for model: additional_slice_of_slice_additional_properties_items_items.go 3993 flattenRun.AddExpectations("additional_slice_of_slice_additional_properties_items_items.go", []string{ 3994 `type AdditionalSliceOfSliceAdditionalPropertiesItemsItems struct {`, 3995 " Prop5 int64 `json:\"prop5,omitempty\"`", 3996 `func (m *AdditionalSliceOfSliceAdditionalPropertiesItemsItems) Validate(formats strfmt.Registry) error {`, 3997 ` if err := m.validateProp5(formats); err != nil {`, 3998 ` return errors.CompositeValidationError(res...`, 3999 `func (m *AdditionalSliceOfSliceAdditionalPropertiesItemsItems) validateProp5(formats strfmt.Registry) error {`, 4000 ` if swag.IsZero(m.Prop5) {`, 4001 ` if err := validate.MaximumInt("prop5", "body", m.Prop5, 10, false); err != nil {`, 4002 }, 4003 // not expected 4004 todo, 4005 // output in log 4006 noLines, 4007 noLines) 4008 4009 // load expectations for model: additional_object_additional_properties.go 4010 flattenRun.AddExpectations("additional_object_additional_properties.go", []string{ 4011 `type AdditionalObjectAdditionalProperties struct {`, 4012 " MockA string `json:\"mockA,omitempty\"`", 4013 " MockB *string `json:\"mockB\"`", 4014 " MockC float64 `json:\"mockC,omitempty\"`", 4015 `func (m *AdditionalObjectAdditionalProperties) Validate(formats strfmt.Registry) error {`, 4016 ` if err := m.validateMockA(formats); err != nil {`, 4017 ` if err := m.validateMockB(formats); err != nil {`, 4018 ` return errors.CompositeValidationError(res...`, 4019 `func (m *AdditionalObjectAdditionalProperties) validateMockA(formats strfmt.Registry) error {`, 4020 ` if swag.IsZero(m.MockA) {`, 4021 " if err := validate.Pattern(\"mockA\", \"body\", m.MockA, `^[A-Z]$`); err != nil {", 4022 `func (m *AdditionalObjectAdditionalProperties) validateMockB(formats strfmt.Registry) error {`, 4023 ` if err := validate.Required("mockB", "body", m.MockB); err != nil {`, 4024 ` if err := validate.MinLength("mockB", "body", *m.MockB, 1); err != nil {`, 4025 }, 4026 // not expected 4027 todo, 4028 // output in log 4029 noLines, 4030 noLines) 4031 4032 // load expectations for model: additional_transitive_refed_thing.go 4033 flattenRun.AddExpectations("additional_transitive_refed_thing.go", []string{ 4034 `type AdditionalTransitiveRefedThing struct {`, 4035 " ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`", 4036 " AdditionalTransitiveRefedThing map[string][]*TransitiveRefedThing `json:\"-\"`", 4037 `func (m *AdditionalTransitiveRefedThing) Validate(formats strfmt.Registry) error {`, 4038 ` if err := m.validateThisOneNotRequired(formats); err != nil {`, 4039 ` for k := range m.AdditionalTransitiveRefedThing {`, 4040 ` if err := validate.Required(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`, 4041 ` if err := validate.UniqueItems(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`, 4042 ` for i := 0; i < len(m.AdditionalTransitiveRefedThing[k]); i++ {`, 4043 // do we need Required when item is nullable? 4044 // nullable not required: 4045 ` if swag.IsZero(m.AdditionalTransitiveRefedThing[k][i]) {`, 4046 // nullable required: 4047 ` if m.AdditionalTransitiveRefedThing[k][i] != nil {`, 4048 ` if err := m.AdditionalTransitiveRefedThing[k][i].Validate(formats); err != nil {`, 4049 ` if ve, ok := err.(*errors.Validation); ok {`, 4050 ` return ve.ValidateName(k + "." + strconv.Itoa(i)`, 4051 ` return errors.CompositeValidationError(res...`, 4052 `func (m *AdditionalTransitiveRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`, 4053 ` if swag.IsZero(m.ThisOneNotRequired) {`, 4054 ` if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`, 4055 }, 4056 // not expected 4057 todo, 4058 // output in log 4059 noLines, 4060 noLines) 4061 4062 expandRun.AddExpectations("additional_transitive_refed_thing.go", []string{ 4063 `type AdditionalTransitiveRefedThing struct {`, 4064 " ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`", 4065 " AdditionalTransitiveRefedThing map[string][]*AdditionalTransitiveRefedThingItems0 `json:\"-\"`", 4066 `func (m *AdditionalTransitiveRefedThing) Validate(formats strfmt.Registry) error {`, 4067 ` if err := m.validateThisOneNotRequired(formats); err != nil {`, 4068 ` for k := range m.AdditionalTransitiveRefedThing {`, 4069 ` if err := validate.Required(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`, 4070 ` if err := validate.UniqueItems(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`, 4071 ` for i := 0; i < len(m.AdditionalTransitiveRefedThing[k]); i++ {`, 4072 // do we need Required when item is nullable? 4073 // nullable not required: 4074 ` if swag.IsZero(m.AdditionalTransitiveRefedThing[k][i]) {`, 4075 // nullable required: 4076 ` if m.AdditionalTransitiveRefedThing[k][i] != nil {`, 4077 ` if err := m.AdditionalTransitiveRefedThing[k][i].Validate(formats); err != nil {`, 4078 ` if ve, ok := err.(*errors.Validation); ok {`, 4079 ` return ve.ValidateName(k + "." + strconv.Itoa(i)`, 4080 ` return errors.CompositeValidationError(res...`, 4081 `func (m *AdditionalTransitiveRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`, 4082 ` if swag.IsZero(m.ThisOneNotRequired) {`, 4083 ` if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`, 4084 `type AdditionalTransitiveRefedThingItems0 struct {`, 4085 " ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`", 4086 " AdditionalTransitiveRefedThingItems0 map[string]*AdditionalTransitiveRefedThingItems0Anon `json:\"-\"`", 4087 `func (m *AdditionalTransitiveRefedThingItems0) Validate(formats strfmt.Registry) error {`, 4088 ` if err := m.validateThisOneNotRequiredEither(formats); err != nil {`, 4089 ` for k := range m.AdditionalTransitiveRefedThingItems0 {`, 4090 ` if val, ok := m.AdditionalTransitiveRefedThingItems0[k]; ok {`, 4091 ` if val != nil {`, 4092 ` if err := val.Validate(formats); err != nil {`, 4093 ` return errors.CompositeValidationError(res...`, 4094 `func (m *AdditionalTransitiveRefedThingItems0) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`, 4095 ` if swag.IsZero(m.ThisOneNotRequiredEither) {`, 4096 ` if err := validate.MaximumInt("thisOneNotRequiredEither", "body", m.ThisOneNotRequiredEither, 20, false); err != nil {`, 4097 `type AdditionalTransitiveRefedThingItems0Anon struct {`, 4098 " A1 strfmt.DateTime `json:\"a1,omitempty\"`", 4099 " AdditionalTransitiveRefedThingItems0Anon map[string]*AdditionalTransitiveRefedThingItems0AnonAnon `json:\"-\"`", 4100 `func (m *AdditionalTransitiveRefedThingItems0Anon) Validate(formats strfmt.Registry) error {`, 4101 ` if err := m.validateA1(formats); err != nil {`, 4102 ` for k := range m.AdditionalTransitiveRefedThingItems0Anon {`, 4103 ` if val, ok := m.AdditionalTransitiveRefedThingItems0Anon[k]; ok {`, 4104 ` if val != nil {`, 4105 ` if err := val.Validate(formats); err != nil {`, 4106 ` return errors.CompositeValidationError(res...`, 4107 `func (m *AdditionalTransitiveRefedThingItems0Anon) validateA1(formats strfmt.Registry) error {`, 4108 ` if swag.IsZero(m.A1) {`, 4109 ` if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`, 4110 `type AdditionalTransitiveRefedThingItems0AnonAnon struct {`, 4111 " Discourse string `json:\"discourse,omitempty\"`", 4112 " HoursSpent float64 `json:\"hoursSpent,omitempty\"`", 4113 " AdditionalTransitiveRefedThingItems0AnonAnonAdditionalProperties map[string]interface{} `json:\"-\"`", 4114 // empty validation 4115 "func (m *AdditionalTransitiveRefedThingItems0AnonAnon) Validate(formats strfmt.Registry) error {\n return nil\n}", 4116 }, 4117 // not expected 4118 todo, 4119 // output in log 4120 noLines, 4121 noLines) 4122 4123 // load expectations for model: additional_nullable_array_thing.go 4124 flattenRun.AddExpectations("additional_nullable_array_thing.go", []string{ 4125 `type AdditionalNullableArrayThing struct {`, 4126 " ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`", 4127 " AdditionalNullableArrayThing map[string][]strfmt.ISBN `json:\"-\"`", 4128 `func (m *AdditionalNullableArrayThing) Validate(formats strfmt.Registry) error {`, 4129 ` if err := m.validateThisOneNotRequired(formats); err != nil {`, 4130 ` for k := range m.AdditionalNullableArrayThing {`, 4131 ` if err := validate.UniqueItems(k, "body", m.AdditionalNullableArrayThing[k]); err != nil {`, 4132 ` for i := 0; i < len(m.AdditionalNullableArrayThing[k]); i++ {`, 4133 ` if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "isbn", m.AdditionalNullableArrayThing[k][i].String(), formats); err != nil {`, 4134 ` return errors.CompositeValidationError(res...`, 4135 `func (m *AdditionalNullableArrayThing) validateThisOneNotRequired(formats strfmt.Registry) error {`, 4136 ` if swag.IsZero(m.ThisOneNotRequired) {`, 4137 ` if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`, 4138 }, 4139 // not expected 4140 todo, 4141 // output in log 4142 noLines, 4143 noLines) 4144 4145 expandRun.AddExpectations("additional_nullable_array_thing.go", flattenRun.ExpectedFor("AdditionalNullableArrayThing").ExpectedLines, todo, noLines, noLines) 4146 4147 // load expectations for model: additional_slice_of_primitives.go 4148 flattenRun.AddExpectations("additional_slice_of_primitives.go", []string{ 4149 `type AdditionalSliceOfPrimitives struct {`, 4150 " Prop1 string `json:\"prop1,omitempty\"`", 4151 " AdditionalSliceOfPrimitives map[string][]strfmt.Date `json:\"-\"`", 4152 `func (m *AdditionalSliceOfPrimitives) Validate(formats strfmt.Registry) error {`, 4153 ` for k := range m.AdditionalSliceOfPrimitives {`, 4154 ` if err := validate.UniqueItems(k, "body", m.AdditionalSliceOfPrimitives[k]); err != nil {`, 4155 ` for i := 0; i < len(m.AdditionalSliceOfPrimitives[k]); i++ {`, 4156 ` if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "date", m.AdditionalSliceOfPrimitives[k][i].String(), formats); err != nil {`, 4157 ` return errors.CompositeValidationError(res...`, 4158 }, 4159 // not expected 4160 todo, 4161 // output in log 4162 noLines, 4163 noLines) 4164 4165 expandRun.AddExpectations("additional_slice_of_primitives.go", flattenRun.ExpectedFor("AdditionalSliceOfPrimitives").ExpectedLines, todo, noLines, noLines) 4166 4167 // load expectations for model: additional_array_thing.go 4168 flattenRun.AddExpectations("additional_array_thing.go", []string{ 4169 `type AdditionalArrayThing struct {`, 4170 " ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`", 4171 " AdditionalArrayThing map[string][]strfmt.UUID `json:\"-\"`", 4172 `func (m *AdditionalArrayThing) Validate(formats strfmt.Registry) error {`, 4173 ` if err := m.validateThisOneNotRequired(formats); err != nil {`, 4174 ` for k := range m.AdditionalArrayThing {`, 4175 ` if err := validate.UniqueItems(k, "body", m.AdditionalArrayThing[k]); err != nil {`, 4176 ` for i := 0; i < len(m.AdditionalArrayThing[k]); i++ {`, 4177 ` if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "uuid", m.AdditionalArrayThing[k][i].String(), formats); err != nil {`, 4178 ` return errors.CompositeValidationError(res...`, 4179 `func (m *AdditionalArrayThing) validateThisOneNotRequired(formats strfmt.Registry) error {`, 4180 ` if swag.IsZero(m.ThisOneNotRequired) {`, 4181 ` if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`, 4182 }, 4183 // not expected 4184 todo, 4185 // output in log 4186 noLines, 4187 noLines) 4188 4189 expandRun.AddExpectations("additional_array_thing.go", flattenRun.ExpectedFor("AdditionalArrayThing").ExpectedLines, todo, noLines, noLines) 4190 4191 // load expectations for model: interface_thing.go 4192 flattenRun.AddExpectations("interface_thing.go", []string{ 4193 `type InterfaceThing interface{}`, 4194 }, 4195 // not expected 4196 todo, 4197 // output in log 4198 noLines, 4199 noLines) 4200 4201 expandRun.AddExpectations("interface_thing.go", flattenRun.ExpectedFor("InterfaceThing").ExpectedLines, todo, noLines, noLines) 4202 4203 // load expectations for model: empty_object_with_additional_slice.go 4204 flattenRun.AddExpectations("empty_object_with_additional_slice.go", []string{ 4205 `type EmptyObjectWithAdditionalSlice map[string][]EmptyObjectWithAdditionalSliceAdditionalPropertiesItems`, 4206 `func (m EmptyObjectWithAdditionalSlice) Validate(formats strfmt.Registry) error {`, 4207 ` for k := range m {`, 4208 ` if err := validate.Required(k, "body", m[k]); err != nil {`, 4209 ` for i := 0; i < len(m[k]); i++ {`, 4210 ` if err := m[k][i].Validate(formats); err != nil {`, 4211 ` if ve, ok := err.(*errors.Validation); ok {`, 4212 ` return ve.ValidateName(k + "." + strconv.Itoa(i)`, 4213 ` return errors.CompositeValidationError(res...`, 4214 }, 4215 // not expected 4216 todo, 4217 // output in log 4218 noLines, 4219 noLines) 4220 4221 expandRun.AddExpectations("empty_object_with_additional_slice.go", []string{ 4222 `type EmptyObjectWithAdditionalSlice map[string][]EmptyObjectWithAdditionalSliceItems0`, 4223 `func (m EmptyObjectWithAdditionalSlice) Validate(formats strfmt.Registry) error {`, 4224 ` for k := range m {`, 4225 ` if err := validate.Required(k, "body", m[k]); err != nil {`, 4226 ` for i := 0; i < len(m[k]); i++ {`, 4227 ` if err := m[k][i].Validate(formats); err != nil {`, 4228 ` if ve, ok := err.(*errors.Validation); ok {`, 4229 ` return ve.ValidateName(k + "." + strconv.Itoa(i)`, 4230 ` return errors.CompositeValidationError(res...`, 4231 `type EmptyObjectWithAdditionalSliceItems0 struct {`, 4232 " DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`", 4233 `func (m *EmptyObjectWithAdditionalSliceItems0) Validate(formats strfmt.Registry) error {`, 4234 ` if err := m.validateDummyProp1(formats); err != nil {`, 4235 ` return errors.CompositeValidationError(res...`, 4236 `func (m *EmptyObjectWithAdditionalSliceItems0) validateDummyProp1(formats strfmt.Registry) error {`, 4237 ` if swag.IsZero(m.DummyProp1) {`, 4238 ` if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`, 4239 }, 4240 // not expected 4241 todo, 4242 // output in log 4243 noLines, 4244 noLines) 4245 4246 // load expectations for model: additional_slice_of_objects.go 4247 flattenRun.AddExpectations("additional_slice_of_objects.go", []string{ 4248 `type AdditionalSliceOfObjects struct {`, 4249 " Prop1 string `json:\"prop1,omitempty\"`", 4250 " AdditionalSliceOfObjects map[string][]*AdditionalSliceOfObjectsAdditionalPropertiesItems `json:\"-\"`", 4251 `func (m *AdditionalSliceOfObjects) Validate(formats strfmt.Registry) error {`, 4252 ` for k := range m.AdditionalSliceOfObjects {`, 4253 ` if err := validate.Required(k, "body", m.AdditionalSliceOfObjects[k]); err != nil {`, 4254 ` if err := validate.UniqueItems(k, "body", m.AdditionalSliceOfObjects[k]); err != nil {`, 4255 ` for i := 0; i < len(m.AdditionalSliceOfObjects[k]); i++ {`, 4256 // do we need Required when item is nullable? 4257 // nullable not required: 4258 ` if swag.IsZero(m.AdditionalSliceOfObjects[k][i]) {`, 4259 // nullable required: 4260 ` if m.AdditionalSliceOfObjects[k][i] != nil {`, 4261 ` if err := m.AdditionalSliceOfObjects[k][i].Validate(formats); err != nil {`, 4262 ` if ve, ok := err.(*errors.Validation); ok {`, 4263 ` return ve.ValidateName(k + "." + strconv.Itoa(i)`, 4264 ` return errors.CompositeValidationError(res...`, 4265 }, 4266 // not expected 4267 todo, 4268 // output in log 4269 noLines, 4270 noLines) 4271 4272 expandRun.AddExpectations("additional_slice_of_objects.go", []string{ 4273 `type AdditionalSliceOfObjects struct {`, 4274 " Prop1 string `json:\"prop1,omitempty\"`", 4275 " AdditionalSliceOfObjects map[string][]*AdditionalSliceOfObjectsItems0 `json:\"-\"`", 4276 `func (m *AdditionalSliceOfObjects) Validate(formats strfmt.Registry) error {`, 4277 ` for k := range m.AdditionalSliceOfObjects {`, 4278 ` if err := validate.Required(k, "body", m.AdditionalSliceOfObjects[k]); err != nil {`, 4279 ` if err := validate.UniqueItems(k, "body", m.AdditionalSliceOfObjects[k]); err != nil {`, 4280 ` for i := 0; i < len(m.AdditionalSliceOfObjects[k]); i++ {`, 4281 // do we need Required when item is nullable? 4282 // nullable not required: 4283 ` if swag.IsZero(m.AdditionalSliceOfObjects[k][i]) {`, 4284 // nullable required: 4285 ` if m.AdditionalSliceOfObjects[k][i] != nil {`, 4286 ` if err := m.AdditionalSliceOfObjects[k][i].Validate(formats); err != nil {`, 4287 ` if ve, ok := err.(*errors.Validation); ok {`, 4288 ` return ve.ValidateName(k + "." + strconv.Itoa(i)`, 4289 ` return errors.CompositeValidationError(res...`, 4290 `type AdditionalSliceOfObjectsItems0 struct {`, 4291 " Prop2 int64 `json:\"prop2,omitempty\"`", 4292 // empty validation 4293 "func (m *AdditionalSliceOfObjectsItems0) Validate(formats strfmt.Registry) error {\n return nil\n}", 4294 }, 4295 // not expected 4296 todo, 4297 // output in log 4298 noLines, 4299 noLines) 4300 4301 // load expectations for model: additional_things_nested.go 4302 flattenRun.AddExpectations("additional_things_nested.go", []string{ 4303 `type AdditionalThingsNested struct {`, 4304 " Origin string `json:\"origin,omitempty\"`", 4305 " AdditionalThingsNested map[string]*AdditionalThingsNestedAdditionalProperties `json:\"-\"`", 4306 `func (m *AdditionalThingsNested) Validate(formats strfmt.Registry) error {`, 4307 ` if err := m.validateOrigin(formats); err != nil {`, 4308 ` for k := range m.AdditionalThingsNested {`, 4309 ` if val, ok := m.AdditionalThingsNested[k]; ok {`, 4310 ` if val != nil {`, 4311 ` if err := val.Validate(formats); err != nil {`, 4312 ` return errors.CompositeValidationError(res...`, 4313 `var additionalThingsNestedTypeOriginPropEnum []interface{`, 4314 ` var res []string`, 4315 " if err := json.Unmarshal([]byte(`[\"goPrint\",\"goE-book\",\"goCollection\",\"goMuseum\"]`), &res); err != nil {", 4316 ` for _, v := range res {`, 4317 ` additionalThingsNestedTypeOriginPropEnum = append(additionalThingsNestedTypeOriginPropEnum, v`, 4318 ` AdditionalThingsNestedOriginGoPrint string = "goPrint"`, 4319 ` AdditionalThingsNestedOriginGoEDashBook string = "goE-book"`, 4320 ` AdditionalThingsNestedOriginGoCollection string = "goCollection"`, 4321 ` AdditionalThingsNestedOriginGoMuseum string = "goMuseum"`, 4322 `func (m *AdditionalThingsNested) validateOriginEnum(path, location string, value string) error {`, 4323 ` if err := validate.EnumCase(path, location, value, additionalThingsNestedTypeOriginPropEnum, true); err != nil {`, 4324 `func (m *AdditionalThingsNested) validateOrigin(formats strfmt.Registry) error {`, 4325 ` if swag.IsZero(m.Origin) {`, 4326 ` if err := m.validateOriginEnum("origin", "body", m.Origin); err != nil {`, 4327 }, 4328 // not expected 4329 todo, 4330 // output in log 4331 noLines, 4332 noLines) 4333 4334 expandRun.AddExpectations("additional_things_nested.go", []string{ 4335 `type AdditionalThingsNested struct {`, 4336 " Origin string `json:\"origin,omitempty\"`", 4337 " AdditionalThingsNested map[string]*AdditionalThingsNestedAnon `json:\"-\"`", 4338 `func (m *AdditionalThingsNested) Validate(formats strfmt.Registry) error {`, 4339 ` if err := m.validateOrigin(formats); err != nil {`, 4340 ` for k := range m.AdditionalThingsNested {`, 4341 ` if val, ok := m.AdditionalThingsNested[k]; ok {`, 4342 ` if val != nil {`, 4343 ` if err := val.Validate(formats); err != nil {`, 4344 ` return errors.CompositeValidationError(res...`, 4345 `var additionalThingsNestedTypeOriginPropEnum []interface{`, 4346 ` var res []string`, 4347 " if err := json.Unmarshal([]byte(`[\"goPrint\",\"goE-book\",\"goCollection\",\"goMuseum\"]`), &res); err != nil {", 4348 ` for _, v := range res {`, 4349 ` additionalThingsNestedTypeOriginPropEnum = append(additionalThingsNestedTypeOriginPropEnum, v`, 4350 ` AdditionalThingsNestedOriginGoPrint string = "goPrint"`, 4351 ` AdditionalThingsNestedOriginGoEDashBook string = "goE-book"`, 4352 ` AdditionalThingsNestedOriginGoCollection string = "goCollection"`, 4353 ` AdditionalThingsNestedOriginGoMuseum string = "goMuseum"`, 4354 `func (m *AdditionalThingsNested) validateOriginEnum(path, location string, value string) error {`, 4355 ` if err := validate.EnumCase(path, location, value, additionalThingsNestedTypeOriginPropEnum, true); err != nil {`, 4356 `func (m *AdditionalThingsNested) validateOrigin(formats strfmt.Registry) error {`, 4357 ` if swag.IsZero(m.Origin) {`, 4358 ` if err := m.validateOriginEnum("origin", "body", m.Origin); err != nil {`, 4359 `type AdditionalThingsNestedAnon struct {`, 4360 " PrinterAddress string `json:\"printerAddress,omitempty\"`", 4361 " PrinterCountry string `json:\"printerCountry,omitempty\"`", 4362 " PrinterDate strfmt.Date `json:\"printerDate,omitempty\"`", 4363 " AdditionalThingsNestedAnon map[string]*AdditionalThingsNestedAnonAnon `json:\"-\"`", 4364 `func (m *AdditionalThingsNestedAnon) Validate(formats strfmt.Registry) error {`, 4365 ` if err := m.validatePrinterCountry(formats); err != nil {`, 4366 ` if err := m.validatePrinterDate(formats); err != nil {`, 4367 ` for k := range m.AdditionalThingsNestedAnon {`, 4368 ` if val, ok := m.AdditionalThingsNestedAnon[k]; ok {`, 4369 ` if val != nil {`, 4370 ` if err := val.Validate(formats); err != nil {`, 4371 ` return errors.CompositeValidationError(res...`, 4372 `var additionalThingsNestedAnonTypePrinterCountryPropEnum []interface{`, 4373 ` var res []string`, 4374 " if err := json.Unmarshal([]byte(`[\"US\",\"FR\",\"UK\",\"BE\",\"CA\",\"DE\"]`), &res); err != nil {", 4375 ` for _, v := range res {`, 4376 ` additionalThingsNestedAnonTypePrinterCountryPropEnum = append(additionalThingsNestedAnonTypePrinterCountryPropEnum, v`, 4377 ` AdditionalThingsNestedAnonPrinterCountryUS string = "US"`, 4378 ` AdditionalThingsNestedAnonPrinterCountryFR string = "FR"`, 4379 ` AdditionalThingsNestedAnonPrinterCountryUK string = "UK"`, 4380 ` AdditionalThingsNestedAnonPrinterCountryBE string = "BE"`, 4381 ` AdditionalThingsNestedAnonPrinterCountryCA string = "CA"`, 4382 ` AdditionalThingsNestedAnonPrinterCountryDE string = "DE"`, 4383 `func (m *AdditionalThingsNestedAnon) validatePrinterCountryEnum(path, location string, value string) error {`, 4384 ` if err := validate.EnumCase(path, location, value, additionalThingsNestedAnonTypePrinterCountryPropEnum, true); err != nil {`, 4385 `func (m *AdditionalThingsNestedAnon) validatePrinterCountry(formats strfmt.Registry) error {`, 4386 ` if swag.IsZero(m.PrinterCountry) {`, 4387 ` if err := m.validatePrinterCountryEnum("printerCountry", "body", m.PrinterCountry); err != nil {`, 4388 `func (m *AdditionalThingsNestedAnon) validatePrinterDate(formats strfmt.Registry) error {`, 4389 ` if swag.IsZero(m.PrinterDate) {`, 4390 ` if err := validate.FormatOf("printerDate", "body", "date", m.PrinterDate.String(), formats); err != nil {`, 4391 `type AdditionalThingsNestedAnonAnon struct {`, 4392 " AverageDelay strfmt.Duration `json:\"averageDelay,omitempty\"`", 4393 `func (m *AdditionalThingsNestedAnonAnon) Validate(formats strfmt.Registry) error {`, 4394 ` if err := m.validateAverageDelay(formats); err != nil {`, 4395 ` return errors.CompositeValidationError(res...`, 4396 `func (m *AdditionalThingsNestedAnonAnon) validateAverageDelay(formats strfmt.Registry) error {`, 4397 ` if swag.IsZero(m.AverageDelay) {`, 4398 ` if err := validate.FormatOf("averageDelay", "body", "duration", m.AverageDelay.String(), formats); err != nil {`, 4399 }, 4400 // not expected 4401 todo, 4402 // output in log 4403 noLines, 4404 noLines) 4405 4406 // load expectations for model: no_validation_thing.go 4407 flattenRun.AddExpectations("no_validation_thing.go", []string{ 4408 `type NoValidationThing struct {`, 4409 " Discourse string `json:\"discourse,omitempty\"`", 4410 " HoursSpent float64 `json:\"hoursSpent,omitempty\"`", 4411 " NoValidationThingAdditionalProperties map[string]interface{} `json:\"-\"`", 4412 // empty validation 4413 "func (m *NoValidationThing) Validate(formats strfmt.Registry) error {\n return nil\n}", 4414 }, 4415 // not expected 4416 todo, 4417 // output in log 4418 noLines, 4419 noLines) 4420 4421 expandRun.AddExpectations("no_validation_thing.go", flattenRun.ExpectedFor("NoValidationThing").ExpectedLines, todo, noLines, noLines) 4422 4423 // load expectations for model: additional_array_of_interface.go 4424 flattenRun.AddExpectations("additional_array_of_interface.go", []string{ 4425 `type AdditionalArrayOfInterface struct {`, 4426 " ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`", 4427 " AdditionalArrayOfInterface map[string][]interface{} `json:\"-\"`", 4428 `func (m *AdditionalArrayOfInterface) Validate(formats strfmt.Registry) error {`, 4429 ` if err := m.validateThisOneNotRequired(formats); err != nil {`, 4430 ` for k := range m.AdditionalArrayOfInterface {`, 4431 // remove undue IsZero call 4432 ` if err := validate.UniqueItems(k, "body", m.AdditionalArrayOfInterface[k]); err != nil {`, 4433 ` return errors.CompositeValidationError(res...`, 4434 `func (m *AdditionalArrayOfInterface) validateThisOneNotRequired(formats strfmt.Registry) error {`, 4435 ` if swag.IsZero(m.ThisOneNotRequired) {`, 4436 ` if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`, 4437 }, 4438 // not expected 4439 todo, 4440 // output in log 4441 noLines, 4442 noLines) 4443 4444 expandRun.AddExpectations("additional_array_of_interface.go", flattenRun.ExpectedFor("AdditionalArrayOfInterface").ExpectedLines, todo, noLines, noLines) 4445 4446 // load expectations for model: additional_formated_thing.go 4447 flattenRun.AddExpectations("additional_formated_thing.go", []string{ 4448 `type AdditionalFormatedThing map[string]strfmt.Date`, 4449 `func (m AdditionalFormatedThing) Validate(formats strfmt.Registry) error {`, 4450 ` for k := range m {`, 4451 ` if err := validate.FormatOf(k, "body", "date", m[k].String(), formats); err != nil {`, 4452 ` return errors.CompositeValidationError(res...`, 4453 }, 4454 // not expected 4455 todo, 4456 // output in log 4457 noLines, 4458 noLines) 4459 4460 expandRun.AddExpectations("additional_formated_thing.go", flattenRun.ExpectedFor("AdditionalFormatedThing").ExpectedLines, todo, noLines, noLines) 4461 4462 // load expectations for model: aliased_nullable_date.go 4463 flattenRun.AddExpectations("aliased_nullable_date.go", []string{ 4464 `type AliasedNullableDate strfmt.Date`, 4465 `func (m AliasedNullableDate) Validate(formats strfmt.Registry) error {`, 4466 ` if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`, 4467 ` return errors.CompositeValidationError(res...`, 4468 }, 4469 // not expected 4470 todo, 4471 // output in log 4472 noLines, 4473 noLines) 4474 4475 expandRun.AddExpectations("aliased_nullable_date.go", flattenRun.ExpectedFor("AliasedNullableDate").ExpectedLines, todo, noLines, noLines) 4476 4477 // load expectations for model: additional_array_of_refed_object.go 4478 flattenRun.AddExpectations("additional_array_of_refed_object.go", []string{ 4479 `type AdditionalArrayOfRefedObject struct {`, 4480 " ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`", 4481 " AdditionalArrayOfRefedObject map[string][]*NoValidationThing `json:\"-\"`", 4482 `func (m *AdditionalArrayOfRefedObject) Validate(formats strfmt.Registry) error {`, 4483 ` if err := m.validateThisOneNotRequired(formats); err != nil {`, 4484 ` for k := range m.AdditionalArrayOfRefedObject {`, 4485 ` if err := validate.Required(k, "body", m.AdditionalArrayOfRefedObject[k]); err != nil {`, 4486 ` if err := validate.UniqueItems(k, "body", m.AdditionalArrayOfRefedObject[k]); err != nil {`, 4487 ` for i := 0; i < len(m.AdditionalArrayOfRefedObject[k]); i++ {`, 4488 // do we need Required when item is nullable? 4489 // nullable not required: 4490 ` if swag.IsZero(m.AdditionalArrayOfRefedObject[k][i]) {`, 4491 // nullable required: 4492 ` if m.AdditionalArrayOfRefedObject[k][i] != nil {`, 4493 ` if err := m.AdditionalArrayOfRefedObject[k][i].Validate(formats); err != nil {`, 4494 ` if ve, ok := err.(*errors.Validation); ok {`, 4495 ` return ve.ValidateName(k + "." + strconv.Itoa(i)`, 4496 ` return errors.CompositeValidationError(res...`, 4497 `func (m *AdditionalArrayOfRefedObject) validateThisOneNotRequired(formats strfmt.Registry) error {`, 4498 ` if swag.IsZero(m.ThisOneNotRequired) {`, 4499 ` if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`, 4500 }, 4501 // not expected 4502 todo, 4503 // output in log 4504 noLines, 4505 noLines) 4506 4507 expandRun.AddExpectations("additional_array_of_refed_object.go", []string{ 4508 `type AdditionalArrayOfRefedObject struct {`, 4509 " ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`", 4510 " AdditionalArrayOfRefedObject map[string][]*AdditionalArrayOfRefedObjectItems0 `json:\"-\"`", 4511 `func (m *AdditionalArrayOfRefedObject) Validate(formats strfmt.Registry) error {`, 4512 ` if err := m.validateThisOneNotRequired(formats); err != nil {`, 4513 ` for k := range m.AdditionalArrayOfRefedObject {`, 4514 ` if err := validate.Required(k, "body", m.AdditionalArrayOfRefedObject[k]); err != nil {`, 4515 ` if err := validate.UniqueItems(k, "body", m.AdditionalArrayOfRefedObject[k]); err != nil {`, 4516 ` for i := 0; i < len(m.AdditionalArrayOfRefedObject[k]); i++ {`, 4517 // do we need Required when item is nullable? 4518 // nullable not required: 4519 ` if swag.IsZero(m.AdditionalArrayOfRefedObject[k][i]) {`, 4520 // nullable required: 4521 ` if m.AdditionalArrayOfRefedObject[k][i] != nil {`, 4522 ` if err := m.AdditionalArrayOfRefedObject[k][i].Validate(formats); err != nil {`, 4523 ` if ve, ok := err.(*errors.Validation); ok {`, 4524 ` return ve.ValidateName(k + "." + strconv.Itoa(i)`, 4525 ` return errors.CompositeValidationError(res...`, 4526 `func (m *AdditionalArrayOfRefedObject) validateThisOneNotRequired(formats strfmt.Registry) error {`, 4527 ` if swag.IsZero(m.ThisOneNotRequired) {`, 4528 ` if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`, 4529 `type AdditionalArrayOfRefedObjectItems0 struct {`, 4530 " Discourse string `json:\"discourse,omitempty\"`", 4531 " HoursSpent float64 `json:\"hoursSpent,omitempty\"`", 4532 " AdditionalArrayOfRefedObjectItems0AdditionalProperties map[string]interface{} `json:\"-\"`", 4533 // empty validation 4534 "func (m *AdditionalArrayOfRefedObjectItems0) Validate(formats strfmt.Registry) error {\n return nil\n}", 4535 }, 4536 // not expected 4537 todo, 4538 // output in log 4539 noLines, 4540 noLines) 4541 4542 // load expectations for model: additional_slice_of_aliased_primitives.go 4543 flattenRun.AddExpectations("additional_slice_of_aliased_primitives.go", []string{ 4544 `type AdditionalSliceOfAliasedPrimitives struct {`, 4545 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 4546 " AdditionalSliceOfAliasedPrimitives map[string][]AliasedDate `json:\"-\"`", 4547 `func (m *AdditionalSliceOfAliasedPrimitives) Validate(formats strfmt.Registry) error {`, 4548 ` if err := m.validateProp2(formats); err != nil {`, 4549 ` for k := range m.AdditionalSliceOfAliasedPrimitives {`, 4550 // removed undue IsZero call 4551 ` iAdditionalSliceOfAliasedPrimitivesSize := int64(len(m.AdditionalSliceOfAliasedPrimitives[k])`, 4552 ` if err := validate.MaxItems(k, "body", iAdditionalSliceOfAliasedPrimitivesSize, 10); err != nil {`, 4553 ` for i := 0; i < len(m.AdditionalSliceOfAliasedPrimitives[k]); i++ {`, 4554 ` if err := m.AdditionalSliceOfAliasedPrimitives[k][i].Validate(formats); err != nil {`, 4555 ` if ve, ok := err.(*errors.Validation); ok {`, 4556 ` return ve.ValidateName(k + "." + strconv.Itoa(i)`, 4557 ` return errors.CompositeValidationError(res...`, 4558 `func (m *AdditionalSliceOfAliasedPrimitives) validateProp2(formats strfmt.Registry) error {`, 4559 ` if swag.IsZero(m.Prop2) {`, 4560 ` if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`, 4561 }, 4562 // not expected 4563 todo, 4564 // output in log 4565 noLines, 4566 noLines) 4567 4568 expandRun.AddExpectations("additional_slice_of_aliased_primitives.go", []string{ 4569 `type AdditionalSliceOfAliasedPrimitives struct {`, 4570 " Prop2 strfmt.UUID `json:\"prop2,omitempty\"`", 4571 " AdditionalSliceOfAliasedPrimitives map[string][]strfmt.Date `json:\"-\"`", 4572 `func (m *AdditionalSliceOfAliasedPrimitives) Validate(formats strfmt.Registry) error {`, 4573 ` if err := m.validateProp2(formats); err != nil {`, 4574 ` for k := range m.AdditionalSliceOfAliasedPrimitives {`, 4575 ` iAdditionalSliceOfAliasedPrimitivesSize := int64(len(m.AdditionalSliceOfAliasedPrimitives[k])`, 4576 ` if err := validate.MaxItems(k, "body", iAdditionalSliceOfAliasedPrimitivesSize, 10); err != nil {`, 4577 ` for i := 0; i < len(m.AdditionalSliceOfAliasedPrimitives[k]); i++ {`, 4578 ` if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "date", m.AdditionalSliceOfAliasedPrimitives[k][i].String(), formats); err != nil {`, 4579 ` return errors.CompositeValidationError(res...`, 4580 `func (m *AdditionalSliceOfAliasedPrimitives) validateProp2(formats strfmt.Registry) error {`, 4581 ` if swag.IsZero(m.Prop2) {`, 4582 ` if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`, 4583 }, 4584 // not expected 4585 todo, 4586 // output in log 4587 noLines, 4588 noLines) 4589 4590 // load expectations for model: transitive_refed_thing.go 4591 flattenRun.AddExpectations("transitive_refed_thing.go", []string{ 4592 `type TransitiveRefedThing struct {`, 4593 " ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`", 4594 " TransitiveRefedThing map[string]*TransitiveRefedThingAdditionalProperties `json:\"-\"`", 4595 `func (m *TransitiveRefedThing) Validate(formats strfmt.Registry) error {`, 4596 ` if err := m.validateThisOneNotRequiredEither(formats); err != nil {`, 4597 ` for k := range m.TransitiveRefedThing {`, 4598 ` if val, ok := m.TransitiveRefedThing[k]; ok {`, 4599 ` if val != nil {`, 4600 ` if err := val.Validate(formats); err != nil {`, 4601 ` return errors.CompositeValidationError(res...`, 4602 `func (m *TransitiveRefedThing) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`, 4603 ` if swag.IsZero(m.ThisOneNotRequiredEither) {`, 4604 ` if err := validate.MaximumInt("thisOneNotRequiredEither", "body", m.ThisOneNotRequiredEither, 20, false); err != nil {`, 4605 }, 4606 // not expected 4607 todo, 4608 // output in log 4609 noLines, 4610 noLines) 4611 4612 expandRun.AddExpectations("transitive_refed_thing.go", []string{ 4613 `type TransitiveRefedThing struct {`, 4614 " ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`", 4615 " TransitiveRefedThing map[string]*TransitiveRefedThingAnon `json:\"-\"`", 4616 `func (m *TransitiveRefedThing) Validate(formats strfmt.Registry) error {`, 4617 ` if err := m.validateThisOneNotRequiredEither(formats); err != nil {`, 4618 ` for k := range m.TransitiveRefedThing {`, 4619 ` if val, ok := m.TransitiveRefedThing[k]; ok {`, 4620 ` if val != nil {`, 4621 ` if err := val.Validate(formats); err != nil {`, 4622 ` return errors.CompositeValidationError(res...`, 4623 `func (m *TransitiveRefedThing) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`, 4624 ` if swag.IsZero(m.ThisOneNotRequiredEither) {`, 4625 ` if err := validate.MaximumInt("thisOneNotRequiredEither", "body", m.ThisOneNotRequiredEither, 20, false); err != nil {`, 4626 `type TransitiveRefedThingAnon struct {`, 4627 " A1 strfmt.DateTime `json:\"a1,omitempty\"`", 4628 " TransitiveRefedThingAnon map[string]*TransitiveRefedThingAnonAnon `json:\"-\"`", 4629 `func (m *TransitiveRefedThingAnon) Validate(formats strfmt.Registry) error {`, 4630 ` if err := m.validateA1(formats); err != nil {`, 4631 ` for k := range m.TransitiveRefedThingAnon {`, 4632 ` if val, ok := m.TransitiveRefedThingAnon[k]; ok {`, 4633 ` if val != nil {`, 4634 ` if err := val.Validate(formats); err != nil {`, 4635 ` return errors.CompositeValidationError(res...`, 4636 `func (m *TransitiveRefedThingAnon) validateA1(formats strfmt.Registry) error {`, 4637 ` if swag.IsZero(m.A1) {`, 4638 ` if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`, 4639 `type TransitiveRefedThingAnonAnon struct {`, 4640 " Discourse string `json:\"discourse,omitempty\"`", 4641 " HoursSpent float64 `json:\"hoursSpent,omitempty\"`", 4642 " TransitiveRefedThingAnonAnonAdditionalProperties map[string]interface{} `json:\"-\"`", 4643 // empty validation 4644 "func (m *TransitiveRefedThingAnonAnon) Validate(formats strfmt.Registry) error {\n return nil\n}", 4645 }, 4646 // not expected 4647 todo, 4648 // output in log 4649 noLines, 4650 noLines) 4651 4652 // load expectations for model: additional_empty_object.go 4653 flattenRun.AddExpectations("additional_empty_object.go", []string{ 4654 `type AdditionalEmptyObject struct {`, 4655 " PropA interface{} `json:\"propA,omitempty\"`", 4656 " AdditionalEmptyObject map[string]interface{} `json:\"-\"`", 4657 // empty validation 4658 "func (m *AdditionalEmptyObject) Validate(formats strfmt.Registry) error {\n return nil\n}", 4659 }, 4660 // not expected 4661 todo, 4662 // output in log 4663 noLines, 4664 noLines) 4665 4666 expandRun.AddExpectations("additional_empty_object.go", flattenRun.ExpectedFor("AdditionalEmptyObject").ExpectedLines, todo, noLines, noLines) 4667 4668 // load expectations for model: additional_date_with_nullable_thing.go 4669 flattenRun.AddExpectations("additional_date_with_nullable_thing.go", []string{ 4670 `type AdditionalDateWithNullableThing struct {`, 4671 " Blob int64 `json:\"blob,omitempty\"`", 4672 " NullableDate *AliasedNullableDate `json:\"nullableDate,omitempty\"`", 4673 " AdditionalDateWithNullableThing map[string]*AliasedNullableDate `json:\"-\"`", 4674 `func (m *AdditionalDateWithNullableThing) Validate(formats strfmt.Registry) error {`, 4675 ` if err := m.validateBlob(formats); err != nil {`, 4676 ` if err := m.validateNullableDate(formats); err != nil {`, 4677 ` for k := range m.AdditionalDateWithNullableThing {`, 4678 ` if swag.IsZero(m.AdditionalDateWithNullableThing[k]) {`, 4679 ` if val, ok := m.AdditionalDateWithNullableThing[k]; ok {`, 4680 ` if val != nil {`, 4681 ` if err := val.Validate(formats); err != nil {`, 4682 ` return errors.CompositeValidationError(res...`, 4683 `func (m *AdditionalDateWithNullableThing) validateBlob(formats strfmt.Registry) error {`, 4684 ` if swag.IsZero(m.Blob) {`, 4685 ` if err := validate.MinimumInt("blob", "body", m.Blob, 1, false); err != nil {`, 4686 `func (m *AdditionalDateWithNullableThing) validateNullableDate(formats strfmt.Registry) error {`, 4687 ` if swag.IsZero(m.NullableDate) {`, 4688 ` if m.NullableDate != nil {`, 4689 ` if err := m.NullableDate.Validate(formats); err != nil {`, 4690 ` if ve, ok := err.(*errors.Validation); ok {`, 4691 ` return ve.ValidateName("nullableDate"`, 4692 }, 4693 // not expected 4694 todo, 4695 // output in log 4696 noLines, 4697 noLines) 4698 4699 expandRun.AddExpectations("additional_date_with_nullable_thing.go", []string{ 4700 `type AdditionalDateWithNullableThing struct {`, 4701 " Blob int64 `json:\"blob,omitempty\"`", 4702 " NullableDate *strfmt.Date `json:\"nullableDate,omitempty\"`", 4703 " AdditionalDateWithNullableThing map[string]*strfmt.Date `json:\"-\"`", 4704 `func (m *AdditionalDateWithNullableThing) Validate(formats strfmt.Registry) error {`, 4705 ` if err := m.validateBlob(formats); err != nil {`, 4706 ` if err := m.validateNullableDate(formats); err != nil {`, 4707 ` for k := range m.AdditionalDateWithNullableThing {`, 4708 ` if swag.IsZero(m.AdditionalDateWithNullableThing[k]) {`, 4709 ` if err := validate.FormatOf(k, "body", "date", m.AdditionalDateWithNullableThing[k].String(), formats); err != nil {`, 4710 ` return errors.CompositeValidationError(res...`, 4711 `func (m *AdditionalDateWithNullableThing) validateBlob(formats strfmt.Registry) error {`, 4712 ` if swag.IsZero(m.Blob) {`, 4713 ` if err := validate.MinimumInt("blob", "body", m.Blob, 1, false); err != nil {`, 4714 `func (m *AdditionalDateWithNullableThing) validateNullableDate(formats strfmt.Registry) error {`, 4715 ` if swag.IsZero(m.NullableDate) {`, 4716 ` if err := validate.FormatOf("nullableDate", "body", "date", m.NullableDate.String(), formats); err != nil {`, 4717 }, 4718 // not expected 4719 todo, 4720 // output in log 4721 noLines, 4722 noLines) 4723 4724 } 4725 4726 func initFixtureTuple() { 4727 // testing ../fixtures/bugs/1487/fixture-tuple.yaml with expand (--skip-flatten) 4728 4729 /* check different patterns of additionalItems validations or absence thereof 4730 */ 4731 f := newModelFixture("../fixtures/bugs/1487/fixture-tuple.yaml", "fixture for tuples and additionalItems") 4732 flattenRun := f.AddRun(false) 4733 expandRun := f.AddRun(true) 4734 4735 // load expectations for model: classics.go 4736 flattenRun.AddExpectations("classics.go", []string{ 4737 `type Classics struct {`, 4738 " P0 *int64 `json:\"-\"`", 4739 " P1 *strfmt.ISBN `json:\"-\"`", 4740 " P2 Comics `json:\"-\"`", 4741 " ClassicsItems []ClassicsTupleAdditionalItems `json:\"-\"`", 4742 `func (m *Classics) Validate(formats strfmt.Registry) error {`, 4743 ` if err := m.validateP0(formats); err != nil {`, 4744 ` if err := m.validateP1(formats); err != nil {`, 4745 ` if err := m.validateP2(formats); err != nil {`, 4746 ` if err := m.validateClassicsItems(formats); err != nil {`, 4747 ` return errors.CompositeValidationError(res...`, 4748 `func (m *Classics) validateP0(formats strfmt.Registry) error {`, 4749 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 4750 `func (m *Classics) validateP1(formats strfmt.Registry) error {`, 4751 ` if err := validate.Required("1", "body", m.P1); err != nil {`, 4752 ` if err := validate.FormatOf("1", "body", "isbn", m.P1.String(), formats); err != nil {`, 4753 `func (m *Classics) validateP2(formats strfmt.Registry) error {`, 4754 ` if err := m.P2.Validate(formats); err != nil {`, 4755 ` if ve, ok := err.(*errors.Validation); ok {`, 4756 ` return ve.ValidateName("2"`, 4757 `func (m *Classics) validateClassicsItems(formats strfmt.Registry) error {`, 4758 ` for i := range m.ClassicsItems {`, 4759 ` if err := m.ClassicsItems[i].Validate(formats); err != nil {`, 4760 ` if ve, ok := err.(*errors.Validation); ok {`, 4761 ` return ve.ValidateName(strconv.Itoa(i + 3)`, 4762 }, 4763 // not expected 4764 todo, 4765 // output in log 4766 noLines, 4767 noLines) 4768 4769 expandRun.AddExpectations("classics.go", []string{ 4770 `type Classics struct {`, 4771 " P0 *int64 `json:\"-\"`", 4772 " P1 *strfmt.ISBN `json:\"-\"`", 4773 " P2 *ClassicsTuple0 `json:\"-\"`", 4774 // TODO: items should not be pointer 4775 " ClassicsItems []*ClassicsClassicsItemsTuple0 `json:\"-\"`", 4776 `func (m *Classics) Validate(formats strfmt.Registry) error {`, 4777 ` if err := m.validateP0(formats); err != nil {`, 4778 ` if err := m.validateP1(formats); err != nil {`, 4779 ` if err := m.validateP2(formats); err != nil {`, 4780 ` if err := m.validateClassicsItems(formats); err != nil {`, 4781 ` return errors.CompositeValidationError(res...`, 4782 `func (m *Classics) validateP0(formats strfmt.Registry) error {`, 4783 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 4784 `func (m *Classics) validateP1(formats strfmt.Registry) error {`, 4785 ` if err := validate.Required("1", "body", m.P1); err != nil {`, 4786 ` if err := validate.FormatOf("1", "body", "isbn", m.P1.String(), formats); err != nil {`, 4787 `func (m *Classics) validateP2(formats strfmt.Registry) error {`, 4788 ` if err := validate.Required("2", "body", m.P2); err != nil {`, 4789 ` if m.P2 != nil {`, 4790 ` if err := m.P2.Validate(formats); err != nil {`, 4791 ` if ve, ok := err.(*errors.Validation); ok {`, 4792 ` return ve.ValidateName("2"`, 4793 `func (m *Classics) validateClassicsItems(formats strfmt.Registry) error {`, 4794 ` for i := range m.ClassicsItems {`, 4795 ` if m.ClassicsItems[i] != nil {`, 4796 ` if err := m.ClassicsItems[i].Validate(formats); err != nil {`, 4797 ` if ve, ok := err.(*errors.Validation); ok {`, 4798 ` return ve.ValidateName(strconv.Itoa(i + 3)`, 4799 `type ClassicsClassicsItemsTuple0 struct {`, 4800 " P0 *ClassicsClassicsItemsTuple0P0 `json:\"-\"`", 4801 " P1 []strfmt.Date `json:\"-\"`", 4802 " P2 *ClassicsClassicsItemsTuple0P2 `json:\"-\"`", 4803 " P3 *ClassicsClassicsItemsTuple0P3Tuple0 `json:\"-\"`", 4804 `func (m *ClassicsClassicsItemsTuple0) Validate(formats strfmt.Registry) error {`, 4805 ` if err := m.validateP0(formats); err != nil {`, 4806 ` if err := m.validateP1(formats); err != nil {`, 4807 ` if err := m.validateP2(formats); err != nil {`, 4808 ` if err := m.validateP3(formats); err != nil {`, 4809 ` return errors.CompositeValidationError(res...`, 4810 `func (m *ClassicsClassicsItemsTuple0) validateP0(formats strfmt.Registry) error {`, 4811 ` if err := validate.Required("P0", "body", m.P0); err != nil {`, 4812 ` if m.P0 != nil {`, 4813 ` if err := m.P0.Validate(formats); err != nil {`, 4814 ` if ve, ok := err.(*errors.Validation); ok {`, 4815 ` return ve.ValidateName("P0"`, 4816 `func (m *ClassicsClassicsItemsTuple0) validateP1(formats strfmt.Registry) error {`, 4817 ` if err := validate.Required("P1", "body", m.P1); err != nil {`, 4818 ` for i := 0; i < len(m.P1); i++ {`, 4819 ` if err := validate.FormatOf("P1"+"."+strconv.Itoa(i), "body", "date", m.P1[i].String(), formats); err != nil {`, 4820 `func (m *ClassicsClassicsItemsTuple0) validateP2(formats strfmt.Registry) error {`, 4821 ` if err := validate.Required("P2", "body", m.P2); err != nil {`, 4822 ` if m.P2 != nil {`, 4823 ` if err := m.P2.Validate(formats); err != nil {`, 4824 ` if ve, ok := err.(*errors.Validation); ok {`, 4825 ` return ve.ValidateName("P2"`, 4826 `func (m *ClassicsClassicsItemsTuple0) validateP3(formats strfmt.Registry) error {`, 4827 ` if err := validate.Required("P3", "body", m.P3); err != nil {`, 4828 ` if m.P3 != nil {`, 4829 ` if err := m.P3.Validate(formats); err != nil {`, 4830 ` if ve, ok := err.(*errors.Validation); ok {`, 4831 ` return ve.ValidateName("P3"`, 4832 `type ClassicsClassicsItemsTuple0P0 struct {`, 4833 " Period *string `json:\"period,omitempty\"`", 4834 " Title *string `json:\"title,omitempty\"`", 4835 `func (m *ClassicsClassicsItemsTuple0P0) Validate(formats strfmt.Registry) error {`, 4836 ` if err := m.validateTitle(formats); err != nil {`, 4837 ` return errors.CompositeValidationError(res...`, 4838 `var classicsClassicsItemsTuple0P0TypeTitlePropEnum []interface{`, 4839 ` var res []string`, 4840 " if err := json.Unmarshal([]byte(`[\"Les Misérables\",\"Bleak House\",\"Sherlock Holmes\",\"Siddhartha\"]`), &res); err != nil {", 4841 ` for _, v := range res {`, 4842 ` classicsClassicsItemsTuple0P0TypeTitlePropEnum = append(classicsClassicsItemsTuple0P0TypeTitlePropEnum, v`, 4843 ` ClassicsClassicsItemsTuple0P0TitleLesMisérables string = "Les Misérables"`, 4844 ` ClassicsClassicsItemsTuple0P0TitleBleakHouse string = "Bleak House"`, 4845 ` ClassicsClassicsItemsTuple0P0TitleSherlockHolmes string = "Sherlock Holmes"`, 4846 ` ClassicsClassicsItemsTuple0P0TitleSiddhartha string = "Siddhartha"`, 4847 `func (m *ClassicsClassicsItemsTuple0P0) validateTitleEnum(path, location string, value string) error {`, 4848 ` if err := validate.EnumCase(path, location, value, classicsClassicsItemsTuple0P0TypeTitlePropEnum, true); err != nil {`, 4849 `func (m *ClassicsClassicsItemsTuple0P0) validateTitle(formats strfmt.Registry) error {`, 4850 ` if swag.IsZero(m.Title) {`, 4851 ` if err := m.validateTitleEnum("P0"+"."+"title", "body", *m.Title); err != nil {`, 4852 `type ClassicsClassicsItemsTuple0P2 struct {`, 4853 " Origin *string `json:\"origin,omitempty\"`", 4854 " ClassicsClassicsItemsTuple0P2 map[string]string `json:\"-\"`", 4855 `var classicsClassicsItemsTuple0P2ValueEnum []interface{`, 4856 ` var res []string`, 4857 " if err := json.Unmarshal([]byte(`[\"bookshop\",\"amazon\",\"library\"]`), &res); err != nil {", 4858 ` for _, v := range res {`, 4859 ` classicsClassicsItemsTuple0P2ValueEnum = append(classicsClassicsItemsTuple0P2ValueEnum, v`, 4860 `func (m *ClassicsClassicsItemsTuple0P2) validateClassicsClassicsItemsTuple0P2ValueEnum(path, location string, value string) error {`, 4861 ` if err := validate.EnumCase(path, location, value, classicsClassicsItemsTuple0P2ValueEnum, true); err != nil {`, 4862 `func (m *ClassicsClassicsItemsTuple0P2) Validate(formats strfmt.Registry) error {`, 4863 ` if err := m.validateOrigin(formats); err != nil {`, 4864 ` for k := range m.ClassicsClassicsItemsTuple0P2 {`, 4865 // removed undue IsZero() call 4866 ` if err := m.validateClassicsClassicsItemsTuple0P2ValueEnum("P2"+"."+k, "body", m.ClassicsClassicsItemsTuple0P2[k]); err != nil {`, 4867 ` return errors.CompositeValidationError(res...`, 4868 `var classicsClassicsItemsTuple0P2TypeOriginPropEnum []interface{`, 4869 ` var res []string`, 4870 " if err := json.Unmarshal([]byte(`[\"print\",\"e-book\",\"collection\",\"museum\"]`), &res); err != nil {", 4871 ` for _, v := range res {`, 4872 ` classicsClassicsItemsTuple0P2TypeOriginPropEnum = append(classicsClassicsItemsTuple0P2TypeOriginPropEnum, v`, 4873 ` ClassicsClassicsItemsTuple0P2OriginPrint string = "print"`, 4874 ` ClassicsClassicsItemsTuple0P2OriginEDashBook string = "e-book"`, 4875 ` ClassicsClassicsItemsTuple0P2OriginCollection string = "collection"`, 4876 ` ClassicsClassicsItemsTuple0P2OriginMuseum string = "museum"`, 4877 `func (m *ClassicsClassicsItemsTuple0P2) validateOriginEnum(path, location string, value string) error {`, 4878 ` if err := validate.EnumCase(path, location, value, classicsClassicsItemsTuple0P2TypeOriginPropEnum, true); err != nil {`, 4879 `func (m *ClassicsClassicsItemsTuple0P2) validateOrigin(formats strfmt.Registry) error {`, 4880 ` if swag.IsZero(m.Origin) {`, 4881 ` if err := m.validateOriginEnum("P2"+"."+"origin", "body", *m.Origin); err != nil {`, 4882 `type ClassicsClassicsItemsTuple0P3Tuple0 struct {`, 4883 " P0 *string `json:\"-\"`", 4884 " P1 *ClassicsClassicsItemsTuple0P3Tuple0P1 `json:\"-\"`", 4885 " P2 *ClassicsClassicsItemsTuple0P3Tuple0P2 `json:\"-\"`", 4886 " P3 *ClassicsClassicsItemsTuple0P3Tuple0P3 `json:\"-\"`", 4887 " P4 []strfmt.ISBN `json:\"-\"`", 4888 " P5 *int64 `json:\"-\"`", 4889 `func (m *ClassicsClassicsItemsTuple0P3Tuple0) Validate(formats strfmt.Registry) error {`, 4890 ` if err := m.validateP0(formats); err != nil {`, 4891 ` if err := m.validateP1(formats); err != nil {`, 4892 ` if err := m.validateP2(formats); err != nil {`, 4893 ` if err := m.validateP3(formats); err != nil {`, 4894 ` if err := m.validateP4(formats); err != nil {`, 4895 ` if err := m.validateP5(formats); err != nil {`, 4896 ` return errors.CompositeValidationError(res...`, 4897 `func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP0(formats strfmt.Registry) error {`, 4898 ` if err := validate.Required("P0", "body", m.P0); err != nil {`, 4899 `func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP1(formats strfmt.Registry) error {`, 4900 ` if err := validate.Required("P1", "body", m.P1); err != nil {`, 4901 ` if m.P1 != nil {`, 4902 ` if err := m.P1.Validate(formats); err != nil {`, 4903 ` if ve, ok := err.(*errors.Validation); ok {`, 4904 ` return ve.ValidateName("P1"`, 4905 `func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP2(formats strfmt.Registry) error {`, 4906 ` if err := validate.Required("P2", "body", m.P2); err != nil {`, 4907 ` if m.P2 != nil {`, 4908 ` if err := m.P2.Validate(formats); err != nil {`, 4909 ` if ve, ok := err.(*errors.Validation); ok {`, 4910 ` return ve.ValidateName("P2"`, 4911 `func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP3(formats strfmt.Registry) error {`, 4912 ` if err := validate.Required("P3", "body", m.P3); err != nil {`, 4913 ` if m.P3 != nil {`, 4914 ` if err := m.P3.Validate(formats); err != nil {`, 4915 ` if ve, ok := err.(*errors.Validation); ok {`, 4916 ` return ve.ValidateName("P3"`, 4917 `func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP4(formats strfmt.Registry) error {`, 4918 ` if err := validate.Required("P4", "body", m.P4); err != nil {`, 4919 ` for i := 0; i < len(m.P4); i++ {`, 4920 ` if err := validate.FormatOf("P4"+"."+strconv.Itoa(i), "body", "isbn", m.P4[i].String(), formats); err != nil {`, 4921 `func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP5(formats strfmt.Registry) error {`, 4922 ` if err := validate.Required("P5", "body", m.P5); err != nil {`, 4923 `type ClassicsClassicsItemsTuple0P3Tuple0P1 struct {`, 4924 " Narrative *string `json:\"narrative\"`", 4925 `func (m *ClassicsClassicsItemsTuple0P3Tuple0P1) Validate(formats strfmt.Registry) error {`, 4926 ` if err := m.validateNarrative(formats); err != nil {`, 4927 ` return errors.CompositeValidationError(res...`, 4928 `func (m *ClassicsClassicsItemsTuple0P3Tuple0P1) validateNarrative(formats strfmt.Registry) error {`, 4929 ` if err := validate.Required("P1"+"."+"narrative", "body", m.Narrative); err != nil {`, 4930 `type ClassicsClassicsItemsTuple0P3Tuple0P2 struct {`, 4931 " MarketingBS *string `json:\"marketingBS,omitempty\"`", 4932 `func (m *ClassicsClassicsItemsTuple0P3Tuple0P2) Validate(formats strfmt.Registry) error {`, 4933 ` return errors.CompositeValidationError(res...`, 4934 `type ClassicsClassicsItemsTuple0P3Tuple0P3 struct {`, 4935 " Author *string `json:\"author,omitempty\"`", 4936 " Character *string `json:\"character,omitempty\"`", 4937 `func (m *ClassicsClassicsItemsTuple0P3Tuple0P3) Validate(formats strfmt.Registry) error {`, 4938 ` if err := m.validateAuthor(formats); err != nil {`, 4939 ` if err := m.validateCharacter(formats); err != nil {`, 4940 ` return errors.CompositeValidationError(res...`, 4941 `func (m *ClassicsClassicsItemsTuple0P3Tuple0P3) validateAuthor(formats strfmt.Registry) error {`, 4942 ` if swag.IsZero(m.Author) {`, 4943 ` if err := validate.MinLength("P3"+"."+"author", "body", *m.Author, 1); err != nil {`, 4944 `func (m *ClassicsClassicsItemsTuple0P3Tuple0P3) validateCharacter(formats strfmt.Registry) error {`, 4945 ` if swag.IsZero(m.Character) {`, 4946 " if err := validate.Pattern(\"P3\"+\".\"+\"character\", \"body\", *m.Character, `^[A-Z]+$`); err != nil {", 4947 `type ClassicsTuple0 struct {`, 4948 " P0 *string `json:\"-\"`", 4949 " P1 *ClassicsTuple0P1 `json:\"-\"`", 4950 " P2 *ClassicsTuple0P2 `json:\"-\"`", 4951 " P3 *ClassicsTuple0P3 `json:\"-\"`", 4952 " P4 []strfmt.ISBN `json:\"-\"`", 4953 " P5 *int64 `json:\"-\"`", 4954 `func (m *ClassicsTuple0) Validate(formats strfmt.Registry) error {`, 4955 ` if err := m.validateP0(formats); err != nil {`, 4956 ` if err := m.validateP1(formats); err != nil {`, 4957 ` if err := m.validateP2(formats); err != nil {`, 4958 ` if err := m.validateP3(formats); err != nil {`, 4959 ` if err := m.validateP4(formats); err != nil {`, 4960 ` if err := m.validateP5(formats); err != nil {`, 4961 ` return errors.CompositeValidationError(res...`, 4962 `func (m *ClassicsTuple0) validateP0(formats strfmt.Registry) error {`, 4963 ` if err := validate.Required("P0", "body", m.P0); err != nil {`, 4964 `func (m *ClassicsTuple0) validateP1(formats strfmt.Registry) error {`, 4965 ` if err := validate.Required("P1", "body", m.P1); err != nil {`, 4966 ` if m.P1 != nil {`, 4967 ` if err := m.P1.Validate(formats); err != nil {`, 4968 ` if ve, ok := err.(*errors.Validation); ok {`, 4969 ` return ve.ValidateName("P1"`, 4970 `func (m *ClassicsTuple0) validateP2(formats strfmt.Registry) error {`, 4971 ` if err := validate.Required("P2", "body", m.P2); err != nil {`, 4972 ` if m.P2 != nil {`, 4973 ` if err := m.P2.Validate(formats); err != nil {`, 4974 ` if ve, ok := err.(*errors.Validation); ok {`, 4975 ` return ve.ValidateName("P2"`, 4976 `func (m *ClassicsTuple0) validateP3(formats strfmt.Registry) error {`, 4977 ` if err := validate.Required("P3", "body", m.P3); err != nil {`, 4978 ` if m.P3 != nil {`, 4979 ` if err := m.P3.Validate(formats); err != nil {`, 4980 ` if ve, ok := err.(*errors.Validation); ok {`, 4981 ` return ve.ValidateName("P3"`, 4982 `func (m *ClassicsTuple0) validateP4(formats strfmt.Registry) error {`, 4983 ` if err := validate.Required("P4", "body", m.P4); err != nil {`, 4984 ` for i := 0; i < len(m.P4); i++ {`, 4985 ` if err := validate.FormatOf("P4"+"."+strconv.Itoa(i), "body", "isbn", m.P4[i].String(), formats); err != nil {`, 4986 `func (m *ClassicsTuple0) validateP5(formats strfmt.Registry) error {`, 4987 ` if err := validate.Required("P5", "body", m.P5); err != nil {`, 4988 `type ClassicsTuple0P1 struct {`, 4989 " Narrative *string `json:\"narrative\"`", 4990 `func (m *ClassicsTuple0P1) Validate(formats strfmt.Registry) error {`, 4991 ` if err := m.validateNarrative(formats); err != nil {`, 4992 ` return errors.CompositeValidationError(res...`, 4993 `func (m *ClassicsTuple0P1) validateNarrative(formats strfmt.Registry) error {`, 4994 ` if err := validate.Required("P1"+"."+"narrative", "body", m.Narrative); err != nil {`, 4995 `type ClassicsTuple0P2 struct {`, 4996 " MarketingBS *string `json:\"marketingBS,omitempty\"`", 4997 `func (m *ClassicsTuple0P2) Validate(formats strfmt.Registry) error {`, 4998 ` return errors.CompositeValidationError(res...`, 4999 `type ClassicsTuple0P3 struct {`, 5000 " Author *string `json:\"author,omitempty\"`", 5001 " Character *string `json:\"character,omitempty\"`", 5002 `func (m *ClassicsTuple0P3) Validate(formats strfmt.Registry) error {`, 5003 ` if err := m.validateAuthor(formats); err != nil {`, 5004 ` if err := m.validateCharacter(formats); err != nil {`, 5005 ` return errors.CompositeValidationError(res...`, 5006 `func (m *ClassicsTuple0P3) validateAuthor(formats strfmt.Registry) error {`, 5007 ` if swag.IsZero(m.Author) {`, 5008 ` if err := validate.MinLength("P3"+"."+"author", "body", *m.Author, 1); err != nil {`, 5009 `func (m *ClassicsTuple0P3) validateCharacter(formats strfmt.Registry) error {`, 5010 ` if swag.IsZero(m.Character) {`, 5011 " if err := validate.Pattern(\"P3\"+\".\"+\"character\", \"body\", *m.Character, `^[A-Z]+$`); err != nil {", 5012 }, 5013 // not expected 5014 todo, 5015 // output in log 5016 noLines, 5017 noLines) 5018 5019 // load expectations for model: comics_items2.go 5020 flattenRun.AddExpectations("comics_items2.go", []string{ 5021 `type ComicsItems2 struct {`, 5022 " MarketingBS string `json:\"marketingBS,omitempty\"`", 5023 // empty validation 5024 "func (m *ComicsItems2) Validate(formats strfmt.Registry) error {\n return nil\n}", 5025 }, 5026 // not expected 5027 todo, 5028 // output in log 5029 noLines, 5030 noLines) 5031 5032 // load expectations for model: classics_items_additional_items_items2.go 5033 flattenRun.AddExpectations("classics_items_additional_items_items2.go", []string{ 5034 `type ClassicsItemsAdditionalItemsItems2 struct {`, 5035 " Origin string `json:\"origin,omitempty\"`", 5036 " ClassicsItemsAdditionalItemsItems2 map[string]string `json:\"-\"`", 5037 `var classicsItemsAdditionalItemsItems2ValueEnum []interface{`, 5038 ` var res []string`, 5039 " if err := json.Unmarshal([]byte(`[\"bookshop\",\"amazon\",\"library\"]`), &res); err != nil {", 5040 ` for _, v := range res {`, 5041 ` classicsItemsAdditionalItemsItems2ValueEnum = append(classicsItemsAdditionalItemsItems2ValueEnum, v`, 5042 `func (m *ClassicsItemsAdditionalItemsItems2) validateClassicsItemsAdditionalItemsItems2ValueEnum(path, location string, value string) error {`, 5043 ` if err := validate.EnumCase(path, location, value, classicsItemsAdditionalItemsItems2ValueEnum, true); err != nil {`, 5044 `func (m *ClassicsItemsAdditionalItemsItems2) Validate(formats strfmt.Registry) error {`, 5045 ` if err := m.validateOrigin(formats); err != nil {`, 5046 ` for k := range m.ClassicsItemsAdditionalItemsItems2 {`, 5047 // removed undue IsZero() 5048 ` if err := m.validateClassicsItemsAdditionalItemsItems2ValueEnum(k, "body", m.ClassicsItemsAdditionalItemsItems2[k]); err != nil {`, 5049 ` return errors.CompositeValidationError(res...`, 5050 `var classicsItemsAdditionalItemsItems2TypeOriginPropEnum []interface{`, 5051 ` var res []string`, 5052 " if err := json.Unmarshal([]byte(`[\"print\",\"e-book\",\"collection\",\"museum\"]`), &res); err != nil {", 5053 ` for _, v := range res {`, 5054 ` classicsItemsAdditionalItemsItems2TypeOriginPropEnum = append(classicsItemsAdditionalItemsItems2TypeOriginPropEnum, v`, 5055 ` ClassicsItemsAdditionalItemsItems2OriginPrint string = "print"`, 5056 ` ClassicsItemsAdditionalItemsItems2OriginEDashBook string = "e-book"`, 5057 ` ClassicsItemsAdditionalItemsItems2OriginCollection string = "collection"`, 5058 ` ClassicsItemsAdditionalItemsItems2OriginMuseum string = "museum"`, 5059 `func (m *ClassicsItemsAdditionalItemsItems2) validateOriginEnum(path, location string, value string) error {`, 5060 ` if err := validate.EnumCase(path, location, value, classicsItemsAdditionalItemsItems2TypeOriginPropEnum, true); err != nil {`, 5061 `func (m *ClassicsItemsAdditionalItemsItems2) validateOrigin(formats strfmt.Registry) error {`, 5062 ` if swag.IsZero(m.Origin) {`, 5063 ` if err := m.validateOriginEnum("origin", "body", m.Origin); err != nil {`, 5064 }, 5065 // not expected 5066 todo, 5067 // output in log 5068 noLines, 5069 noLines) 5070 5071 // load expectations for model: comics.go 5072 flattenRun.AddExpectations("comics.go", []string{ 5073 `type Comics struct {`, 5074 " P0 *string `json:\"-\"`", 5075 " P1 *ComicsItems1 `json:\"-\"`", 5076 " P2 *ComicsItems2 `json:\"-\"`", 5077 " P3 *ComicsItems3 `json:\"-\"`", 5078 " P4 []strfmt.ISBN `json:\"-\"`", 5079 " P5 *int64 `json:\"-\"`", 5080 `func (m *Comics) Validate(formats strfmt.Registry) error {`, 5081 ` if err := m.validateP0(formats); err != nil {`, 5082 ` if err := m.validateP1(formats); err != nil {`, 5083 ` if err := m.validateP2(formats); err != nil {`, 5084 ` if err := m.validateP3(formats); err != nil {`, 5085 ` if err := m.validateP4(formats); err != nil {`, 5086 ` if err := m.validateP5(formats); err != nil {`, 5087 ` return errors.CompositeValidationError(res...`, 5088 `func (m *Comics) validateP0(formats strfmt.Registry) error {`, 5089 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 5090 `func (m *Comics) validateP1(formats strfmt.Registry) error {`, 5091 ` if err := validate.Required("1", "body", m.P1); err != nil {`, 5092 ` if m.P1 != nil {`, 5093 ` if err := m.P1.Validate(formats); err != nil {`, 5094 ` if ve, ok := err.(*errors.Validation); ok {`, 5095 ` return ve.ValidateName("1"`, 5096 `func (m *Comics) validateP2(formats strfmt.Registry) error {`, 5097 ` if err := validate.Required("2", "body", m.P2); err != nil {`, 5098 ` if m.P2 != nil {`, 5099 ` if err := m.P2.Validate(formats); err != nil {`, 5100 ` if ve, ok := err.(*errors.Validation); ok {`, 5101 ` return ve.ValidateName("2"`, 5102 `func (m *Comics) validateP3(formats strfmt.Registry) error {`, 5103 ` if err := validate.Required("3", "body", m.P3); err != nil {`, 5104 ` if m.P3 != nil {`, 5105 ` if err := m.P3.Validate(formats); err != nil {`, 5106 ` if ve, ok := err.(*errors.Validation); ok {`, 5107 ` return ve.ValidateName("3"`, 5108 `func (m *Comics) validateP4(formats strfmt.Registry) error {`, 5109 ` if err := validate.Required("4", "body", m.P4); err != nil {`, 5110 ` for i := 0; i < len(m.P4); i++ {`, 5111 ` if err := validate.FormatOf("4"+"."+strconv.Itoa(i), "body", "isbn", m.P4[i].String(), formats); err != nil {`, 5112 `func (m *Comics) validateP5(formats strfmt.Registry) error {`, 5113 ` if err := validate.Required("5", "body", m.P5); err != nil {`, 5114 }, 5115 // not expected 5116 todo, 5117 // output in log 5118 noLines, 5119 noLines) 5120 5121 expandRun.AddExpectations("comics.go", []string{ 5122 `type Comics struct {`, 5123 " P0 *string `json:\"-\"`", 5124 " P1 *ComicsItems1 `json:\"-\"`", 5125 " P2 *ComicsItems2 `json:\"-\"`", 5126 " P3 *ComicsItems3 `json:\"-\"`", 5127 " P4 []strfmt.ISBN `json:\"-\"`", 5128 " P5 *int64 `json:\"-\"`", 5129 `func (m *Comics) Validate(formats strfmt.Registry) error {`, 5130 ` if err := m.validateP0(formats); err != nil {`, 5131 ` if err := m.validateP1(formats); err != nil {`, 5132 ` if err := m.validateP2(formats); err != nil {`, 5133 ` if err := m.validateP3(formats); err != nil {`, 5134 ` if err := m.validateP4(formats); err != nil {`, 5135 ` if err := m.validateP5(formats); err != nil {`, 5136 ` return errors.CompositeValidationError(res...`, 5137 `func (m *Comics) validateP0(formats strfmt.Registry) error {`, 5138 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 5139 `func (m *Comics) validateP1(formats strfmt.Registry) error {`, 5140 ` if err := validate.Required("1", "body", m.P1); err != nil {`, 5141 `func (m *Comics) validateP2(formats strfmt.Registry) error {`, 5142 ` if err := validate.Required("2", "body", m.P2); err != nil {`, 5143 `func (m *Comics) validateP3(formats strfmt.Registry) error {`, 5144 ` if err := validate.Required("3", "body", m.P3); err != nil {`, 5145 `func (m *Comics) validateP4(formats strfmt.Registry) error {`, 5146 ` if err := validate.Required("4", "body", m.P4); err != nil {`, 5147 ` for i := 0; i < len(m.P4); i++ {`, 5148 ` if err := validate.FormatOf("4"+"."+strconv.Itoa(i), "body", "isbn", m.P4[i].String(), formats); err != nil {`, 5149 `func (m *Comics) validateP5(formats strfmt.Registry) error {`, 5150 ` if err := validate.Required("5", "body", m.P5); err != nil {`, 5151 `type ComicsItems1 struct {`, 5152 `type ComicsItems2 struct {`, 5153 `type ComicsItems3 struct {`, 5154 }, 5155 // not expected 5156 todo, 5157 // output in log 5158 noLines, 5159 noLines) 5160 5161 // load expectations for model: classics_items_additional_items_items0.go 5162 flattenRun.AddExpectations("classics_items_additional_items_items0.go", []string{ 5163 `type ClassicsItemsAdditionalItemsItems0 struct {`, 5164 " Period string `json:\"period,omitempty\"`", 5165 " Title string `json:\"title,omitempty\"`", 5166 `func (m *ClassicsItemsAdditionalItemsItems0) Validate(formats strfmt.Registry) error {`, 5167 ` if err := m.validateTitle(formats); err != nil {`, 5168 ` return errors.CompositeValidationError(res...`, 5169 `var classicsItemsAdditionalItemsItems0TypeTitlePropEnum []interface{`, 5170 ` var res []string`, 5171 " if err := json.Unmarshal([]byte(`[\"Les Misérables\",\"Bleak House\",\"Sherlock Holmes\",\"Siddhartha\"]`), &res); err != nil {", 5172 ` for _, v := range res {`, 5173 ` classicsItemsAdditionalItemsItems0TypeTitlePropEnum = append(classicsItemsAdditionalItemsItems0TypeTitlePropEnum, v`, 5174 ` ClassicsItemsAdditionalItemsItems0TitleLesMisérables string = "Les Misérables"`, 5175 ` ClassicsItemsAdditionalItemsItems0TitleBleakHouse string = "Bleak House"`, 5176 ` ClassicsItemsAdditionalItemsItems0TitleSherlockHolmes string = "Sherlock Holmes"`, 5177 ` ClassicsItemsAdditionalItemsItems0TitleSiddhartha string = "Siddhartha"`, 5178 `func (m *ClassicsItemsAdditionalItemsItems0) validateTitleEnum(path, location string, value string) error {`, 5179 ` if err := validate.EnumCase(path, location, value, classicsItemsAdditionalItemsItems0TypeTitlePropEnum, true); err != nil {`, 5180 `func (m *ClassicsItemsAdditionalItemsItems0) validateTitle(formats strfmt.Registry) error {`, 5181 ` if swag.IsZero(m.Title) {`, 5182 ` if err := m.validateTitleEnum("title", "body", m.Title); err != nil {`, 5183 }, 5184 // not expected 5185 todo, 5186 // output in log 5187 noLines, 5188 noLines) 5189 5190 // load expectations for model: comics_items1.go 5191 flattenRun.AddExpectations("comics_items1.go", []string{ 5192 `type ComicsItems1 struct {`, 5193 " Narrative *string `json:\"narrative\"`", 5194 `func (m *ComicsItems1) Validate(formats strfmt.Registry) error {`, 5195 ` if err := m.validateNarrative(formats); err != nil {`, 5196 ` return errors.CompositeValidationError(res...`, 5197 `func (m *ComicsItems1) validateNarrative(formats strfmt.Registry) error {`, 5198 ` if err := validate.Required("narrative", "body", m.Narrative); err != nil {`, 5199 }, 5200 // not expected 5201 todo, 5202 // output in log 5203 noLines, 5204 noLines) 5205 5206 // load expectations for model: comics_items3.go 5207 flattenRun.AddExpectations("comics_items3.go", []string{ 5208 `type ComicsItems3 struct {`, 5209 " Author string `json:\"author,omitempty\"`", 5210 " Character string `json:\"character,omitempty\"`", 5211 `func (m *ComicsItems3) Validate(formats strfmt.Registry) error {`, 5212 ` if err := m.validateAuthor(formats); err != nil {`, 5213 ` if err := m.validateCharacter(formats); err != nil {`, 5214 ` return errors.CompositeValidationError(res...`, 5215 `func (m *ComicsItems3) validateAuthor(formats strfmt.Registry) error {`, 5216 ` if swag.IsZero(m.Author) {`, 5217 ` if err := validate.MinLength("author", "body", m.Author, 1); err != nil {`, 5218 `func (m *ComicsItems3) validateCharacter(formats strfmt.Registry) error {`, 5219 ` if swag.IsZero(m.Character) {`, 5220 " if err := validate.Pattern(\"character\", \"body\", m.Character, `^[A-Z]+$`); err != nil {", 5221 }, 5222 // not expected 5223 todo, 5224 // output in log 5225 noLines, 5226 noLines) 5227 5228 // load expectations for model: classics_tuple_additional_items.go 5229 flattenRun.AddExpectations("classics_tuple_additional_items.go", []string{ 5230 `type ClassicsTupleAdditionalItems struct {`, 5231 " P0 *ClassicsItemsAdditionalItemsItems0 `json:\"-\"`", 5232 " P1 []strfmt.Date `json:\"-\"`", 5233 " P2 *ClassicsItemsAdditionalItemsItems2 `json:\"-\"`", 5234 " P3 Comics `json:\"-\"`", 5235 `func (m *ClassicsTupleAdditionalItems) Validate(formats strfmt.Registry) error {`, 5236 ` if err := m.validateP0(formats); err != nil {`, 5237 ` if err := m.validateP1(formats); err != nil {`, 5238 ` if err := m.validateP2(formats); err != nil {`, 5239 ` if err := m.validateP3(formats); err != nil {`, 5240 ` return errors.CompositeValidationError(res...`, 5241 `func (m *ClassicsTupleAdditionalItems) validateP0(formats strfmt.Registry) error {`, 5242 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 5243 ` if m.P0 != nil {`, 5244 ` if err := m.P0.Validate(formats); err != nil {`, 5245 ` if ve, ok := err.(*errors.Validation); ok {`, 5246 ` return ve.ValidateName("0"`, 5247 `func (m *ClassicsTupleAdditionalItems) validateP1(formats strfmt.Registry) error {`, 5248 ` if err := validate.Required("1", "body", m.P1); err != nil {`, 5249 ` for i := 0; i < len(m.P1); i++ {`, 5250 ` if err := validate.FormatOf("1"+"."+strconv.Itoa(i), "body", "date", m.P1[i].String(), formats); err != nil {`, 5251 `func (m *ClassicsTupleAdditionalItems) validateP2(formats strfmt.Registry) error {`, 5252 ` if err := validate.Required("2", "body", m.P2); err != nil {`, 5253 ` if m.P2 != nil {`, 5254 ` if err := m.P2.Validate(formats); err != nil {`, 5255 ` if ve, ok := err.(*errors.Validation); ok {`, 5256 ` return ve.ValidateName("2"`, 5257 `func (m *ClassicsTupleAdditionalItems) validateP3(formats strfmt.Registry) error {`, 5258 ` if err := m.P3.Validate(formats); err != nil {`, 5259 ` if ve, ok := err.(*errors.Validation); ok {`, 5260 ` return ve.ValidateName("3"`, 5261 }, 5262 // not expected 5263 todo, 5264 // output in log 5265 noLines, 5266 noLines) 5267 5268 } 5269 5270 func initFixture1198() { 5271 // testing ../fixtures/bugs/1487/fixture-1198.yaml with expand (--skip-flatten) 5272 5273 f := newModelFixture("../fixtures/bugs/1198/fixture-1198.yaml", "string-body-api") 5274 flattenRun := f.AddRun(false) 5275 5276 // load expectations for model: pet.go 5277 flattenRun.AddExpectations("pet.go", []string{ 5278 `type Pet struct {`, 5279 " Date interface{} `json:\"date\"`", 5280 `func (m *Pet) Validate(formats strfmt.Registry) error {`, 5281 ` if err := m.validateDate(formats); err != nil {`, 5282 ` return errors.CompositeValidationError(res...`, 5283 `func (m *Pet) validateDate(formats strfmt.Registry) error {`, 5284 }, 5285 // not expected 5286 todo, 5287 // output in log 5288 noLines, 5289 noLines) 5290 5291 } 5292 5293 func initFixture1042() { 5294 // testing ../fixtures/bugs/1487/fixture-1042.yaml with expand (--skip-flatten) 5295 5296 /* when the specification incorrectly defines the allOf, 5297 generated unmarshalling is wrong. 5298 This fixture asserts that with correct spec, the generated models are correct. 5299 5300 */ 5301 5302 f := newModelFixture("../fixtures/bugs/1042/fixture-1042.yaml", "allOf marshalling") 5303 flattenRun := f.AddRun(false) 5304 5305 // load expectations for model: b.go 5306 flattenRun.AddExpectations("b.go", []string{ 5307 `type B struct {`, 5308 ` A`, 5309 ` BAllOf1`, 5310 `func (m *B) UnmarshalJSON(raw []byte) error {`, 5311 ` var aO0 A`, 5312 ` if err := swag.ReadJSON(raw, &aO0); err != nil {`, 5313 ` m.A = aO0`, 5314 ` var aO1 BAllOf1`, 5315 ` if err := swag.ReadJSON(raw, &aO1); err != nil {`, 5316 ` m.BAllOf1 = aO1`, 5317 `func (m B) MarshalJSON() ([]byte, error) {`, 5318 // slight optimization of allocations 5319 ` _parts := make([][]byte, 0, 2)`, 5320 ` aO0, err := swag.WriteJSON(m.A`, 5321 ` if err != nil {`, 5322 ` return nil, err`, 5323 ` _parts = append(_parts, aO0`, 5324 ` aO1, err := swag.WriteJSON(m.BAllOf1`, 5325 ` if err != nil {`, 5326 ` return nil, err`, 5327 ` _parts = append(_parts, aO1`, 5328 ` return swag.ConcatJSON(_parts...), nil`, 5329 `func (m *B) Validate(formats strfmt.Registry) error {`, 5330 ` if err := m.A.Validate(formats); err != nil {`, 5331 ` if err := m.BAllOf1.Validate(formats); err != nil {`, 5332 ` return errors.CompositeValidationError(res...`, 5333 }, 5334 // not expected 5335 todo, 5336 // output in log 5337 noLines, 5338 noLines) 5339 5340 // load expectations for model: b_all_of1.go 5341 flattenRun.AddExpectations("b_all_of1.go", []string{ 5342 `type BAllOf1 struct {`, 5343 " F3 *string `json:\"f3\"`", 5344 " F4 []string `json:\"f4\"`", 5345 `func (m *BAllOf1) Validate(formats strfmt.Registry) error {`, 5346 ` if err := m.validateF3(formats); err != nil {`, 5347 ` if err := m.validateF4(formats); err != nil {`, 5348 ` return errors.CompositeValidationError(res...`, 5349 `func (m *BAllOf1) validateF3(formats strfmt.Registry) error {`, 5350 ` if err := validate.Required("f3", "body", m.F3); err != nil {`, 5351 `func (m *BAllOf1) validateF4(formats strfmt.Registry) error {`, 5352 ` if err := validate.Required("f4", "body", m.F4); err != nil {`, 5353 }, 5354 // not expected 5355 todo, 5356 // output in log 5357 noLines, 5358 noLines) 5359 5360 // load expectations for model: a.go 5361 flattenRun.AddExpectations("a.go", []string{ 5362 `type A struct {`, 5363 " F1 string `json:\"f1,omitempty\"`", 5364 " F2 string `json:\"f2,omitempty\"`", 5365 // empty validation 5366 "func (m *A) Validate(formats strfmt.Registry) error {\n return nil\n}", 5367 }, 5368 // not expected 5369 todo, 5370 // output in log 5371 noLines, 5372 noLines) 5373 5374 } 5375 5376 func initFixture1042V2() { 5377 // testing ../fixtures/bugs/1487/fixture-1042-2.yaml with expand (--skip-flatten) 5378 5379 /* when the specification incorrectly defines the allOf, 5380 generated unmarshalling is wrong. 5381 This fixture asserts that with correct spec, the generated models are correct. 5382 5383 */ 5384 5385 f := newModelFixture("../fixtures/bugs/1042/fixture-1042-2.yaml", "allOf marshalling") 5386 flattenRun := f.AddRun(false) 5387 5388 // load expectations for model: error_model.go 5389 flattenRun.AddExpectations("error_model.go", []string{ 5390 `type ErrorModel struct {`, 5391 " Code *int64 `json:\"code\"`", 5392 " Message *string `json:\"message\"`", 5393 `func (m *ErrorModel) Validate(formats strfmt.Registry) error {`, 5394 ` if err := m.validateCode(formats); err != nil {`, 5395 ` if err := m.validateMessage(formats); err != nil {`, 5396 ` return errors.CompositeValidationError(res...`, 5397 `func (m *ErrorModel) validateCode(formats strfmt.Registry) error {`, 5398 ` if err := validate.Required("code", "body", m.Code); err != nil {`, 5399 ` if err := validate.MinimumInt("code", "body", *m.Code, 100, false); err != nil {`, 5400 ` if err := validate.MaximumInt("code", "body", *m.Code, 600, false); err != nil {`, 5401 `func (m *ErrorModel) validateMessage(formats strfmt.Registry) error {`, 5402 ` if err := validate.Required("message", "body", m.Message); err != nil {`, 5403 }, 5404 // not expected 5405 todo, 5406 // output in log 5407 noLines, 5408 noLines) 5409 5410 // load expectations for model: extended_error_model.go 5411 flattenRun.AddExpectations("extended_error_model.go", []string{ 5412 `type ExtendedErrorModel struct {`, 5413 ` ErrorModel`, 5414 ` ExtendedErrorModelAllOf1`, 5415 `func (m *ExtendedErrorModel) UnmarshalJSON(raw []byte) error {`, 5416 ` var aO0 ErrorModel`, 5417 ` if err := swag.ReadJSON(raw, &aO0); err != nil {`, 5418 ` m.ErrorModel = aO0`, 5419 ` var aO1 ExtendedErrorModelAllOf1`, 5420 ` if err := swag.ReadJSON(raw, &aO1); err != nil {`, 5421 ` m.ExtendedErrorModelAllOf1 = aO1`, 5422 `func (m ExtendedErrorModel) MarshalJSON() ([]byte, error) {`, 5423 // slight optimization of allocations 5424 ` _parts := make([][]byte, 0, 2)`, 5425 ` aO0, err := swag.WriteJSON(m.ErrorModel`, 5426 ` if err != nil {`, 5427 ` return nil, err`, 5428 ` _parts = append(_parts, aO0`, 5429 ` aO1, err := swag.WriteJSON(m.ExtendedErrorModelAllOf1`, 5430 ` if err != nil {`, 5431 ` return nil, err`, 5432 ` _parts = append(_parts, aO1`, 5433 ` return swag.ConcatJSON(_parts...), nil`, 5434 `func (m *ExtendedErrorModel) Validate(formats strfmt.Registry) error {`, 5435 ` if err := m.ErrorModel.Validate(formats); err != nil {`, 5436 ` if err := m.ExtendedErrorModelAllOf1.Validate(formats); err != nil {`, 5437 ` return errors.CompositeValidationError(res...`, 5438 }, 5439 // not expected 5440 todo, 5441 // output in log 5442 noLines, 5443 noLines) 5444 5445 // load expectations for model: extended_error_model_all_of1.go 5446 flattenRun.AddExpectations("extended_error_model_all_of1.go", []string{ 5447 `type ExtendedErrorModelAllOf1 struct {`, 5448 " RootCause *string `json:\"rootCause\"`", 5449 `func (m *ExtendedErrorModelAllOf1) Validate(formats strfmt.Registry) error {`, 5450 ` if err := m.validateRootCause(formats); err != nil {`, 5451 ` return errors.CompositeValidationError(res...`, 5452 `func (m *ExtendedErrorModelAllOf1) validateRootCause(formats strfmt.Registry) error {`, 5453 ` if err := validate.Required("rootCause", "body", m.RootCause); err != nil {`, 5454 }, 5455 // not expected 5456 todo, 5457 // output in log 5458 noLines, 5459 noLines) 5460 5461 } 5462 5463 func initFixture979() { 5464 // testing ../fixtures/bugs/1487/fixture-979.yaml with expand (--skip-flatten) 5465 5466 /* checking that properties is enough to figure out an object schema 5467 */ 5468 5469 f := newModelFixture("../fixtures/bugs/979/fixture-979.yaml", "allOf without the explicit type object") 5470 flattenRun := f.AddRun(false) 5471 5472 // load expectations for model: cluster.go 5473 flattenRun.AddExpectations("cluster.go", []string{ 5474 `type Cluster struct {`, 5475 ` NewCluster`, 5476 ` ClusterAllOf1`, 5477 `func (m *Cluster) UnmarshalJSON(raw []byte) error {`, 5478 ` var aO0 NewCluster`, 5479 ` if err := swag.ReadJSON(raw, &aO0); err != nil {`, 5480 ` m.NewCluster = aO0`, 5481 ` var aO1 ClusterAllOf1`, 5482 ` if err := swag.ReadJSON(raw, &aO1); err != nil {`, 5483 ` m.ClusterAllOf1 = aO1`, 5484 `func (m Cluster) MarshalJSON() ([]byte, error) {`, 5485 // slight optimization of allocations 5486 ` _parts := make([][]byte, 0, 2)`, 5487 ` aO0, err := swag.WriteJSON(m.NewCluster`, 5488 ` if err != nil {`, 5489 ` return nil, err`, 5490 ` _parts = append(_parts, aO0`, 5491 ` aO1, err := swag.WriteJSON(m.ClusterAllOf1`, 5492 ` if err != nil {`, 5493 ` return nil, err`, 5494 ` _parts = append(_parts, aO1`, 5495 ` return swag.ConcatJSON(_parts...), nil`, 5496 `func (m *Cluster) Validate(formats strfmt.Registry) error {`, 5497 ` if err := m.NewCluster.Validate(formats); err != nil {`, 5498 ` if err := m.ClusterAllOf1.Validate(formats); err != nil {`, 5499 ` return errors.CompositeValidationError(res...`, 5500 }, 5501 // not expected 5502 todo, 5503 // output in log 5504 noLines, 5505 noLines) 5506 5507 // load expectations for model: new_cluster.go 5508 flattenRun.AddExpectations("new_cluster.go", []string{ 5509 `type NewCluster struct {`, 5510 " DummyProp1 int64 `json:\"dummyProp1,omitempty\"`", 5511 // empty validation 5512 "func (m *NewCluster) Validate(formats strfmt.Registry) error {\n return nil\n}", 5513 }, 5514 // not expected 5515 todo, 5516 // output in log 5517 noLines, 5518 noLines) 5519 5520 // load expectations for model: cluster_all_of1.go 5521 flattenRun.AddExpectations("cluster_all_of1.go", []string{ 5522 `type ClusterAllOf1 struct {`, 5523 " Result string `json:\"result,omitempty\"`", 5524 " Status string `json:\"status,omitempty\"`", 5525 // empty validation 5526 "func (m *ClusterAllOf1) Validate(formats strfmt.Registry) error {\n return nil\n}", 5527 }, 5528 // not expected 5529 todo, 5530 // output in log 5531 noLines, 5532 noLines) 5533 5534 } 5535 5536 func initFixture842() { 5537 // testing ../fixtures/bugs/1487/fixture-842.yaml with expand (--skip-flatten) 5538 5539 /* codegen fails to produce code that builds 5540 */ 5541 5542 f := newModelFixture("../fixtures/bugs/842/fixture-842.yaml", "polymorphic type containing an array of the base type") 5543 flattenRun := f.AddRun(false) 5544 5545 // load expectations for model: value_array_all_of1.go 5546 flattenRun.AddExpectations("value_array_all_of1.go", []string{ 5547 `type ValueArrayAllOf1 struct {`, 5548 ` valuesField []Value`, 5549 `func (m *ValueArrayAllOf1) Values() []Value {`, 5550 ` return m.valuesField`, 5551 `func (m *ValueArrayAllOf1) SetValues(val []Value) {`, 5552 ` m.valuesField = val`, 5553 `func (m *ValueArrayAllOf1) Validate(formats strfmt.Registry) error {`, 5554 ` if err := m.validateValues(formats); err != nil {`, 5555 ` return errors.CompositeValidationError(res...`, 5556 `func (m *ValueArrayAllOf1) validateValues(formats strfmt.Registry) error {`, 5557 ` if err := validate.Required("Values", "body", m.Values()); err != nil {`, 5558 ` for i := 0; i < len(m.Values()); i++ {`, 5559 ` if err := m.valuesField[i].Validate(formats); err != nil {`, 5560 ` if ve, ok := err.(*errors.Validation); ok {`, 5561 ` return ve.ValidateName("Values" + "." + strconv.Itoa(i)`, 5562 }, 5563 // not expected 5564 todo, 5565 // output in log 5566 noLines, 5567 noLines) 5568 5569 // load expectations for model: value_array.go 5570 flattenRun.AddExpectations("value_array.go", []string{ 5571 `type ValueArray struct {`, 5572 ` ValueArrayAllOf1`, 5573 `func (m *ValueArray) ValueType() string {`, 5574 ` return "ValueArray"`, 5575 `func (m *ValueArray) SetValueType(val string) {`, 5576 `func (m *ValueArray) Validate(formats strfmt.Registry) error {`, 5577 ` if err := m.ValueArrayAllOf1.Validate(formats); err != nil {`, 5578 ` return errors.CompositeValidationError(res...`, 5579 }, 5580 // not expected 5581 todo, 5582 // output in log 5583 noLines, 5584 noLines) 5585 5586 // load expectations for model: value.go 5587 flattenRun.AddExpectations("value.go", []string{ 5588 `type Value interface {`, 5589 ` runtime.Validatable`, 5590 ` ValueType() string`, 5591 ` SetValueType(string`, 5592 `type value struct {`, 5593 ` valueTypeField string`, 5594 `func (m *value) ValueType() string {`, 5595 ` return "Value"`, 5596 `func (m *value) SetValueType(val string) {`, 5597 `func UnmarshalValueSlice(reader io.Reader, consumer runtime.Consumer) ([]Value, error) {`, 5598 ` var elements []json.RawMessage`, 5599 ` if err := consumer.Consume(reader, &elements); err != nil {`, 5600 ` return nil, err`, 5601 ` var result []Value`, 5602 ` for _, element := range elements {`, 5603 ` obj, err := unmarshalValue(element, consumer`, 5604 ` if err != nil {`, 5605 ` return nil, err`, 5606 ` result = append(result, obj`, 5607 ` return result, nil`, 5608 `func UnmarshalValue(reader io.Reader, consumer runtime.Consumer) (Value, error) {`, 5609 ` data, err := ioutil.ReadAll(reader`, 5610 ` if err != nil {`, 5611 ` return nil, err`, 5612 ` return unmarshalValue(data, consumer`, 5613 `func unmarshalValue(data []byte, consumer runtime.Consumer) (Value, error) {`, 5614 ` buf := bytes.NewBuffer(data`, 5615 ` buf2 := bytes.NewBuffer(data`, 5616 ` var getType struct {`, 5617 " ValueType string `json:\"ValueType\"`", 5618 ` if err := consumer.Consume(buf, &getType); err != nil {`, 5619 ` return nil, err`, 5620 ` if err := validate.RequiredString("ValueType", "body", getType.ValueType); err != nil {`, 5621 ` return nil, err`, 5622 ` switch getType.ValueType {`, 5623 ` case "Value":`, 5624 ` var result value`, 5625 ` if err := consumer.Consume(buf2, &result); err != nil {`, 5626 ` return nil, err`, 5627 ` return &result, nil`, 5628 ` case "ValueArray":`, 5629 ` var result ValueArray`, 5630 ` if err := consumer.Consume(buf2, &result); err != nil {`, 5631 ` return nil, err`, 5632 ` return &result, nil`, 5633 ` return nil, errors.New(422, "invalid ValueType value: %q", getType.ValueType`, 5634 // empty validation 5635 "func (m *value) Validate(formats strfmt.Registry) error {\n return nil\n}", 5636 }, 5637 // not expected 5638 todo, 5639 // output in log 5640 noLines, 5641 noLines) 5642 5643 } 5644 5645 func initFixture607() { 5646 // testing ../fixtures/bugs/1487/fixture-607.yaml with expand (--skip-flatten) 5647 5648 /* broken code produced on polymorphic type 5649 */ 5650 5651 f := newModelFixture("../fixtures/bugs/607/fixture-607.yaml", "broken code when using array of polymorphic type") 5652 flattenRun := f.AddRun(false) 5653 5654 // load expectations for model: range_filter_all_of1.go 5655 flattenRun.AddExpectations("range_filter_all_of1.go", []string{ 5656 `type RangeFilterAllOf1 struct {`, 5657 " Config *RangeFilterAllOf1Config `json:\"config\"`", 5658 `func (m *RangeFilterAllOf1) Validate(formats strfmt.Registry) error {`, 5659 ` if err := m.validateConfig(formats); err != nil {`, 5660 ` return errors.CompositeValidationError(res...`, 5661 `func (m *RangeFilterAllOf1) validateConfig(formats strfmt.Registry) error {`, 5662 ` if err := validate.Required("config", "body", m.Config); err != nil {`, 5663 ` if m.Config != nil {`, 5664 ` if err := m.Config.Validate(formats); err != nil {`, 5665 ` if ve, ok := err.(*errors.Validation); ok {`, 5666 ` return ve.ValidateName("config"`, 5667 }, 5668 // not expected 5669 todo, 5670 // output in log 5671 noLines, 5672 noLines) 5673 5674 // load expectations for model: filter.go 5675 flattenRun.AddExpectations("filter.go", []string{ 5676 `type Filter interface {`, 5677 ` runtime.Validatable`, 5678 ` Type() string`, 5679 ` SetType(string`, 5680 `type filter struct {`, 5681 ` typeField string`, 5682 `func (m *filter) Type() string {`, 5683 ` return "Filter"`, 5684 `func (m *filter) SetType(val string) {`, 5685 `func UnmarshalFilterSlice(reader io.Reader, consumer runtime.Consumer) ([]Filter, error) {`, 5686 ` var elements []json.RawMessage`, 5687 ` if err := consumer.Consume(reader, &elements); err != nil {`, 5688 ` return nil, err`, 5689 ` var result []Filter`, 5690 ` for _, element := range elements {`, 5691 ` obj, err := unmarshalFilter(element, consumer`, 5692 ` if err != nil {`, 5693 ` return nil, err`, 5694 ` result = append(result, obj`, 5695 ` return result, nil`, 5696 `func UnmarshalFilter(reader io.Reader, consumer runtime.Consumer) (Filter, error) {`, 5697 ` data, err := ioutil.ReadAll(reader`, 5698 ` if err != nil {`, 5699 ` return nil, err`, 5700 ` return unmarshalFilter(data, consumer`, 5701 `func unmarshalFilter(data []byte, consumer runtime.Consumer) (Filter, error) {`, 5702 ` buf := bytes.NewBuffer(data`, 5703 ` buf2 := bytes.NewBuffer(data`, 5704 ` var getType struct {`, 5705 " Type string `json:\"type\"`", 5706 ` if err := consumer.Consume(buf, &getType); err != nil {`, 5707 ` return nil, err`, 5708 ` if err := validate.RequiredString("type", "body", getType.Type); err != nil {`, 5709 ` return nil, err`, 5710 ` switch getType.Type {`, 5711 ` case "AndFilter":`, 5712 ` var result AndFilter`, 5713 ` if err := consumer.Consume(buf2, &result); err != nil {`, 5714 ` return nil, err`, 5715 ` return &result, nil`, 5716 ` case "Filter":`, 5717 ` var result filter`, 5718 ` if err := consumer.Consume(buf2, &result); err != nil {`, 5719 ` return nil, err`, 5720 ` return &result, nil`, 5721 ` case "RangeFilter":`, 5722 ` var result RangeFilter`, 5723 ` if err := consumer.Consume(buf2, &result); err != nil {`, 5724 ` return nil, err`, 5725 ` return &result, nil`, 5726 ` return nil, errors.New(422, "invalid type value: %q", getType.Type`, 5727 // empty validation 5728 "func (m *filter) Validate(formats strfmt.Registry) error {\n return nil\n}", 5729 }, 5730 // not expected 5731 todo, 5732 // output in log 5733 noLines, 5734 noLines) 5735 5736 // load expectations for model: and_filter_all_of1.go 5737 flattenRun.AddExpectations("and_filter_all_of1.go", []string{ 5738 `type AndFilterAllOf1 struct {`, 5739 ` configField []Filter`, 5740 `func (m *AndFilterAllOf1) Config() []Filter {`, 5741 ` return m.configField`, 5742 `func (m *AndFilterAllOf1) SetConfig(val []Filter) {`, 5743 ` m.configField = val`, 5744 `func (m *AndFilterAllOf1) UnmarshalJSON(raw []byte) error {`, 5745 ` var data struct {`, 5746 " Config json.RawMessage `json:\"config\"`", 5747 ` buf := bytes.NewBuffer(raw`, 5748 ` dec := json.NewDecoder(buf`, 5749 ` dec.UseNumber(`, 5750 ` if err := dec.Decode(&data); err != nil {`, 5751 ` propConfig, err := UnmarshalFilterSlice(bytes.NewBuffer(data.Config), runtime.JSONConsumer()`, 5752 ` if err != nil && err != io.EOF {`, 5753 ` var result AndFilterAllOf1`, 5754 ` result.configField = propConfig`, 5755 ` *m = result`, 5756 `func (m AndFilterAllOf1) MarshalJSON() ([]byte, error) {`, 5757 ` var b1, b2, b3 []byte`, 5758 ` var err error`, 5759 ` b1, err = json.Marshal(struct {`, 5760 ` }{})`, 5761 ` if err != nil {`, 5762 ` return nil, err`, 5763 ` b2, err = json.Marshal(struct {`, 5764 " Config []Filter `json:\"config\"`", 5765 ` }{`, 5766 ` Config: m.configField,`, 5767 ` })`, 5768 ` if err != nil {`, 5769 ` return nil, err`, 5770 ` return swag.ConcatJSON(b1, b2, b3), nil`, 5771 `func (m *AndFilterAllOf1) Validate(formats strfmt.Registry) error {`, 5772 ` if err := m.validateConfig(formats); err != nil {`, 5773 ` return errors.CompositeValidationError(res...`, 5774 `func (m *AndFilterAllOf1) validateConfig(formats strfmt.Registry) error {`, 5775 ` if err := validate.Required("config", "body", m.Config()); err != nil {`, 5776 ` for i := 0; i < len(m.Config()); i++ {`, 5777 ` if err := m.configField[i].Validate(formats); err != nil {`, 5778 ` if ve, ok := err.(*errors.Validation); ok {`, 5779 ` return ve.ValidateName("config" + "." + strconv.Itoa(i)`, 5780 }, 5781 // not expected 5782 todo, 5783 // output in log 5784 noLines, 5785 noLines) 5786 5787 // load expectations for model: and_filter.go 5788 flattenRun.AddExpectations("and_filter.go", []string{ 5789 `type AndFilter struct {`, 5790 ` AndFilterAllOf1`, 5791 `func (m *AndFilter) Type() string {`, 5792 ` return "AndFilter"`, 5793 `func (m *AndFilter) SetType(val string) {`, 5794 `func (m *AndFilter) UnmarshalJSON(raw []byte) error {`, 5795 ` var data struct {`, 5796 ` AndFilterAllOf1`, 5797 ` buf := bytes.NewBuffer(raw`, 5798 ` dec := json.NewDecoder(buf`, 5799 ` dec.UseNumber(`, 5800 ` if err := dec.Decode(&data); err != nil {`, 5801 ` var base struct {`, 5802 " Type string `json:\"type\"`", 5803 ` buf = bytes.NewBuffer(raw`, 5804 ` dec = json.NewDecoder(buf`, 5805 ` dec.UseNumber(`, 5806 ` if err := dec.Decode(&base); err != nil {`, 5807 ` var result AndFilter`, 5808 ` if base.Type != result.Type() {`, 5809 ` return errors.New(422, "invalid type value: %q", base.Type`, 5810 ` result.AndFilterAllOf1 = data.AndFilterAllOf1`, 5811 ` *m = result`, 5812 `func (m AndFilter) MarshalJSON() ([]byte, error) {`, 5813 ` var b1, b2, b3 []byte`, 5814 ` var err error`, 5815 ` b1, err = json.Marshal(struct {`, 5816 ` AndFilterAllOf1`, 5817 ` }{`, 5818 ` AndFilterAllOf1: m.AndFilterAllOf1,`, 5819 ` })`, 5820 ` if err != nil {`, 5821 ` return nil, err`, 5822 ` b2, err = json.Marshal(struct {`, 5823 " Type string `json:\"type\"`", 5824 ` }{`, 5825 ` Type: m.Type(),`, 5826 ` })`, 5827 ` if err != nil {`, 5828 ` return nil, err`, 5829 ` return swag.ConcatJSON(b1, b2, b3), nil`, 5830 `func (m *AndFilter) Validate(formats strfmt.Registry) error {`, 5831 ` if err := m.AndFilterAllOf1.Validate(formats); err != nil {`, 5832 ` return errors.CompositeValidationError(res...`, 5833 }, 5834 // not expected 5835 todo, 5836 // output in log 5837 noLines, 5838 noLines) 5839 5840 // load expectations for model: range_filter.go 5841 flattenRun.AddExpectations("range_filter.go", []string{ 5842 `type RangeFilter struct {`, 5843 ` RangeFilterAllOf1`, 5844 `func (m *RangeFilter) Type() string {`, 5845 ` return "RangeFilter"`, 5846 `func (m *RangeFilter) SetType(val string) {`, 5847 `func (m *RangeFilter) UnmarshalJSON(raw []byte) error {`, 5848 ` var data struct {`, 5849 ` RangeFilterAllOf1`, 5850 ` buf := bytes.NewBuffer(raw`, 5851 ` dec := json.NewDecoder(buf`, 5852 ` dec.UseNumber(`, 5853 ` if err := dec.Decode(&data); err != nil {`, 5854 ` var base struct {`, 5855 " Type string `json:\"type\"`", 5856 ` buf = bytes.NewBuffer(raw`, 5857 ` dec = json.NewDecoder(buf`, 5858 ` dec.UseNumber(`, 5859 ` if err := dec.Decode(&base); err != nil {`, 5860 ` var result RangeFilter`, 5861 ` if base.Type != result.Type() {`, 5862 ` return errors.New(422, "invalid type value: %q", base.Type`, 5863 ` result.RangeFilterAllOf1 = data.RangeFilterAllOf1`, 5864 ` *m = result`, 5865 `func (m RangeFilter) MarshalJSON() ([]byte, error) {`, 5866 ` var b1, b2, b3 []byte`, 5867 ` var err error`, 5868 ` b1, err = json.Marshal(struct {`, 5869 ` RangeFilterAllOf1`, 5870 ` }{`, 5871 ` RangeFilterAllOf1: m.RangeFilterAllOf1,`, 5872 ` })`, 5873 ` if err != nil {`, 5874 ` return nil, err`, 5875 ` b2, err = json.Marshal(struct {`, 5876 " Type string `json:\"type\"`", 5877 ` }{`, 5878 ` Type: m.Type(),`, 5879 ` })`, 5880 ` if err != nil {`, 5881 ` return nil, err`, 5882 ` return swag.ConcatJSON(b1, b2, b3), nil`, 5883 `func (m *RangeFilter) Validate(formats strfmt.Registry) error {`, 5884 ` if err := m.RangeFilterAllOf1.Validate(formats); err != nil {`, 5885 ` return errors.CompositeValidationError(res...`, 5886 }, 5887 // not expected 5888 todo, 5889 // output in log 5890 noLines, 5891 noLines) 5892 5893 // load expectations for model: range_filter_all_of1_config.go 5894 flattenRun.AddExpectations("range_filter_all_of1_config.go", []string{ 5895 `type RangeFilterAllOf1Config struct {`, 5896 " Gt float64 `json:\"gt,omitempty\"`", 5897 " Gte float64 `json:\"gte,omitempty\"`", 5898 " Lt float64 `json:\"lt,omitempty\"`", 5899 " Lte float64 `json:\"lte,omitempty\"`", 5900 // empty validation 5901 "func (m *RangeFilterAllOf1Config) Validate(formats strfmt.Registry) error {\n return nil\n}", 5902 }, 5903 // not expected 5904 todo, 5905 // output in log 5906 noLines, 5907 noLines) 5908 5909 } 5910 5911 func initFixture1336() { 5912 // testing ../fixtures/bugs/1487/fixture-1336.yaml with expand (--skip-flatten) 5913 5914 /* broken code produced on polymorphic type 5915 */ 5916 5917 f := newModelFixture("../fixtures/bugs/1336/fixture-1336.yaml", "broken code when using array of polymorphic type") 5918 flattenRun := f.AddRun(false) 5919 5920 // load expectations for model: node.go 5921 flattenRun.AddExpectations("node.go", []string{ 5922 `type Node interface {`, 5923 ` runtime.Validatable`, 5924 ` NodeType() string`, 5925 ` SetNodeType(string`, 5926 `type node struct {`, 5927 ` nodeTypeField string`, 5928 `func (m *node) NodeType() string {`, 5929 ` return "Node"`, 5930 `func (m *node) SetNodeType(val string) {`, 5931 `func UnmarshalNodeSlice(reader io.Reader, consumer runtime.Consumer) ([]Node, error) {`, 5932 ` var elements []json.RawMessage`, 5933 ` if err := consumer.Consume(reader, &elements); err != nil {`, 5934 ` return nil, err`, 5935 ` var result []Node`, 5936 ` for _, element := range elements {`, 5937 ` obj, err := unmarshalNode(element, consumer`, 5938 ` if err != nil {`, 5939 ` return nil, err`, 5940 ` result = append(result, obj`, 5941 ` return result, nil`, 5942 `func UnmarshalNode(reader io.Reader, consumer runtime.Consumer) (Node, error) {`, 5943 ` data, err := ioutil.ReadAll(reader`, 5944 ` if err != nil {`, 5945 ` return nil, err`, 5946 ` return unmarshalNode(data, consumer`, 5947 `func unmarshalNode(data []byte, consumer runtime.Consumer) (Node, error) {`, 5948 ` buf := bytes.NewBuffer(data`, 5949 ` buf2 := bytes.NewBuffer(data`, 5950 ` var getType struct {`, 5951 " NodeType string `json:\"NodeType\"`", 5952 ` if err := consumer.Consume(buf, &getType); err != nil {`, 5953 ` return nil, err`, 5954 ` if err := validate.RequiredString("NodeType", "body", getType.NodeType); err != nil {`, 5955 ` return nil, err`, 5956 ` switch getType.NodeType {`, 5957 ` case "CodeBlockNode":`, 5958 ` var result CodeBlockNode`, 5959 ` if err := consumer.Consume(buf2, &result); err != nil {`, 5960 ` return nil, err`, 5961 ` return &result, nil`, 5962 ` case "DocBlockNode":`, 5963 ` var result DocBlockNode`, 5964 ` if err := consumer.Consume(buf2, &result); err != nil {`, 5965 ` return nil, err`, 5966 ` return &result, nil`, 5967 ` case "Node":`, 5968 ` var result node`, 5969 ` if err := consumer.Consume(buf2, &result); err != nil {`, 5970 ` return nil, err`, 5971 ` return &result, nil`, 5972 ` return nil, errors.New(422, "invalid NodeType value: %q", getType.NodeType`, 5973 // empty validation 5974 "func (m *node) Validate(formats strfmt.Registry) error {\n return nil\n}", 5975 }, 5976 // not expected 5977 todo, 5978 // output in log 5979 noLines, 5980 noLines) 5981 5982 // load expectations for model: code_block_node_all_of1.go 5983 flattenRun.AddExpectations("code_block_node_all_of1.go", []string{ 5984 `type CodeBlockNodeAllOf1 struct {`, 5985 " Code string `json:\"Code,omitempty\"`", 5986 // empty validation 5987 "func (m *CodeBlockNodeAllOf1) Validate(formats strfmt.Registry) error {\n return nil\n}", 5988 }, 5989 // not expected 5990 todo, 5991 // output in log 5992 noLines, 5993 noLines) 5994 5995 // load expectations for model: graph.go 5996 flattenRun.AddExpectations("graph.go", []string{ 5997 `type Graph struct {`, 5998 ` nodesField []Node`, 5999 `func (m *Graph) Nodes() []Node {`, 6000 ` return m.nodesField`, 6001 `func (m *Graph) SetNodes(val []Node) {`, 6002 ` m.nodesField = val`, 6003 `func (m *Graph) UnmarshalJSON(raw []byte) error {`, 6004 ` var data struct {`, 6005 " Nodes json.RawMessage `json:\"Nodes\"`", 6006 ` buf := bytes.NewBuffer(raw`, 6007 ` dec := json.NewDecoder(buf`, 6008 ` dec.UseNumber(`, 6009 ` if err := dec.Decode(&data); err != nil {`, 6010 ` nodes, err := UnmarshalNodeSlice(bytes.NewBuffer(data.Nodes), runtime.JSONConsumer()`, 6011 ` if err != nil && err != io.EOF {`, 6012 ` var result Graph`, 6013 ` result.nodesField = propNodes`, 6014 ` *m = result`, 6015 `func (m Graph) MarshalJSON() ([]byte, error) {`, 6016 ` var b1, b2, b3 []byte`, 6017 ` var err error`, 6018 ` b1, err = json.Marshal(struct {`, 6019 ` }{})`, 6020 ` if err != nil {`, 6021 ` return nil, err`, 6022 ` b2, err = json.Marshal(struct {`, 6023 " Nodes []Node `json:\"Nodes\"`", 6024 ` }{`, 6025 ` Nodes: m.nodesField,`, 6026 ` })`, 6027 ` if err != nil {`, 6028 ` return nil, err`, 6029 ` return swag.ConcatJSON(b1, b2, b3), nil`, 6030 `func (m *Graph) Validate(formats strfmt.Registry) error {`, 6031 ` return errors.CompositeValidationError(res...`, 6032 }, 6033 // not expected 6034 todo, 6035 // output in log 6036 noLines, 6037 noLines) 6038 6039 // load expectations for model: doc_block_node_all_of1.go 6040 flattenRun.AddExpectations("doc_block_node_all_of1.go", []string{ 6041 `type DocBlockNodeAllOf1 struct {`, 6042 " Doc string `json:\"Doc,omitempty\"`", 6043 // empty validation 6044 "func (m *DocBlockNodeAllOf1) Validate(formats strfmt.Registry) error {\n return nil\n}", 6045 }, 6046 // not expected 6047 todo, 6048 // output in log 6049 noLines, 6050 noLines) 6051 6052 // load expectations for model: doc_block_node.go 6053 flattenRun.AddExpectations("doc_block_node.go", []string{ 6054 `type DocBlockNode struct {`, 6055 ` DocBlockNodeAllOf1`, 6056 `func (m *DocBlockNode) NodeType() string {`, 6057 ` return "DocBlockNode"`, 6058 `func (m *DocBlockNode) SetNodeType(val string) {`, 6059 `func (m *DocBlockNode) UnmarshalJSON(raw []byte) error {`, 6060 ` var data struct {`, 6061 ` DocBlockNodeAllOf1`, 6062 ` buf := bytes.NewBuffer(raw`, 6063 ` dec := json.NewDecoder(buf`, 6064 ` dec.UseNumber(`, 6065 ` if err := dec.Decode(&data); err != nil {`, 6066 ` var base struct {`, 6067 " NodeType string `json:\"NodeType\"`", 6068 ` buf = bytes.NewBuffer(raw`, 6069 ` dec = json.NewDecoder(buf`, 6070 ` dec.UseNumber(`, 6071 ` if err := dec.Decode(&base); err != nil {`, 6072 ` var result DocBlockNode`, 6073 ` if base.NodeType != result.NodeType() {`, 6074 ` return errors.New(422, "invalid NodeType value: %q", base.NodeType`, 6075 ` result.DocBlockNodeAllOf1 = data.DocBlockNodeAllOf1`, 6076 ` *m = result`, 6077 `func (m DocBlockNode) MarshalJSON() ([]byte, error) {`, 6078 ` var b1, b2, b3 []byte`, 6079 ` var err error`, 6080 ` b1, err = json.Marshal(struct {`, 6081 ` DocBlockNodeAllOf1`, 6082 ` }{`, 6083 ` DocBlockNodeAllOf1: m.DocBlockNodeAllOf1,`, 6084 ` })`, 6085 ` if err != nil {`, 6086 ` return nil, err`, 6087 ` b2, err = json.Marshal(struct {`, 6088 " NodeType string `json:\"NodeType\"`", 6089 ` }{`, 6090 ` NodeType: m.NodeType(),`, 6091 ` })`, 6092 ` if err != nil {`, 6093 ` return nil, err`, 6094 ` return swag.ConcatJSON(b1, b2, b3), nil`, 6095 `func (m *DocBlockNode) Validate(formats strfmt.Registry) error {`, 6096 ` if err := m.DocBlockNodeAllOf1.Validate(formats); err != nil {`, 6097 ` return errors.CompositeValidationError(res...`, 6098 }, 6099 // not expected 6100 todo, 6101 // output in log 6102 noLines, 6103 noLines) 6104 6105 // load expectations for model: code_block_node.go 6106 flattenRun.AddExpectations("code_block_node.go", []string{ 6107 `type CodeBlockNode struct {`, 6108 ` CodeBlockNodeAllOf1`, 6109 `func (m *CodeBlockNode) NodeType() string {`, 6110 ` return "CodeBlockNode"`, 6111 `func (m *CodeBlockNode) SetNodeType(val string) {`, 6112 `func (m *CodeBlockNode) UnmarshalJSON(raw []byte) error {`, 6113 ` var data struct {`, 6114 ` CodeBlockNodeAllOf1`, 6115 ` buf := bytes.NewBuffer(raw`, 6116 ` dec := json.NewDecoder(buf`, 6117 ` dec.UseNumber(`, 6118 ` if err := dec.Decode(&data); err != nil {`, 6119 ` var base struct {`, 6120 " NodeType string `json:\"NodeType\"`", 6121 ` buf = bytes.NewBuffer(raw`, 6122 ` dec = json.NewDecoder(buf`, 6123 ` dec.UseNumber(`, 6124 ` if err := dec.Decode(&base); err != nil {`, 6125 ` var result CodeBlockNode`, 6126 ` if base.NodeType != result.NodeType() {`, 6127 ` return errors.New(422, "invalid NodeType value: %q", base.NodeType`, 6128 ` result.CodeBlockNodeAllOf1 = data.CodeBlockNodeAllOf1`, 6129 ` *m = result`, 6130 `func (m CodeBlockNode) MarshalJSON() ([]byte, error) {`, 6131 ` var b1, b2, b3 []byte`, 6132 ` var err error`, 6133 ` b1, err = json.Marshal(struct {`, 6134 ` CodeBlockNodeAllOf1`, 6135 ` }{`, 6136 ` CodeBlockNodeAllOf1: m.CodeBlockNodeAllOf1,`, 6137 ` })`, 6138 ` if err != nil {`, 6139 ` return nil, err`, 6140 ` b2, err = json.Marshal(struct {`, 6141 " NodeType string `json:\"NodeType\"`", 6142 ` }{`, 6143 ` NodeType: m.NodeType(),`, 6144 ` })`, 6145 ` if err != nil {`, 6146 ` return nil, err`, 6147 ` return swag.ConcatJSON(b1, b2, b3), nil`, 6148 `func (m *CodeBlockNode) Validate(formats strfmt.Registry) error {`, 6149 ` if err := m.CodeBlockNodeAllOf1.Validate(formats); err != nil {`, 6150 ` return errors.CompositeValidationError(res...`, 6151 }, 6152 // not expected 6153 todo, 6154 // output in log 6155 noLines, 6156 noLines) 6157 6158 } 6159 6160 func initFixtureErrors() { 6161 // testing ../fixtures/bugs/1487/fixture-errors.yaml with expand (--skip-flatten) 6162 6163 /* 6164 invalid specs supported by go-swagger 6165 */ 6166 6167 f := newModelFixture("../fixtures/bugs/1487/fixture-errors.yaml", "broken spec to exercise error handling") 6168 flattenRun := f.AddRun(false) 6169 expandRun := f.AddRun(true) 6170 6171 // load expectations for model: node.go 6172 flattenRun.AddExpectations("array_without_items.go", []string{ 6173 `type ArrayWithoutItems []interface{}`, 6174 // empty validation 6175 "func (m ArrayWithoutItems) Validate(formats strfmt.Registry) error {\n return nil\n}", 6176 }, 6177 // not expected 6178 todo, 6179 // output in log 6180 // NOTE would expect warning for a non-swagger compliant, but nonetheless supposed construct (not implemented) 6181 noLines, 6182 noLines) 6183 6184 expandRun.AddExpectations("array_without_items.go", flattenRun.ExpectedFor("ArrayWithoutItems").ExpectedLines, todo, noLines, noLines) 6185 6186 flattenRun.AddExpectations("multiple_types.go", []string{ 6187 `type MultipleTypes interface{`, 6188 }, 6189 // not expected 6190 validatable, 6191 // output in log 6192 // expect warning 6193 // warning, 6194 noLines, 6195 noLines) 6196 6197 expandRun.AddExpectations("multiple_types.go", flattenRun.ExpectedFor("MultipleTypes").ExpectedLines, validatable, noLines, noLines) 6198 } 6199 6200 func initTodolistSchemavalidation() { 6201 // testing todolist.schemavalidation.yaml with flatten and expand (--skip-flatten) 6202 6203 /* 6204 A very simple api description that makes a json only API to submit to do's. 6205 6206 */ 6207 6208 f := newModelFixture("../fixtures/codegen/todolist.schemavalidation.yml", "Private to-do list") 6209 flattenRun := f.AddRun(false) 6210 expandRun := f.AddRun(true) 6211 6212 // load expectations for model: all_of_validations_meta_all_of6.go 6213 flattenRun.AddExpectations("all_of_validations_meta_all_of6.go", []string{ 6214 `type AllOfValidationsMetaAllOf6 struct {`, 6215 " Coords *AllOfValidationsMetaAllOf6Coords `json:\"coords,omitempty\"`", 6216 `func (m *AllOfValidationsMetaAllOf6) Validate(formats strfmt.Registry) error {`, 6217 ` if err := m.validateCoords(formats); err != nil {`, 6218 ` return errors.CompositeValidationError(res...`, 6219 `func (m *AllOfValidationsMetaAllOf6) validateCoords(formats strfmt.Registry) error {`, 6220 ` if swag.IsZero(m.Coords) {`, 6221 ` if m.Coords != nil {`, 6222 ` if err := m.Coords.Validate(formats); err != nil {`, 6223 ` if ve, ok := err.(*errors.Validation); ok {`, 6224 ` return ve.ValidateName("coords"`, 6225 }, 6226 // not expected 6227 todo, 6228 // output in log 6229 noLines, 6230 noLines) 6231 6232 // load expectations for model: nested_array_validations.go 6233 flattenRun.AddExpectations("nested_array_validations.go", []string{ 6234 `type NestedArrayValidations struct {`, 6235 " Tags [][][]string `json:\"tags\"`", 6236 `func (m *NestedArrayValidations) Validate(formats strfmt.Registry) error {`, 6237 ` if err := m.validateTags(formats); err != nil {`, 6238 ` return errors.CompositeValidationError(res...`, 6239 `func (m *NestedArrayValidations) validateTags(formats strfmt.Registry) error {`, 6240 ` if swag.IsZero(m.Tags) {`, 6241 ` iTagsSize := int64(len(m.Tags)`, 6242 ` if err := validate.MinItems("tags", "body", iTagsSize, 3); err != nil {`, 6243 ` if err := validate.MaxItems("tags", "body", iTagsSize, 10); err != nil {`, 6244 ` for i := 0; i < len(m.Tags); i++ {`, 6245 ` iiTagsSize := int64(len(m.Tags[i])`, 6246 ` if err := validate.MinItems("tags"+"."+strconv.Itoa(i), "body", iiTagsSize, 3); err != nil {`, 6247 ` if err := validate.MaxItems("tags"+"."+strconv.Itoa(i), "body", iiTagsSize, 10); err != nil {`, 6248 ` for ii := 0; ii < len(m.Tags[i]); ii++ {`, 6249 ` iiiTagsSize := int64(len(m.Tags[i][ii])`, 6250 ` if err := validate.MinItems("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiTagsSize, 3); err != nil {`, 6251 ` if err := validate.MaxItems("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiTagsSize, 10); err != nil {`, 6252 ` for iii := 0; iii < len(m.Tags[i][ii]); iii++ {`, 6253 ` if err := validate.MinLength("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Tags[i][ii][iii], 3); err != nil {`, 6254 ` if err := validate.MaxLength("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Tags[i][ii][iii], 10); err != nil {`, 6255 " if err := validate.Pattern(\"tags\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", m.Tags[i][ii][iii], `\\w+`); err != nil {", 6256 }, 6257 // not expected 6258 todo, 6259 // output in log 6260 noLines, 6261 noLines) 6262 6263 expandRun.AddExpectations("nested_array_validations.go", flattenRun.ExpectedFor("NestedArrayValidations").ExpectedLines, todo, noLines, noLines) 6264 6265 // load expectations for model: all_of_validations_meta_all_of4.go 6266 flattenRun.AddExpectations("all_of_validations_meta_all_of4.go", []string{ 6267 `type AllOfValidationsMetaAllOf4 struct {`, 6268 " Opts map[string]int32 `json:\"opts,omitempty\"`", 6269 `func (m *AllOfValidationsMetaAllOf4) Validate(formats strfmt.Registry) error {`, 6270 ` if err := m.validateOpts(formats); err != nil {`, 6271 ` return errors.CompositeValidationError(res...`, 6272 `func (m *AllOfValidationsMetaAllOf4) validateOpts(formats strfmt.Registry) error {`, 6273 ` if swag.IsZero(m.Opts) {`, 6274 ` for k := range m.Opts {`, 6275 ` if err := validate.MinimumInt("opts"+"."+k, "body", int64(m.Opts[k]), 2, false); err != nil {`, 6276 ` if err := validate.MaximumInt("opts"+"."+k, "body", int64(m.Opts[k]), 50, false); err != nil {`, 6277 ` if err := validate.MultipleOf("opts"+"."+k, "body", float64(m.Opts[k]), 1.5); err != nil {`, 6278 }, 6279 // not expected 6280 todo, 6281 // output in log 6282 noLines, 6283 noLines) 6284 6285 // load expectations for model: simple_zero_allowed.go 6286 flattenRun.AddExpectations("simple_zero_allowed.go", []string{ 6287 `type SimpleZeroAllowed struct {`, 6288 " ID string `json:\"id,omitempty\"`", 6289 " Name *string `json:\"name\"`", 6290 " Urls []string `json:\"urls\"`", 6291 `func (m *SimpleZeroAllowed) Validate(formats strfmt.Registry) error {`, 6292 ` if err := m.validateID(formats); err != nil {`, 6293 ` if err := m.validateName(formats); err != nil {`, 6294 ` if err := m.validateUrls(formats); err != nil {`, 6295 ` return errors.CompositeValidationError(res...`, 6296 `func (m *SimpleZeroAllowed) validateID(formats strfmt.Registry) error {`, 6297 ` if swag.IsZero(m.ID) {`, 6298 ` if err := validate.MinLength("id", "body", m.ID, 2); err != nil {`, 6299 ` if err := validate.MaxLength("id", "body", m.ID, 50); err != nil {`, 6300 " if err := validate.Pattern(\"id\", \"body\", m.ID, `[A-Za-z0-9][\\w- ]+`); err != nil {", 6301 `func (m *SimpleZeroAllowed) validateName(formats strfmt.Registry) error {`, 6302 ` if err := validate.Required("name", "body", m.Name); err != nil {`, 6303 ` if err := validate.MinLength("name", "body", *m.Name, 2); err != nil {`, 6304 ` if err := validate.MaxLength("name", "body", *m.Name, 50); err != nil {`, 6305 " if err := validate.Pattern(\"name\", \"body\", *m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {", 6306 `func (m *SimpleZeroAllowed) validateUrls(formats strfmt.Registry) error {`, 6307 ` if err := validate.Required("urls", "body", m.Urls); err != nil {`, 6308 }, 6309 // not expected 6310 todo, 6311 // output in log 6312 noLines, 6313 noLines) 6314 6315 expandRun.AddExpectations("simple_zero_allowed.go", flattenRun.ExpectedFor("SimpleZeroAllowed").ExpectedLines, todo, noLines, noLines) 6316 6317 // load expectations for model: named_all_of_all_of6_coords_all_of0.go 6318 flattenRun.AddExpectations("named_all_of_all_of6_coords_all_of0.go", []string{ 6319 `type NamedAllOfAllOf6CoordsAllOf0 struct {`, 6320 " Name string `json:\"name,omitempty\"`", 6321 `func (m *NamedAllOfAllOf6CoordsAllOf0) Validate(formats strfmt.Registry) error {`, 6322 ` if err := m.validateName(formats); err != nil {`, 6323 ` return errors.CompositeValidationError(res...`, 6324 `func (m *NamedAllOfAllOf6CoordsAllOf0) validateName(formats strfmt.Registry) error {`, 6325 ` if swag.IsZero(m.Name) {`, 6326 ` if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`, 6327 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 6328 " if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {", 6329 }, 6330 // not expected 6331 todo, 6332 // output in log 6333 noLines, 6334 noLines) 6335 6336 // load expectations for model: named_all_of_all_of6.go 6337 flattenRun.AddExpectations("named_all_of_all_of6.go", []string{ 6338 `type NamedAllOfAllOf6 struct {`, 6339 " Coords *NamedAllOfAllOf6Coords `json:\"coords,omitempty\"`", 6340 `func (m *NamedAllOfAllOf6) Validate(formats strfmt.Registry) error {`, 6341 ` if err := m.validateCoords(formats); err != nil {`, 6342 ` return errors.CompositeValidationError(res...`, 6343 `func (m *NamedAllOfAllOf6) validateCoords(formats strfmt.Registry) error {`, 6344 ` if swag.IsZero(m.Coords) {`, 6345 ` if m.Coords != nil {`, 6346 ` if err := m.Coords.Validate(formats); err != nil {`, 6347 ` if ve, ok := err.(*errors.Validation); ok {`, 6348 ` return ve.ValidateName("coords"`, 6349 }, 6350 // not expected 6351 todo, 6352 // output in log 6353 noLines, 6354 noLines) 6355 6356 // load expectations for model: named_array_multi.go 6357 flattenRun.AddExpectations("named_array_multi.go", []string{ 6358 `type NamedArrayMulti struct {`, 6359 " P0 *string `json:\"-\"`", 6360 " P1 *float64 `json:\"-\"`", 6361 `func (m *NamedArrayMulti) Validate(formats strfmt.Registry) error {`, 6362 ` if err := m.validateP0(formats); err != nil {`, 6363 ` if err := m.validateP1(formats); err != nil {`, 6364 ` return errors.CompositeValidationError(res...`, 6365 `func (m *NamedArrayMulti) validateP0(formats strfmt.Registry) error {`, 6366 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 6367 ` if err := validate.MinLength("0", "body", *m.P0, 3); err != nil {`, 6368 ` if err := validate.MaxLength("0", "body", *m.P0, 10); err != nil {`, 6369 " if err := validate.Pattern(\"0\", \"body\", *m.P0, `\\w+`); err != nil {", 6370 `func (m *NamedArrayMulti) validateP1(formats strfmt.Registry) error {`, 6371 ` if err := validate.Required("1", "body", m.P1); err != nil {`, 6372 ` if err := validate.Minimum("1", "body", *m.P1, 3, false); err != nil {`, 6373 ` if err := validate.Maximum("1", "body", *m.P1, 12, false); err != nil {`, 6374 ` if err := validate.MultipleOf("1", "body", *m.P1, 1.5); err != nil {`, 6375 }, 6376 // not expected 6377 todo, 6378 // output in log 6379 noLines, 6380 noLines) 6381 6382 expandRun.AddExpectations("named_array_multi.go", flattenRun.ExpectedFor("NamedArrayMulti").ExpectedLines, todo, noLines, noLines) 6383 6384 // load expectations for model: named_array.go 6385 flattenRun.AddExpectations("named_array.go", []string{ 6386 `type NamedArray []string`, 6387 `func (m NamedArray) Validate(formats strfmt.Registry) error {`, 6388 ` iNamedArraySize := int64(len(m)`, 6389 ` if err := validate.MinItems("", "body", iNamedArraySize, 3); err != nil {`, 6390 ` if err := validate.MaxItems("", "body", iNamedArraySize, 10); err != nil {`, 6391 ` for i := 0; i < len(m); i++ {`, 6392 ` if err := validate.MinLength(strconv.Itoa(i), "body", m[i], 3); err != nil {`, 6393 ` if err := validate.MaxLength(strconv.Itoa(i), "body", m[i], 10); err != nil {`, 6394 " if err := validate.Pattern(strconv.Itoa(i), \"body\", m[i], `\\w+`); err != nil {", 6395 ` return errors.CompositeValidationError(res...`, 6396 }, 6397 // not expected 6398 todo, 6399 // output in log 6400 noLines, 6401 noLines) 6402 6403 expandRun.AddExpectations("named_array.go", flattenRun.ExpectedFor("NamedArray").ExpectedLines, todo, noLines, noLines) 6404 6405 // load expectations for model: named_number.go 6406 flattenRun.AddExpectations("named_number.go", []string{ 6407 `type NamedNumber int32`, 6408 `func (m NamedNumber) Validate(formats strfmt.Registry) error {`, 6409 ` if err := validate.MinimumInt("", "body", int64(m), 0, true); err != nil {`, 6410 ` if err := validate.MaximumInt("", "body", int64(m), 500, false); err != nil {`, 6411 ` if err := validate.MultipleOf("", "body", float64(m), 1.5); err != nil {`, 6412 ` return errors.CompositeValidationError(res...`, 6413 }, 6414 // not expected 6415 todo, 6416 // output in log 6417 noLines, 6418 noLines) 6419 6420 expandRun.AddExpectations("named_number.go", flattenRun.ExpectedFor("NamedNumber").ExpectedLines, todo, noLines, noLines) 6421 6422 // load expectations for model: nested_map_validations.go 6423 flattenRun.AddExpectations("nested_map_validations.go", []string{ 6424 `type NestedMapValidations struct {`, 6425 " Meta map[string]map[string]map[string]int64 `json:\"meta,omitempty\"`", 6426 `func (m *NestedMapValidations) Validate(formats strfmt.Registry) error {`, 6427 ` if err := m.validateMeta(formats); err != nil {`, 6428 ` return errors.CompositeValidationError(res...`, 6429 `func (m *NestedMapValidations) validateMeta(formats strfmt.Registry) error {`, 6430 ` if swag.IsZero(m.Meta) {`, 6431 ` for k := range m.Meta {`, 6432 ` for kk := range m.Meta[k] {`, 6433 ` for kkk := range m.Meta[k][kk] {`, 6434 ` if err := validate.MinimumInt("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk], 3, false); err != nil {`, 6435 ` if err := validate.MaximumInt("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk], 6, false); err != nil {`, 6436 ` if err := validate.MultipleOfInt("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk], 1); err != nil {`, 6437 }, 6438 // not expected 6439 todo, 6440 // output in log 6441 noLines, 6442 noLines) 6443 6444 expandRun.AddExpectations("nested_map_validations.go", flattenRun.ExpectedFor("NestedMapValidations").ExpectedLines, todo, noLines, noLines) 6445 6446 // load expectations for model: array_multi_validations_args.go 6447 flattenRun.AddExpectations("array_multi_validations_args.go", []string{ 6448 `type ArrayMultiValidationsArgs struct {`, 6449 " P0 *string `json:\"-\"`", 6450 " P1 *float64 `json:\"-\"`", 6451 `func (m *ArrayMultiValidationsArgs) Validate(formats strfmt.Registry) error {`, 6452 ` if err := m.validateP0(formats); err != nil {`, 6453 ` if err := m.validateP1(formats); err != nil {`, 6454 ` return errors.CompositeValidationError(res...`, 6455 `func (m *ArrayMultiValidationsArgs) validateP0(formats strfmt.Registry) error {`, 6456 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 6457 ` if err := validate.MinLength("0", "body", *m.P0, 3); err != nil {`, 6458 ` if err := validate.MaxLength("0", "body", *m.P0, 10); err != nil {`, 6459 " if err := validate.Pattern(\"0\", \"body\", *m.P0, `\\w+`); err != nil {", 6460 `func (m *ArrayMultiValidationsArgs) validateP1(formats strfmt.Registry) error {`, 6461 ` if err := validate.Required("1", "body", m.P1); err != nil {`, 6462 ` if err := validate.Minimum("1", "body", *m.P1, 3, false); err != nil {`, 6463 ` if err := validate.Maximum("1", "body", *m.P1, 12, false); err != nil {`, 6464 ` if err := validate.MultipleOf("1", "body", *m.P1, 1.5); err != nil {`, 6465 }, 6466 // not expected 6467 todo, 6468 // output in log 6469 noLines, 6470 noLines) 6471 6472 // load expectations for model: named_map_complex_additional_properties.go 6473 flattenRun.AddExpectations("named_map_complex_additional_properties.go", []string{ 6474 `type NamedMapComplexAdditionalProperties struct {`, 6475 " Age int32 `json:\"age,omitempty\"`", 6476 " Name string `json:\"name,omitempty\"`", 6477 `func (m *NamedMapComplexAdditionalProperties) Validate(formats strfmt.Registry) error {`, 6478 ` if err := m.validateAge(formats); err != nil {`, 6479 ` if err := m.validateName(formats); err != nil {`, 6480 ` return errors.CompositeValidationError(res...`, 6481 `func (m *NamedMapComplexAdditionalProperties) validateAge(formats strfmt.Registry) error {`, 6482 ` if swag.IsZero(m.Age) {`, 6483 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`, 6484 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`, 6485 ` if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`, 6486 `func (m *NamedMapComplexAdditionalProperties) validateName(formats strfmt.Registry) error {`, 6487 ` if swag.IsZero(m.Name) {`, 6488 ` if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`, 6489 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 6490 " if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {", 6491 }, 6492 // not expected 6493 todo, 6494 // output in log 6495 noLines, 6496 noLines) 6497 6498 // load expectations for model: named_nested_map_complex.go 6499 flattenRun.AddExpectations("named_nested_map_complex.go", []string{ 6500 // maps are now simple types 6501 `type NamedNestedMapComplex map[string]map[string]map[string]NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties`, 6502 `func (m NamedNestedMapComplex) Validate(formats strfmt.Registry) error {`, 6503 ` for k := range m {`, 6504 ` for kk := range m[k] {`, 6505 ` for kkk := range m[k][kk] {`, 6506 ` if err := validate.Required(k+"."+kk+"."+kkk, "body", m[k][kk][kkk]); err != nil {`, 6507 ` if val, ok := m[k][kk][kkk]; ok {`, 6508 ` if err := val.Validate(formats); err != nil {`, 6509 ` return errors.CompositeValidationError(res...`, 6510 }, 6511 // not expected 6512 todo, 6513 // output in log 6514 noLines, 6515 noLines) 6516 6517 expandRun.AddExpectations("named_nested_map_complex.go", []string{ 6518 `type NamedNestedMapComplex map[string]map[string]map[string]NamedNestedMapComplexAnon`, 6519 `func (m NamedNestedMapComplex) Validate(formats strfmt.Registry) error {`, 6520 ` for k := range m {`, 6521 ` for kk := range m[k] {`, 6522 ` for kkk := range m[k][kk] {`, 6523 ` if val, ok := m[k][kk][kkk]; ok {`, 6524 ` if err := val.Validate(formats); err != nil {`, 6525 ` return errors.CompositeValidationError(res...`, 6526 `type NamedNestedMapComplexAnon struct {`, 6527 " Age int32 `json:\"age,omitempty\"`", 6528 " Name string `json:\"name,omitempty\"`", 6529 `func (m *NamedNestedMapComplexAnon) Validate(formats strfmt.Registry) error {`, 6530 ` if err := m.validateAge(formats); err != nil {`, 6531 ` if err := m.validateName(formats); err != nil {`, 6532 ` return errors.CompositeValidationError(res...`, 6533 `func (m *NamedNestedMapComplexAnon) validateAge(formats strfmt.Registry) error {`, 6534 ` if swag.IsZero(m.Age) {`, 6535 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`, 6536 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`, 6537 ` if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`, 6538 `func (m *NamedNestedMapComplexAnon) validateName(formats strfmt.Registry) error {`, 6539 ` if swag.IsZero(m.Name) {`, 6540 ` if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`, 6541 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 6542 " if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {", 6543 }, 6544 // not expected 6545 todo, 6546 // output in log 6547 noLines, 6548 noLines) 6549 6550 // load expectations for model: all_of_validations_meta_all_of1.go 6551 flattenRun.AddExpectations("all_of_validations_meta_all_of1.go", []string{ 6552 `type AllOfValidationsMetaAllOf1 struct {`, 6553 " Age int32 `json:\"age,omitempty\"`", 6554 `func (m *AllOfValidationsMetaAllOf1) Validate(formats strfmt.Registry) error {`, 6555 ` if err := m.validateAge(formats); err != nil {`, 6556 ` return errors.CompositeValidationError(res...`, 6557 `func (m *AllOfValidationsMetaAllOf1) validateAge(formats strfmt.Registry) error {`, 6558 ` if swag.IsZero(m.Age) {`, 6559 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`, 6560 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 50, false); err != nil {`, 6561 ` if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`, 6562 }, 6563 // not expected 6564 todo, 6565 // output in log 6566 noLines, 6567 noLines) 6568 6569 // load expectations for model: nested_map_complex_validations_meta_additional_properties_additional_properties.go 6570 // NOTE(fredbi): maps are now simple types - this definition is no more generated 6571 6572 // load expectations for model: tag.go 6573 flattenRun.AddExpectations("tag.go", []string{ 6574 `type Tag struct {`, 6575 " ID int64 `json:\"id,omitempty\"`", 6576 " Name string `json:\"name,omitempty\"`", 6577 // empty validation 6578 "func (m *Tag) Validate(formats strfmt.Registry) error {\n return nil\n}", 6579 }, 6580 // not expected 6581 todo, 6582 // output in log 6583 noLines, 6584 noLines) 6585 6586 expandRun.AddExpectations("tag.go", flattenRun.ExpectedFor("Tag").ExpectedLines, todo, noLines, noLines) 6587 6588 // load expectations for model: nested_object_validations_args.go 6589 flattenRun.AddExpectations("nested_object_validations_args.go", []string{ 6590 `type NestedObjectValidationsArgs struct {`, 6591 " Meta *NestedObjectValidationsArgsMeta `json:\"meta,omitempty\"`", 6592 `func (m *NestedObjectValidationsArgs) Validate(formats strfmt.Registry) error {`, 6593 ` if err := m.validateMeta(formats); err != nil {`, 6594 ` return errors.CompositeValidationError(res...`, 6595 `func (m *NestedObjectValidationsArgs) validateMeta(formats strfmt.Registry) error {`, 6596 ` if swag.IsZero(m.Meta) {`, 6597 ` if m.Meta != nil {`, 6598 ` if err := m.Meta.Validate(formats); err != nil {`, 6599 ` if ve, ok := err.(*errors.Validation); ok {`, 6600 ` return ve.ValidateName("meta"`, 6601 }, 6602 // not expected 6603 todo, 6604 // output in log 6605 noLines, 6606 noLines) 6607 6608 // load expectations for model: named_all_of_all_of6_coords_all_of1.go 6609 flattenRun.AddExpectations("named_all_of_all_of6_coords_all_of1.go", []string{ 6610 `type NamedAllOfAllOf6CoordsAllOf1 struct {`, 6611 " Age int32 `json:\"age,omitempty\"`", 6612 `func (m *NamedAllOfAllOf6CoordsAllOf1) Validate(formats strfmt.Registry) error {`, 6613 ` if err := m.validateAge(formats); err != nil {`, 6614 ` return errors.CompositeValidationError(res...`, 6615 `func (m *NamedAllOfAllOf6CoordsAllOf1) validateAge(formats strfmt.Registry) error {`, 6616 ` if swag.IsZero(m.Age) {`, 6617 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`, 6618 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 50, false); err != nil {`, 6619 ` if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`, 6620 }, 6621 // not expected 6622 todo, 6623 // output in log 6624 noLines, 6625 noLines) 6626 6627 // load expectations for model: named_all_of_all_of6_coords.go 6628 flattenRun.AddExpectations("named_all_of_all_of6_coords.go", []string{ 6629 `type NamedAllOfAllOf6Coords struct {`, 6630 ` NamedAllOfAllOf6CoordsAllOf0`, 6631 ` NamedAllOfAllOf6CoordsAllOf1`, 6632 `func (m *NamedAllOfAllOf6Coords) Validate(formats strfmt.Registry) error {`, 6633 ` if err := m.NamedAllOfAllOf6CoordsAllOf0.Validate(formats); err != nil {`, 6634 ` if err := m.NamedAllOfAllOf6CoordsAllOf1.Validate(formats); err != nil {`, 6635 ` return errors.CompositeValidationError(res...`, 6636 }, 6637 // not expected 6638 todo, 6639 // output in log 6640 noLines, 6641 noLines) 6642 6643 // load expectations for model: array_multi_validations.go 6644 flattenRun.AddExpectations("array_multi_validations.go", []string{ 6645 `type ArrayMultiValidations struct {`, 6646 " Args ArrayMultiValidationsArgs `json:\"args,omitempty\"`", 6647 `func (m *ArrayMultiValidations) Validate(formats strfmt.Registry) error {`, 6648 ` return errors.CompositeValidationError(res...`, 6649 }, 6650 // not expected 6651 todo, 6652 // output in log 6653 noLines, 6654 noLines) 6655 6656 expandRun.AddExpectations("array_multi_validations.go", []string{ 6657 `type ArrayMultiValidations struct {`, 6658 " Args *ArrayMultiValidationsArgsTuple0 `json:\"args,omitempty\"`", 6659 `func (m *ArrayMultiValidations) Validate(formats strfmt.Registry) error {`, 6660 ` if err := m.validateArgs(formats); err != nil {`, 6661 ` return errors.CompositeValidationError(res...`, 6662 `func (m *ArrayMultiValidations) validateArgs(formats strfmt.Registry) error {`, 6663 ` if swag.IsZero(m.Args) {`, 6664 ` if m.Args != nil {`, 6665 ` if err := m.Args.Validate(formats); err != nil {`, 6666 ` if ve, ok := err.(*errors.Validation); ok {`, 6667 ` return ve.ValidateName("args"`, 6668 `type ArrayMultiValidationsArgsTuple0 struct {`, 6669 " P0 *string `json:\"-\"`", 6670 " P1 *float64 `json:\"-\"`", 6671 `func (m *ArrayMultiValidationsArgsTuple0) Validate(formats strfmt.Registry) error {`, 6672 ` if err := m.validateP0(formats); err != nil {`, 6673 ` if err := m.validateP1(formats); err != nil {`, 6674 ` return errors.CompositeValidationError(res...`, 6675 `func (m *ArrayMultiValidationsArgsTuple0) validateP0(formats strfmt.Registry) error {`, 6676 ` if err := validate.Required("P0", "body", m.P0); err != nil {`, 6677 ` if err := validate.MinLength("P0", "body", *m.P0, 3); err != nil {`, 6678 ` if err := validate.MaxLength("P0", "body", *m.P0, 10); err != nil {`, 6679 " if err := validate.Pattern(\"P0\", \"body\", *m.P0, `\\w+`); err != nil {", 6680 `func (m *ArrayMultiValidationsArgsTuple0) validateP1(formats strfmt.Registry) error {`, 6681 ` if err := validate.Required("P1", "body", m.P1); err != nil {`, 6682 ` if err := validate.Minimum("P1", "body", *m.P1, 3, false); err != nil {`, 6683 ` if err := validate.Maximum("P1", "body", *m.P1, 12, false); err != nil {`, 6684 ` if err := validate.MultipleOf("P1", "body", *m.P1, 1.5); err != nil {`, 6685 }, 6686 // not expected 6687 todo, 6688 // output in log 6689 noLines, 6690 noLines) 6691 6692 // load expectations for model: string_validations.go 6693 flattenRun.AddExpectations("string_validations.go", []string{ 6694 `type StringValidations struct {`, 6695 " Name string `json:\"name,omitempty\"`", 6696 `func (m *StringValidations) Validate(formats strfmt.Registry) error {`, 6697 ` if err := m.validateName(formats); err != nil {`, 6698 ` return errors.CompositeValidationError(res...`, 6699 `func (m *StringValidations) validateName(formats strfmt.Registry) error {`, 6700 ` if swag.IsZero(m.Name) {`, 6701 ` if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`, 6702 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 6703 " if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {", 6704 }, 6705 // not expected 6706 todo, 6707 // output in log 6708 noLines, 6709 noLines) 6710 6711 expandRun.AddExpectations("string_validations.go", flattenRun.ExpectedFor("StringValidations").ExpectedLines, todo, noLines, noLines) 6712 6713 // load expectations for model: required_props.go 6714 flattenRun.AddExpectations("required_props.go", []string{ 6715 `type RequiredProps struct {`, 6716 " Age *int32 `json:\"age\"`", 6717 " CreatedAt *strfmt.DateTime `json:\"createdAt\"`", 6718 " ID *int64 `json:\"id\"`", 6719 " Name *string `json:\"name\"`", 6720 " Score *float32 `json:\"score\"`", 6721 " Tags []string `json:\"tags\"`", 6722 `func (m *RequiredProps) Validate(formats strfmt.Registry) error {`, 6723 ` if err := m.validateAge(formats); err != nil {`, 6724 ` if err := m.validateCreatedAt(formats); err != nil {`, 6725 ` if err := m.validateID(formats); err != nil {`, 6726 ` if err := m.validateName(formats); err != nil {`, 6727 ` if err := m.validateScore(formats); err != nil {`, 6728 ` if err := m.validateTags(formats); err != nil {`, 6729 ` return errors.CompositeValidationError(res...`, 6730 `func (m *RequiredProps) validateAge(formats strfmt.Registry) error {`, 6731 ` if err := validate.Required("age", "body", m.Age); err != nil {`, 6732 `func (m *RequiredProps) validateCreatedAt(formats strfmt.Registry) error {`, 6733 ` if err := validate.Required("createdAt", "body", m.CreatedAt); err != nil {`, 6734 ` if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {`, 6735 `func (m *RequiredProps) validateID(formats strfmt.Registry) error {`, 6736 ` if err := validate.Required("id", "body", m.ID); err != nil {`, 6737 `func (m *RequiredProps) validateName(formats strfmt.Registry) error {`, 6738 ` if err := validate.Required("name", "body", m.Name); err != nil {`, 6739 `func (m *RequiredProps) validateScore(formats strfmt.Registry) error {`, 6740 ` if err := validate.Required("score", "body", m.Score); err != nil {`, 6741 `func (m *RequiredProps) validateTags(formats strfmt.Registry) error {`, 6742 ` if err := validate.Required("tags", "body", m.Tags); err != nil {`, 6743 }, 6744 // not expected 6745 todo, 6746 // output in log 6747 noLines, 6748 noLines) 6749 6750 expandRun.AddExpectations("required_props.go", flattenRun.ExpectedFor("RequiredProps").ExpectedLines, todo, noLines, noLines) 6751 6752 // load expectations for model: named_all_of_all_of5.go 6753 flattenRun.AddExpectations("named_all_of_all_of5.go", []string{ 6754 `type NamedAllOfAllOf5 struct {`, 6755 " ExtOpts map[string]map[string]map[string]int32 `json:\"extOpts,omitempty\"`", 6756 `func (m *NamedAllOfAllOf5) Validate(formats strfmt.Registry) error {`, 6757 ` if err := m.validateExtOpts(formats); err != nil {`, 6758 ` return errors.CompositeValidationError(res...`, 6759 `func (m *NamedAllOfAllOf5) validateExtOpts(formats strfmt.Registry) error {`, 6760 ` if swag.IsZero(m.ExtOpts) {`, 6761 ` for k := range m.ExtOpts {`, 6762 ` for kk := range m.ExtOpts[k] {`, 6763 ` for kkk := range m.ExtOpts[k][kk] {`, 6764 ` if err := validate.MinimumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 2, false); err != nil {`, 6765 ` if err := validate.MaximumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 50, false); err != nil {`, 6766 ` if err := validate.MultipleOf("extOpts"+"."+k+"."+kk+"."+kkk, "body", float64(m.ExtOpts[k][kk][kkk]), 1.5); err != nil {`, 6767 }, 6768 // not expected 6769 todo, 6770 // output in log 6771 noLines, 6772 noLines) 6773 6774 // load expectations for model: named_map.go 6775 flattenRun.AddExpectations("named_map.go", []string{ 6776 `type NamedMap map[string]int64`, 6777 `func (m NamedMap) Validate(formats strfmt.Registry) error {`, 6778 ` for k := range m {`, 6779 ` if err := validate.MinimumInt(k, "body", m[k], 3, false); err != nil {`, 6780 ` if err := validate.MaximumInt(k, "body", m[k], 6, false); err != nil {`, 6781 ` if err := validate.MultipleOfInt(k, "body", m[k], 1); err != nil {`, 6782 ` return errors.CompositeValidationError(res...`, 6783 }, 6784 // not expected 6785 todo, 6786 // output in log 6787 noLines, 6788 noLines) 6789 6790 expandRun.AddExpectations("named_map.go", flattenRun.ExpectedFor("NamedMap").ExpectedLines, todo, noLines, noLines) 6791 6792 // load expectations for model: named_string.go 6793 flattenRun.AddExpectations("named_string.go", []string{ 6794 `type NamedString string`, 6795 `func (m NamedString) Validate(formats strfmt.Registry) error {`, 6796 ` if err := validate.MinLength("", "body", string(m), 2); err != nil {`, 6797 ` if err := validate.MaxLength("", "body", string(m), 50); err != nil {`, 6798 " if err := validate.Pattern(\"\", \"body\", string(m), `[A-Za-z0-9][\\w- ]+`); err != nil {", 6799 ` return errors.CompositeValidationError(res...`, 6800 }, 6801 // not expected 6802 todo, 6803 // output in log 6804 noLines, 6805 noLines) 6806 6807 expandRun.AddExpectations("named_string.go", flattenRun.ExpectedFor("NamedString").ExpectedLines, todo, noLines, noLines) 6808 6809 // load expectations for model: named_all_of_all_of3.go 6810 flattenRun.AddExpectations("named_all_of_all_of3.go", []string{ 6811 `type NamedAllOfAllOf3 struct {`, 6812 " Assoc [][][]string `json:\"assoc\"`", 6813 `func (m *NamedAllOfAllOf3) Validate(formats strfmt.Registry) error {`, 6814 ` if err := m.validateAssoc(formats); err != nil {`, 6815 ` return errors.CompositeValidationError(res...`, 6816 `func (m *NamedAllOfAllOf3) validateAssoc(formats strfmt.Registry) error {`, 6817 ` if swag.IsZero(m.Assoc) {`, 6818 ` iAssocSize := int64(len(m.Assoc)`, 6819 ` if err := validate.MinItems("assoc", "body", iAssocSize, 5); err != nil {`, 6820 ` if err := validate.MaxItems("assoc", "body", iAssocSize, 20); err != nil {`, 6821 ` for i := 0; i < len(m.Assoc); i++ {`, 6822 ` iiAssocSize := int64(len(m.Assoc[i])`, 6823 ` if err := validate.MinItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 5); err != nil {`, 6824 ` if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 20); err != nil {`, 6825 ` for ii := 0; ii < len(m.Assoc[i]); ii++ {`, 6826 ` iiiAssocSize := int64(len(m.Assoc[i][ii])`, 6827 ` if err := validate.MinItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`, 6828 ` if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`, 6829 ` for iii := 0; iii < len(m.Assoc[i][ii]); iii++ {`, 6830 ` if err := validate.MinLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 2); err != nil {`, 6831 ` if err := validate.MaxLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 50); err != nil {`, 6832 " if err := validate.Pattern(\"assoc\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", m.Assoc[i][ii][iii], `[A-Za-z0-9][\\w- ]+`); err != nil {", 6833 }, 6834 // not expected 6835 todo, 6836 // output in log 6837 noLines, 6838 noLines) 6839 6840 // load expectations for model: map_complex_validations.go 6841 flattenRun.AddExpectations("map_complex_validations.go", []string{ 6842 `type MapComplexValidations struct {`, 6843 // maps are now simple types 6844 "Meta map[string]MapComplexValidationsMetaAdditionalProperties `json:\"meta,omitempty\"`", 6845 `func (m *MapComplexValidations) Validate(formats strfmt.Registry) error {`, 6846 ` if err := m.validateMeta(formats); err != nil {`, 6847 ` return errors.CompositeValidationError(res...`, 6848 `func (m *MapComplexValidations) validateMeta(formats strfmt.Registry) error {`, 6849 ` if swag.IsZero(m.Meta) {`, 6850 ` for k := range m.Meta {`, 6851 ` if val, ok := m.Meta[k]; ok {`, 6852 ` if err := val.Validate(formats); err != nil {`, 6853 }, 6854 // not expected 6855 todo, 6856 // output in log 6857 noLines, 6858 noLines) 6859 6860 expandRun.AddExpectations("map_complex_validations.go", []string{ 6861 `type MapComplexValidations struct {`, 6862 " Meta map[string]MapComplexValidationsMetaAnon `json:\"meta,omitempty\"`", 6863 `func (m *MapComplexValidations) Validate(formats strfmt.Registry) error {`, 6864 ` if err := m.validateMeta(formats); err != nil {`, 6865 ` return errors.CompositeValidationError(res...`, 6866 `func (m *MapComplexValidations) validateMeta(formats strfmt.Registry) error {`, 6867 ` if swag.IsZero(m.Meta) {`, 6868 ` for k := range m.Meta {`, 6869 ` if val, ok := m.Meta[k]; ok {`, 6870 ` if err := val.Validate(formats); err != nil {`, 6871 `type MapComplexValidationsMetaAnon struct {`, 6872 " Age int32 `json:\"age,omitempty\"`", 6873 " Name string `json:\"name,omitempty\"`", 6874 `func (m *MapComplexValidationsMetaAnon) Validate(formats strfmt.Registry) error {`, 6875 ` if err := m.validateAge(formats); err != nil {`, 6876 ` if err := m.validateName(formats); err != nil {`, 6877 ` return errors.CompositeValidationError(res...`, 6878 `func (m *MapComplexValidationsMetaAnon) validateAge(formats strfmt.Registry) error {`, 6879 ` if swag.IsZero(m.Age) {`, 6880 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`, 6881 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`, 6882 ` if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`, 6883 `func (m *MapComplexValidationsMetaAnon) validateName(formats strfmt.Registry) error {`, 6884 ` if swag.IsZero(m.Name) {`, 6885 ` if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`, 6886 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 6887 " if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {", 6888 }, 6889 // not expected 6890 todo, 6891 // output in log 6892 noLines, 6893 noLines) 6894 6895 // load expectations for model: named_nested_map_complex_additional_properties_additional_properties_additional_properties.go 6896 flattenRun.AddExpectations("named_nested_map_complex_additional_properties_additional_properties_additional_properties.go", []string{ 6897 `type NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties struct {`, 6898 " Age int32 `json:\"age,omitempty\"`", 6899 " Name string `json:\"name,omitempty\"`", 6900 `func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {`, 6901 ` if err := m.validateAge(formats); err != nil {`, 6902 ` if err := m.validateName(formats); err != nil {`, 6903 ` return errors.CompositeValidationError(res...`, 6904 `func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateAge(formats strfmt.Registry) error {`, 6905 ` if swag.IsZero(m.Age) {`, 6906 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`, 6907 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`, 6908 ` if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`, 6909 `func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`, 6910 ` if swag.IsZero(m.Name) {`, 6911 ` if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`, 6912 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 6913 " if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {", 6914 }, 6915 // not expected 6916 todo, 6917 // output in log 6918 noLines, 6919 noLines) 6920 6921 // load expectations for model: all_of_validations_meta_all_of6_coords.go 6922 flattenRun.AddExpectations("all_of_validations_meta_all_of6_coords.go", []string{ 6923 `type AllOfValidationsMetaAllOf6Coords struct {`, 6924 ` AllOfValidationsMetaAllOf6CoordsAllOf0`, 6925 ` AllOfValidationsMetaAllOf6CoordsAllOf1`, 6926 `func (m *AllOfValidationsMetaAllOf6Coords) Validate(formats strfmt.Registry) error {`, 6927 ` if err := m.AllOfValidationsMetaAllOf6CoordsAllOf0.Validate(formats); err != nil {`, 6928 ` if err := m.AllOfValidationsMetaAllOf6CoordsAllOf1.Validate(formats); err != nil {`, 6929 ` return errors.CompositeValidationError(res...`, 6930 }, 6931 // not expected 6932 todo, 6933 // output in log 6934 noLines, 6935 noLines) 6936 6937 // load expectations for model: array_validations.go 6938 flattenRun.AddExpectations("array_validations.go", []string{ 6939 `type ArrayValidations struct {`, 6940 " Tags []string `json:\"tags\"`", 6941 `func (m *ArrayValidations) Validate(formats strfmt.Registry) error {`, 6942 ` if err := m.validateTags(formats); err != nil {`, 6943 ` return errors.CompositeValidationError(res...`, 6944 `func (m *ArrayValidations) validateTags(formats strfmt.Registry) error {`, 6945 ` if swag.IsZero(m.Tags) {`, 6946 ` iTagsSize := int64(len(m.Tags)`, 6947 ` if err := validate.MinItems("tags", "body", iTagsSize, 3); err != nil {`, 6948 ` if err := validate.MaxItems("tags", "body", iTagsSize, 10); err != nil {`, 6949 ` for i := 0; i < len(m.Tags); i++ {`, 6950 ` if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", m.Tags[i], 3); err != nil {`, 6951 ` if err := validate.MaxLength("tags"+"."+strconv.Itoa(i), "body", m.Tags[i], 10); err != nil {`, 6952 " if err := validate.Pattern(\"tags\"+\".\"+strconv.Itoa(i), \"body\", m.Tags[i], `\\w+`); err != nil {", 6953 }, 6954 // not expected 6955 todo, 6956 // output in log 6957 noLines, 6958 noLines) 6959 6960 expandRun.AddExpectations("array_validations.go", flattenRun.ExpectedFor("ArrayValidations").ExpectedLines, todo, noLines, noLines) 6961 6962 // load expectations for model: all_of_validations_meta.go 6963 flattenRun.AddExpectations("all_of_validations_meta.go", []string{ 6964 `type AllOfValidationsMeta struct {`, 6965 ` AllOfValidationsMetaAllOf0`, 6966 ` AllOfValidationsMetaAllOf1`, 6967 ` AllOfValidationsMetaAllOf2`, 6968 ` AllOfValidationsMetaAllOf3`, 6969 ` AllOfValidationsMetaAllOf4`, 6970 ` AllOfValidationsMetaAllOf5`, 6971 ` AllOfValidationsMetaAllOf6`, 6972 `func (m *AllOfValidationsMeta) Validate(formats strfmt.Registry) error {`, 6973 ` if err := m.AllOfValidationsMetaAllOf0.Validate(formats); err != nil {`, 6974 ` if err := m.AllOfValidationsMetaAllOf1.Validate(formats); err != nil {`, 6975 ` if err := m.AllOfValidationsMetaAllOf2.Validate(formats); err != nil {`, 6976 ` if err := m.AllOfValidationsMetaAllOf3.Validate(formats); err != nil {`, 6977 ` if err := m.AllOfValidationsMetaAllOf4.Validate(formats); err != nil {`, 6978 ` if err := m.AllOfValidationsMetaAllOf5.Validate(formats); err != nil {`, 6979 ` if err := m.AllOfValidationsMetaAllOf6.Validate(formats); err != nil {`, 6980 ` return errors.CompositeValidationError(res...`, 6981 }, 6982 // not expected 6983 todo, 6984 // output in log 6985 noLines, 6986 noLines) 6987 6988 // load expectations for model: map_complex_validations_meta_additional_properties.go 6989 flattenRun.AddExpectations("map_complex_validations_meta_additional_properties.go", []string{ 6990 `type MapComplexValidationsMetaAdditionalProperties struct {`, 6991 " Age int32 `json:\"age,omitempty\"`", 6992 " Name string `json:\"name,omitempty\"`", 6993 `func (m *MapComplexValidationsMetaAdditionalProperties) Validate(formats strfmt.Registry) error {`, 6994 ` if err := m.validateAge(formats); err != nil {`, 6995 ` if err := m.validateName(formats); err != nil {`, 6996 ` return errors.CompositeValidationError(res...`, 6997 `func (m *MapComplexValidationsMetaAdditionalProperties) validateAge(formats strfmt.Registry) error {`, 6998 ` if swag.IsZero(m.Age) {`, 6999 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`, 7000 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`, 7001 ` if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`, 7002 `func (m *MapComplexValidationsMetaAdditionalProperties) validateName(formats strfmt.Registry) error {`, 7003 ` if swag.IsZero(m.Name) {`, 7004 ` if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`, 7005 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 7006 " if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {", 7007 }, 7008 // not expected 7009 todo, 7010 // output in log 7011 noLines, 7012 noLines) 7013 7014 // load expectations for model: nested_map_complex_validations_meta_additional_properties.go 7015 // NOTE(fredbi): maps are simple types and this definition is no more generated 7016 7017 // load expectations for model: all_of_validations_meta_all_of6_coords_all_of1.go 7018 flattenRun.AddExpectations("all_of_validations_meta_all_of6_coords_all_of1.go", []string{ 7019 `type AllOfValidationsMetaAllOf6CoordsAllOf1 struct {`, 7020 " Age int32 `json:\"age,omitempty\"`", 7021 `func (m *AllOfValidationsMetaAllOf6CoordsAllOf1) Validate(formats strfmt.Registry) error {`, 7022 ` if err := m.validateAge(formats); err != nil {`, 7023 ` return errors.CompositeValidationError(res...`, 7024 `func (m *AllOfValidationsMetaAllOf6CoordsAllOf1) validateAge(formats strfmt.Registry) error {`, 7025 ` if swag.IsZero(m.Age) {`, 7026 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`, 7027 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 50, false); err != nil {`, 7028 ` if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`, 7029 }, 7030 // not expected 7031 todo, 7032 // output in log 7033 noLines, 7034 noLines) 7035 7036 // load expectations for model: all_of_validations_meta_all_of3.go 7037 flattenRun.AddExpectations("all_of_validations_meta_all_of3.go", []string{ 7038 `type AllOfValidationsMetaAllOf3 struct {`, 7039 " Assoc [][][]string `json:\"assoc\"`", 7040 `func (m *AllOfValidationsMetaAllOf3) Validate(formats strfmt.Registry) error {`, 7041 ` if err := m.validateAssoc(formats); err != nil {`, 7042 ` return errors.CompositeValidationError(res...`, 7043 `func (m *AllOfValidationsMetaAllOf3) validateAssoc(formats strfmt.Registry) error {`, 7044 ` if swag.IsZero(m.Assoc) {`, 7045 ` iAssocSize := int64(len(m.Assoc)`, 7046 ` if err := validate.MinItems("assoc", "body", iAssocSize, 5); err != nil {`, 7047 ` if err := validate.MaxItems("assoc", "body", iAssocSize, 20); err != nil {`, 7048 ` for i := 0; i < len(m.Assoc); i++ {`, 7049 ` iiAssocSize := int64(len(m.Assoc[i])`, 7050 ` if err := validate.MinItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 5); err != nil {`, 7051 ` if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 20); err != nil {`, 7052 ` for ii := 0; ii < len(m.Assoc[i]); ii++ {`, 7053 ` iiiAssocSize := int64(len(m.Assoc[i][ii])`, 7054 ` if err := validate.MinItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`, 7055 ` if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`, 7056 ` for iii := 0; iii < len(m.Assoc[i][ii]); iii++ {`, 7057 ` if err := validate.MinLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 2); err != nil {`, 7058 ` if err := validate.MaxLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 50); err != nil {`, 7059 " if err := validate.Pattern(\"assoc\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", m.Assoc[i][ii][iii], `[A-Za-z0-9][\\w- ]+`); err != nil {", 7060 }, 7061 // not expected 7062 todo, 7063 // output in log 7064 noLines, 7065 noLines) 7066 7067 // load expectations for model: nested_object_validations.go 7068 flattenRun.AddExpectations("nested_object_validations.go", []string{ 7069 `type NestedObjectValidations struct {`, 7070 " Args *NestedObjectValidationsArgs `json:\"args,omitempty\"`", 7071 `func (m *NestedObjectValidations) Validate(formats strfmt.Registry) error {`, 7072 ` if err := m.validateArgs(formats); err != nil {`, 7073 ` return errors.CompositeValidationError(res...`, 7074 `func (m *NestedObjectValidations) validateArgs(formats strfmt.Registry) error {`, 7075 ` if swag.IsZero(m.Args) {`, 7076 ` if m.Args != nil {`, 7077 ` if err := m.Args.Validate(formats); err != nil {`, 7078 ` if ve, ok := err.(*errors.Validation); ok {`, 7079 ` return ve.ValidateName("args"`, 7080 }, 7081 // not expected 7082 todo, 7083 // output in log 7084 noLines, 7085 noLines) 7086 7087 expandRun.AddExpectations("nested_object_validations.go", []string{ 7088 `type NestedObjectValidations struct {`, 7089 " Args *NestedObjectValidationsArgs `json:\"args,omitempty\"`", 7090 `func (m *NestedObjectValidations) Validate(formats strfmt.Registry) error {`, 7091 ` if err := m.validateArgs(formats); err != nil {`, 7092 ` return errors.CompositeValidationError(res...`, 7093 `func (m *NestedObjectValidations) validateArgs(formats strfmt.Registry) error {`, 7094 ` if swag.IsZero(m.Args) {`, 7095 ` if m.Args != nil {`, 7096 ` if err := m.Args.Validate(formats); err != nil {`, 7097 ` if ve, ok := err.(*errors.Validation); ok {`, 7098 ` return ve.ValidateName("args"`, 7099 `type NestedObjectValidationsArgs struct {`, 7100 " Meta *NestedObjectValidationsArgsMeta `json:\"meta,omitempty\"`", 7101 `func (m *NestedObjectValidationsArgs) Validate(formats strfmt.Registry) error {`, 7102 ` if err := m.validateMeta(formats); err != nil {`, 7103 ` return errors.CompositeValidationError(res...`, 7104 `func (m *NestedObjectValidationsArgs) validateMeta(formats strfmt.Registry) error {`, 7105 ` if swag.IsZero(m.Meta) {`, 7106 ` if m.Meta != nil {`, 7107 ` if err := m.Meta.Validate(formats); err != nil {`, 7108 ` if ve, ok := err.(*errors.Validation); ok {`, 7109 ` return ve.ValidateName("args" + "." + "meta"`, 7110 `type NestedObjectValidationsArgsMeta struct {`, 7111 " First string `json:\"first,omitempty\"`", 7112 " Fourth [][][]float32 `json:\"fourth\"`", 7113 " Second float64 `json:\"second,omitempty\"`", 7114 " Third []float32 `json:\"third\"`", 7115 `func (m *NestedObjectValidationsArgsMeta) Validate(formats strfmt.Registry) error {`, 7116 ` if err := m.validateFirst(formats); err != nil {`, 7117 ` if err := m.validateFourth(formats); err != nil {`, 7118 ` if err := m.validateSecond(formats); err != nil {`, 7119 ` if err := m.validateThird(formats); err != nil {`, 7120 ` return errors.CompositeValidationError(res...`, 7121 `func (m *NestedObjectValidationsArgsMeta) validateFirst(formats strfmt.Registry) error {`, 7122 ` if swag.IsZero(m.First) {`, 7123 ` if err := validate.MinLength("args"+"."+"meta"+"."+"first", "body", m.First, 2); err != nil {`, 7124 ` if err := validate.MaxLength("args"+"."+"meta"+"."+"first", "body", m.First, 50); err != nil {`, 7125 " if err := validate.Pattern(\"args\"+\".\"+\"meta\"+\".\"+\"first\", \"body\", m.First, `^\\w+`); err != nil {", 7126 `func (m *NestedObjectValidationsArgsMeta) validateFourth(formats strfmt.Registry) error {`, 7127 ` if swag.IsZero(m.Fourth) {`, 7128 ` iFourthSize := int64(len(m.Fourth)`, 7129 ` if err := validate.MinItems("args"+"."+"meta"+"."+"fourth", "body", iFourthSize, 5); err != nil {`, 7130 ` if err := validate.MaxItems("args"+"."+"meta"+"."+"fourth", "body", iFourthSize, 93); err != nil {`, 7131 ` for i := 0; i < len(m.Fourth); i++ {`, 7132 ` iiFourthSize := int64(len(m.Fourth[i])`, 7133 ` if err := validate.MinItems("args"+"."+"meta"+"."+"fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 5); err != nil {`, 7134 ` if err := validate.MaxItems("args"+"."+"meta"+"."+"fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 93); err != nil {`, 7135 ` for ii := 0; ii < len(m.Fourth[i]); ii++ {`, 7136 ` iiiFourthSize := int64(len(m.Fourth[i][ii])`, 7137 ` if err := validate.MinItems("args"+"."+"meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 5); err != nil {`, 7138 ` if err := validate.MaxItems("args"+"."+"meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 93); err != nil {`, 7139 ` for iii := 0; iii < len(m.Fourth[i][ii]); iii++ {`, 7140 ` if err := validate.Minimum("args"+"."+"meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", float64(m.Fourth[i][ii][iii]), 3, false); err != nil {`, 7141 ` if err := validate.Maximum("args"+"."+"meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", float64(m.Fourth[i][ii][iii]), 6, false); err != nil {`, 7142 ` if err := validate.MultipleOf("args"+"."+"meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", float64(m.Fourth[i][ii][iii]), 0.5); err != nil {`, 7143 `func (m *NestedObjectValidationsArgsMeta) validateSecond(formats strfmt.Registry) error {`, 7144 ` if swag.IsZero(m.Second) {`, 7145 ` if err := validate.Minimum("args"+"."+"meta"+"."+"second", "body", m.Second, 3, false); err != nil {`, 7146 ` if err := validate.Maximum("args"+"."+"meta"+"."+"second", "body", m.Second, 51, false); err != nil {`, 7147 ` if err := validate.MultipleOf("args"+"."+"meta"+"."+"second", "body", m.Second, 1.5); err != nil {`, 7148 `func (m *NestedObjectValidationsArgsMeta) validateThird(formats strfmt.Registry) error {`, 7149 ` if swag.IsZero(m.Third) {`, 7150 ` iThirdSize := int64(len(m.Third)`, 7151 ` if err := validate.MinItems("args"+"."+"meta"+"."+"third", "body", iThirdSize, 5); err != nil {`, 7152 ` if err := validate.MaxItems("args"+"."+"meta"+"."+"third", "body", iThirdSize, 93); err != nil {`, 7153 ` for i := 0; i < len(m.Third); i++ {`, 7154 ` if err := validate.Minimum("args"+"."+"meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 3, false); err != nil {`, 7155 ` if err := validate.Maximum("args"+"."+"meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 6, false); err != nil {`, 7156 ` if err := validate.MultipleOf("args"+"."+"meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 0.5); err != nil {`, 7157 }, 7158 // not expected 7159 todo, 7160 // output in log 7161 noLines, 7162 noLines) 7163 7164 // load expectations for model: named_array_additional.go 7165 flattenRun.AddExpectations("named_array_additional.go", []string{ 7166 `type NamedArrayAdditional struct {`, 7167 " P0 *string `json:\"-\"`", 7168 " P1 *float64 `json:\"-\"`", 7169 " NamedArrayAdditionalItems []int64 `json:\"-\"`", 7170 `func (m *NamedArrayAdditional) Validate(formats strfmt.Registry) error {`, 7171 ` if err := m.validateP0(formats); err != nil {`, 7172 ` if err := m.validateP1(formats); err != nil {`, 7173 ` if err := m.validateNamedArrayAdditionalItems(formats); err != nil {`, 7174 ` return errors.CompositeValidationError(res...`, 7175 `func (m *NamedArrayAdditional) validateP0(formats strfmt.Registry) error {`, 7176 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 7177 ` if err := validate.MinLength("0", "body", *m.P0, 3); err != nil {`, 7178 ` if err := validate.MaxLength("0", "body", *m.P0, 10); err != nil {`, 7179 " if err := validate.Pattern(\"0\", \"body\", *m.P0, `\\w+`); err != nil {", 7180 `func (m *NamedArrayAdditional) validateP1(formats strfmt.Registry) error {`, 7181 ` if err := validate.Required("1", "body", m.P1); err != nil {`, 7182 ` if err := validate.Minimum("1", "body", *m.P1, 3, false); err != nil {`, 7183 ` if err := validate.Maximum("1", "body", *m.P1, 12, false); err != nil {`, 7184 ` if err := validate.MultipleOf("1", "body", *m.P1, 1.5); err != nil {`, 7185 `func (m *NamedArrayAdditional) validateNamedArrayAdditionalItems(formats strfmt.Registry) error {`, 7186 ` for i := range m.NamedArrayAdditionalItems {`, 7187 ` if err := validate.MinimumInt(strconv.Itoa(i+2), "body", m.NamedArrayAdditionalItems[i], 3, false); err != nil {`, 7188 ` if err := validate.MaximumInt(strconv.Itoa(i+2), "body", m.NamedArrayAdditionalItems[i], 6, false); err != nil {`, 7189 ` if err := validate.MultipleOfInt(strconv.Itoa(i+2), "body", m.NamedArrayAdditionalItems[i], 1); err != nil {`, 7190 }, 7191 // not expected 7192 todo, 7193 // output in log 7194 noLines, 7195 noLines) 7196 7197 expandRun.AddExpectations("named_array_additional.go", flattenRun.ExpectedFor("NamedArrayAdditional").ExpectedLines, todo, noLines, noLines) 7198 7199 // load expectations for model: pet.go 7200 flattenRun.AddExpectations("pet.go", []string{ 7201 `type Pet struct {`, 7202 " Category *Category `json:\"category,omitempty\"`", 7203 " ID int64 `json:\"id,omitempty\"`", 7204 " Name *string `json:\"name\"`", 7205 " PhotoUrls []string `json:\"photoUrls\" xml:\"photoUrl\"`", 7206 " Status string `json:\"status,omitempty\"`", 7207 " Tags []*Tag `json:\"tags\" xml:\"tag\"`", 7208 `func (m *Pet) Validate(formats strfmt.Registry) error {`, 7209 ` if err := m.validateCategory(formats); err != nil {`, 7210 ` if err := m.validateName(formats); err != nil {`, 7211 ` if err := m.validatePhotoUrls(formats); err != nil {`, 7212 ` if err := m.validateStatus(formats); err != nil {`, 7213 ` if err := m.validateTags(formats); err != nil {`, 7214 ` return errors.CompositeValidationError(res...`, 7215 `func (m *Pet) validateCategory(formats strfmt.Registry) error {`, 7216 ` if swag.IsZero(m.Category) {`, 7217 ` if m.Category != nil {`, 7218 ` if err := m.Category.Validate(formats); err != nil {`, 7219 ` if ve, ok := err.(*errors.Validation); ok {`, 7220 ` return ve.ValidateName("category"`, 7221 `func (m *Pet) validateName(formats strfmt.Registry) error {`, 7222 ` if err := validate.Required("name", "body", m.Name); err != nil {`, 7223 `func (m *Pet) validatePhotoUrls(formats strfmt.Registry) error {`, 7224 ` if err := validate.Required("photoUrls", "body", m.PhotoUrls); err != nil {`, 7225 `var petTypeStatusPropEnum []interface{`, 7226 ` var res []string`, 7227 " if err := json.Unmarshal([]byte(`[\"available\",\"pending\",\"sold\"]`), &res); err != nil {", 7228 ` for _, v := range res {`, 7229 ` petTypeStatusPropEnum = append(petTypeStatusPropEnum, v`, 7230 ` PetStatusAvailable string = "available"`, 7231 ` PetStatusPending string = "pending"`, 7232 ` PetStatusSold string = "sold"`, 7233 `func (m *Pet) validateStatusEnum(path, location string, value string) error {`, 7234 ` if err := validate.EnumCase(path, location, value, petTypeStatusPropEnum, true); err != nil {`, 7235 `func (m *Pet) validateStatus(formats strfmt.Registry) error {`, 7236 ` if swag.IsZero(m.Status) {`, 7237 ` if err := m.validateStatusEnum("status", "body", m.Status); err != nil {`, 7238 `func (m *Pet) validateTags(formats strfmt.Registry) error {`, 7239 ` if swag.IsZero(m.Tags) {`, 7240 ` for i := 0; i < len(m.Tags); i++ {`, 7241 // do we need Required when item is nullable? 7242 // nullable not required: 7243 ` if swag.IsZero(m.Tags[i]) {`, 7244 // nullable required: 7245 ` if m.Tags[i] != nil {`, 7246 ` if err := m.Tags[i].Validate(formats); err != nil {`, 7247 ` if ve, ok := err.(*errors.Validation); ok {`, 7248 ` return ve.ValidateName("tags" + "." + strconv.Itoa(i)`, 7249 }, 7250 // not expected 7251 todo, 7252 // output in log 7253 noLines, 7254 noLines) 7255 7256 expandRun.AddExpectations("pet.go", []string{ 7257 `type Pet struct {`, 7258 " Category *PetCategory `json:\"category,omitempty\"`", 7259 " ID int64 `json:\"id,omitempty\"`", 7260 " Name *string `json:\"name\"`", 7261 " PhotoUrls []string `json:\"photoUrls\" xml:\"photoUrl\"`", 7262 " Status string `json:\"status,omitempty\"`", 7263 " Tags []*PetTagsItems0 `json:\"tags\" xml:\"tag\"`", 7264 `func (m *Pet) Validate(formats strfmt.Registry) error {`, 7265 ` if err := m.validateCategory(formats); err != nil {`, 7266 ` if err := m.validateName(formats); err != nil {`, 7267 ` if err := m.validatePhotoUrls(formats); err != nil {`, 7268 ` if err := m.validateStatus(formats); err != nil {`, 7269 ` if err := m.validateTags(formats); err != nil {`, 7270 ` return errors.CompositeValidationError(res...`, 7271 `func (m *Pet) validateCategory(formats strfmt.Registry) error {`, 7272 ` if swag.IsZero(m.Category) {`, 7273 ` if m.Category != nil {`, 7274 ` if err := m.Category.Validate(formats); err != nil {`, 7275 ` if ve, ok := err.(*errors.Validation); ok {`, 7276 ` return ve.ValidateName("category"`, 7277 `func (m *Pet) validateName(formats strfmt.Registry) error {`, 7278 ` if err := validate.Required("name", "body", m.Name); err != nil {`, 7279 `func (m *Pet) validatePhotoUrls(formats strfmt.Registry) error {`, 7280 ` if err := validate.Required("photoUrls", "body", m.PhotoUrls); err != nil {`, 7281 `var petTypeStatusPropEnum []interface{`, 7282 ` var res []string`, 7283 " if err := json.Unmarshal([]byte(`[\"available\",\"pending\",\"sold\"]`), &res); err != nil {", 7284 ` for _, v := range res {`, 7285 ` petTypeStatusPropEnum = append(petTypeStatusPropEnum, v`, 7286 ` PetStatusAvailable string = "available"`, 7287 ` PetStatusPending string = "pending"`, 7288 ` PetStatusSold string = "sold"`, 7289 `func (m *Pet) validateStatusEnum(path, location string, value string) error {`, 7290 ` if err := validate.EnumCase(path, location, value, petTypeStatusPropEnum, true); err != nil {`, 7291 `func (m *Pet) validateStatus(formats strfmt.Registry) error {`, 7292 ` if swag.IsZero(m.Status) {`, 7293 ` if err := m.validateStatusEnum("status", "body", m.Status); err != nil {`, 7294 `func (m *Pet) validateTags(formats strfmt.Registry) error {`, 7295 ` if swag.IsZero(m.Tags) {`, 7296 ` for i := 0; i < len(m.Tags); i++ {`, 7297 // do we need Required when item is nullable? 7298 // nullable not required: 7299 ` if swag.IsZero(m.Tags[i]) {`, 7300 // nullable required: 7301 ` if m.Tags[i] != nil {`, 7302 ` if err := m.Tags[i].Validate(formats); err != nil {`, 7303 ` if ve, ok := err.(*errors.Validation); ok {`, 7304 ` return ve.ValidateName("tags" + "." + strconv.Itoa(i)`, 7305 `type PetCategory struct {`, 7306 " ID int64 `json:\"id,omitempty\"`", 7307 " Name string `json:\"name,omitempty\"`", 7308 // empty validation 7309 "func (m *PetCategory) Validate(formats strfmt.Registry) error {\n return nil\n}", 7310 `type PetTagsItems0 struct {`, 7311 " ID int64 `json:\"id,omitempty\"`", 7312 " Name string `json:\"name,omitempty\"`", 7313 // empty validation 7314 "func (m *PetTagsItems0) Validate(formats strfmt.Registry) error {\n return nil\n}", 7315 }, 7316 // not expected 7317 todo, 7318 // output in log 7319 noLines, 7320 noLines) 7321 7322 // load expectations for model: map_complex_validations_meta.go 7323 // NOTE(fredbi): maps are simple types and this definition is no more generated 7324 7325 // load expectations for model: array_additional_validations_args.go 7326 flattenRun.AddExpectations("array_additional_validations_args.go", []string{ 7327 `type ArrayAdditionalValidationsArgs struct {`, 7328 " P0 *string `json:\"-\"`", 7329 " P1 *float64 `json:\"-\"`", 7330 " ArrayAdditionalValidationsArgsItems []int64 `json:\"-\"`", 7331 `func (m *ArrayAdditionalValidationsArgs) Validate(formats strfmt.Registry) error {`, 7332 ` if err := m.validateP0(formats); err != nil {`, 7333 ` if err := m.validateP1(formats); err != nil {`, 7334 ` if err := m.validateArrayAdditionalValidationsArgsItems(formats); err != nil {`, 7335 ` return errors.CompositeValidationError(res...`, 7336 `func (m *ArrayAdditionalValidationsArgs) validateP0(formats strfmt.Registry) error {`, 7337 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 7338 ` if err := validate.MinLength("0", "body", *m.P0, 3); err != nil {`, 7339 ` if err := validate.MaxLength("0", "body", *m.P0, 10); err != nil {`, 7340 " if err := validate.Pattern(\"0\", \"body\", *m.P0, `\\w+`); err != nil {", 7341 `func (m *ArrayAdditionalValidationsArgs) validateP1(formats strfmt.Registry) error {`, 7342 ` if err := validate.Required("1", "body", m.P1); err != nil {`, 7343 ` if err := validate.Minimum("1", "body", *m.P1, 3, false); err != nil {`, 7344 ` if err := validate.Maximum("1", "body", *m.P1, 12, false); err != nil {`, 7345 ` if err := validate.MultipleOf("1", "body", *m.P1, 1.5); err != nil {`, 7346 `func (m *ArrayAdditionalValidationsArgs) validateArrayAdditionalValidationsArgsItems(formats strfmt.Registry) error {`, 7347 ` for i := range m.ArrayAdditionalValidationsArgsItems {`, 7348 ` if err := validate.MinimumInt(strconv.Itoa(i+2), "body", m.ArrayAdditionalValidationsArgsItems[i], 3, false); err != nil {`, 7349 ` if err := validate.MaximumInt(strconv.Itoa(i+2), "body", m.ArrayAdditionalValidationsArgsItems[i], 6, false); err != nil {`, 7350 ` if err := validate.MultipleOfInt(strconv.Itoa(i+2), "body", m.ArrayAdditionalValidationsArgsItems[i], 1); err != nil {`, 7351 }, 7352 // not expected 7353 todo, 7354 // output in log 7355 noLines, 7356 noLines) 7357 7358 // load expectations for model: all_of_validations_meta_all_of2.go 7359 flattenRun.AddExpectations("all_of_validations_meta_all_of2.go", []string{ 7360 `type AllOfValidationsMetaAllOf2 struct {`, 7361 " Args []string `json:\"args\"`", 7362 `func (m *AllOfValidationsMetaAllOf2) Validate(formats strfmt.Registry) error {`, 7363 ` if err := m.validateArgs(formats); err != nil {`, 7364 ` return errors.CompositeValidationError(res...`, 7365 `func (m *AllOfValidationsMetaAllOf2) validateArgs(formats strfmt.Registry) error {`, 7366 ` if swag.IsZero(m.Args) {`, 7367 ` iArgsSize := int64(len(m.Args)`, 7368 ` if err := validate.MinItems("args", "body", iArgsSize, 5); err != nil {`, 7369 ` if err := validate.MaxItems("args", "body", iArgsSize, 20); err != nil {`, 7370 ` for i := 0; i < len(m.Args); i++ {`, 7371 ` if err := validate.MinLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 2); err != nil {`, 7372 ` if err := validate.MaxLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 50); err != nil {`, 7373 " if err := validate.Pattern(\"args\"+\".\"+strconv.Itoa(i), \"body\", m.Args[i], `[A-Za-z0-9][\\w- ]+`); err != nil {", 7374 }, 7375 // not expected 7376 todo, 7377 // output in log 7378 noLines, 7379 noLines) 7380 7381 // load expectations for model: all_of_validations_meta_all_of0.go 7382 flattenRun.AddExpectations("all_of_validations_meta_all_of0.go", []string{ 7383 `type AllOfValidationsMetaAllOf0 struct {`, 7384 " Name string `json:\"name,omitempty\"`", 7385 `func (m *AllOfValidationsMetaAllOf0) Validate(formats strfmt.Registry) error {`, 7386 ` if err := m.validateName(formats); err != nil {`, 7387 ` return errors.CompositeValidationError(res...`, 7388 `func (m *AllOfValidationsMetaAllOf0) validateName(formats strfmt.Registry) error {`, 7389 ` if swag.IsZero(m.Name) {`, 7390 ` if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`, 7391 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 7392 " if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {", 7393 }, 7394 // not expected 7395 todo, 7396 // output in log 7397 noLines, 7398 noLines) 7399 7400 // load expectations for model: named_all_of_all_of4.go 7401 flattenRun.AddExpectations("named_all_of_all_of4.go", []string{ 7402 `type NamedAllOfAllOf4 struct {`, 7403 " Opts map[string]float64 `json:\"opts,omitempty\"`", 7404 `func (m *NamedAllOfAllOf4) Validate(formats strfmt.Registry) error {`, 7405 ` if err := m.validateOpts(formats); err != nil {`, 7406 ` return errors.CompositeValidationError(res...`, 7407 `func (m *NamedAllOfAllOf4) validateOpts(formats strfmt.Registry) error {`, 7408 ` if swag.IsZero(m.Opts) {`, 7409 ` for k := range m.Opts {`, 7410 ` if err := validate.Minimum("opts"+"."+k, "body", m.Opts[k], 2, false); err != nil {`, 7411 ` if err := validate.Maximum("opts"+"."+k, "body", m.Opts[k], 50, false); err != nil {`, 7412 ` if err := validate.MultipleOf("opts"+"."+k, "body", m.Opts[k], 1.5); err != nil {`, 7413 }, 7414 // not expected 7415 todo, 7416 // output in log 7417 noLines, 7418 noLines) 7419 7420 // load expectations for model: named_all_of_all_of0.go 7421 flattenRun.AddExpectations("named_all_of_all_of0.go", []string{ 7422 `type NamedAllOfAllOf0 struct {`, 7423 " Name string `json:\"name,omitempty\"`", 7424 `func (m *NamedAllOfAllOf0) Validate(formats strfmt.Registry) error {`, 7425 ` if err := m.validateName(formats); err != nil {`, 7426 ` return errors.CompositeValidationError(res...`, 7427 `func (m *NamedAllOfAllOf0) validateName(formats strfmt.Registry) error {`, 7428 ` if swag.IsZero(m.Name) {`, 7429 ` if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`, 7430 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 7431 " if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {", 7432 }, 7433 // not expected 7434 todo, 7435 // output in log 7436 noLines, 7437 noLines) 7438 7439 // load expectations for model: nested_map_complex_validations_meta_additional_properties_additional_properties_additional_properties.go 7440 flattenRun.AddExpectations("nested_map_complex_validations_meta_additional_properties_additional_properties_additional_properties.go", []string{ 7441 `type NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties struct {`, 7442 " Age int32 `json:\"age,omitempty\"`", 7443 " Name string `json:\"name,omitempty\"`", 7444 `func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {`, 7445 ` if err := m.validateAge(formats); err != nil {`, 7446 ` if err := m.validateName(formats); err != nil {`, 7447 ` return errors.CompositeValidationError(res...`, 7448 `func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateAge(formats strfmt.Registry) error {`, 7449 ` if swag.IsZero(m.Age) {`, 7450 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`, 7451 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`, 7452 ` if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`, 7453 `func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`, 7454 ` if swag.IsZero(m.Name) {`, 7455 ` if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`, 7456 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 7457 " if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {", 7458 }, 7459 // not expected 7460 todo, 7461 // output in log 7462 noLines, 7463 noLines) 7464 7465 // load expectations for model: refed_all_of_validations.go 7466 flattenRun.AddExpectations("refed_all_of_validations.go", []string{ 7467 `type RefedAllOfValidations struct {`, 7468 ` NamedString`, 7469 ` NamedNumber`, 7470 `func (m *RefedAllOfValidations) Validate(formats strfmt.Registry) error {`, 7471 ` if err := m.NamedString.Validate(formats); err != nil {`, 7472 ` if err := m.NamedNumber.Validate(formats); err != nil {`, 7473 ` return errors.CompositeValidationError(res...`, 7474 }, 7475 // not expected 7476 todo, 7477 // output in log 7478 noLines, 7479 noLines) 7480 7481 expandRun.AddExpectations("refed_all_of_validations.go", []string{ 7482 `type RefedAllOfValidations struct {`, 7483 ` RefedAllOfValidationsAllOf0`, 7484 ` RefedAllOfValidationsAllOf1`, 7485 `func (m *RefedAllOfValidations) Validate(formats strfmt.Registry) error {`, 7486 ` if err := m.RefedAllOfValidationsAllOf0.Validate(formats); err != nil {`, 7487 ` if err := m.RefedAllOfValidationsAllOf1.Validate(formats); err != nil {`, 7488 ` return errors.CompositeValidationError(res...`, 7489 `type RefedAllOfValidationsAllOf0 string`, 7490 `func (m RefedAllOfValidationsAllOf0) Validate(formats strfmt.Registry) error {`, 7491 ` if err := validate.MinLength("", "body", string(m), 2); err != nil {`, 7492 ` if err := validate.MaxLength("", "body", string(m), 50); err != nil {`, 7493 " if err := validate.Pattern(\"\", \"body\", string(m), `[A-Za-z0-9][\\w- ]+`); err != nil {", 7494 ` return errors.CompositeValidationError(res...`, 7495 `type RefedAllOfValidationsAllOf1 int32`, 7496 `func (m RefedAllOfValidationsAllOf1) Validate(formats strfmt.Registry) error {`, 7497 ` if err := validate.MinimumInt("", "body", int64(m), 0, true); err != nil {`, 7498 ` if err := validate.MaximumInt("", "body", int64(m), 500, false); err != nil {`, 7499 ` if err := validate.MultipleOf("", "body", float64(m), 1.5); err != nil {`, 7500 ` return errors.CompositeValidationError(res...`, 7501 }, 7502 // not expected 7503 todo, 7504 // output in log 7505 noLines, 7506 noLines) 7507 7508 // load expectations for model: update_org.go 7509 flattenRun.AddExpectations("update_org.go", []string{ 7510 `type UpdateOrg struct {`, 7511 " Email string `json:\"email,omitempty\"`", 7512 " InvoiceEmail bool `json:\"invoice_email,omitempty\"`", 7513 " TagExpiration *int64 `json:\"tag_expiration,omitempty\"`", 7514 `func (m *UpdateOrg) Validate(formats strfmt.Registry) error {`, 7515 ` if err := m.validateTagExpiration(formats); err != nil {`, 7516 ` return errors.CompositeValidationError(res...`, 7517 `func (m *UpdateOrg) validateTagExpiration(formats strfmt.Registry) error {`, 7518 ` if swag.IsZero(m.TagExpiration) {`, 7519 ` if err := validate.MinimumInt("tag_expiration", "body", *m.TagExpiration, 0, false); err != nil {`, 7520 ` if err := validate.MaximumInt("tag_expiration", "body", *m.TagExpiration, 2.592e+06, false); err != nil {`, 7521 }, 7522 // not expected 7523 todo, 7524 // output in log 7525 noLines, 7526 noLines) 7527 7528 expandRun.AddExpectations("update_org.go", flattenRun.ExpectedFor("UpdateOrg").ExpectedLines, todo, noLines, noLines) 7529 7530 // load expectations for model: number_validations.go 7531 flattenRun.AddExpectations("number_validations.go", []string{ 7532 `type NumberValidations struct {`, 7533 " Age int32 `json:\"age,omitempty\"`", 7534 `func (m *NumberValidations) Validate(formats strfmt.Registry) error {`, 7535 ` if err := m.validateAge(formats); err != nil {`, 7536 ` return errors.CompositeValidationError(res...`, 7537 `func (m *NumberValidations) validateAge(formats strfmt.Registry) error {`, 7538 ` if swag.IsZero(m.Age) {`, 7539 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 0, true); err != nil {`, 7540 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 500, false); err != nil {`, 7541 ` if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`, 7542 }, 7543 // not expected 7544 todo, 7545 // output in log 7546 noLines, 7547 noLines) 7548 7549 expandRun.AddExpectations("number_validations.go", flattenRun.ExpectedFor("NumberValidations").ExpectedLines, todo, noLines, noLines) 7550 7551 // load expectations for model: nested_map_complex_validations.go 7552 flattenRun.AddExpectations("nested_map_complex_validations.go", []string{ 7553 `type NestedMapComplexValidations struct {`, 7554 // maps are now simple types 7555 " Meta map[string]map[string]map[string]NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties `json:\"meta,omitempty\"`", 7556 `func (m *NestedMapComplexValidations) Validate(formats strfmt.Registry) error {`, 7557 ` if err := m.validateMeta(formats); err != nil {`, 7558 ` return errors.CompositeValidationError(res...`, 7559 `func (m *NestedMapComplexValidations) validateMeta(formats strfmt.Registry) error {`, 7560 ` if swag.IsZero(m.Meta) {`, 7561 ` for k := range m.Meta {`, 7562 ` for kk := range m.Meta[k] {`, 7563 ` for kkk := range m.Meta[k][kk] {`, 7564 ` if err := validate.Required("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk]); err != nil {`, 7565 ` if val, ok := m.Meta[k][kk][kkk]; ok {`, 7566 ` if err := val.Validate(formats); err != nil {`, 7567 }, 7568 // not expected 7569 todo, 7570 // output in log 7571 noLines, 7572 noLines) 7573 7574 expandRun.AddExpectations("nested_map_complex_validations.go", []string{ 7575 `type NestedMapComplexValidations struct {`, 7576 " Meta map[string]map[string]map[string]NestedMapComplexValidationsMetaAnon `json:\"meta,omitempty\"`", 7577 `func (m *NestedMapComplexValidations) Validate(formats strfmt.Registry) error {`, 7578 ` if err := m.validateMeta(formats); err != nil {`, 7579 ` return errors.CompositeValidationError(res...`, 7580 `func (m *NestedMapComplexValidations) validateMeta(formats strfmt.Registry) error {`, 7581 ` if swag.IsZero(m.Meta) {`, 7582 ` for k := range m.Meta {`, 7583 ` for kk := range m.Meta[k] {`, 7584 ` for kkk := range m.Meta[k][kk] {`, 7585 ` if val, ok := m.Meta[k][kk][kkk]; ok {`, 7586 ` if err := val.Validate(formats); err != nil {`, 7587 `type NestedMapComplexValidationsMetaAnon struct {`, 7588 " Age int32 `json:\"age,omitempty\"`", 7589 " Name string `json:\"name,omitempty\"`", 7590 `func (m *NestedMapComplexValidationsMetaAnon) Validate(formats strfmt.Registry) error {`, 7591 ` if err := m.validateAge(formats); err != nil {`, 7592 ` if err := m.validateName(formats); err != nil {`, 7593 ` return errors.CompositeValidationError(res...`, 7594 `func (m *NestedMapComplexValidationsMetaAnon) validateAge(formats strfmt.Registry) error {`, 7595 ` if swag.IsZero(m.Age) {`, 7596 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`, 7597 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`, 7598 ` if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`, 7599 `func (m *NestedMapComplexValidationsMetaAnon) validateName(formats strfmt.Registry) error {`, 7600 ` if swag.IsZero(m.Name) {`, 7601 ` if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`, 7602 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 7603 " if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {", 7604 }, 7605 // not expected 7606 todo, 7607 // output in log 7608 noLines, 7609 noLines) 7610 7611 // load expectations for model: category.go 7612 flattenRun.AddExpectations("category.go", []string{ 7613 `type Category struct {`, 7614 " ID int64 `json:\"id,omitempty\"`", 7615 " Name string `json:\"name,omitempty\"`", 7616 // empty validation 7617 "func (m *Category) Validate(formats strfmt.Registry) error {\n return nil\n}", 7618 }, 7619 // not expected 7620 todo, 7621 // output in log 7622 noLines, 7623 noLines) 7624 7625 expandRun.AddExpectations("category.go", flattenRun.ExpectedFor("Category").ExpectedLines, todo, noLines, noLines) 7626 7627 // load expectations for model: named_all_of_all_of2.go 7628 flattenRun.AddExpectations("named_all_of_all_of2.go", []string{ 7629 `type NamedAllOfAllOf2 struct {`, 7630 " Args []string `json:\"args\"`", 7631 `func (m *NamedAllOfAllOf2) Validate(formats strfmt.Registry) error {`, 7632 ` if err := m.validateArgs(formats); err != nil {`, 7633 ` return errors.CompositeValidationError(res...`, 7634 `func (m *NamedAllOfAllOf2) validateArgs(formats strfmt.Registry) error {`, 7635 ` if swag.IsZero(m.Args) {`, 7636 ` iArgsSize := int64(len(m.Args)`, 7637 ` if err := validate.MinItems("args", "body", iArgsSize, 5); err != nil {`, 7638 ` if err := validate.MaxItems("args", "body", iArgsSize, 20); err != nil {`, 7639 ` for i := 0; i < len(m.Args); i++ {`, 7640 ` if err := validate.MinLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 2); err != nil {`, 7641 ` if err := validate.MaxLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 50); err != nil {`, 7642 " if err := validate.Pattern(\"args\"+\".\"+strconv.Itoa(i), \"body\", m.Args[i], `[A-Za-z0-9][\\w- ]+`); err != nil {", 7643 }, 7644 // not expected 7645 todo, 7646 // output in log 7647 noLines, 7648 noLines) 7649 7650 // load expectations for model: named_nested_map_complex_additional_properties_additional_properties.go 7651 // NOTE(fredbi): maps are now simple types - this definition is no more generated 7652 7653 // load expectations for model: named_nested_map_complex_additional_properties.go 7654 // NOTE(fredbi): maps are now simple types - this definition is no more generated 7655 7656 // load expectations for model: named_nested_array.go 7657 flattenRun.AddExpectations("named_nested_array.go", []string{ 7658 `type NamedNestedArray [][][]string`, 7659 `func (m NamedNestedArray) Validate(formats strfmt.Registry) error {`, 7660 ` iNamedNestedArraySize := int64(len(m)`, 7661 ` if err := validate.MinItems("", "body", iNamedNestedArraySize, 3); err != nil {`, 7662 ` if err := validate.MaxItems("", "body", iNamedNestedArraySize, 10); err != nil {`, 7663 ` for i := 0; i < len(m); i++ {`, 7664 ` iiNamedNestedArraySize := int64(len(m[i])`, 7665 ` if err := validate.MinItems(strconv.Itoa(i), "body", iiNamedNestedArraySize, 3); err != nil {`, 7666 ` if err := validate.MaxItems(strconv.Itoa(i), "body", iiNamedNestedArraySize, 10); err != nil {`, 7667 ` for ii := 0; ii < len(m[i]); ii++ {`, 7668 ` iiiNamedNestedArraySize := int64(len(m[i][ii])`, 7669 ` if err := validate.MinItems(strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiNamedNestedArraySize, 3); err != nil {`, 7670 ` if err := validate.MaxItems(strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiNamedNestedArraySize, 10); err != nil {`, 7671 ` for iii := 0; iii < len(m[i][ii]); iii++ {`, 7672 ` if err := validate.MinLength(strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m[i][ii][iii], 3); err != nil {`, 7673 ` if err := validate.MaxLength(strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m[i][ii][iii], 10); err != nil {`, 7674 " if err := validate.Pattern(strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", m[i][ii][iii], `\\w+`); err != nil {", 7675 ` return errors.CompositeValidationError(res...`, 7676 }, 7677 // not expected 7678 todo, 7679 // output in log 7680 noLines, 7681 noLines) 7682 7683 expandRun.AddExpectations("named_nested_array.go", flattenRun.ExpectedFor("NamedNestedArray").ExpectedLines, todo, noLines, noLines) 7684 7685 // load expectations for model: named_all_of.go 7686 flattenRun.AddExpectations("named_all_of.go", []string{ 7687 `type NamedAllOf struct {`, 7688 ` NamedAllOfAllOf0`, 7689 ` NamedAllOfAllOf1`, 7690 ` NamedAllOfAllOf2`, 7691 ` NamedAllOfAllOf3`, 7692 ` NamedAllOfAllOf4`, 7693 ` NamedAllOfAllOf5`, 7694 ` NamedAllOfAllOf6`, 7695 `func (m *NamedAllOf) Validate(formats strfmt.Registry) error {`, 7696 ` if err := m.NamedAllOfAllOf0.Validate(formats); err != nil {`, 7697 ` if err := m.NamedAllOfAllOf1.Validate(formats); err != nil {`, 7698 ` if err := m.NamedAllOfAllOf2.Validate(formats); err != nil {`, 7699 ` if err := m.NamedAllOfAllOf3.Validate(formats); err != nil {`, 7700 ` if err := m.NamedAllOfAllOf4.Validate(formats); err != nil {`, 7701 ` if err := m.NamedAllOfAllOf5.Validate(formats); err != nil {`, 7702 ` if err := m.NamedAllOfAllOf6.Validate(formats); err != nil {`, 7703 ` return errors.CompositeValidationError(res...`, 7704 }, 7705 // not expected 7706 todo, 7707 // output in log 7708 noLines, 7709 noLines) 7710 7711 expandRun.AddExpectations("named_all_of.go", []string{ 7712 `type NamedAllOf struct {`, 7713 " Name string `json:\"name,omitempty\"`", 7714 " Age int32 `json:\"age,omitempty\"`", 7715 " Args []string `json:\"args\"`", 7716 " Assoc [][][]string `json:\"assoc\"`", 7717 " Opts map[string]float64 `json:\"opts,omitempty\"`", 7718 " ExtOpts map[string]map[string]map[string]int32 `json:\"extOpts,omitempty\"`", 7719 ` Coords struct {`, 7720 " Name string `json:\"name,omitempty\"`", 7721 " Age int32 `json:\"age,omitempty\"`", 7722 " } `json:\"coords,omitempty\"`", 7723 `func (m *NamedAllOf) Validate(formats strfmt.Registry) error {`, 7724 ` if err := m.validateName(formats); err != nil {`, 7725 ` if err := m.validateAge(formats); err != nil {`, 7726 ` if err := m.validateArgs(formats); err != nil {`, 7727 ` if err := m.validateAssoc(formats); err != nil {`, 7728 ` if err := m.validateOpts(formats); err != nil {`, 7729 ` if err := m.validateExtOpts(formats); err != nil {`, 7730 ` if err := m.validateCoords(formats); err != nil {`, 7731 ` return errors.CompositeValidationError(res...`, 7732 `func (m *NamedAllOf) validateName(formats strfmt.Registry) error {`, 7733 ` if swag.IsZero(m.Name) {`, 7734 ` if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`, 7735 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 7736 " if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {", 7737 `func (m *NamedAllOf) validateAge(formats strfmt.Registry) error {`, 7738 ` if swag.IsZero(m.Age) {`, 7739 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`, 7740 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 50, false); err != nil {`, 7741 ` if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`, 7742 `func (m *NamedAllOf) validateArgs(formats strfmt.Registry) error {`, 7743 ` if swag.IsZero(m.Args) {`, 7744 ` iArgsSize := int64(len(m.Args)`, 7745 ` if err := validate.MinItems("args", "body", iArgsSize, 5); err != nil {`, 7746 ` if err := validate.MaxItems("args", "body", iArgsSize, 20); err != nil {`, 7747 ` for i := 0; i < len(m.Args); i++ {`, 7748 ` if err := validate.MinLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 2); err != nil {`, 7749 ` if err := validate.MaxLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 50); err != nil {`, 7750 " if err := validate.Pattern(\"args\"+\".\"+strconv.Itoa(i), \"body\", m.Args[i], `[A-Za-z0-9][\\w- ]+`); err != nil {", 7751 `func (m *NamedAllOf) validateAssoc(formats strfmt.Registry) error {`, 7752 ` if swag.IsZero(m.Assoc) {`, 7753 ` iAssocSize := int64(len(m.Assoc)`, 7754 ` if err := validate.MinItems("assoc", "body", iAssocSize, 5); err != nil {`, 7755 ` if err := validate.MaxItems("assoc", "body", iAssocSize, 20); err != nil {`, 7756 ` for i := 0; i < len(m.Assoc); i++ {`, 7757 ` iiAssocSize := int64(len(m.Assoc[i])`, 7758 ` if err := validate.MinItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 5); err != nil {`, 7759 ` if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 20); err != nil {`, 7760 ` for ii := 0; ii < len(m.Assoc[i]); ii++ {`, 7761 ` iiiAssocSize := int64(len(m.Assoc[i][ii])`, 7762 ` if err := validate.MinItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`, 7763 ` if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`, 7764 ` for iii := 0; iii < len(m.Assoc[i][ii]); iii++ {`, 7765 ` if err := validate.MinLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 2); err != nil {`, 7766 ` if err := validate.MaxLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 50); err != nil {`, 7767 " if err := validate.Pattern(\"assoc\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", m.Assoc[i][ii][iii], `[A-Za-z0-9][\\w- ]+`); err != nil {", 7768 `func (m *NamedAllOf) validateOpts(formats strfmt.Registry) error {`, 7769 ` if swag.IsZero(m.Opts) {`, 7770 ` for k := range m.Opts {`, 7771 ` if err := validate.Minimum("opts"+"."+k, "body", m.Opts[k], 2, false); err != nil {`, 7772 ` if err := validate.Maximum("opts"+"."+k, "body", m.Opts[k], 50, false); err != nil {`, 7773 ` if err := validate.MultipleOf("opts"+"."+k, "body", m.Opts[k], 1.5); err != nil {`, 7774 `func (m *NamedAllOf) validateExtOpts(formats strfmt.Registry) error {`, 7775 ` if swag.IsZero(m.ExtOpts) {`, 7776 ` for k := range m.ExtOpts {`, 7777 ` for kk := range m.ExtOpts[k] {`, 7778 ` for kkk := range m.ExtOpts[k][kk] {`, 7779 ` if err := validate.MinimumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 2, false); err != nil {`, 7780 ` if err := validate.MaximumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 50, false); err != nil {`, 7781 ` if err := validate.MultipleOf("extOpts"+"."+k+"."+kk+"."+kkk, "body", float64(m.ExtOpts[k][kk][kkk]), 1.5); err != nil {`, 7782 `func (m *NamedAllOf) validateCoords(formats strfmt.Registry) error {`, 7783 ` if swag.IsZero(m.Coords) {`, 7784 ` if err := validate.MinLength("coords"+"."+"name", "body", m.Coords.Name, 2); err != nil {`, 7785 ` if err := validate.MaxLength("coords"+"."+"name", "body", m.Coords.Name, 50); err != nil {`, 7786 " if err := validate.Pattern(\"coords\"+\".\"+\"name\", \"body\", m.Coords.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {", 7787 ` if err := validate.MinimumInt("coords"+"."+"age", "body", int64(m.Coords.Age), 2, false); err != nil {`, 7788 ` if err := validate.MaximumInt("coords"+"."+"age", "body", int64(m.Coords.Age), 50, false); err != nil {`, 7789 ` if err := validate.MultipleOf("coords"+"."+"age", "body", float64(m.Coords.Age), 1.5); err != nil {`, 7790 }, 7791 // not expected 7792 todo, 7793 // output in log 7794 noLines, 7795 noLines) 7796 7797 // load expectations for model: named_map_complex.go 7798 flattenRun.AddExpectations("named_map_complex.go", []string{ 7799 `type NamedMapComplex map[string]NamedMapComplexAdditionalProperties`, 7800 `func (m NamedMapComplex) Validate(formats strfmt.Registry) error {`, 7801 ` for k := range m {`, 7802 ` if err := validate.Required(k, "body", m[k]); err != nil {`, 7803 ` if val, ok := m[k]; ok {`, 7804 ` if err := val.Validate(formats); err != nil {`, 7805 ` return errors.CompositeValidationError(res...`, 7806 }, 7807 // not expected 7808 todo, 7809 // output in log 7810 noLines, 7811 noLines) 7812 7813 expandRun.AddExpectations("named_map_complex.go", []string{ 7814 `type NamedMapComplex map[string]NamedMapComplexAnon`, 7815 `func (m NamedMapComplex) Validate(formats strfmt.Registry) error {`, 7816 ` for k := range m {`, 7817 ` if val, ok := m[k]; ok {`, 7818 ` if err := val.Validate(formats); err != nil {`, 7819 ` return errors.CompositeValidationError(res...`, 7820 `type NamedMapComplexAnon struct {`, 7821 " Age int32 `json:\"age,omitempty\"`", 7822 " Name string `json:\"name,omitempty\"`", 7823 `func (m *NamedMapComplexAnon) Validate(formats strfmt.Registry) error {`, 7824 ` if err := m.validateAge(formats); err != nil {`, 7825 ` if err := m.validateName(formats); err != nil {`, 7826 ` return errors.CompositeValidationError(res...`, 7827 `func (m *NamedMapComplexAnon) validateAge(formats strfmt.Registry) error {`, 7828 ` if swag.IsZero(m.Age) {`, 7829 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`, 7830 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`, 7831 ` if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`, 7832 `func (m *NamedMapComplexAnon) validateName(formats strfmt.Registry) error {`, 7833 ` if swag.IsZero(m.Name) {`, 7834 ` if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`, 7835 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 7836 " if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {", 7837 }, 7838 // not expected 7839 todo, 7840 // output in log 7841 noLines, 7842 noLines) 7843 7844 // load expectations for model: nested_map_complex_validations_meta.go 7845 // NOTE(fredbi): maps are now simple types - this definition is no more generated 7846 7847 // load expectations for model: array_additional_validations.go 7848 flattenRun.AddExpectations("array_additional_validations.go", []string{ 7849 `type ArrayAdditionalValidations struct {`, 7850 " Args ArrayAdditionalValidationsArgs `json:\"args,omitempty\"`", 7851 `func (m *ArrayAdditionalValidations) Validate(formats strfmt.Registry) error {`, 7852 ` if err := m.validateArgs(formats); err != nil {`, 7853 ` return errors.CompositeValidationError(res...`, 7854 `func (m *ArrayAdditionalValidations) validateArgs(formats strfmt.Registry) error {`, 7855 ` if swag.IsZero(m.Args) {`, 7856 ` if err := m.Args.Validate(formats); err != nil {`, 7857 ` if ve, ok := err.(*errors.Validation); ok {`, 7858 ` return ve.ValidateName("args"`, 7859 }, 7860 // not expected 7861 todo, 7862 // output in log 7863 noLines, 7864 noLines) 7865 7866 expandRun.AddExpectations("array_additional_validations.go", []string{ 7867 `type ArrayAdditionalValidations struct {`, 7868 " Args *ArrayAdditionalValidationsArgsTuple0 `json:\"args,omitempty\"`", 7869 `func (m *ArrayAdditionalValidations) Validate(formats strfmt.Registry) error {`, 7870 ` if err := m.validateArgs(formats); err != nil {`, 7871 ` return errors.CompositeValidationError(res...`, 7872 `func (m *ArrayAdditionalValidations) validateArgs(formats strfmt.Registry) error {`, 7873 ` if swag.IsZero(m.Args) {`, 7874 ` if m.Args != nil {`, 7875 ` if err := m.Args.Validate(formats); err != nil {`, 7876 ` if ve, ok := err.(*errors.Validation); ok {`, 7877 ` return ve.ValidateName("args"`, 7878 `type ArrayAdditionalValidationsArgsTuple0 struct {`, 7879 " P0 *string `json:\"-\"`", 7880 " P1 *float64 `json:\"-\"`", 7881 " ArrayAdditionalValidationsArgsTuple0Items []int64 `json:\"-\"`", 7882 `func (m *ArrayAdditionalValidationsArgsTuple0) Validate(formats strfmt.Registry) error {`, 7883 ` if err := m.validateP0(formats); err != nil {`, 7884 ` if err := m.validateP1(formats); err != nil {`, 7885 ` if err := m.validateArrayAdditionalValidationsArgsTuple0Items(formats); err != nil {`, 7886 ` return errors.CompositeValidationError(res...`, 7887 `func (m *ArrayAdditionalValidationsArgsTuple0) validateP0(formats strfmt.Registry) error {`, 7888 ` if err := validate.Required("P0", "body", m.P0); err != nil {`, 7889 ` if err := validate.MinLength("P0", "body", *m.P0, 3); err != nil {`, 7890 ` if err := validate.MaxLength("P0", "body", *m.P0, 10); err != nil {`, 7891 " if err := validate.Pattern(\"P0\", \"body\", *m.P0, `\\w+`); err != nil {", 7892 `func (m *ArrayAdditionalValidationsArgsTuple0) validateP1(formats strfmt.Registry) error {`, 7893 ` if err := validate.Required("P1", "body", m.P1); err != nil {`, 7894 ` if err := validate.Minimum("P1", "body", *m.P1, 3, false); err != nil {`, 7895 ` if err := validate.Maximum("P1", "body", *m.P1, 12, false); err != nil {`, 7896 ` if err := validate.MultipleOf("P1", "body", *m.P1, 1.5); err != nil {`, 7897 `func (m *ArrayAdditionalValidationsArgsTuple0) validateArrayAdditionalValidationsArgsTuple0Items(formats strfmt.Registry) error {`, 7898 ` for i := range m.ArrayAdditionalValidationsArgsTuple0Items {`, 7899 ` if err := validate.MinimumInt(strconv.Itoa(i), "body", m.ArrayAdditionalValidationsArgsTuple0Items[i], 3, false); err != nil {`, 7900 ` if err := validate.MaximumInt(strconv.Itoa(i), "body", m.ArrayAdditionalValidationsArgsTuple0Items[i], 6, false); err != nil {`, 7901 ` if err := validate.MultipleOfInt(strconv.Itoa(i), "body", m.ArrayAdditionalValidationsArgsTuple0Items[i], 1); err != nil {`, 7902 }, 7903 // not expected 7904 todo, 7905 // output in log 7906 noLines, 7907 noLines) 7908 7909 // load expectations for model: nested_object_validations_args_meta.go 7910 flattenRun.AddExpectations("nested_object_validations_args_meta.go", []string{ 7911 `type NestedObjectValidationsArgsMeta struct {`, 7912 " First string `json:\"first,omitempty\"`", 7913 " Fourth [][][]float32 `json:\"fourth\"`", 7914 " Second float64 `json:\"second,omitempty\"`", 7915 " Third []float32 `json:\"third\"`", 7916 `func (m *NestedObjectValidationsArgsMeta) Validate(formats strfmt.Registry) error {`, 7917 ` if err := m.validateFirst(formats); err != nil {`, 7918 ` if err := m.validateFourth(formats); err != nil {`, 7919 ` if err := m.validateSecond(formats); err != nil {`, 7920 ` if err := m.validateThird(formats); err != nil {`, 7921 ` return errors.CompositeValidationError(res...`, 7922 `func (m *NestedObjectValidationsArgsMeta) validateFirst(formats strfmt.Registry) error {`, 7923 ` if swag.IsZero(m.First) {`, 7924 ` if err := validate.MinLength("first", "body", m.First, 2); err != nil {`, 7925 ` if err := validate.MaxLength("first", "body", m.First, 50); err != nil {`, 7926 " if err := validate.Pattern(\"first\", \"body\", m.First, `^\\w+`); err != nil {", 7927 `func (m *NestedObjectValidationsArgsMeta) validateFourth(formats strfmt.Registry) error {`, 7928 ` if swag.IsZero(m.Fourth) {`, 7929 ` iFourthSize := int64(len(m.Fourth)`, 7930 ` if err := validate.MinItems("fourth", "body", iFourthSize, 5); err != nil {`, 7931 ` if err := validate.MaxItems("fourth", "body", iFourthSize, 93); err != nil {`, 7932 ` for i := 0; i < len(m.Fourth); i++ {`, 7933 ` iiFourthSize := int64(len(m.Fourth[i])`, 7934 ` if err := validate.MinItems("fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 5); err != nil {`, 7935 ` if err := validate.MaxItems("fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 93); err != nil {`, 7936 ` for ii := 0; ii < len(m.Fourth[i]); ii++ {`, 7937 ` iiiFourthSize := int64(len(m.Fourth[i][ii])`, 7938 ` if err := validate.MinItems("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 5); err != nil {`, 7939 ` if err := validate.MaxItems("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 93); err != nil {`, 7940 ` for iii := 0; iii < len(m.Fourth[i][ii]); iii++ {`, 7941 ` if err := validate.Minimum("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", float64(m.Fourth[i][ii][iii]), 3, false); err != nil {`, 7942 ` if err := validate.Maximum("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", float64(m.Fourth[i][ii][iii]), 6, false); err != nil {`, 7943 ` if err := validate.MultipleOf("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", float64(m.Fourth[i][ii][iii]), 0.5); err != nil {`, 7944 `func (m *NestedObjectValidationsArgsMeta) validateSecond(formats strfmt.Registry) error {`, 7945 ` if swag.IsZero(m.Second) {`, 7946 ` if err := validate.Minimum("second", "body", m.Second, 3, false); err != nil {`, 7947 ` if err := validate.Maximum("second", "body", m.Second, 51, false); err != nil {`, 7948 ` if err := validate.MultipleOf("second", "body", m.Second, 1.5); err != nil {`, 7949 `func (m *NestedObjectValidationsArgsMeta) validateThird(formats strfmt.Registry) error {`, 7950 ` if swag.IsZero(m.Third) {`, 7951 ` iThirdSize := int64(len(m.Third)`, 7952 ` if err := validate.MinItems("third", "body", iThirdSize, 5); err != nil {`, 7953 ` if err := validate.MaxItems("third", "body", iThirdSize, 93); err != nil {`, 7954 ` for i := 0; i < len(m.Third); i++ {`, 7955 ` if err := validate.Minimum("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 3, false); err != nil {`, 7956 ` if err := validate.Maximum("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 6, false); err != nil {`, 7957 ` if err := validate.MultipleOf("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 0.5); err != nil {`, 7958 }, 7959 // not expected 7960 todo, 7961 // output in log 7962 noLines, 7963 noLines) 7964 7965 // load expectations for model: map_validations.go 7966 flattenRun.AddExpectations("map_validations.go", []string{ 7967 `type MapValidations struct {`, 7968 " Meta map[string]int64 `json:\"meta,omitempty\"`", 7969 `func (m *MapValidations) Validate(formats strfmt.Registry) error {`, 7970 ` if err := m.validateMeta(formats); err != nil {`, 7971 ` return errors.CompositeValidationError(res...`, 7972 `func (m *MapValidations) validateMeta(formats strfmt.Registry) error {`, 7973 ` if swag.IsZero(m.Meta) {`, 7974 ` for k := range m.Meta {`, 7975 ` if err := validate.MinimumInt("meta"+"."+k, "body", m.Meta[k], 3, false); err != nil {`, 7976 ` if err := validate.MaximumInt("meta"+"."+k, "body", m.Meta[k], 6, false); err != nil {`, 7977 ` if err := validate.MultipleOfInt("meta"+"."+k, "body", m.Meta[k], 1); err != nil {`, 7978 }, 7979 // not expected 7980 todo, 7981 // output in log 7982 noLines, 7983 noLines) 7984 7985 expandRun.AddExpectations("map_validations.go", flattenRun.ExpectedFor("MapValidations").ExpectedLines, todo, noLines, noLines) 7986 7987 // load expectations for model: named_all_of_all_of1.go 7988 flattenRun.AddExpectations("named_all_of_all_of1.go", []string{ 7989 `type NamedAllOfAllOf1 struct {`, 7990 " Age int32 `json:\"age,omitempty\"`", 7991 `func (m *NamedAllOfAllOf1) Validate(formats strfmt.Registry) error {`, 7992 ` if err := m.validateAge(formats); err != nil {`, 7993 ` return errors.CompositeValidationError(res...`, 7994 `func (m *NamedAllOfAllOf1) validateAge(formats strfmt.Registry) error {`, 7995 ` if swag.IsZero(m.Age) {`, 7996 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`, 7997 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 50, false); err != nil {`, 7998 ` if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`, 7999 }, 8000 // not expected 8001 todo, 8002 // output in log 8003 noLines, 8004 noLines) 8005 8006 // load expectations for model: all_of_validations_meta_all_of5.go 8007 flattenRun.AddExpectations("all_of_validations_meta_all_of5.go", []string{ 8008 `type AllOfValidationsMetaAllOf5 struct {`, 8009 " ExtOpts map[string]map[string]map[string]int32 `json:\"extOpts,omitempty\"`", 8010 `func (m *AllOfValidationsMetaAllOf5) Validate(formats strfmt.Registry) error {`, 8011 ` if err := m.validateExtOpts(formats); err != nil {`, 8012 ` return errors.CompositeValidationError(res...`, 8013 `func (m *AllOfValidationsMetaAllOf5) validateExtOpts(formats strfmt.Registry) error {`, 8014 ` if swag.IsZero(m.ExtOpts) {`, 8015 ` for k := range m.ExtOpts {`, 8016 ` for kk := range m.ExtOpts[k] {`, 8017 ` for kkk := range m.ExtOpts[k][kk] {`, 8018 ` if err := validate.MinimumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 2, false); err != nil {`, 8019 ` if err := validate.MaximumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 50, false); err != nil {`, 8020 ` if err := validate.MultipleOf("extOpts"+"."+k+"."+kk+"."+kkk, "body", float64(m.ExtOpts[k][kk][kkk]), 1.5); err != nil {`, 8021 }, 8022 // not expected 8023 todo, 8024 // output in log 8025 noLines, 8026 noLines) 8027 8028 // load expectations for model: all_of_validations.go 8029 flattenRun.AddExpectations("all_of_validations.go", []string{ 8030 `type AllOfValidations struct {`, 8031 " Meta *AllOfValidationsMeta `json:\"meta,omitempty\"`", 8032 `func (m *AllOfValidations) Validate(formats strfmt.Registry) error {`, 8033 ` if err := m.validateMeta(formats); err != nil {`, 8034 ` return errors.CompositeValidationError(res...`, 8035 `func (m *AllOfValidations) validateMeta(formats strfmt.Registry) error {`, 8036 ` if swag.IsZero(m.Meta) {`, 8037 ` if m.Meta != nil {`, 8038 ` if err := m.Meta.Validate(formats); err != nil {`, 8039 ` if ve, ok := err.(*errors.Validation); ok {`, 8040 ` return ve.ValidateName("meta"`, 8041 }, 8042 // not expected 8043 todo, 8044 // output in log 8045 noLines, 8046 noLines) 8047 8048 expandRun.AddExpectations("all_of_validations.go", []string{ 8049 `type AllOfValidations struct {`, 8050 ` Meta struct {`, 8051 " Name string `json:\"name,omitempty\"`", 8052 " Age int32 `json:\"age,omitempty\"`", 8053 " Args []string `json:\"args\"`", 8054 " Assoc [][][]string `json:\"assoc\"`", 8055 " Opts map[string]int32 `json:\"opts,omitempty\"`", 8056 " ExtOpts map[string]map[string]map[string]int32 `json:\"extOpts,omitempty\"`", 8057 ` Coords struct {`, 8058 " Name string `json:\"name,omitempty\"`", 8059 " Age int32 `json:\"age,omitempty\"`", 8060 " } `json:\"coords,omitempty\"`", 8061 " } `json:\"meta,omitempty\"`", 8062 `func (m *AllOfValidations) Validate(formats strfmt.Registry) error {`, 8063 ` if err := m.validateMeta(formats); err != nil {`, 8064 ` return errors.CompositeValidationError(res...`, 8065 `func (m *AllOfValidations) validateMeta(formats strfmt.Registry) error {`, 8066 ` if swag.IsZero(m.Meta) {`, 8067 ` if err := validate.MinLength("meta"+"."+"name", "body", m.Meta.Name, 2); err != nil {`, 8068 ` if err := validate.MaxLength("meta"+"."+"name", "body", m.Meta.Name, 50); err != nil {`, 8069 " if err := validate.Pattern(\"meta\"+\".\"+\"name\", \"body\", m.Meta.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {", 8070 ` if err := validate.MinimumInt("meta"+"."+"age", "body", int64(m.Meta.Age), 2, false); err != nil {`, 8071 ` if err := validate.MaximumInt("meta"+"."+"age", "body", int64(m.Meta.Age), 50, false); err != nil {`, 8072 ` if err := validate.MultipleOf("meta"+"."+"age", "body", float64(m.Meta.Age), 1.5); err != nil {`, 8073 ` iArgsSize := int64(len(m.Meta.Args)`, 8074 ` if err := validate.MinItems("meta"+"."+"args", "body", iArgsSize, 5); err != nil {`, 8075 ` if err := validate.MaxItems("meta"+"."+"args", "body", iArgsSize, 20); err != nil {`, 8076 ` for i := 0; i < len(m.Meta.Args); i++ {`, 8077 ` if err := validate.MinLength("meta"+"."+"args"+"."+strconv.Itoa(i), "body", m.Meta.Args[i], 2); err != nil {`, 8078 ` if err := validate.MaxLength("meta"+"."+"args"+"."+strconv.Itoa(i), "body", m.Meta.Args[i], 50); err != nil {`, 8079 " if err := validate.Pattern(\"meta\"+\".\"+\"args\"+\".\"+strconv.Itoa(i), \"body\", m.Meta.Args[i], `[A-Za-z0-9][\\w- ]+`); err != nil {", 8080 ` iAssocSize := int64(len(m.Meta.Assoc)`, 8081 ` if err := validate.MinItems("meta"+"."+"assoc", "body", iAssocSize, 5); err != nil {`, 8082 ` if err := validate.MaxItems("meta"+"."+"assoc", "body", iAssocSize, 20); err != nil {`, 8083 ` for i := 0; i < len(m.Meta.Assoc); i++ {`, 8084 ` iiAssocSize := int64(len(m.Meta.Assoc[i])`, 8085 ` if err := validate.MinItems("meta"+"."+"assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 5); err != nil {`, 8086 ` if err := validate.MaxItems("meta"+"."+"assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 20); err != nil {`, 8087 ` for ii := 0; ii < len(m.Meta.Assoc[i]); ii++ {`, 8088 ` iiiAssocSize := int64(len(m.Meta.Assoc[i][ii])`, 8089 ` if err := validate.MinItems("meta"+"."+"assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`, 8090 ` if err := validate.MaxItems("meta"+"."+"assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`, 8091 ` for iii := 0; iii < len(m.Meta.Assoc[i][ii]); iii++ {`, 8092 ` if err := validate.MinLength("meta"+"."+"assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Meta.Assoc[i][ii][iii], 2); err != nil {`, 8093 ` if err := validate.MaxLength("meta"+"."+"assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Meta.Assoc[i][ii][iii], 50); err != nil {`, 8094 " if err := validate.Pattern(\"meta\"+\".\"+\"assoc\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", m.Meta.Assoc[i][ii][iii], `[A-Za-z0-9][\\w- ]+`); err != nil {", 8095 ` for k := range m.Meta.Opts {`, 8096 ` if err := validate.MinimumInt("meta"+"."+"opts"+"."+k, "body", int64(m.Meta.Opts[k]), 2, false); err != nil {`, 8097 ` if err := validate.MaximumInt("meta"+"."+"opts"+"."+k, "body", int64(m.Meta.Opts[k]), 50, false); err != nil {`, 8098 ` if err := validate.MultipleOf("meta"+"."+"opts"+"."+k, "body", float64(m.Meta.Opts[k]), 1.5); err != nil {`, 8099 ` for k := range m.Meta.ExtOpts {`, 8100 ` for kk := range m.Meta.ExtOpts[k] {`, 8101 ` for kkk := range m.Meta.ExtOpts[k][kk] {`, 8102 ` if err := validate.MinimumInt("meta"+"."+"extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.Meta.ExtOpts[k][kk][kkk]), 2, false); err != nil {`, 8103 ` if err := validate.MaximumInt("meta"+"."+"extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.Meta.ExtOpts[k][kk][kkk]), 50, false); err != nil {`, 8104 ` if err := validate.MultipleOf("meta"+"."+"extOpts"+"."+k+"."+kk+"."+kkk, "body", float64(m.Meta.ExtOpts[k][kk][kkk]), 1.5); err != nil {`, 8105 ` if err := validate.MinLength("meta"+"."+"coords"+"."+"name", "body", m.Meta.Coords.Name, 2); err != nil {`, 8106 ` if err := validate.MaxLength("meta"+"."+"coords"+"."+"name", "body", m.Meta.Coords.Name, 50); err != nil {`, 8107 " if err := validate.Pattern(\"meta\"+\".\"+\"coords\"+\".\"+\"name\", \"body\", m.Meta.Coords.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {", 8108 ` if err := validate.MinimumInt("meta"+"."+"coords"+"."+"age", "body", int64(m.Meta.Coords.Age), 2, false); err != nil {`, 8109 ` if err := validate.MaximumInt("meta"+"."+"coords"+"."+"age", "body", int64(m.Meta.Coords.Age), 50, false); err != nil {`, 8110 ` if err := validate.MultipleOf("meta"+"."+"coords"+"."+"age", "body", float64(m.Meta.Coords.Age), 1.5); err != nil {`, 8111 }, 8112 // not expected 8113 todo, 8114 // output in log 8115 noLines, 8116 noLines) 8117 8118 // load expectations for model: named_nested_object_meta.go 8119 flattenRun.AddExpectations("named_nested_object_meta.go", []string{ 8120 `type NamedNestedObjectMeta struct {`, 8121 " First string `json:\"first,omitempty\"`", 8122 " Fourth [][][]float32 `json:\"fourth\"`", 8123 " Second float64 `json:\"second,omitempty\"`", 8124 " Third []float32 `json:\"third\"`", 8125 `func (m *NamedNestedObjectMeta) Validate(formats strfmt.Registry) error {`, 8126 ` if err := m.validateFirst(formats); err != nil {`, 8127 ` if err := m.validateFourth(formats); err != nil {`, 8128 ` if err := m.validateSecond(formats); err != nil {`, 8129 ` if err := m.validateThird(formats); err != nil {`, 8130 ` return errors.CompositeValidationError(res...`, 8131 `func (m *NamedNestedObjectMeta) validateFirst(formats strfmt.Registry) error {`, 8132 ` if swag.IsZero(m.First) {`, 8133 ` if err := validate.MinLength("first", "body", m.First, 2); err != nil {`, 8134 ` if err := validate.MaxLength("first", "body", m.First, 50); err != nil {`, 8135 " if err := validate.Pattern(\"first\", \"body\", m.First, `^\\w+`); err != nil {", 8136 `func (m *NamedNestedObjectMeta) validateFourth(formats strfmt.Registry) error {`, 8137 ` if swag.IsZero(m.Fourth) {`, 8138 ` iFourthSize := int64(len(m.Fourth)`, 8139 ` if err := validate.MinItems("fourth", "body", iFourthSize, 5); err != nil {`, 8140 ` if err := validate.MaxItems("fourth", "body", iFourthSize, 93); err != nil {`, 8141 ` for i := 0; i < len(m.Fourth); i++ {`, 8142 ` iiFourthSize := int64(len(m.Fourth[i])`, 8143 ` if err := validate.MinItems("fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 5); err != nil {`, 8144 ` if err := validate.MaxItems("fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 93); err != nil {`, 8145 ` for ii := 0; ii < len(m.Fourth[i]); ii++ {`, 8146 ` iiiFourthSize := int64(len(m.Fourth[i][ii])`, 8147 ` if err := validate.MinItems("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 5); err != nil {`, 8148 ` if err := validate.MaxItems("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 93); err != nil {`, 8149 ` for iii := 0; iii < len(m.Fourth[i][ii]); iii++ {`, 8150 ` if err := validate.Minimum("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", float64(m.Fourth[i][ii][iii]), 3, false); err != nil {`, 8151 ` if err := validate.Maximum("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", float64(m.Fourth[i][ii][iii]), 6, false); err != nil {`, 8152 ` if err := validate.MultipleOf("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", float64(m.Fourth[i][ii][iii]), 0.5); err != nil {`, 8153 `func (m *NamedNestedObjectMeta) validateSecond(formats strfmt.Registry) error {`, 8154 ` if swag.IsZero(m.Second) {`, 8155 ` if err := validate.Minimum("second", "body", m.Second, 3, false); err != nil {`, 8156 ` if err := validate.Maximum("second", "body", m.Second, 51, false); err != nil {`, 8157 ` if err := validate.MultipleOf("second", "body", m.Second, 1.5); err != nil {`, 8158 `func (m *NamedNestedObjectMeta) validateThird(formats strfmt.Registry) error {`, 8159 ` if swag.IsZero(m.Third) {`, 8160 ` iThirdSize := int64(len(m.Third)`, 8161 ` if err := validate.MinItems("third", "body", iThirdSize, 5); err != nil {`, 8162 ` if err := validate.MaxItems("third", "body", iThirdSize, 93); err != nil {`, 8163 ` for i := 0; i < len(m.Third); i++ {`, 8164 ` if err := validate.Minimum("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 3, false); err != nil {`, 8165 ` if err := validate.Maximum("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 6, false); err != nil {`, 8166 ` if err := validate.MultipleOf("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 0.5); err != nil {`, 8167 }, 8168 // not expected 8169 todo, 8170 // output in log 8171 noLines, 8172 noLines) 8173 8174 // load expectations for model: named_nested_object.go 8175 flattenRun.AddExpectations("named_nested_object.go", []string{ 8176 `type NamedNestedObject struct {`, 8177 " Meta *NamedNestedObjectMeta `json:\"meta,omitempty\"`", 8178 `func (m *NamedNestedObject) Validate(formats strfmt.Registry) error {`, 8179 ` if err := m.validateMeta(formats); err != nil {`, 8180 ` return errors.CompositeValidationError(res...`, 8181 `func (m *NamedNestedObject) validateMeta(formats strfmt.Registry) error {`, 8182 ` if swag.IsZero(m.Meta) {`, 8183 ` if m.Meta != nil {`, 8184 ` if err := m.Meta.Validate(formats); err != nil {`, 8185 ` if ve, ok := err.(*errors.Validation); ok {`, 8186 ` return ve.ValidateName("meta"`, 8187 }, 8188 // not expected 8189 todo, 8190 // output in log 8191 noLines, 8192 noLines) 8193 8194 expandRun.AddExpectations("named_nested_object.go", []string{ 8195 `type NamedNestedObject struct {`, 8196 " Meta *NamedNestedObjectMeta `json:\"meta,omitempty\"`", 8197 `func (m *NamedNestedObject) Validate(formats strfmt.Registry) error {`, 8198 ` if err := m.validateMeta(formats); err != nil {`, 8199 ` return errors.CompositeValidationError(res...`, 8200 `func (m *NamedNestedObject) validateMeta(formats strfmt.Registry) error {`, 8201 ` if swag.IsZero(m.Meta) {`, 8202 ` if m.Meta != nil {`, 8203 ` if err := m.Meta.Validate(formats); err != nil {`, 8204 ` if ve, ok := err.(*errors.Validation); ok {`, 8205 ` return ve.ValidateName("meta"`, 8206 `type NamedNestedObjectMeta struct {`, 8207 " First string `json:\"first,omitempty\"`", 8208 " Fourth [][][]float32 `json:\"fourth\"`", 8209 " Second float64 `json:\"second,omitempty\"`", 8210 " Third []float32 `json:\"third\"`", 8211 `func (m *NamedNestedObjectMeta) Validate(formats strfmt.Registry) error {`, 8212 ` if err := m.validateFirst(formats); err != nil {`, 8213 ` if err := m.validateFourth(formats); err != nil {`, 8214 ` if err := m.validateSecond(formats); err != nil {`, 8215 ` if err := m.validateThird(formats); err != nil {`, 8216 ` return errors.CompositeValidationError(res...`, 8217 `func (m *NamedNestedObjectMeta) validateFirst(formats strfmt.Registry) error {`, 8218 ` if swag.IsZero(m.First) {`, 8219 ` if err := validate.MinLength("meta"+"."+"first", "body", m.First, 2); err != nil {`, 8220 ` if err := validate.MaxLength("meta"+"."+"first", "body", m.First, 50); err != nil {`, 8221 " if err := validate.Pattern(\"meta\"+\".\"+\"first\", \"body\", m.First, `^\\w+`); err != nil {", 8222 `func (m *NamedNestedObjectMeta) validateFourth(formats strfmt.Registry) error {`, 8223 ` if swag.IsZero(m.Fourth) {`, 8224 ` iFourthSize := int64(len(m.Fourth)`, 8225 ` if err := validate.MinItems("meta"+"."+"fourth", "body", iFourthSize, 5); err != nil {`, 8226 ` if err := validate.MaxItems("meta"+"."+"fourth", "body", iFourthSize, 93); err != nil {`, 8227 ` for i := 0; i < len(m.Fourth); i++ {`, 8228 ` iiFourthSize := int64(len(m.Fourth[i])`, 8229 ` if err := validate.MinItems("meta"+"."+"fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 5); err != nil {`, 8230 ` if err := validate.MaxItems("meta"+"."+"fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 93); err != nil {`, 8231 ` for ii := 0; ii < len(m.Fourth[i]); ii++ {`, 8232 ` iiiFourthSize := int64(len(m.Fourth[i][ii])`, 8233 ` if err := validate.MinItems("meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 5); err != nil {`, 8234 ` if err := validate.MaxItems("meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 93); err != nil {`, 8235 ` for iii := 0; iii < len(m.Fourth[i][ii]); iii++ {`, 8236 ` if err := validate.Minimum("meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", float64(m.Fourth[i][ii][iii]), 3, false); err != nil {`, 8237 ` if err := validate.Maximum("meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", float64(m.Fourth[i][ii][iii]), 6, false); err != nil {`, 8238 ` if err := validate.MultipleOf("meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", float64(m.Fourth[i][ii][iii]), 0.5); err != nil {`, 8239 `func (m *NamedNestedObjectMeta) validateSecond(formats strfmt.Registry) error {`, 8240 ` if swag.IsZero(m.Second) {`, 8241 ` if err := validate.Minimum("meta"+"."+"second", "body", m.Second, 3, false); err != nil {`, 8242 ` if err := validate.Maximum("meta"+"."+"second", "body", m.Second, 51, false); err != nil {`, 8243 ` if err := validate.MultipleOf("meta"+"."+"second", "body", m.Second, 1.5); err != nil {`, 8244 `func (m *NamedNestedObjectMeta) validateThird(formats strfmt.Registry) error {`, 8245 ` if swag.IsZero(m.Third) {`, 8246 ` iThirdSize := int64(len(m.Third)`, 8247 ` if err := validate.MinItems("meta"+"."+"third", "body", iThirdSize, 5); err != nil {`, 8248 ` if err := validate.MaxItems("meta"+"."+"third", "body", iThirdSize, 93); err != nil {`, 8249 ` for i := 0; i < len(m.Third); i++ {`, 8250 ` if err := validate.Minimum("meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 3, false); err != nil {`, 8251 ` if err := validate.Maximum("meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 6, false); err != nil {`, 8252 ` if err := validate.MultipleOf("meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 0.5); err != nil {`, 8253 }, 8254 // not expected 8255 todo, 8256 // output in log 8257 noLines, 8258 noLines) 8259 8260 // load expectations for model: all_of_validations_meta_all_of6_coords_all_of0.go 8261 flattenRun.AddExpectations("all_of_validations_meta_all_of6_coords_all_of0.go", []string{ 8262 `type AllOfValidationsMetaAllOf6CoordsAllOf0 struct {`, 8263 " Name string `json:\"name,omitempty\"`", 8264 `func (m *AllOfValidationsMetaAllOf6CoordsAllOf0) Validate(formats strfmt.Registry) error {`, 8265 ` if err := m.validateName(formats); err != nil {`, 8266 ` return errors.CompositeValidationError(res...`, 8267 `func (m *AllOfValidationsMetaAllOf6CoordsAllOf0) validateName(formats strfmt.Registry) error {`, 8268 ` if swag.IsZero(m.Name) {`, 8269 ` if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`, 8270 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 8271 " if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {", 8272 }, 8273 // not expected 8274 todo, 8275 // output in log 8276 noLines, 8277 noLines) 8278 8279 // load expectations for model: named_nested_map.go 8280 flattenRun.AddExpectations("named_nested_map.go", []string{ 8281 `type NamedNestedMap map[string]map[string]map[string]int64`, 8282 `func (m NamedNestedMap) Validate(formats strfmt.Registry) error {`, 8283 ` for k := range m {`, 8284 ` for kk := range m[k] {`, 8285 ` for kkk := range m[k][kk] {`, 8286 ` if err := validate.MinimumInt(k+"."+kk+"."+kkk, "body", m[k][kk][kkk], 3, false); err != nil {`, 8287 ` if err := validate.MaximumInt(k+"."+kk+"."+kkk, "body", m[k][kk][kkk], 6, false); err != nil {`, 8288 ` if err := validate.MultipleOfInt(k+"."+kk+"."+kkk, "body", m[k][kk][kkk], 1); err != nil {`, 8289 ` return errors.CompositeValidationError(res...`, 8290 }, 8291 // not expected 8292 todo, 8293 // output in log 8294 noLines, 8295 noLines) 8296 8297 expandRun.AddExpectations("named_nested_map.go", flattenRun.ExpectedFor("NamedNestedMap").ExpectedLines, todo, noLines, noLines) 8298 } 8299 8300 func initFixtureNestedMaps() { 8301 // testing fixture-nested-maps.yaml with flatten and expand (--skip-flatten) 8302 8303 /* 8304 Test specifically focused on nested maps (e.g.nested additionalProperties) 8305 8306 */ 8307 8308 f := newModelFixture("../fixtures/bugs/1487/fixture-nested-maps.yaml", "Nested maps") 8309 flattenRun := f.AddRun(false) 8310 expandRun := f.AddRun(true) 8311 8312 // load expectations for model: alias_interface.go 8313 flattenRun.AddExpectations("alias_interface.go", []string{ 8314 `type AliasInterface interface{`, 8315 }, 8316 // not expected 8317 validatable, 8318 // output in log 8319 noLines, 8320 noLines) 8321 8322 expandRun.AddExpectations("alias_interface.go", flattenRun.ExpectedFor("AliasInterface").ExpectedLines, validatable, noLines, noLines) 8323 8324 // load expectations for model: test_nested_aliased_interface.go 8325 flattenRun.AddExpectations("test_nested_aliased_interface.go", []string{ 8326 `type TestNestedAliasedInterface struct {`, 8327 " Meta map[string]map[string]map[string]AliasInterface `json:\"meta,omitempty\"`", 8328 // empty validation 8329 "func (m *TestNestedAliasedInterface) Validate(formats strfmt.Registry) error {\n return nil\n}", 8330 }, 8331 // not expected 8332 todo, 8333 // output in log 8334 noLines, 8335 noLines) 8336 8337 expandRun.AddExpectations("test_nested_aliased_interface.go", []string{ 8338 `type TestNestedAliasedInterface struct {`, 8339 " Meta map[string]map[string]map[string]interface{} `json:\"meta,omitempty\"`", 8340 // empty validation 8341 "func (m *TestNestedAliasedInterface) Validate(formats strfmt.Registry) error {\n return nil\n}", 8342 }, 8343 // not expected 8344 todo, 8345 // output in log 8346 noLines, 8347 noLines) 8348 8349 // load expectations for model: nested_map_validations.go 8350 flattenRun.AddExpectations("nested_map_validations.go", []string{ 8351 `type NestedMapValidations struct {`, 8352 " Meta map[string]map[string]map[string]int64 `json:\"meta,omitempty\"`", 8353 `func (m *NestedMapValidations) Validate(formats strfmt.Registry) error {`, 8354 ` if err := m.validateMeta(formats); err != nil {`, 8355 ` return errors.CompositeValidationError(res...`, 8356 `func (m *NestedMapValidations) validateMeta(formats strfmt.Registry) error {`, 8357 ` if swag.IsZero(m.Meta) {`, 8358 ` for k := range m.Meta {`, 8359 ` for kk := range m.Meta[k] {`, 8360 ` for kkk := range m.Meta[k][kk] {`, 8361 ` if err := validate.MinimumInt("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk], 3, false); err != nil {`, 8362 ` if err := validate.MaximumInt("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk], 6, false); err != nil {`, 8363 ` if err := validate.MultipleOfInt("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk], 1); err != nil {`, 8364 }, 8365 // not expected 8366 todo, 8367 // output in log 8368 noLines, 8369 noLines) 8370 8371 expandRun.AddExpectations("nested_map_validations.go", flattenRun.ExpectedFor("NestedMapValidations").ExpectedLines, todo, noLines, noLines) 8372 8373 // load expectations for model: named_nested_map_complex.go 8374 flattenRun.AddExpectations("named_nested_map_complex.go", []string{ 8375 `type NamedNestedMapComplex map[string]map[string]map[string]NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties`, 8376 `func (m NamedNestedMapComplex) Validate(formats strfmt.Registry) error {`, 8377 ` for k := range m {`, 8378 ` for kk := range m[k] {`, 8379 ` for kkk := range m[k][kk] {`, 8380 ` if err := validate.Required(k+"."+kk+"."+kkk, "body", m[k][kk][kkk]); err != nil {`, 8381 ` if val, ok := m[k][kk][kkk]; ok {`, 8382 ` if err := val.Validate(formats); err != nil {`, 8383 ` return errors.CompositeValidationError(res...`, 8384 }, 8385 // not expected 8386 todo, 8387 // output in log 8388 noLines, 8389 noLines) 8390 8391 expandRun.AddExpectations("named_nested_map_complex.go", []string{ 8392 `type NamedNestedMapComplex map[string]map[string]map[string]NamedNestedMapComplexAnon`, 8393 `func (m NamedNestedMapComplex) Validate(formats strfmt.Registry) error {`, 8394 ` for k := range m {`, 8395 ` for kk := range m[k] {`, 8396 ` for kkk := range m[k][kk] {`, 8397 ` if val, ok := m[k][kk][kkk]; ok {`, 8398 ` if err := val.Validate(formats); err != nil {`, 8399 ` return errors.CompositeValidationError(res...`, 8400 `type NamedNestedMapComplexAnon struct {`, 8401 " Age int32 `json:\"age,omitempty\"`", 8402 " Name string `json:\"name,omitempty\"`", 8403 `func (m *NamedNestedMapComplexAnon) Validate(formats strfmt.Registry) error {`, 8404 ` if err := m.validateAge(formats); err != nil {`, 8405 ` if err := m.validateName(formats); err != nil {`, 8406 ` return errors.CompositeValidationError(res...`, 8407 `func (m *NamedNestedMapComplexAnon) validateAge(formats strfmt.Registry) error {`, 8408 ` if swag.IsZero(m.Age) {`, 8409 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`, 8410 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`, 8411 ` if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`, 8412 `func (m *NamedNestedMapComplexAnon) validateName(formats strfmt.Registry) error {`, 8413 ` if swag.IsZero(m.Name) {`, 8414 ` if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`, 8415 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 8416 " if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {", 8417 }, 8418 // not expected 8419 todo, 8420 // output in log 8421 noLines, 8422 noLines) 8423 8424 // load expectations for model: nested_map_complex_validations_meta_additional_properties_additional_properties.go 8425 // NOTE(fredbi): maps are now simple types - this definition is no more generated 8426 8427 // load expectations for model: nested_map_no_validations_additional_properties_additional_properties.go 8428 // NOTE(fredbi): maps are now simple types - this definition is no more generated 8429 8430 // load expectations for model: test_nested_interface.go 8431 flattenRun.AddExpectations("test_nested_interface.go", []string{ 8432 `type TestNestedInterface struct {`, 8433 " Meta map[string]map[string]map[string]interface{} `json:\"meta,omitempty\"`", 8434 // empty validation 8435 "func (m *TestNestedInterface) Validate(formats strfmt.Registry) error {\n return nil\n}", 8436 }, 8437 // not expected 8438 todo, 8439 // output in log 8440 noLines, 8441 noLines) 8442 8443 expandRun.AddExpectations("test_nested_interface.go", flattenRun.ExpectedFor("TestNestedInterface").ExpectedLines, todo, noLines, noLines) 8444 8445 // load expectations for model: named_nested_map_complex_additional_properties_additional_properties_additional_properties.go 8446 flattenRun.AddExpectations("named_nested_map_complex_additional_properties_additional_properties_additional_properties.go", []string{ 8447 `type NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties struct {`, 8448 " Age int32 `json:\"age,omitempty\"`", 8449 " Name string `json:\"name,omitempty\"`", 8450 `func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {`, 8451 ` if err := m.validateAge(formats); err != nil {`, 8452 ` if err := m.validateName(formats); err != nil {`, 8453 ` return errors.CompositeValidationError(res...`, 8454 `func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateAge(formats strfmt.Registry) error {`, 8455 ` if swag.IsZero(m.Age) {`, 8456 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`, 8457 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`, 8458 ` if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`, 8459 `func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`, 8460 ` if swag.IsZero(m.Name) {`, 8461 ` if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`, 8462 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 8463 " if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {", 8464 }, 8465 // not expected 8466 todo, 8467 // output in log 8468 noLines, 8469 noLines) 8470 8471 // load expectations for model: nested_map_no_validations_additional_properties.go 8472 // NOTE(fredbi): maps are simple types and this definition is no more generated 8473 8474 expandRun.AddExpectations("nested_map_no_validations.go", []string{ 8475 `type NestedMapNoValidations map[string]map[string]map[string]NestedMapNoValidationsAnon`, 8476 `func (m NestedMapNoValidations) Validate(formats strfmt.Registry) error {`, 8477 ` for k := range m {`, 8478 ` for kk := range m[k] {`, 8479 ` for kkk := range m[k][kk] {`, 8480 ` if val, ok := m[k][kk][kkk]; ok {`, 8481 ` if err := val.Validate(formats); err != nil {`, 8482 ` return errors.CompositeValidationError(res...`, 8483 `type NestedMapNoValidationsAnon struct {`, 8484 " Age int64 `json:\"age,omitempty\"`", 8485 " Name string `json:\"name,omitempty\"`", 8486 // empty validation 8487 "func (m *NestedMapNoValidationsAnon) Validate(formats strfmt.Registry) error {\n return nil\n}", 8488 }, 8489 // not expected 8490 todo, 8491 // output in log 8492 noLines, 8493 noLines) 8494 8495 // load expectations for model: nested_map_complex_validations_meta_additional_properties.go 8496 // NOTE(fredbi): maps are simple types and this definition is no more generated 8497 8498 // load expectations for model: nested_map_no_validations_additional_properties_additional_properties_additional_properties.go 8499 // NOTE: maps are now simple types - this definition is no more generated 8500 8501 // load expectations for model: nested_map_no_validations.go 8502 flattenRun.AddExpectations("nested_map_no_validations.go", []string{ 8503 `type NestedMapNoValidations map[string]map[string]map[string]NestedMapNoValidationsAdditionalPropertiesAdditionalPropertiesAdditionalProperties`, 8504 `func (m NestedMapNoValidations) Validate(formats strfmt.Registry) error {`, 8505 ` for k := range m {`, 8506 ` for kk := range m[k] {`, 8507 ` for kkk := range m[k][kk] {`, 8508 ` if val, ok := m[k][kk][kkk]; ok {`, 8509 ` if err := validate.Required(k+"."+kk+"."+kkk, "body", m[k][kk][kkk]); err != nil {`, 8510 ` if err := val.Validate(formats); err != nil {`, 8511 ` return errors.CompositeValidationError(res...`, 8512 }, 8513 // not expected 8514 todo, 8515 // output in log 8516 noLines, 8517 noLines) 8518 8519 // load expectations for model: nested_map_complex_validations_meta_additional_properties_additional_properties_additional_properties.go 8520 flattenRun.AddExpectations("nested_map_complex_validations_meta_additional_properties_additional_properties_additional_properties.go", []string{ 8521 `type NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties struct {`, 8522 " Age int32 `json:\"age,omitempty\"`", 8523 " Name string `json:\"name,omitempty\"`", 8524 `func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {`, 8525 ` if err := m.validateAge(formats); err != nil {`, 8526 ` if err := m.validateName(formats); err != nil {`, 8527 ` return errors.CompositeValidationError(res...`, 8528 `func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateAge(formats strfmt.Registry) error {`, 8529 ` if swag.IsZero(m.Age) {`, 8530 ` if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`, 8531 ` if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`, 8532 ` if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`, 8533 `func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`, 8534 ` if swag.IsZero(m.Name) {`, 8535 ` if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`, 8536 ` if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`, 8537 " if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {", 8538 }, 8539 // not expected 8540 todo, 8541 // output in log 8542 noLines, 8543 noLines) 8544 8545 // load expectations for model: nested_map_complex_validations.go 8546 flattenRun.AddExpectations("nested_map_complex_validations.go", []string{ 8547 `type NestedMapComplexValidations struct {`, 8548 // maps are now simple types 8549 " Meta map[string]map[string]map[string]NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties `json:\"meta,omitempty\"`", 8550 `func (m *NestedMapComplexValidations) Validate(formats strfmt.Registry) error {`, 8551 ` if err := m.validateMeta(formats); err != nil {`, 8552 ` return errors.CompositeValidationError(res...`, 8553 `func (m *NestedMapComplexValidations) validateMeta(formats strfmt.Registry) error {`, 8554 ` if swag.IsZero(m.Meta) {`, 8555 ` for k := range m.Meta {`, 8556 ` for kk := range m.Meta[k] {`, 8557 ` for kkk := range m.Meta[k][kk] {`, 8558 ` if err := validate.Required("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk]); err != nil {`, 8559 ` if val, ok := m.Meta[k][kk][kkk]; ok {`, 8560 ` if err := val.Validate(formats); err != nil {`, 8561 }, 8562 // not expected 8563 todo, 8564 // output in log 8565 noLines, 8566 noLines) 8567 8568 // load expectations for model: named_nested_map_complex_additional_properties_additional_properties.go 8569 // NOTE(fredbi): maps are now simple types - this definition is no more generated 8570 8571 // load expectations for model: named_nested_map_complex_additional_properties.go 8572 // NOTE(fredbi): maps are now simple types - this definition is no more generated 8573 8574 // load expectations for model: nested_map_complex_validations_meta.go 8575 // NOTE(fredbi): maps are now simple types - this definition is no more generated 8576 } 8577 8578 func initFixture844Variations() { 8579 // testing fixture-844-variations.yaml with flatten and expand (--skip-flatten) 8580 8581 /* 8582 repro 8583 */ 8584 8585 f := newModelFixture("../fixtures/bugs/1487/fixture-844-variations.yaml", "allOf bugs with empty objects") 8586 flattenRun := f.AddRun(false) 8587 expandRun := f.AddRun(true) 8588 8589 // load expectations for model: foo.go 8590 flattenRun.AddExpectations("foo.go", []string{ 8591 `type Foo interface{`, 8592 }, 8593 // not expected 8594 validatable, 8595 // output in log 8596 noLines, 8597 noLines) 8598 8599 expandRun.AddExpectations("foo.go", flattenRun.ExpectedFor("Foo").ExpectedLines, validatable, noLines, noLines) 8600 8601 // load expectations for model: variation2.go 8602 flattenRun.AddExpectations("variation2.go", []string{ 8603 `type Variation2 struct {`, 8604 " Prop1 EmptyEnum `json:\"prop1,omitempty\"`", 8605 // empty validation 8606 "func (m *Variation2) Validate(formats strfmt.Registry) error {\n return nil\n}", 8607 }, 8608 // not expected 8609 todo, 8610 // output in log 8611 noLines, 8612 noLines) 8613 8614 expandRun.AddExpectations("variation2.go", []string{ 8615 `type Variation2 struct {`, 8616 " Prop1 interface{} `json:\"prop1,omitempty\"`", 8617 // empty validation 8618 "func (m *Variation2) Validate(formats strfmt.Registry) error {\n return nil\n}", 8619 }, 8620 // not expected 8621 todo, 8622 // output in log 8623 noLines, 8624 noLines) 8625 8626 // load expectations for model: bar.go 8627 flattenRun.AddExpectations("bar.go", []string{ 8628 `type Bar interface{`, 8629 }, 8630 // not expected 8631 validatable, 8632 // output in log 8633 noLines, 8634 noLines) 8635 8636 expandRun.AddExpectations("bar.go", flattenRun.ExpectedFor("Bar").ExpectedLines, validatable, noLines, noLines) 8637 8638 // load expectations for model: variation3.go 8639 flattenRun.AddExpectations("variation3.go", []string{ 8640 `type Variation3 struct {`, 8641 " Prop1 []EmptyEnum `json:\"prop1\"`", 8642 `func (m *Variation3) Validate(formats strfmt.Registry) error {`, 8643 ` if err := m.validateProp1(formats); err != nil {`, 8644 ` return errors.CompositeValidationError(res...`, 8645 `func (m *Variation3) validateProp1(formats strfmt.Registry) error {`, 8646 ` if swag.IsZero(m.Prop1) {`, 8647 ` iProp1Size := int64(len(m.Prop1)`, 8648 ` if err := validate.MinItems("prop1", "body", iProp1Size, 10); err != nil {`, 8649 }, 8650 // not expected 8651 todo, 8652 // output in log 8653 noLines, 8654 noLines) 8655 8656 expandRun.AddExpectations("variation3.go", []string{ 8657 `type Variation3 struct {`, 8658 " Prop1 []interface{} `json:\"prop1\"`", 8659 `func (m *Variation3) Validate(formats strfmt.Registry) error {`, 8660 ` if err := m.validateProp1(formats); err != nil {`, 8661 ` return errors.CompositeValidationError(res...`, 8662 `var variation3Prop1ItemsEnum []interface{`, 8663 ` var res []interface{`, 8664 " if err := json.Unmarshal([]byte(`[\"abc\",\"def\"]`), &res); err != nil {", 8665 ` for _, v := range res {`, 8666 ` variation3Prop1ItemsEnum = append(variation3Prop1ItemsEnum, v`, 8667 `func (m *Variation3) validateProp1ItemsEnum(path, location string, value interface{}) error {`, 8668 ` if err := validate.EnumCase(path, location, value, variation3Prop1ItemsEnum, true); err != nil {`, 8669 `func (m *Variation3) validateProp1(formats strfmt.Registry) error {`, 8670 ` if swag.IsZero(m.Prop1) {`, 8671 ` iProp1Size := int64(len(m.Prop1)`, 8672 ` if err := validate.MinItems("prop1", "body", iProp1Size, 10); err != nil {`, 8673 }, 8674 // not expected 8675 todo, 8676 // output in log 8677 noLines, 8678 noLines) 8679 8680 // load expectations for model: tuple_variation.go 8681 flattenRun.AddExpectations("tuple_variation.go", []string{ 8682 `type TupleVariation struct {`, 8683 " P0 *int64 `json:\"-\"`", 8684 " P1 Bar `json:\"-\"`", 8685 " P2 NonInterface `json:\"-\"`", 8686 " P3 []Bar `json:\"-\"`", 8687 " TupleVariationItems []interface{} `json:\"-\"`", 8688 `func (m *TupleVariation) Validate(formats strfmt.Registry) error {`, 8689 ` if err := m.validateP0(formats); err != nil {`, 8690 ` if err := m.validateP1(formats); err != nil {`, 8691 ` if err := m.validateP2(formats); err != nil {`, 8692 ` if err := m.validateP3(formats); err != nil {`, 8693 ` if err := m.validateTupleVariationItems(formats); err != nil {`, 8694 ` return errors.CompositeValidationError(res...`, 8695 `func (m *TupleVariation) validateP0(formats strfmt.Registry) error {`, 8696 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 8697 ` if err := validate.MaximumInt("0", "body", *m.P0, 10, false); err != nil {`, 8698 `func (m *TupleVariation) validateP1(formats strfmt.Registry) error {`, 8699 `if m.P1 == nil {`, // now required interface{} checked against nil 8700 `return errors.Required("1", "body", m.P1)`, 8701 `func (m *TupleVariation) validateP2(formats strfmt.Registry) error {`, 8702 ` if err := m.P2.Validate(formats); err != nil {`, 8703 ` if ve, ok := err.(*errors.Validation); ok {`, 8704 ` return ve.ValidateName("2"`, 8705 `func (m *TupleVariation) validateP3(formats strfmt.Registry) error {`, 8706 ` if err := validate.Required("3", "body", m.P3); err != nil {`, 8707 ` iP3Size := int64(len(m.P3)`, 8708 ` if err := validate.MaxItems("3", "body", iP3Size, 10); err != nil {`, 8709 // empty validation 8710 "func (m *TupleVariation) validateTupleVariationItems(formats strfmt.Registry) error {\n\n return nil\n}", 8711 }, 8712 // not expected 8713 append(todo, 8714 ` if err := validate.Required("1", "body", m.P1)`, // check we don't have redundant validations 8715 ` if err := validate.Required("1", "body", Bar(m.P1))`, 8716 ), 8717 // output in log 8718 noLines, 8719 noLines) 8720 8721 expandRun.AddExpectations("tuple_variation.go", []string{ 8722 `type TupleVariation struct {`, 8723 " P0 *int64 `json:\"-\"`", 8724 " P1 interface{} `json:\"-\"`", 8725 " P2 map[string]strfmt.Date `json:\"-\"`", 8726 " P3 []interface{} `json:\"-\"`", 8727 " TupleVariationItems []interface{} `json:\"-\"`", 8728 `func (m *TupleVariation) Validate(formats strfmt.Registry) error {`, 8729 ` if err := m.validateP0(formats); err != nil {`, 8730 ` if err := m.validateP1(formats); err != nil {`, 8731 ` if err := m.validateP2(formats); err != nil {`, 8732 ` if err := m.validateP3(formats); err != nil {`, 8733 ` if err := m.validateTupleVariationItems(formats); err != nil {`, 8734 ` return errors.CompositeValidationError(res...`, 8735 `func (m *TupleVariation) validateP0(formats strfmt.Registry) error {`, 8736 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 8737 ` if err := validate.MaximumInt("0", "body", *m.P0, 10, false); err != nil {`, 8738 `func (m *TupleVariation) validateP1(formats strfmt.Registry) error {`, 8739 `if m.P1 == nil {`, // now required interface{} checked against nil 8740 `return errors.Required("1", "body", m.P1)`, 8741 `func (m *TupleVariation) validateP2(formats strfmt.Registry) error {`, 8742 ` for k := range m.P2 {`, 8743 ` if err := validate.FormatOf("2"+"."+k, "body", "date", m.P2[k].String(), formats); err != nil {`, 8744 `func (m *TupleVariation) validateP3(formats strfmt.Registry) error {`, 8745 ` if err := validate.Required("3", "body", m.P3); err != nil {`, 8746 ` iP3Size := int64(len(m.P3)`, 8747 ` if err := validate.MaxItems("3", "body", iP3Size, 10); err != nil {`, 8748 // empty validation 8749 "func (m *TupleVariation) validateTupleVariationItems(formats strfmt.Registry) error {\n\n return nil\n}", 8750 }, 8751 // not expected 8752 todo, 8753 // output in log 8754 noLines, 8755 noLines) 8756 8757 // load expectations for model: add_items_variation.go 8758 flattenRun.AddExpectations("add_items_variation.go", []string{ 8759 `type AddItemsVariation struct {`, 8760 " P0 *int64 `json:\"-\"`", 8761 " P1 Bar `json:\"-\"`", 8762 " AddItemsVariationItems [][]Foo `json:\"-\"`", 8763 `func (m *AddItemsVariation) Validate(formats strfmt.Registry) error {`, 8764 ` if err := m.validateP0(formats); err != nil {`, 8765 ` if err := m.validateP1(formats); err != nil {`, 8766 ` if err := m.validateAddItemsVariationItems(formats); err != nil {`, 8767 ` return errors.CompositeValidationError(res...`, 8768 `func (m *AddItemsVariation) validateP0(formats strfmt.Registry) error {`, 8769 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 8770 ` if err := validate.MaximumInt("0", "body", *m.P0, 10, false); err != nil {`, 8771 `func (m *AddItemsVariation) validateP1(formats strfmt.Registry) error {`, 8772 `if m.P1 == nil {`, // now required interface{} checked against nil 8773 `return errors.Required("1", "body", m.P1)`, 8774 `func (m *AddItemsVariation) validateAddItemsVariationItems(formats strfmt.Registry) error {`, 8775 ` for i := range m.AddItemsVariationItems {`, 8776 ` if err := validate.UniqueItems(strconv.Itoa(i+2), "body", m.AddItemsVariationItems[i]); err != nil {`, 8777 }, 8778 // not expected 8779 todo, 8780 // output in log 8781 noLines, 8782 noLines) 8783 8784 expandRun.AddExpectations("add_items_variation.go", []string{ 8785 `type AddItemsVariation struct {`, 8786 " P0 *int64 `json:\"-\"`", 8787 " P1 interface{} `json:\"-\"`", 8788 " AddItemsVariationItems [][]interface{} `json:\"-\"`", 8789 `func (m *AddItemsVariation) Validate(formats strfmt.Registry) error {`, 8790 ` if err := m.validateP0(formats); err != nil {`, 8791 ` if err := m.validateP1(formats); err != nil {`, 8792 ` if err := m.validateAddItemsVariationItems(formats); err != nil {`, 8793 ` return errors.CompositeValidationError(res...`, 8794 `func (m *AddItemsVariation) validateP0(formats strfmt.Registry) error {`, 8795 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 8796 ` if err := validate.MaximumInt("0", "body", *m.P0, 10, false); err != nil {`, 8797 `func (m *AddItemsVariation) validateP1(formats strfmt.Registry) error {`, 8798 `if m.P1 == nil {`, // now required interface{} checked against nil 8799 `return errors.Required("1", "body", m.P1)`, 8800 `func (m *AddItemsVariation) validateAddItemsVariationItems(formats strfmt.Registry) error {`, 8801 ` for i := range m.AddItemsVariationItems {`, 8802 ` if err := validate.UniqueItems(strconv.Itoa(i+2), "body", m.AddItemsVariationItems[i]); err != nil {`, 8803 }, 8804 // not expected 8805 todo, 8806 // output in log 8807 noLines, 8808 noLines) 8809 8810 // load expectations for model: non_interface.go 8811 flattenRun.AddExpectations("non_interface.go", []string{ 8812 `type NonInterface map[string]strfmt.Date`, 8813 `func (m NonInterface) Validate(formats strfmt.Registry) error {`, 8814 ` for k := range m {`, 8815 ` if err := validate.FormatOf(k, "body", "date", m[k].String(), formats); err != nil {`, 8816 ` return errors.CompositeValidationError(res...`, 8817 }, 8818 // not expected 8819 todo, 8820 // output in log 8821 noLines, 8822 noLines) 8823 8824 expandRun.AddExpectations("non_interface.go", flattenRun.ExpectedFor("NonInterface").ExpectedLines, todo, noLines, noLines) 8825 8826 // load expectations for model: variation0.go 8827 flattenRun.AddExpectations("variation0.go", []string{ 8828 `type Variation0 struct {`, 8829 ` Foo`, 8830 ` Bar`, 8831 // empty validation 8832 "func (m *Variation0) Validate(formats strfmt.Registry) error {\n return nil\n}", 8833 }, 8834 // not expected 8835 todo, 8836 // output in log 8837 noLines, 8838 noLines) 8839 8840 expandRun.AddExpectations("variation0.go", []string{ 8841 `type Variation0 struct {`, 8842 ` Variation0AllOf0`, 8843 ` Variation0AllOf1`, 8844 `type Variation0AllOf0 interface{}`, 8845 `type Variation0AllOf1 interface{}`, 8846 // empty validation 8847 "func (m *Variation0) Validate(formats strfmt.Registry) error {\n return nil\n}", 8848 }, 8849 // not expected 8850 todo, 8851 // output in log 8852 noLines, 8853 noLines) 8854 8855 // load expectations for model: variation1.go 8856 flattenRun.AddExpectations("variation1.go", []string{ 8857 `type Variation1 struct {`, 8858 ` Foo`, 8859 ` NonInterface`, 8860 `func (m *Variation1) Validate(formats strfmt.Registry) error {`, 8861 ` if err := m.NonInterface.Validate(formats); err != nil {`, 8862 ` return errors.CompositeValidationError(res...`, 8863 }, 8864 // not expected 8865 todo, 8866 // output in log 8867 noLines, 8868 noLines) 8869 8870 expandRun.AddExpectations("variation1.go", []string{ 8871 `type Variation1 struct {`, 8872 ` Variation1AllOf0`, 8873 " AO1 map[string]strfmt.Date `json:\"-\"`", 8874 `func (m *Variation1) Validate(formats strfmt.Registry) error {`, 8875 ` for k := range m.AO1 {`, 8876 ` if err := validate.FormatOf(k, "body", "date", m.AO1[k].String(), formats); err != nil {`, 8877 ` return errors.CompositeValidationError(res...`, 8878 `type Variation1AllOf0 interface{}`, 8879 }, 8880 // not expected 8881 todo, 8882 // output in log 8883 noLines, 8884 noLines) 8885 8886 // load expectations for model: empty_enum.go 8887 flattenRun.AddExpectations("empty_enum.go", []string{ 8888 `type EmptyEnum interface{}`, 8889 }, 8890 // not expected 8891 validatable, 8892 // output in log 8893 noLines, 8894 noLines) 8895 8896 expandRun.AddExpectations("empty_enum.go", flattenRun.ExpectedFor("EmptyEnum").ExpectedLines, validatable, noLines, noLines) 8897 8898 // load expectations for model: get_o_k_body.go 8899 flattenRun.AddExpectations("get_o_k_body.go", []string{ 8900 `type GetOKBody struct {`, 8901 ` Foo`, 8902 ` Bar`, 8903 // empty validation 8904 "func (m *GetOKBody) Validate(formats strfmt.Registry) error {\n return nil\n}", 8905 }, 8906 // not expected 8907 todo, 8908 // output in log 8909 noLines, 8910 noLines) 8911 8912 } 8913 8914 func initFixtureMoreAddProps() { 8915 // testing fixture-moreAddProps.yaml with flatten and expand (--skip-flatten) 8916 8917 /* 8918 various patterns of additionalProperties 8919 */ 8920 8921 f := newModelFixture("../fixtures/bugs/1487/fixture-moreAddProps.yaml", "fixture for additionalProperties") 8922 flattenRun := f.AddRun(false) 8923 expandRun := f.AddRun(true) 8924 8925 // load expectations for model: trial.go 8926 flattenRun.AddExpectations("trial.go", []string{ 8927 `type Trial struct {`, 8928 " A1 strfmt.DateTime `json:\"a1,omitempty\"`", 8929 " AdditionalProperties *TrialAdditionalProperties `json:\"additionalProperties,omitempty\"`", 8930 `func (m *Trial) Validate(formats strfmt.Registry) error {`, 8931 ` if err := m.validateA1(formats); err != nil {`, 8932 ` if err := m.validateAdditionalProperties(formats); err != nil {`, 8933 ` return errors.CompositeValidationError(res...`, 8934 `func (m *Trial) validateA1(formats strfmt.Registry) error {`, 8935 ` if swag.IsZero(m.A1) {`, 8936 ` if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`, 8937 `func (m *Trial) validateAdditionalProperties(formats strfmt.Registry) error {`, 8938 ` if swag.IsZero(m.AdditionalProperties) {`, 8939 ` if m.AdditionalProperties != nil {`, 8940 ` if err := m.AdditionalProperties.Validate(formats); err != nil {`, 8941 ` if ve, ok := err.(*errors.Validation); ok {`, 8942 ` return ve.ValidateName("additionalProperties"`, 8943 }, 8944 // not expected 8945 todo, 8946 // output in log 8947 noLines, 8948 noLines) 8949 8950 // load expectations for model: trial_additional_properties.go 8951 flattenRun.AddExpectations("trial_additional_properties.go", []string{ 8952 `type TrialAdditionalProperties struct {`, 8953 " Discourse string `json:\"discourse,omitempty\"`", 8954 " HoursSpent float64 `json:\"hoursSpent,omitempty\"`", 8955 " TrialAdditionalPropertiesAdditionalProperties map[string]interface{} `json:\"-\"`", 8956 // empty validation 8957 "func (m *TrialAdditionalProperties) Validate(formats strfmt.Registry) error {\n return nil\n}", 8958 }, 8959 // not expected 8960 todo, 8961 // output in log 8962 noLines, 8963 noLines) 8964 8965 // load expectations for model: additional_transitive_refed_object_thing_additional_properties.go 8966 flattenRun.AddExpectations("additional_transitive_refed_object_thing_additional_properties.go", []string{ 8967 `type AdditionalTransitiveRefedObjectThingAdditionalProperties struct {`, 8968 " Prop1 *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1 `json:\"prop1,omitempty\"`", 8969 " AdditionalTransitiveRefedObjectThingAdditionalProperties map[string]*AdditionalTransitiveRefedObjectThingAdditionalPropertiesAdditionalProperties `json:\"-\"`", 8970 `func (m *AdditionalTransitiveRefedObjectThingAdditionalProperties) Validate(formats strfmt.Registry) error {`, 8971 ` if err := m.validateProp1(formats); err != nil {`, 8972 ` for k := range m.AdditionalTransitiveRefedObjectThingAdditionalProperties {`, 8973 ` if val, ok := m.AdditionalTransitiveRefedObjectThingAdditionalProperties[k]; ok {`, 8974 ` if val != nil {`, 8975 ` if err := val.Validate(formats); err != nil {`, 8976 ` return errors.CompositeValidationError(res...`, 8977 `func (m *AdditionalTransitiveRefedObjectThingAdditionalProperties) validateProp1(formats strfmt.Registry) error {`, 8978 ` if swag.IsZero(m.Prop1) {`, 8979 ` if m.Prop1 != nil {`, 8980 ` if err := m.Prop1.Validate(formats); err != nil {`, 8981 ` if ve, ok := err.(*errors.Validation); ok {`, 8982 ` return ve.ValidateName("prop1"`, 8983 }, 8984 // not expected 8985 todo, 8986 // output in log 8987 noLines, 8988 noLines) 8989 8990 // load expectations for model: additional_transitive_refed_object_thing_additional_properties_prop1.go 8991 flattenRun.AddExpectations("additional_transitive_refed_object_thing_additional_properties_prop1.go", []string{ 8992 `type AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1 struct {`, 8993 " ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`", 8994 " AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1 map[string]*AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalProperties `json:\"-\"`", 8995 `func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1) Validate(formats strfmt.Registry) error {`, 8996 ` if err := m.validateThisOneNotRequiredEither(formats); err != nil {`, 8997 ` for k := range m.AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1 {`, 8998 ` if val, ok := m.AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1[k]; ok {`, 8999 ` if val != nil {`, 9000 ` if err := val.Validate(formats); err != nil {`, 9001 ` return errors.CompositeValidationError(res...`, 9002 `func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`, 9003 ` if swag.IsZero(m.ThisOneNotRequiredEither) {`, 9004 ` if err := validate.MaximumInt("thisOneNotRequiredEither", "body", m.ThisOneNotRequiredEither, 20, false); err != nil {`, 9005 }, 9006 // not expected 9007 todo, 9008 // output in log 9009 noLines, 9010 noLines) 9011 9012 // load expectations for model: additional_transitive_refed_thing.go 9013 flattenRun.AddExpectations("additional_transitive_refed_thing.go", []string{ 9014 `type AdditionalTransitiveRefedThing struct {`, 9015 " ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`", 9016 " AdditionalTransitiveRefedThing map[string][]*AdditionalTransitiveRefedThingAdditionalPropertiesItems `json:\"-\"`", 9017 `func (m *AdditionalTransitiveRefedThing) Validate(formats strfmt.Registry) error {`, 9018 ` if err := m.validateThisOneNotRequired(formats); err != nil {`, 9019 ` for k := range m.AdditionalTransitiveRefedThing {`, 9020 ` if err := validate.Required(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`, 9021 ` if err := validate.UniqueItems(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`, 9022 ` for i := 0; i < len(m.AdditionalTransitiveRefedThing[k]); i++ {`, 9023 // do we need Required when item is nullable? 9024 // nullable not required: 9025 ` if swag.IsZero(m.AdditionalTransitiveRefedThing[k][i]) {`, 9026 // nullable not required: 9027 ` if m.AdditionalTransitiveRefedThing[k][i] != nil {`, 9028 ` if err := m.AdditionalTransitiveRefedThing[k][i].Validate(formats); err != nil {`, 9029 ` if ve, ok := err.(*errors.Validation); ok {`, 9030 ` return ve.ValidateName(k + "." + strconv.Itoa(i)`, 9031 ` return errors.CompositeValidationError(res...`, 9032 `func (m *AdditionalTransitiveRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`, 9033 ` if swag.IsZero(m.ThisOneNotRequired) {`, 9034 ` if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`, 9035 }, 9036 // not expected 9037 todo, 9038 // output in log 9039 noLines, 9040 noLines) 9041 9042 // load expectations for model: additional_transitive_refed_thing_additional_properties_items_additional_properties_additional_properties.go 9043 flattenRun.AddExpectations("additional_transitive_refed_thing_additional_properties_items_additional_properties_additional_properties.go", []string{ 9044 `type AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalPropertiesAdditionalProperties struct {`, 9045 " Discourse string `json:\"discourse,omitempty\"`", 9046 " HoursSpent float64 `json:\"hoursSpent,omitempty\"`", 9047 " AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalPropertiesAdditionalPropertiesAdditionalProperties map[string]interface{} `json:\"-\"`", 9048 // empty validation 9049 "func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {\n return nil\n}", 9050 }, 9051 // not expected 9052 todo, 9053 // output in log 9054 noLines, 9055 noLines) 9056 9057 // load expectations for model: additional_transitive_refed_object_thing.go 9058 flattenRun.AddExpectations("additional_transitive_refed_object_thing.go", []string{ 9059 `type AdditionalTransitiveRefedObjectThing struct {`, 9060 " ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`", 9061 " AdditionalTransitiveRefedObjectThing map[string]*AdditionalTransitiveRefedObjectThingAdditionalProperties `json:\"-\"`", 9062 `func (m *AdditionalTransitiveRefedObjectThing) Validate(formats strfmt.Registry) error {`, 9063 ` if err := m.validateThisOneNotRequired(formats); err != nil {`, 9064 ` for k := range m.AdditionalTransitiveRefedObjectThing {`, 9065 ` if val, ok := m.AdditionalTransitiveRefedObjectThing[k]; ok {`, 9066 ` if val != nil {`, 9067 ` if err := val.Validate(formats); err != nil {`, 9068 ` return errors.CompositeValidationError(res...`, 9069 `func (m *AdditionalTransitiveRefedObjectThing) validateThisOneNotRequired(formats strfmt.Registry) error {`, 9070 ` if swag.IsZero(m.ThisOneNotRequired) {`, 9071 ` if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`, 9072 }, 9073 // not expected 9074 todo, 9075 // output in log 9076 noLines, 9077 noLines) 9078 9079 // load expectations for model: additional_transitive_refed_object_thing_additional_properties_additional_properties.go 9080 flattenRun.AddExpectations("additional_transitive_refed_object_thing_additional_properties_additional_properties.go", []string{ 9081 `type AdditionalTransitiveRefedObjectThingAdditionalPropertiesAdditionalProperties struct {`, 9082 " Discourse string `json:\"discourse,omitempty\"`", 9083 " HoursSpent float64 `json:\"hoursSpent,omitempty\"`", 9084 " AdditionalTransitiveRefedObjectThingAdditionalPropertiesAdditionalPropertiesAdditionalProperties map[string]interface{} `json:\"-\"`", 9085 // empty validation 9086 "func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {\n return nil\n}", 9087 }, 9088 // not expected 9089 todo, 9090 // output in log 9091 noLines, 9092 noLines) 9093 9094 // load expectations for model: additional_transitive_refed_object_thing_additional_properties_prop1_additional_properties.go 9095 flattenRun.AddExpectations("additional_transitive_refed_object_thing_additional_properties_prop1_additional_properties.go", []string{ 9096 `type AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalProperties struct {`, 9097 " A1 strfmt.DateTime `json:\"a1,omitempty\"`", 9098 " B1 strfmt.Date `json:\"b1,omitempty\"`", 9099 " AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalPropertiesAdditionalProperties map[string]interface{} `json:\"-\"`", 9100 `func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalProperties) Validate(formats strfmt.Registry) error {`, 9101 ` if err := m.validateA1(formats); err != nil {`, 9102 ` if err := m.validateB1(formats); err != nil {`, 9103 ` return errors.CompositeValidationError(res...`, 9104 `func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalProperties) validateA1(formats strfmt.Registry) error {`, 9105 ` if swag.IsZero(m.A1) {`, 9106 ` if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`, 9107 `func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalProperties) validateB1(formats strfmt.Registry) error {`, 9108 ` if swag.IsZero(m.B1) {`, 9109 ` if err := validate.FormatOf("b1", "body", "date", m.B1.String(), formats); err != nil {`, 9110 }, 9111 // not expected 9112 todo, 9113 // output in log 9114 noLines, 9115 noLines) 9116 9117 // load expectations for model: additional_transitive_refed_thing_additional_properties_items.go 9118 flattenRun.AddExpectations("additional_transitive_refed_thing_additional_properties_items.go", []string{ 9119 `type AdditionalTransitiveRefedThingAdditionalPropertiesItems struct {`, 9120 " ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`", 9121 " AdditionalTransitiveRefedThingAdditionalPropertiesItems map[string]*AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties `json:\"-\"`", 9122 `func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItems) Validate(formats strfmt.Registry) error {`, 9123 ` if err := m.validateThisOneNotRequiredEither(formats); err != nil {`, 9124 ` for k := range m.AdditionalTransitiveRefedThingAdditionalPropertiesItems {`, 9125 ` if val, ok := m.AdditionalTransitiveRefedThingAdditionalPropertiesItems[k]; ok {`, 9126 ` if val != nil {`, 9127 ` if err := val.Validate(formats); err != nil {`, 9128 ` return errors.CompositeValidationError(res...`, 9129 `func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItems) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`, 9130 ` if swag.IsZero(m.ThisOneNotRequiredEither) {`, 9131 ` if err := validate.MaximumInt("thisOneNotRequiredEither", "body", m.ThisOneNotRequiredEither, 20, false); err != nil {`, 9132 }, 9133 // not expected 9134 todo, 9135 // output in log 9136 noLines, 9137 noLines) 9138 9139 // load expectations for model: additional_transitive_refed_thing_additional_properties_items_additional_properties.go 9140 flattenRun.AddExpectations("additional_transitive_refed_thing_additional_properties_items_additional_properties.go", []string{ 9141 `type AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties struct {`, 9142 " A1 strfmt.DateTime `json:\"a1,omitempty\"`", 9143 " B1 strfmt.DateTime `json:\"b1,omitempty\"`", 9144 " AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties map[string]*AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalPropertiesAdditionalProperties `json:\"-\"`", 9145 `func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties) Validate(formats strfmt.Registry) error {`, 9146 ` if err := m.validateA1(formats); err != nil {`, 9147 ` if err := m.validateB1(formats); err != nil {`, 9148 ` for k := range m.AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties {`, 9149 ` if val, ok := m.AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties[k]; ok {`, 9150 ` if val != nil {`, 9151 ` if err := val.Validate(formats); err != nil {`, 9152 ` return errors.CompositeValidationError(res...`, 9153 `func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties) validateA1(formats strfmt.Registry) error {`, 9154 ` if swag.IsZero(m.A1) {`, 9155 ` if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`, 9156 `func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties) validateB1(formats strfmt.Registry) error {`, 9157 ` if swag.IsZero(m.B1) {`, 9158 ` if err := validate.FormatOf("b1", "body", "date-time", m.B1.String(), formats); err != nil {`, 9159 }, 9160 // not expected 9161 todo, 9162 // output in log 9163 noLines, 9164 noLines) 9165 9166 // load expectations for model: trial.go 9167 expandRun.AddExpectations("trial.go", []string{ 9168 `type Trial struct {`, 9169 " A1 strfmt.DateTime `json:\"a1,omitempty\"`", 9170 " AdditionalProperties *TrialAdditionalProperties `json:\"additionalProperties,omitempty\"`", 9171 `func (m *Trial) Validate(formats strfmt.Registry) error {`, 9172 ` if err := m.validateA1(formats); err != nil {`, 9173 ` if err := m.validateAdditionalProperties(formats); err != nil {`, 9174 ` return errors.CompositeValidationError(res...`, 9175 `func (m *Trial) validateA1(formats strfmt.Registry) error {`, 9176 ` if swag.IsZero(m.A1) {`, 9177 ` if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`, 9178 `func (m *Trial) validateAdditionalProperties(formats strfmt.Registry) error {`, 9179 ` if swag.IsZero(m.AdditionalProperties) {`, 9180 ` if m.AdditionalProperties != nil {`, 9181 ` if err := m.AdditionalProperties.Validate(formats); err != nil {`, 9182 ` if ve, ok := err.(*errors.Validation); ok {`, 9183 ` return ve.ValidateName("additionalProperties"`, 9184 `type TrialAdditionalProperties struct {`, 9185 " Discourse string `json:\"discourse,omitempty\"`", 9186 " HoursSpent float64 `json:\"hoursSpent,omitempty\"`", 9187 " TrialAdditionalPropertiesAdditionalProperties map[string]interface{} `json:\"-\"`", 9188 // empty validation 9189 "func (m *TrialAdditionalProperties) Validate(formats strfmt.Registry) error {\n return nil\n}", 9190 }, 9191 // not expected 9192 todo, 9193 // output in log 9194 noLines, 9195 noLines) 9196 9197 // load expectations for model: additional_transitive_refed_thing.go 9198 expandRun.AddExpectations("additional_transitive_refed_thing.go", []string{ 9199 `type AdditionalTransitiveRefedThing struct {`, 9200 " ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`", 9201 " AdditionalTransitiveRefedThing map[string][]*AdditionalTransitiveRefedThingItems0 `json:\"-\"`", 9202 `func (m *AdditionalTransitiveRefedThing) Validate(formats strfmt.Registry) error {`, 9203 ` if err := m.validateThisOneNotRequired(formats); err != nil {`, 9204 ` for k := range m.AdditionalTransitiveRefedThing {`, 9205 ` if err := validate.Required(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`, 9206 ` if err := validate.UniqueItems(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`, 9207 ` for i := 0; i < len(m.AdditionalTransitiveRefedThing[k]); i++ {`, 9208 // do we need Required when item is nullable? 9209 // nullable not required: 9210 ` if swag.IsZero(m.AdditionalTransitiveRefedThing[k][i]) {`, 9211 // nullable required: 9212 ` if m.AdditionalTransitiveRefedThing[k][i] != nil {`, 9213 ` if err := m.AdditionalTransitiveRefedThing[k][i].Validate(formats); err != nil {`, 9214 ` if ve, ok := err.(*errors.Validation); ok {`, 9215 ` return ve.ValidateName(k + "." + strconv.Itoa(i)`, 9216 ` return errors.CompositeValidationError(res...`, 9217 `func (m *AdditionalTransitiveRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`, 9218 ` if swag.IsZero(m.ThisOneNotRequired) {`, 9219 ` if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`, 9220 `type AdditionalTransitiveRefedThingItems0 struct {`, 9221 " ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`", 9222 " AdditionalTransitiveRefedThingItems0 map[string]*AdditionalTransitiveRefedThingItems0Anon `json:\"-\"`", 9223 `func (m *AdditionalTransitiveRefedThingItems0) Validate(formats strfmt.Registry) error {`, 9224 ` if err := m.validateThisOneNotRequiredEither(formats); err != nil {`, 9225 ` for k := range m.AdditionalTransitiveRefedThingItems0 {`, 9226 ` if val, ok := m.AdditionalTransitiveRefedThingItems0[k]; ok {`, 9227 ` if val != nil {`, 9228 ` if err := val.Validate(formats); err != nil {`, 9229 ` return errors.CompositeValidationError(res...`, 9230 `func (m *AdditionalTransitiveRefedThingItems0) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`, 9231 ` if swag.IsZero(m.ThisOneNotRequiredEither) {`, 9232 ` if err := validate.MaximumInt("thisOneNotRequiredEither", "body", m.ThisOneNotRequiredEither, 20, false); err != nil {`, 9233 `type AdditionalTransitiveRefedThingItems0Anon struct {`, 9234 " A1 strfmt.DateTime `json:\"a1,omitempty\"`", 9235 " B1 strfmt.DateTime `json:\"b1,omitempty\"`", 9236 " AdditionalTransitiveRefedThingItems0Anon map[string]*AdditionalTransitiveRefedThingItems0AnonAnon `json:\"-\"`", 9237 `func (m *AdditionalTransitiveRefedThingItems0Anon) Validate(formats strfmt.Registry) error {`, 9238 ` if err := m.validateA1(formats); err != nil {`, 9239 ` if err := m.validateB1(formats); err != nil {`, 9240 ` for k := range m.AdditionalTransitiveRefedThingItems0Anon {`, 9241 ` if val, ok := m.AdditionalTransitiveRefedThingItems0Anon[k]; ok {`, 9242 ` if val != nil {`, 9243 ` if err := val.Validate(formats); err != nil {`, 9244 ` return errors.CompositeValidationError(res...`, 9245 `func (m *AdditionalTransitiveRefedThingItems0Anon) validateA1(formats strfmt.Registry) error {`, 9246 ` if swag.IsZero(m.A1) {`, 9247 ` if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`, 9248 `func (m *AdditionalTransitiveRefedThingItems0Anon) validateB1(formats strfmt.Registry) error {`, 9249 ` if swag.IsZero(m.B1) {`, 9250 ` if err := validate.FormatOf("b1", "body", "date-time", m.B1.String(), formats); err != nil {`, 9251 `type AdditionalTransitiveRefedThingItems0AnonAnon struct {`, 9252 " Discourse string `json:\"discourse,omitempty\"`", 9253 " HoursSpent float64 `json:\"hoursSpent,omitempty\"`", 9254 " AdditionalTransitiveRefedThingItems0AnonAnonAdditionalProperties map[string]interface{} `json:\"-\"`", 9255 // empty validation 9256 "func (m *AdditionalTransitiveRefedThingItems0AnonAnon) Validate(formats strfmt.Registry) error {\n return nil\n}", 9257 }, 9258 // not expected 9259 todo, 9260 // output in log 9261 noLines, 9262 noLines) 9263 9264 // load expectations for model: additional_transitive_refed_object_thing.go 9265 expandRun.AddExpectations("additional_transitive_refed_object_thing.go", []string{ 9266 `type AdditionalTransitiveRefedObjectThing struct {`, 9267 " ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`", 9268 " AdditionalTransitiveRefedObjectThing map[string]*AdditionalTransitiveRefedObjectThingAnon `json:\"-\"`", 9269 `func (m *AdditionalTransitiveRefedObjectThing) Validate(formats strfmt.Registry) error {`, 9270 ` if err := m.validateThisOneNotRequired(formats); err != nil {`, 9271 ` for k := range m.AdditionalTransitiveRefedObjectThing {`, 9272 ` if val, ok := m.AdditionalTransitiveRefedObjectThing[k]; ok {`, 9273 ` if val != nil {`, 9274 ` if err := val.Validate(formats); err != nil {`, 9275 ` return errors.CompositeValidationError(res...`, 9276 `func (m *AdditionalTransitiveRefedObjectThing) validateThisOneNotRequired(formats strfmt.Registry) error {`, 9277 ` if swag.IsZero(m.ThisOneNotRequired) {`, 9278 ` if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`, 9279 `type AdditionalTransitiveRefedObjectThingAnon struct {`, 9280 " Prop1 *AdditionalTransitiveRefedObjectThingAnonProp1 `json:\"prop1,omitempty\"`", 9281 " AdditionalTransitiveRefedObjectThingAnon map[string]*AdditionalTransitiveRefedObjectThingAnonAnon `json:\"-\"`", 9282 `func (m *AdditionalTransitiveRefedObjectThingAnon) Validate(formats strfmt.Registry) error {`, 9283 ` if err := m.validateProp1(formats); err != nil {`, 9284 ` for k := range m.AdditionalTransitiveRefedObjectThingAnon {`, 9285 ` if val, ok := m.AdditionalTransitiveRefedObjectThingAnon[k]; ok {`, 9286 ` if val != nil {`, 9287 ` if err := val.Validate(formats); err != nil {`, 9288 ` return errors.CompositeValidationError(res...`, 9289 `func (m *AdditionalTransitiveRefedObjectThingAnon) validateProp1(formats strfmt.Registry) error {`, 9290 ` if swag.IsZero(m.Prop1) {`, 9291 ` if m.Prop1 != nil {`, 9292 ` if err := m.Prop1.Validate(formats); err != nil {`, 9293 ` if ve, ok := err.(*errors.Validation); ok {`, 9294 ` return ve.ValidateName("prop1"`, 9295 `type AdditionalTransitiveRefedObjectThingAnonAnon struct {`, 9296 " Discourse string `json:\"discourse,omitempty\"`", 9297 " HoursSpent float64 `json:\"hoursSpent,omitempty\"`", 9298 " AdditionalTransitiveRefedObjectThingAnonAnonAdditionalProperties map[string]interface{} `json:\"-\"`", 9299 `type AdditionalTransitiveRefedObjectThingAnonProp1 struct {`, 9300 " ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`", 9301 " AdditionalTransitiveRefedObjectThingAnonProp1 map[string]*AdditionalTransitiveRefedObjectThingAnonProp1Anon `json:\"-\"`", 9302 `func (m *AdditionalTransitiveRefedObjectThingAnonProp1) Validate(formats strfmt.Registry) error {`, 9303 ` if err := m.validateThisOneNotRequiredEither(formats); err != nil {`, 9304 ` for k := range m.AdditionalTransitiveRefedObjectThingAnonProp1 {`, 9305 ` if val, ok := m.AdditionalTransitiveRefedObjectThingAnonProp1[k]; ok {`, 9306 ` if val != nil {`, 9307 ` if err := val.Validate(formats); err != nil {`, 9308 ` return errors.CompositeValidationError(res...`, 9309 `func (m *AdditionalTransitiveRefedObjectThingAnonProp1) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`, 9310 ` if swag.IsZero(m.ThisOneNotRequiredEither) {`, 9311 ` if err := validate.MaximumInt("prop1"+"."+"thisOneNotRequiredEither", "body", m.ThisOneNotRequiredEither, 20, false); err != nil {`, 9312 `type AdditionalTransitiveRefedObjectThingAnonProp1Anon struct {`, 9313 " A1 strfmt.DateTime `json:\"a1,omitempty\"`", 9314 " B1 strfmt.Date `json:\"b1,omitempty\"`", 9315 " AdditionalTransitiveRefedObjectThingAnonProp1AnonAdditionalProperties map[string]interface{} `json:\"-\"`", 9316 `func (m *AdditionalTransitiveRefedObjectThingAnonProp1Anon) Validate(formats strfmt.Registry) error {`, 9317 ` if err := m.validateA1(formats); err != nil {`, 9318 ` if err := m.validateB1(formats); err != nil {`, 9319 ` return errors.CompositeValidationError(res...`, 9320 `func (m *AdditionalTransitiveRefedObjectThingAnonProp1Anon) validateA1(formats strfmt.Registry) error {`, 9321 ` if swag.IsZero(m.A1) {`, 9322 ` if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`, 9323 `func (m *AdditionalTransitiveRefedObjectThingAnonProp1Anon) validateB1(formats strfmt.Registry) error {`, 9324 ` if swag.IsZero(m.B1) {`, 9325 ` if err := validate.FormatOf("b1", "body", "date", m.B1.String(), formats); err != nil {`, 9326 // empty validation 9327 "func (m *AdditionalTransitiveRefedObjectThingAnonAnon) Validate(formats strfmt.Registry) error {\n return nil\n}", 9328 }, 9329 // not expected 9330 todo, 9331 // output in log 9332 noLines, 9333 noLines) 9334 9335 } 9336 9337 func initFixture1537() { 9338 // testing fixture-1537.yaml with flatten and expand (--skip-flatten) 9339 // TODO: expand 9340 9341 /* 9342 repro issue 1537 9343 */ 9344 9345 f := newModelFixture("../fixtures/bugs/1537/fixture-1537.yaml", "param body required with array of objects") 9346 thisRun := f.AddRun(false) 9347 9348 // load expectations for model: profile_array.go 9349 thisRun.AddExpectations("profile_array.go", []string{ 9350 `type ProfileArray struct {`, 9351 " ProfileCfg []*ProfileCfg `json:\"profileCfg\"`", 9352 `func (m *ProfileArray) Validate(formats strfmt.Registry) error {`, 9353 ` if err := m.validateProfileCfg(formats); err != nil {`, 9354 ` return errors.CompositeValidationError(res...`, 9355 `func (m *ProfileArray) validateProfileCfg(formats strfmt.Registry) error {`, 9356 ` if err := validate.Required("profileCfg", "body", m.ProfileCfg); err != nil {`, 9357 ` for i := 0; i < len(m.ProfileCfg); i++ {`, 9358 // do we need Required when item is nullable? 9359 // nullable not required: 9360 ` if swag.IsZero(m.ProfileCfg[i]) {`, 9361 // nullable required: 9362 ` if m.ProfileCfg[i] != nil {`, 9363 ` if err := m.ProfileCfg[i].Validate(formats); err != nil {`, 9364 ` if ve, ok := err.(*errors.Validation); ok {`, 9365 ` return ve.ValidateName("profileCfg" + "." + strconv.Itoa(i)`, 9366 }, 9367 // not expected 9368 todo, 9369 // output in log 9370 noLines, 9371 noLines) 9372 9373 // load expectations for model: profile.go 9374 thisRun.AddExpectations("profile.go", []string{ 9375 `type Profile struct {`, 9376 " ProfileCfg ProfileCfgs `json:\"profileCfg,omitempty\"`", 9377 `func (m *Profile) Validate(formats strfmt.Registry) error {`, 9378 ` if err := m.validateProfileCfg(formats); err != nil {`, 9379 ` return errors.CompositeValidationError(res...`, 9380 `func (m *Profile) validateProfileCfg(formats strfmt.Registry) error {`, 9381 ` if swag.IsZero(m.ProfileCfg) {`, 9382 ` if err := m.ProfileCfg.Validate(formats); err != nil {`, 9383 ` if ve, ok := err.(*errors.Validation); ok {`, 9384 ` return ve.ValidateName("profileCfg"`, 9385 }, 9386 // not expected 9387 todo, 9388 // output in log 9389 noLines, 9390 noLines) 9391 9392 // load expectations for model: profile_cfgs.go 9393 thisRun.AddExpectations("profile_cfgs.go", []string{ 9394 `type ProfileCfgs []*ProfileCfg`, 9395 `func (m ProfileCfgs) Validate(formats strfmt.Registry) error {`, 9396 ` for i := 0; i < len(m); i++ {`, 9397 // do we need Required when item is nullable? 9398 // nullable not required: 9399 ` if swag.IsZero(m[i]) {`, 9400 // nullable required: 9401 ` if m[i] != nil {`, 9402 ` if err := m[i].Validate(formats); err != nil {`, 9403 ` if ve, ok := err.(*errors.Validation); ok {`, 9404 ` return ve.ValidateName(strconv.Itoa(i)`, 9405 ` return errors.CompositeValidationError(res...`, 9406 }, 9407 // not expected 9408 todo, 9409 // output in log 9410 noLines, 9411 noLines) 9412 9413 // load expectations for model: profile_cfg.go 9414 thisRun.AddExpectations("profile_cfg.go", []string{ 9415 `type ProfileCfg struct {`, 9416 " Value1 int32 `json:\"value1,omitempty\"`", 9417 " Value2 int32 `json:\"value2,omitempty\"`", 9418 // empty validation 9419 "func (m *ProfileCfg) Validate(formats strfmt.Registry) error {\n return nil\n}", 9420 }, 9421 // not expected 9422 todo, 9423 // output in log 9424 noLines, 9425 noLines) 9426 9427 // load expectations for model: profile_required.go 9428 thisRun.AddExpectations("profile_required.go", []string{ 9429 `type ProfileRequired struct {`, 9430 " ProfileCfg ProfileCfgs `json:\"profileCfg\"`", 9431 `func (m *ProfileRequired) Validate(formats strfmt.Registry) error {`, 9432 ` if err := m.validateProfileCfg(formats); err != nil {`, 9433 ` return errors.CompositeValidationError(res...`, 9434 `func (m *ProfileRequired) validateProfileCfg(formats strfmt.Registry) error {`, 9435 ` if err := validate.Required("profileCfg", "body", m.ProfileCfg); err != nil {`, 9436 ` if err := m.ProfileCfg.Validate(formats); err != nil {`, 9437 ` if ve, ok := err.(*errors.Validation); ok {`, 9438 ` return ve.ValidateName("profileCfg"`, 9439 }, 9440 // not expected 9441 todo, 9442 // output in log 9443 noLines, 9444 noLines) 9445 9446 } 9447 9448 func initFixture1537v2() { 9449 // testing fixture-1537-2.yaml with flatten and expand (--skip-flatten) 9450 // TODO: expand 9451 9452 /* 9453 repro issue 1537, with aliased items 9454 */ 9455 9456 f := newModelFixture("../fixtures/bugs/1537/fixture-1537-2.yaml", "param body required with array of aliased items") 9457 thisRun := f.AddRun(false) 9458 9459 // load expectations for model: profiles.go 9460 thisRun.AddExpectations("profiles.go", []string{ 9461 `type Profiles []ProfileCfgs`, 9462 `func (m Profiles) Validate(formats strfmt.Registry) error {`, 9463 ` for i := 0; i < len(m); i++ {`, 9464 ` if err := m[i].Validate(formats); err != nil {`, 9465 ` if ve, ok := err.(*errors.Validation); ok {`, 9466 ` return ve.ValidateName(strconv.Itoa(i)`, 9467 ` return errors.CompositeValidationError(res...`, 9468 }, 9469 // not expected 9470 todo, 9471 // output in log 9472 noLines, 9473 noLines) 9474 9475 // load expectations for model: profile_cfgs_no_validation.go 9476 thisRun.AddExpectations("profile_cfgs_no_validation.go", []string{ 9477 `type ProfileCfgsNoValidation []*ProfileCfg`, 9478 `func (m ProfileCfgsNoValidation) Validate(formats strfmt.Registry) error {`, 9479 ` for i := 0; i < len(m); i++ {`, 9480 // do we need Required when item is nullable? 9481 // nullable not required: 9482 ` if swag.IsZero(m[i]) {`, 9483 // nullable required: 9484 ` if m[i] != nil {`, 9485 ` if err := m[i].Validate(formats); err != nil {`, 9486 ` if ve, ok := err.(*errors.Validation); ok {`, 9487 ` return ve.ValidateName(strconv.Itoa(i)`, 9488 ` return errors.CompositeValidationError(res...`, 9489 }, 9490 // not expected 9491 todo, 9492 // output in log 9493 noLines, 9494 noLines) 9495 9496 // load expectations for model: profile_cfgs.go 9497 thisRun.AddExpectations("profile_cfgs.go", []string{ 9498 `type ProfileCfgs []*ProfileCfg`, 9499 `func (m ProfileCfgs) Validate(formats strfmt.Registry) error {`, 9500 ` iProfileCfgsSize := int64(len(m)`, 9501 ` if err := validate.MaxItems("", "body", iProfileCfgsSize, 10); err != nil {`, 9502 ` for i := 0; i < len(m); i++ {`, 9503 // do we need Required when item is nullable? 9504 // nullable not required: 9505 ` if swag.IsZero(m[i]) {`, 9506 // nullable required: 9507 ` if m[i] != nil {`, 9508 ` if err := m[i].Validate(formats); err != nil {`, 9509 ` if ve, ok := err.(*errors.Validation); ok {`, 9510 ` return ve.ValidateName(strconv.Itoa(i)`, 9511 ` return errors.CompositeValidationError(res...`, 9512 }, 9513 // not expected 9514 todo, 9515 // output in log 9516 noLines, 9517 noLines) 9518 9519 // load expectations for model: profile_cfg.go 9520 thisRun.AddExpectations("profile_cfg.go", []string{ 9521 `type ProfileCfg struct {`, 9522 " Value1 int32 `json:\"value1,omitempty\"`", 9523 " Value2 int32 `json:\"value2,omitempty\"`", 9524 // empty validation 9525 "func (m *ProfileCfg) Validate(formats strfmt.Registry) error {\n return nil\n}", 9526 }, 9527 // not expected 9528 todo, 9529 // output in log 9530 noLines, 9531 noLines) 9532 9533 // load expectations for model: profiles_no_validation.go 9534 thisRun.AddExpectations("profiles_no_validation.go", []string{ 9535 `type ProfilesNoValidation []ProfileCfgsNoValidation`, 9536 `func (m ProfilesNoValidation) Validate(formats strfmt.Registry) error {`, 9537 ` for i := 0; i < len(m); i++ {`, 9538 ` if err := m[i].Validate(formats); err != nil {`, 9539 ` if ve, ok := err.(*errors.Validation); ok {`, 9540 ` return ve.ValidateName(strconv.Itoa(i)`, 9541 ` return errors.CompositeValidationError(res...`, 9542 }, 9543 // not expected 9544 todo, 9545 // output in log 9546 noLines, 9547 noLines) 9548 9549 } 9550 9551 func initFixture15365() { 9552 // testing fixture-1536-5.yaml with flatten but NOT expand (--skip-flatten) 9553 9554 f := newModelFixture("../fixtures/bugs/1536/fixture-1536-5.yaml", "param body with maps") 9555 thisRun := f.AddRun(false) 9556 9557 // load expectations for model: model_array_of_nullable.go 9558 thisRun.AddExpectations("model_array_of_nullable.go", []string{ 9559 `type ModelArrayOfNullable []*int64`, 9560 `func (m ModelArrayOfNullable) Validate(formats strfmt.Registry) error {`, 9561 ` for i := 0; i < len(m); i++ {`, 9562 // do we need Required when item is nullable? 9563 // nullable not required: 9564 ` if swag.IsZero(m[i]) {`, 9565 // nullable required: 9566 ` if err := validate.MinimumInt(strconv.Itoa(i), "body", *m[i], 0, false); err != nil {`, 9567 ` return errors.CompositeValidationError(res...`, 9568 }, 9569 // not expected 9570 todo, 9571 // output in log 9572 noLines, 9573 noLines) 9574 9575 // load expectations for model: model_map_of_nullable_primitive.go 9576 thisRun.AddExpectations("model_map_of_nullable_primitive.go", []string{ 9577 `type ModelMapOfNullablePrimitive map[string]*int64`, 9578 `func (m ModelMapOfNullablePrimitive) Validate(formats strfmt.Registry) error {`, 9579 ` for k := range m {`, 9580 // do we need Required when element is nullable? 9581 // nullable not required: 9582 ` if swag.IsZero(m[k]) {`, 9583 ` if err := validate.MinimumInt(k, "body", *m[k], 0, false); err != nil {`, 9584 ` return errors.CompositeValidationError(res...`, 9585 }, 9586 // not expected 9587 todo, 9588 // output in log 9589 noLines, 9590 noLines) 9591 9592 // load expectations for model: model_array_with_max.go 9593 thisRun.AddExpectations("model_array_with_max.go", []string{ 9594 `type ModelArrayWithMax []interface{`, 9595 `func (m ModelArrayWithMax) Validate(formats strfmt.Registry) error {`, 9596 ` iModelArrayWithMaxSize := int64(len(m)`, 9597 ` if err := validate.MaxItems("", "body", iModelArrayWithMaxSize, 10); err != nil {`, 9598 ` return errors.CompositeValidationError(res...`, 9599 }, 9600 // not expected 9601 todo, 9602 // output in log 9603 noLines, 9604 noLines) 9605 9606 // load expectations for model: model_array_of_x_nullable.go 9607 thisRun.AddExpectations("model_array_of_x_nullable.go", []string{ 9608 `type ModelArrayOfXNullable []*int64`, 9609 // do we need Required when item is nullable? 9610 // nullable not required: 9611 "func (m ModelArrayOfXNullable) Validate(formats strfmt.Registry) error {\n return nil\n}", 9612 // nullable required: 9613 }, 9614 // not expected 9615 todo, 9616 // output in log 9617 noLines, 9618 noLines) 9619 9620 // load expectations for model: model_array_of_nullable_format.go 9621 thisRun.AddExpectations("model_array_of_nullable_format.go", []string{ 9622 `type ModelArrayOfNullableFormat []*strfmt.UUID`, 9623 `func (m ModelArrayOfNullableFormat) Validate(formats strfmt.Registry) error {`, 9624 ` for i := 0; i < len(m); i++ {`, 9625 // do we need Required when item is nullable? 9626 // nullable not required: 9627 ` if swag.IsZero(m[i]) {`, 9628 // nullable required: 9629 ` if err := validate.FormatOf(strconv.Itoa(i), "body", "uuid", m[i].String(), formats); err != nil {`, 9630 ` return errors.CompositeValidationError(res...`, 9631 }, 9632 // not expected 9633 todo, 9634 // output in log 9635 noLines, 9636 noLines) 9637 9638 // load expectations for model: model_map_of_of_slice_of_nullable_primitive.go 9639 thisRun.AddExpectations("model_map_of_of_slice_of_nullable_primitive.go", []string{ 9640 `type ModelMapOfOfSliceOfNullablePrimitive map[string][]*int64`, 9641 `func (m ModelMapOfOfSliceOfNullablePrimitive) Validate(formats strfmt.Registry) error {`, 9642 ` for k := range m {`, 9643 // do we need Required when element is nullable? 9644 // nullable not required: 9645 ` for i := 0; i < len(m[k]); i++ {`, 9646 // do we need Required when item is nullable? 9647 // nullable not required: 9648 ` if err := validate.MinimumInt(k+"."+strconv.Itoa(i), "body", *m[k][i], 0, false); err != nil {`, 9649 ` return errors.CompositeValidationError(res...`, 9650 }, 9651 // not expected 9652 todo, 9653 // output in log 9654 noLines, 9655 noLines) 9656 9657 // load expectations for model: model_map_of_ref.go 9658 thisRun.AddExpectations("model_map_of_ref.go", []string{ 9659 `type ModelMapOfRef map[string]ModelArrayWithMax`, 9660 `func (m ModelMapOfRef) Validate(formats strfmt.Registry) error {`, 9661 ` for k := range m {`, 9662 ` if err := m[k].Validate(formats); err != nil {`, 9663 ` if ve, ok := err.(*errors.Validation); ok {`, 9664 ` return ve.ValidateName(k`, 9665 ` return errors.CompositeValidationError(res...`, 9666 }, 9667 // not expected 9668 todo, 9669 // output in log 9670 noLines, 9671 noLines) 9672 9673 // load expectations for model: model_array_of_format.go 9674 thisRun.AddExpectations("model_array_of_format.go", []string{ 9675 `type ModelArrayOfFormat []strfmt.UUID`, 9676 `func (m ModelArrayOfFormat) Validate(formats strfmt.Registry) error {`, 9677 ` for i := 0; i < len(m); i++ {`, 9678 ` if err := validate.FormatOf(strconv.Itoa(i), "body", "uuid", m[i].String(), formats); err != nil {`, 9679 ` return errors.CompositeValidationError(res...`, 9680 }, 9681 // not expected 9682 todo, 9683 // output in log 9684 noLines, 9685 noLines) 9686 9687 // load expectations for model: model_array_of_ref_no_validations.go 9688 thisRun.AddExpectations("model_array_of_ref_no_validations.go", []string{ 9689 `type ModelArrayOfRefNoValidations []ModelInterface`, 9690 // empty validation 9691 "func (m ModelArrayOfRefNoValidations) Validate(formats strfmt.Registry) error {\n return nil\n}", 9692 }, 9693 // not expected 9694 todo, 9695 // output in log 9696 noLines, 9697 noLines) 9698 9699 // load expectations for model: model_array_of_not_nullable.go 9700 thisRun.AddExpectations("model_array_of_not_nullable.go", []string{ 9701 `type ModelArrayOfNotNullable []int64`, 9702 `func (m ModelArrayOfNotNullable) Validate(formats strfmt.Registry) error {`, 9703 ` for i := 0; i < len(m); i++ {`, 9704 ` if err := validate.MinimumInt(strconv.Itoa(i), "body", m[i], 10, false); err != nil {`, 9705 ` return errors.CompositeValidationError(res...`, 9706 }, 9707 // not expected 9708 todo, 9709 // output in log 9710 noLines, 9711 noLines) 9712 9713 // load expectations for model: model_array_of_nullable_string.go 9714 thisRun.AddExpectations("model_array_of_nullable_string.go", []string{ 9715 `type ModelArrayOfNullableString []*string`, 9716 // do we need Required when item is nullable? 9717 // nullable not required: 9718 // empty validation 9719 "func (m ModelArrayOfNullableString) Validate(formats strfmt.Registry) error {\n return nil\n}", 9720 // nullable required: 9721 }, 9722 // not expected 9723 todo, 9724 // output in log 9725 noLines, 9726 noLines) 9727 9728 // load expectations for model: model_map_of_x_nullable_primitive.go 9729 thisRun.AddExpectations("model_map_of_x_nullable_primitive.go", []string{ 9730 `type ModelMapOfXNullablePrimitive map[string]*int64`, 9731 `func (m ModelMapOfXNullablePrimitive) Validate(formats strfmt.Registry) error {`, 9732 ` for k := range m {`, 9733 // do we need...? 9734 ` if swag.IsZero(m[k]) {`, 9735 ` if err := validate.MinimumInt(k, "body", *m[k], 100, false); err != nil {`, 9736 ` return errors.CompositeValidationError(res...`, 9737 }, 9738 // not expected 9739 todo, 9740 // output in log 9741 noLines, 9742 noLines) 9743 9744 // load expectations for model: model_array_of_not_nullable_string.go 9745 thisRun.AddExpectations("model_array_of_not_nullable_string.go", []string{ 9746 `type ModelArrayOfNotNullableString []string`, 9747 // empty validation 9748 "func (m ModelArrayOfNotNullableString) Validate(formats strfmt.Registry) error {\n return nil\n}", 9749 }, 9750 // not expected 9751 todo, 9752 // output in log 9753 noLines, 9754 noLines) 9755 9756 // load expectations for model: model_array_of_ref_slice_validations.go 9757 thisRun.AddExpectations("model_array_of_ref_slice_validations.go", []string{ 9758 `type ModelArrayOfRefSliceValidations []ModelInterface`, 9759 `func (m ModelArrayOfRefSliceValidations) Validate(formats strfmt.Registry) error {`, 9760 ` iModelArrayOfRefSliceValidationsSize := int64(len(m)`, 9761 ` if err := validate.MaxItems("", "body", iModelArrayOfRefSliceValidationsSize, 10); err != nil {`, 9762 ` return errors.CompositeValidationError(res...`, 9763 }, 9764 // not expected 9765 todo, 9766 // output in log 9767 noLines, 9768 noLines) 9769 9770 // load expectations for model: model_interface.go 9771 thisRun.AddExpectations("model_interface.go", []string{ 9772 `type ModelInterface interface{`, 9773 }, 9774 // not expected 9775 todo, 9776 // output in log 9777 noLines, 9778 noLines) 9779 9780 // load expectations for model: model_array_of_ref.go 9781 thisRun.AddExpectations("model_array_of_ref.go", []string{ 9782 `type ModelArrayOfRef []ModelArrayOfXNullable`, 9783 `func (m ModelArrayOfRef) Validate(formats strfmt.Registry) error {`, 9784 ` for i := 0; i < len(m); i++ {`, 9785 ` if err := m[i].Validate(formats); err != nil {`, 9786 ` if ve, ok := err.(*errors.Validation); ok {`, 9787 ` return ve.ValidateName(strconv.Itoa(i)`, 9788 ` return errors.CompositeValidationError(res...`, 9789 }, 9790 // not expected 9791 todo, 9792 // output in log 9793 noLines, 9794 noLines) 9795 } 9796 9797 func initFixture1548() { 9798 // testing fixture-1548.yaml with flatten 9799 9800 /* 9801 My App API: check that there is no format validation on Base64 types 9802 */ 9803 9804 f := newModelFixture("../fixtures/bugs/1548/fixture-1548.yaml", "My App API") 9805 thisRun := f.AddRun(false) 9806 9807 // load expectations for model: base64_alias.go 9808 thisRun.AddExpectations("base64_alias.go", []string{ 9809 `type Base64Alias strfmt.Base64`, 9810 `func (m *Base64Alias) UnmarshalJSON(b []byte) error {`, 9811 ` return ((*strfmt.Base64)(m)).UnmarshalJSON(b`, 9812 `func (m Base64Alias) MarshalJSON() ([]byte, error) {`, 9813 ` return (strfmt.Base64(m)).MarshalJSON(`, 9814 `func (m Base64Alias) Validate(formats strfmt.Registry) error {`, 9815 }, 9816 // not expected 9817 []string{"TODO", 9818 "validate.FormatOf(", 9819 `return errors.CompositeValidationError(res...`, 9820 }, 9821 // output in log 9822 noLines, 9823 noLines) 9824 9825 // load expectations for model: base64_map.go 9826 thisRun.AddExpectations("base64_map.go", []string{ 9827 `type Base64Map map[string]strfmt.Base64`, 9828 `func (m Base64Map) Validate(formats strfmt.Registry) error {`, 9829 ` for k := range m {`, 9830 ` if err := validate.MaxLength(k, "body", m[k].String(), 100); err != nil {`, 9831 ` return errors.CompositeValidationError(res...`, 9832 }, 9833 // not expected 9834 []string{"TODO", "validate.FormatOf("}, 9835 // output in log 9836 noLines, 9837 noLines) 9838 9839 // load expectations for model: base64_array.go 9840 thisRun.AddExpectations("base64_array.go", []string{ 9841 `type Base64Array []strfmt.Base64`, 9842 `func (m Base64Array) Validate(formats strfmt.Registry) error {`, 9843 }, 9844 // not expected 9845 []string{ 9846 "TODO", 9847 "validate.FormatOf(", 9848 ` for i := 0; i < len(m); i++ {`, 9849 ` return errors.CompositeValidationError(res...`, 9850 }, 9851 // output in log 9852 noLines, 9853 noLines) 9854 9855 // load expectations for model: base64_model.go 9856 thisRun.AddExpectations("base64_model.go", []string{ 9857 `type Base64Model struct {`, 9858 " Prop1 strfmt.Base64 `json:\"prop1,omitempty\"`", 9859 `func (m *Base64Model) Validate(formats strfmt.Registry) error {`, 9860 }, 9861 // not expected 9862 []string{ 9863 "TODO", 9864 "validate.FormatOf(", 9865 ` if err := m.validateProp1(formats); err != nil {`, 9866 `func (m *Base64Model) validateProp1(formats strfmt.Registry) error {`, 9867 }, 9868 // output in log 9869 noLines, 9870 noLines) 9871 } 9872 9873 func initFixtureSimpleTuple() { 9874 // testing fixture-simple-tuple.yaml with flatten 9875 9876 /* 9877 A basic test of for serialization generation for tuples and additionalItems. 9878 9879 */ 9880 f := newModelFixture("../fixtures/bugs/1571/fixture-simple-tuple.yaml", "fixture for serializing tuples") 9881 flattenRun := f.AddRun(false).WithMinimalFlatten(true) 9882 expandRun := f.AddRun(true) 9883 9884 // load expectations for model: tuple_thing_with_map_element.go 9885 flattenRun.AddExpectations("tuple_thing_with_map_element.go", []string{ 9886 `type TupleThingWithMapElement struct {`, 9887 " P0 map[string]string `json:\"-\"`", 9888 " P1 map[string]int64 `json:\"-\"`", 9889 " TupleThingWithMapElementItems []map[string]strfmt.Date `json:\"-\"`", 9890 `func (m *TupleThingWithMapElement) UnmarshalJSON(raw []byte) error {`, 9891 ` var stage1 []json.RawMessage`, 9892 ` buf := bytes.NewBuffer(raw`, 9893 ` dec := json.NewDecoder(buf`, 9894 ` dec.UseNumber(`, 9895 ` if err := dec.Decode(&stage1); err != nil {`, 9896 ` var lastIndex int`, 9897 ` if len(stage1) > 0 {`, 9898 ` var dataP0 map[string]string`, 9899 ` buf = bytes.NewBuffer(stage1[0]`, 9900 ` dec := json.NewDecoder(buf`, 9901 ` dec.UseNumber(`, 9902 ` if err := dec.Decode(&dataP0); err != nil {`, 9903 ` m.P0 = dataP0`, 9904 ` lastIndex = 0`, 9905 ` if len(stage1) > 1 {`, 9906 ` var dataP1 map[string]int64`, 9907 ` buf = bytes.NewBuffer(stage1[1]`, 9908 ` dec := json.NewDecoder(buf`, 9909 ` dec.UseNumber(`, 9910 ` if err := dec.Decode(&dataP1); err != nil {`, 9911 ` m.P1 = dataP1`, 9912 ` lastIndex = 1`, 9913 ` if len(stage1) > lastIndex+1 {`, 9914 ` for _, val := range stage1[lastIndex+1:] {`, 9915 ` var toadd map[string]strfmt.Date`, 9916 ` buf = bytes.NewBuffer(val`, 9917 ` dec := json.NewDecoder(buf`, 9918 ` dec.UseNumber(`, 9919 ` if err := dec.Decode(&toadd); err != nil {`, 9920 ` m.TupleThingWithMapElementItems = append(m.TupleThingWithMapElementItems, toadd`, 9921 `func (m TupleThingWithMapElement) MarshalJSON() ([]byte, error) {`, 9922 ` data := []interface{}{`, 9923 ` m.P0,`, 9924 ` m.P1,`, 9925 ` for _, v := range m.TupleThingWithMapElementItems {`, 9926 ` data = append(data, v`, 9927 ` return json.Marshal(data`, 9928 `func (m *TupleThingWithMapElement) Validate(formats strfmt.Registry) error {`, 9929 ` if err := m.validateP0(formats); err != nil {`, 9930 ` if err := m.validateP1(formats); err != nil {`, 9931 ` if err := m.validateTupleThingWithMapElementItems(formats); err != nil {`, 9932 ` return errors.CompositeValidationError(res...`, 9933 `func (m *TupleThingWithMapElement) validateP0(formats strfmt.Registry) error {`, 9934 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 9935 ` for k := range m.P0 {`, 9936 ` if err := validate.MaxLength("0"+"."+k, "body", m.P0[k], 10); err != nil {`, 9937 `func (m *TupleThingWithMapElement) validateP1(formats strfmt.Registry) error {`, 9938 ` if err := validate.Required("1", "body", m.P1); err != nil {`, 9939 ` for k := range m.P1 {`, 9940 ` if err := validate.MinimumInt("1"+"."+k, "body", m.P1[k], 10, false); err != nil {`, 9941 `func (m *TupleThingWithMapElement) validateTupleThingWithMapElementItems(formats strfmt.Registry) error {`, 9942 ` for i := range m.TupleThingWithMapElementItems {`, 9943 ` for k := range m.TupleThingWithMapElementItems[i] {`, 9944 ` if err := validate.FormatOf(strconv.Itoa(i+2)+"."+k, "body", "date", ` + 9945 `m.TupleThingWithMapElementItems[i][k].String(), formats); err != nil {`, 9946 }, 9947 // not expected 9948 todo, 9949 // output in log 9950 noLines, 9951 noLines) 9952 9953 expandRun.AddExpectations("tuple_thing_with_map_element.go", 9954 flattenRun.ExpectedFor("TupleThingWithMapElement").ExpectedLines, todo, noLines, noLines) 9955 9956 // load expectations for model: true_tuple_thing.go 9957 flattenRun.AddExpectations("true_tuple_thing.go", []string{ 9958 `type TrueTupleThing struct {`, 9959 " P0 *float64 `json:\"-\"`", 9960 " P1 *string `json:\"-\"`", 9961 " TrueTupleThingItems []interface{} `json:\"-\"`", 9962 `func (m *TrueTupleThing) UnmarshalJSON(raw []byte) error {`, 9963 ` var stage1 []json.RawMessage`, 9964 ` buf := bytes.NewBuffer(raw`, 9965 ` dec := json.NewDecoder(buf`, 9966 ` dec.UseNumber(`, 9967 ` if err := dec.Decode(&stage1); err != nil {`, 9968 ` var lastIndex int`, 9969 ` if len(stage1) > 0 {`, 9970 ` var dataP0 float64`, 9971 ` buf = bytes.NewBuffer(stage1[0]`, 9972 ` dec := json.NewDecoder(buf`, 9973 ` dec.UseNumber(`, 9974 ` if err := dec.Decode(&dataP0); err != nil {`, 9975 ` m.P0 = &dataP0`, 9976 ` lastIndex = 0`, 9977 ` if len(stage1) > 1 {`, 9978 ` var dataP1 string`, 9979 ` buf = bytes.NewBuffer(stage1[1]`, 9980 ` dec := json.NewDecoder(buf`, 9981 ` dec.UseNumber(`, 9982 ` if err := dec.Decode(&dataP1); err != nil {`, 9983 ` m.P1 = &dataP1`, 9984 ` lastIndex = 1`, 9985 ` if len(stage1) > lastIndex+1 {`, 9986 ` for _, val := range stage1[lastIndex+1:] {`, 9987 ` var toadd interface{`, 9988 ` buf = bytes.NewBuffer(val`, 9989 ` dec := json.NewDecoder(buf`, 9990 ` dec.UseNumber(`, 9991 ` if err := dec.Decode(&toadd); err != nil {`, 9992 ` m.TrueTupleThingItems = append(m.TrueTupleThingItems, toadd`, 9993 `func (m TrueTupleThing) MarshalJSON() ([]byte, error) {`, 9994 ` data := []interface{}{`, 9995 ` m.P0,`, 9996 ` m.P1,`, 9997 ` for _, v := range m.TrueTupleThingItems {`, 9998 ` data = append(data, v`, 9999 ` return json.Marshal(data`, 10000 `func (m *TrueTupleThing) Validate(formats strfmt.Registry) error {`, 10001 ` if err := m.validateP0(formats); err != nil {`, 10002 ` if err := m.validateP1(formats); err != nil {`, 10003 ` if err := m.validateTrueTupleThingItems(formats); err != nil {`, 10004 ` return errors.CompositeValidationError(res...`, 10005 `func (m *TrueTupleThing) validateP0(formats strfmt.Registry) error {`, 10006 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 10007 `func (m *TrueTupleThing) validateP1(formats strfmt.Registry) error {`, 10008 ` if err := validate.Required("1", "body", m.P1); err != nil {`, 10009 `func (m *TrueTupleThing) validateTrueTupleThingItems(formats strfmt.Registry) error {`, 10010 }, 10011 // not expected 10012 todo, 10013 // output in log 10014 noLines, 10015 noLines) 10016 10017 expandRun.AddExpectations("true_tuple_thing.go", 10018 flattenRun.ExpectedFor("TrueTupleThing").ExpectedLines, todo, noLines, noLines) 10019 10020 // load expectations for model: false_tuple_thing.go 10021 flattenRun.AddExpectations("false_tuple_thing.go", []string{ 10022 `type FalseTupleThing struct {`, 10023 " P0 *float64 `json:\"-\"`", 10024 " P1 *string `json:\"-\"`", 10025 `func (m *FalseTupleThing) UnmarshalJSON(raw []byte) error {`, 10026 ` var stage1 []json.RawMessage`, 10027 ` buf := bytes.NewBuffer(raw`, 10028 ` dec := json.NewDecoder(buf`, 10029 ` dec.UseNumber(`, 10030 ` if err := dec.Decode(&stage1); err != nil {`, 10031 ` if len(stage1) > 0 {`, 10032 ` var dataP0 float64`, 10033 ` buf = bytes.NewBuffer(stage1[0]`, 10034 ` dec := json.NewDecoder(buf`, 10035 ` dec.UseNumber(`, 10036 ` if err := dec.Decode(&dataP0); err != nil {`, 10037 ` m.P0 = &dataP0`, 10038 ` if len(stage1) > 1 {`, 10039 ` var dataP1 string`, 10040 ` buf = bytes.NewBuffer(stage1[1]`, 10041 ` dec := json.NewDecoder(buf`, 10042 ` dec.UseNumber(`, 10043 ` if err := dec.Decode(&dataP1); err != nil {`, 10044 ` m.P1 = &dataP1`, 10045 `func (m FalseTupleThing) MarshalJSON() ([]byte, error) {`, 10046 ` data := []interface{}{`, 10047 ` m.P0,`, 10048 ` m.P1,`, 10049 ` return json.Marshal(data`, 10050 `func (m *FalseTupleThing) Validate(formats strfmt.Registry) error {`, 10051 ` if err := m.validateP0(formats); err != nil {`, 10052 ` if err := m.validateP1(formats); err != nil {`, 10053 ` return errors.CompositeValidationError(res...`, 10054 `func (m *FalseTupleThing) validateP0(formats strfmt.Registry) error {`, 10055 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 10056 `func (m *FalseTupleThing) validateP1(formats strfmt.Registry) error {`, 10057 ` if err := validate.Required("1", "body", m.P1); err != nil {`, 10058 }, 10059 // not expected 10060 todo, 10061 // output in log 10062 noLines, 10063 noLines) 10064 10065 expandRun.AddExpectations("false_tuple_thing.go", 10066 flattenRun.ExpectedFor("FalseTupleThing").ExpectedLines, todo, noLines, noLines) 10067 10068 // load expectations for model: tuple_thing_with_not_nullable.go 10069 flattenRun.AddExpectations("tuple_thing_with_not_nullable.go", []string{ 10070 `type TupleThingWithNotNullable struct {`, 10071 " P0 string `json:\"-\"`", 10072 " P1 *int64 `json:\"-\"`", 10073 " TupleThingWithNotNullableItems []interface{} `json:\"-\"`", 10074 `func (m *TupleThingWithNotNullable) UnmarshalJSON(raw []byte) error {`, 10075 ` var stage1 []json.RawMessage`, 10076 ` buf := bytes.NewBuffer(raw`, 10077 ` dec := json.NewDecoder(buf`, 10078 ` dec.UseNumber(`, 10079 ` if err := dec.Decode(&stage1); err != nil {`, 10080 ` var lastIndex int`, 10081 ` if len(stage1) > 0 {`, 10082 ` var dataP0 string`, 10083 ` buf = bytes.NewBuffer(stage1[0]`, 10084 ` dec := json.NewDecoder(buf`, 10085 ` dec.UseNumber(`, 10086 ` if err := dec.Decode(&dataP0); err != nil {`, 10087 ` m.P0 = dataP0`, 10088 ` lastIndex = 0`, 10089 ` if len(stage1) > 1 {`, 10090 ` var dataP1 int64`, 10091 ` buf = bytes.NewBuffer(stage1[1]`, 10092 ` dec := json.NewDecoder(buf`, 10093 ` dec.UseNumber(`, 10094 ` if err := dec.Decode(&dataP1); err != nil {`, 10095 ` m.P1 = &dataP1`, 10096 ` lastIndex = 1`, 10097 ` if len(stage1) > lastIndex+1 {`, 10098 ` for _, val := range stage1[lastIndex+1:] {`, 10099 ` var toadd interface{`, 10100 ` buf = bytes.NewBuffer(val`, 10101 ` dec := json.NewDecoder(buf`, 10102 ` dec.UseNumber(`, 10103 ` if err := dec.Decode(&toadd); err != nil {`, 10104 ` m.TupleThingWithNotNullableItems = append(m.TupleThingWithNotNullableItems, toadd`, 10105 `func (m TupleThingWithNotNullable) MarshalJSON() ([]byte, error) {`, 10106 ` data := []interface{}{`, 10107 ` m.P0,`, 10108 ` m.P1,`, 10109 ` for _, v := range m.TupleThingWithNotNullableItems {`, 10110 ` data = append(data, v`, 10111 ` return json.Marshal(data`, 10112 `func (m *TupleThingWithNotNullable) Validate(formats strfmt.Registry) error {`, 10113 ` if err := m.validateP0(formats); err != nil {`, 10114 ` if err := m.validateP1(formats); err != nil {`, 10115 ` if err := m.validateTupleThingWithNotNullableItems(formats); err != nil {`, 10116 ` return errors.CompositeValidationError(res...`, 10117 `func (m *TupleThingWithNotNullable) validateP0(formats strfmt.Registry) error {`, 10118 ` if err := validate.RequiredString("0", "body", m.P0); err != nil {`, 10119 ` if err := validate.MaxLength("0", "body", m.P0, 10); err != nil {`, 10120 `func (m *TupleThingWithNotNullable) validateP1(formats strfmt.Registry) error {`, 10121 ` if err := validate.Required("1", "body", m.P1); err != nil {`, 10122 ` if err := validate.MaximumInt("1", "body", *m.P1, 10, false); err != nil {`, 10123 `func (m *TupleThingWithNotNullable) validateTupleThingWithNotNullableItems(formats strfmt.Registry) error {`, 10124 }, 10125 // not expected 10126 todo, 10127 // output in log 10128 noLines, 10129 noLines) 10130 10131 expandRun.AddExpectations("tuple_thing_with_not_nullable.go", 10132 flattenRun.ExpectedFor("TupleThingWithNotNullable").ExpectedLines, todo, noLines, noLines) 10133 10134 // load expectations for model: tuple_thing.go 10135 flattenRun.AddExpectations("tuple_thing.go", []string{ 10136 `type TupleThing struct {`, 10137 " P0 *string `json:\"-\"`", 10138 " P1 *string `json:\"-\"`", 10139 `func (m *TupleThing) UnmarshalJSON(raw []byte) error {`, 10140 ` var stage1 []json.RawMessage`, 10141 ` buf := bytes.NewBuffer(raw`, 10142 ` dec := json.NewDecoder(buf`, 10143 ` dec.UseNumber(`, 10144 ` if err := dec.Decode(&stage1); err != nil {`, 10145 ` if len(stage1) > 0 {`, 10146 ` var dataP0 string`, 10147 ` buf = bytes.NewBuffer(stage1[0]`, 10148 ` dec := json.NewDecoder(buf`, 10149 ` dec.UseNumber(`, 10150 ` if err := dec.Decode(&dataP0); err != nil {`, 10151 ` m.P0 = &dataP0`, 10152 ` if len(stage1) > 1 {`, 10153 ` var dataP1 string`, 10154 ` buf = bytes.NewBuffer(stage1[1]`, 10155 ` dec := json.NewDecoder(buf`, 10156 ` dec.UseNumber(`, 10157 ` if err := dec.Decode(&dataP1); err != nil {`, 10158 ` m.P1 = &dataP1`, 10159 `func (m TupleThing) MarshalJSON() ([]byte, error) {`, 10160 ` data := []interface{}{`, 10161 ` m.P0,`, 10162 ` m.P1,`, 10163 ` return json.Marshal(data`, 10164 `func (m *TupleThing) Validate(formats strfmt.Registry) error {`, 10165 ` if err := m.validateP0(formats); err != nil {`, 10166 ` if err := m.validateP1(formats); err != nil {`, 10167 ` return errors.CompositeValidationError(res...`, 10168 `var tupleThingTypeP0PropEnum []interface{`, 10169 ` var res []string`, 10170 " if err := json.Unmarshal([]byte(`[\"CONST1\",\"CONST2\"]`), &res); err != nil {", 10171 ` for _, v := range res {`, 10172 ` tupleThingTypeP0PropEnum = append(tupleThingTypeP0PropEnum, v`, 10173 ` TupleThingP0CONST1 string = "CONST1"`, 10174 ` TupleThingP0CONST2 string = "CONST2"`, 10175 `func (m *TupleThing) validateP0Enum(path, location string, value string) error {`, 10176 ` if err := validate.EnumCase(path, location, value, tupleThingTypeP0PropEnum, true); err != nil {`, 10177 `func (m *TupleThing) validateP0(formats strfmt.Registry) error {`, 10178 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 10179 ` if err := m.validateP0Enum("0", "body", *m.P0); err != nil {`, 10180 `var tupleThingTypeP1PropEnum []interface{`, 10181 ` var res []string`, 10182 " if err := json.Unmarshal([]byte(`[\"CONST3\",\"CONST4\"]`), &res); err != nil {", 10183 ` for _, v := range res {`, 10184 ` tupleThingTypeP1PropEnum = append(tupleThingTypeP1PropEnum, v`, 10185 ` TupleThingP1CONST3 string = "CONST3"`, 10186 ` TupleThingP1CONST4 string = "CONST4"`, 10187 `func (m *TupleThing) validateP1Enum(path, location string, value string) error {`, 10188 ` if err := validate.EnumCase(path, location, value, tupleThingTypeP1PropEnum, true); err != nil {`, 10189 `func (m *TupleThing) validateP1(formats strfmt.Registry) error {`, 10190 ` if err := validate.Required("1", "body", m.P1); err != nil {`, 10191 ` if err := m.validateP1Enum("1", "body", *m.P1); err != nil {`, 10192 }, 10193 // not expected 10194 todo, 10195 // output in log 10196 noLines, 10197 noLines) 10198 10199 expandRun.AddExpectations("tuple_thing.go", 10200 flattenRun.ExpectedFor("TupleThing").ExpectedLines, todo, noLines, noLines) 10201 10202 // load expectations for model: tuple_thing_with_additional_items.go 10203 flattenRun.AddExpectations("tuple_thing_with_additional_items.go", []string{ 10204 `type TupleThingWithAdditionalItems struct {`, 10205 " P0 *string `json:\"-\"`", 10206 " P1 *int64 `json:\"-\"`", 10207 " TupleThingWithAdditionalItemsItems []int64 `json:\"-\"`", 10208 `func (m *TupleThingWithAdditionalItems) UnmarshalJSON(raw []byte) error {`, 10209 ` var stage1 []json.RawMessage`, 10210 ` buf := bytes.NewBuffer(raw`, 10211 ` dec := json.NewDecoder(buf`, 10212 ` dec.UseNumber(`, 10213 ` if err := dec.Decode(&stage1); err != nil {`, 10214 ` var lastIndex int`, 10215 ` if len(stage1) > 0 {`, 10216 ` var dataP0 string`, 10217 ` buf = bytes.NewBuffer(stage1[0]`, 10218 ` dec := json.NewDecoder(buf`, 10219 ` dec.UseNumber(`, 10220 ` if err := dec.Decode(&dataP0); err != nil {`, 10221 ` m.P0 = &dataP0`, 10222 ` lastIndex = 0`, 10223 ` if len(stage1) > 1 {`, 10224 ` var dataP1 int64`, 10225 ` buf = bytes.NewBuffer(stage1[1]`, 10226 ` dec := json.NewDecoder(buf`, 10227 ` dec.UseNumber(`, 10228 ` if err := dec.Decode(&dataP1); err != nil {`, 10229 ` m.P1 = &dataP1`, 10230 ` lastIndex = 1`, 10231 ` if len(stage1) > lastIndex+1 {`, 10232 ` for _, val := range stage1[lastIndex+1:] {`, 10233 ` var toadd int64`, 10234 ` buf = bytes.NewBuffer(val`, 10235 ` dec := json.NewDecoder(buf`, 10236 ` dec.UseNumber(`, 10237 ` if err := dec.Decode(&toadd); err != nil {`, 10238 ` m.TupleThingWithAdditionalItemsItems = append(m.TupleThingWithAdditionalItemsItems, toadd`, 10239 `func (m TupleThingWithAdditionalItems) MarshalJSON() ([]byte, error) {`, 10240 ` data := []interface{}{`, 10241 ` m.P0,`, 10242 ` m.P1,`, 10243 ` for _, v := range m.TupleThingWithAdditionalItemsItems {`, 10244 ` data = append(data, v`, 10245 ` return json.Marshal(data`, 10246 `func (m *TupleThingWithAdditionalItems) Validate(formats strfmt.Registry) error {`, 10247 ` if err := m.validateP0(formats); err != nil {`, 10248 ` if err := m.validateP1(formats); err != nil {`, 10249 ` if err := m.validateTupleThingWithAdditionalItemsItems(formats); err != nil {`, 10250 ` return errors.CompositeValidationError(res...`, 10251 `func (m *TupleThingWithAdditionalItems) validateP0(formats strfmt.Registry) error {`, 10252 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 10253 `func (m *TupleThingWithAdditionalItems) validateP1(formats strfmt.Registry) error {`, 10254 ` if err := validate.Required("1", "body", m.P1); err != nil {`, 10255 ` if err := validate.MaximumInt("1", "body", *m.P1, 10, false); err != nil {`, 10256 `var tupleThingWithAdditionalItemsItemsEnum []interface{`, 10257 ` var res []int64`, 10258 " if err := json.Unmarshal([]byte(`[1,2]`), &res); err != nil {", 10259 ` for _, v := range res {`, 10260 ` tupleThingWithAdditionalItemsItemsEnum = append(tupleThingWithAdditionalItemsItemsEnum, v`, 10261 `func (m *TupleThingWithAdditionalItems) validateTupleThingWithAdditionalItemsItemsEnum(path,` + 10262 ` location string, value int64) error {`, 10263 ` if err := validate.EnumCase(path, location, value, tupleThingWithAdditionalItemsItemsEnum, true); err != nil {`, 10264 `func (m *TupleThingWithAdditionalItems) validateTupleThingWithAdditionalItemsItems(formats strfmt.Registry)` + 10265 ` error {`, 10266 ` for i := range m.TupleThingWithAdditionalItemsItems {`, 10267 ` if err := m.validateTupleThingWithAdditionalItemsItemsEnum(strconv.Itoa(i+2), "body", ` + 10268 `m.TupleThingWithAdditionalItemsItems[i]); err != nil {`, 10269 }, 10270 // not expected 10271 todo, 10272 // output in log 10273 noLines, 10274 noLines) 10275 10276 expandRun.AddExpectations("tuple_thing_with_additional_items.go", 10277 flattenRun.ExpectedFor("TupleThingWithAdditionalItems").ExpectedLines, todo, noLines, noLines) 10278 10279 // load expectations for model: tuple_thing_with_array_element.go 10280 flattenRun.AddExpectations("tuple_thing_with_array_element.go", []string{ 10281 `type TupleThingWithArrayElement struct {`, 10282 " P0 []string `json:\"-\"`", 10283 " P1 []int64 `json:\"-\"`", 10284 " TupleThingWithArrayElementItems [][]strfmt.Date `json:\"-\"`", 10285 `func (m *TupleThingWithArrayElement) UnmarshalJSON(raw []byte) error {`, 10286 ` var stage1 []json.RawMessage`, 10287 ` buf := bytes.NewBuffer(raw`, 10288 ` dec := json.NewDecoder(buf`, 10289 ` dec.UseNumber(`, 10290 ` if err := dec.Decode(&stage1); err != nil {`, 10291 ` var lastIndex int`, 10292 ` if len(stage1) > 0 {`, 10293 ` var dataP0 []string`, 10294 ` buf = bytes.NewBuffer(stage1[0]`, 10295 ` dec := json.NewDecoder(buf`, 10296 ` dec.UseNumber(`, 10297 ` if err := dec.Decode(&dataP0); err != nil {`, 10298 ` m.P0 = dataP0`, 10299 ` lastIndex = 0`, 10300 ` if len(stage1) > 1 {`, 10301 ` var dataP1 []int64`, 10302 ` buf = bytes.NewBuffer(stage1[1]`, 10303 ` dec := json.NewDecoder(buf`, 10304 ` dec.UseNumber(`, 10305 ` if err := dec.Decode(&dataP1); err != nil {`, 10306 ` m.P1 = dataP1`, 10307 ` lastIndex = 1`, 10308 ` if len(stage1) > lastIndex+1 {`, 10309 ` for _, val := range stage1[lastIndex+1:] {`, 10310 ` var toadd []strfmt.Date`, 10311 ` buf = bytes.NewBuffer(val`, 10312 ` dec := json.NewDecoder(buf`, 10313 ` dec.UseNumber(`, 10314 ` if err := dec.Decode(&toadd); err != nil {`, 10315 ` m.TupleThingWithArrayElementItems = append(m.TupleThingWithArrayElementItems, toadd`, 10316 `func (m TupleThingWithArrayElement) MarshalJSON() ([]byte, error) {`, 10317 ` data := []interface{}{`, 10318 ` m.P0,`, 10319 ` m.P1,`, 10320 ` for _, v := range m.TupleThingWithArrayElementItems {`, 10321 ` data = append(data, v`, 10322 ` return json.Marshal(data`, 10323 `func (m *TupleThingWithArrayElement) Validate(formats strfmt.Registry) error {`, 10324 ` if err := m.validateP0(formats); err != nil {`, 10325 ` if err := m.validateP1(formats); err != nil {`, 10326 ` if err := m.validateTupleThingWithArrayElementItems(formats); err != nil {`, 10327 ` return errors.CompositeValidationError(res...`, 10328 `func (m *TupleThingWithArrayElement) validateP0(formats strfmt.Registry) error {`, 10329 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 10330 ` iP0Size := int64(len(m.P0)`, 10331 ` if err := validate.MaxItems("0", "body", iP0Size, 10); err != nil {`, 10332 ` for i := 0; i < len(m.P0); i++ {`, 10333 ` if err := validate.MaxLength("0"+"."+strconv.Itoa(i), "body", m.P0[i], 10); err != nil {`, 10334 `func (m *TupleThingWithArrayElement) validateP1(formats strfmt.Registry) error {`, 10335 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 10336 ` iP1Size := int64(len(m.P1)`, 10337 ` if err := validate.MinItems("1", "body", iP1Size, 20); err != nil {`, 10338 ` for i := 0; i < len(m.P1); i++ {`, 10339 ` if err := validate.MinimumInt("1"+"."+strconv.Itoa(i), "body", m.P1[i], 10, false); err != nil {`, 10340 `func (m *TupleThingWithArrayElement) validateTupleThingWithArrayElementItems(formats strfmt.Registry) error {`, 10341 ` for i := range m.TupleThingWithArrayElementItems {`, 10342 ` for ii := 0; ii < len(m.TupleThingWithArrayElementItems[i]); ii++ {`, 10343 ` if err := validate.FormatOf(strconv.Itoa(i+2)+"."+strconv.Itoa(ii), "body", ` + 10344 `"date", m.TupleThingWithArrayElementItems[i][ii].String(), formats); err != nil {`, 10345 }, 10346 // not expected 10347 todo, 10348 // output in log 10349 noLines, 10350 noLines) 10351 10352 expandRun.AddExpectations("tuple_thing_with_array_element.go", 10353 flattenRun.ExpectedFor("TupleThingWithArrayElement").ExpectedLines, todo, noLines, noLines) 10354 10355 // load expectations for model: array_of_tuples.go 10356 flattenRun.AddExpectations("array_of_tuples.go", []string{ 10357 `type ArrayOfTuples []ArrayOfTuplesTuple0`, 10358 `func (m ArrayOfTuples) Validate(formats strfmt.Registry) error {`, 10359 ` iArrayOfTuplesSize := int64(len(m)`, 10360 ` if err := validate.MinItems("", "body", iArrayOfTuplesSize, 1); err != nil {`, 10361 ` for i := 0; i < len(m); i++ {`, 10362 ` if err := m[i].Validate(formats); err != nil {`, 10363 ` if ve, ok := err.(*errors.Validation); ok {`, 10364 ` return ve.ValidateName(strconv.Itoa(i)`, 10365 ` return errors.CompositeValidationError(res...`, 10366 `type ArrayOfTuplesTuple0 struct {`, 10367 " P0 []string `json:\"-\"`", 10368 " P1 []int64 `json:\"-\"`", 10369 " ArrayOfTuplesTuple0Items [][]strfmt.Date `json:\"-\"`", 10370 `func (m *ArrayOfTuplesTuple0) UnmarshalJSON(raw []byte) error {`, 10371 ` var stage1 []json.RawMessage`, 10372 ` buf := bytes.NewBuffer(raw`, 10373 ` dec := json.NewDecoder(buf`, 10374 ` dec.UseNumber(`, 10375 ` if err := dec.Decode(&stage1); err != nil {`, 10376 ` var lastIndex int`, 10377 ` if len(stage1) > 0 {`, 10378 ` var dataP0 []string`, 10379 ` buf = bytes.NewBuffer(stage1[0]`, 10380 ` dec := json.NewDecoder(buf`, 10381 ` dec.UseNumber(`, 10382 ` if err := dec.Decode(&dataP0); err != nil {`, 10383 ` m.P0 = dataP0`, 10384 ` lastIndex = 0`, 10385 ` if len(stage1) > 1 {`, 10386 ` var dataP1 []int64`, 10387 ` buf = bytes.NewBuffer(stage1[1]`, 10388 ` dec := json.NewDecoder(buf`, 10389 ` dec.UseNumber(`, 10390 ` if err := dec.Decode(&dataP1); err != nil {`, 10391 ` m.P1 = dataP1`, 10392 ` lastIndex = 1`, 10393 ` if len(stage1) > lastIndex+1 {`, 10394 ` for _, val := range stage1[lastIndex+1:] {`, 10395 ` var toadd []strfmt.Date`, 10396 ` buf = bytes.NewBuffer(val`, 10397 ` dec := json.NewDecoder(buf`, 10398 ` dec.UseNumber(`, 10399 ` if err := dec.Decode(&toadd); err != nil {`, 10400 ` m.ArrayOfTuplesTuple0Items = append(m.ArrayOfTuplesTuple0Items, toadd`, 10401 `func (m ArrayOfTuplesTuple0) MarshalJSON() ([]byte, error) {`, 10402 ` data := []interface{}{`, 10403 ` m.P0,`, 10404 ` m.P1,`, 10405 ` for _, v := range m.ArrayOfTuplesTuple0Items {`, 10406 ` data = append(data, v`, 10407 ` return json.Marshal(data`, 10408 `func (m *ArrayOfTuplesTuple0) Validate(formats strfmt.Registry) error {`, 10409 ` if err := m.validateP0(formats); err != nil {`, 10410 ` if err := m.validateP1(formats); err != nil {`, 10411 ` if err := m.validateArrayOfTuplesTuple0Items(formats); err != nil {`, 10412 ` return errors.CompositeValidationError(res...`, 10413 `func (m *ArrayOfTuplesTuple0) validateP0(formats strfmt.Registry) error {`, 10414 ` if err := validate.Required("P0", "body", m.P0); err != nil {`, 10415 ` iP0Size := int64(len(m.P0)`, 10416 ` if err := validate.MaxItems("P0", "body", iP0Size, 10); err != nil {`, 10417 ` for i := 0; i < len(m.P0); i++ {`, 10418 ` if err := validate.MaxLength("P0"+"."+strconv.Itoa(i), "body", m.P0[i], 10); err != nil {`, 10419 `func (m *ArrayOfTuplesTuple0) validateP1(formats strfmt.Registry) error {`, 10420 ` if err := validate.Required("P0", "body", m.P0); err != nil {`, 10421 ` iP1Size := int64(len(m.P1)`, 10422 ` if err := validate.MinItems("P1", "body", iP1Size, 20); err != nil {`, 10423 ` for i := 0; i < len(m.P1); i++ {`, 10424 ` if err := validate.MinimumInt("P1"+"."+strconv.Itoa(i), ` + 10425 `"body", m.P1[i], 10, false); err != nil {`, 10426 `func (m *ArrayOfTuplesTuple0) validateArrayOfTuplesTuple0Items(formats strfmt.Registry) error {`, 10427 ` for i := range m.ArrayOfTuplesTuple0Items {`, 10428 ` for ii := 0; ii < len(m.ArrayOfTuplesTuple0Items[i]); ii++ {`, 10429 ` if err := validate.FormatOf(strconv.Itoa(i)+"."+strconv.Itoa(ii), ` + 10430 `"body", "date", m.ArrayOfTuplesTuple0Items[i][ii].String(), formats); err != nil {`, 10431 }, 10432 // not expected 10433 todo, 10434 // output in log 10435 noLines, 10436 noLines) 10437 10438 expandRun.AddExpectations("array_of_tuples.go", 10439 flattenRun.ExpectedFor("ArrayOfTuples").ExpectedLines, todo, noLines, noLines) 10440 10441 // load expectations for model: tuple_thing_with_object_element.go 10442 flattenRun.AddExpectations("tuple_thing_with_object_element.go", []string{ 10443 `type TupleThingWithObjectElement struct {`, 10444 " P0 *TupleThingWithObjectElementItems0 `json:\"-\"`", 10445 " P1 map[string]int64 `json:\"-\"`", 10446 " TupleThingWithObjectElementItems []map[string]strfmt.Date `json:\"-\"`", 10447 `func (m *TupleThingWithObjectElement) UnmarshalJSON(raw []byte) error {`, 10448 ` var stage1 []json.RawMessage`, 10449 ` buf := bytes.NewBuffer(raw`, 10450 ` dec := json.NewDecoder(buf`, 10451 ` dec.UseNumber(`, 10452 ` if err := dec.Decode(&stage1); err != nil {`, 10453 ` var lastIndex int`, 10454 ` if len(stage1) > 0 {`, 10455 ` var dataP0 TupleThingWithObjectElementItems0`, 10456 ` buf = bytes.NewBuffer(stage1[0]`, 10457 ` dec := json.NewDecoder(buf`, 10458 ` dec.UseNumber(`, 10459 ` if err := dec.Decode(&dataP0); err != nil {`, 10460 ` m.P0 = &dataP0`, 10461 ` lastIndex = 0`, 10462 ` if len(stage1) > 1 {`, 10463 ` var dataP1 map[string]int64`, 10464 ` buf = bytes.NewBuffer(stage1[1]`, 10465 ` dec := json.NewDecoder(buf`, 10466 ` dec.UseNumber(`, 10467 ` if err := dec.Decode(&dataP1); err != nil {`, 10468 ` m.P1 = dataP1`, 10469 ` lastIndex = 1`, 10470 ` if len(stage1) > lastIndex+1 {`, 10471 ` for _, val := range stage1[lastIndex+1:] {`, 10472 ` var toadd map[string]strfmt.Date`, 10473 ` buf = bytes.NewBuffer(val`, 10474 ` dec := json.NewDecoder(buf`, 10475 ` dec.UseNumber(`, 10476 ` if err := dec.Decode(&toadd); err != nil {`, 10477 ` m.TupleThingWithObjectElementItems = append(m.TupleThingWithObjectElementItems, toadd`, 10478 `func (m TupleThingWithObjectElement) MarshalJSON() ([]byte, error) {`, 10479 ` data := []interface{}{`, 10480 ` m.P0,`, 10481 ` m.P1,`, 10482 ` for _, v := range m.TupleThingWithObjectElementItems {`, 10483 ` data = append(data, v`, 10484 ` return json.Marshal(data`, 10485 `func (m *TupleThingWithObjectElement) Validate(formats strfmt.Registry) error {`, 10486 ` if err := m.validateP0(formats); err != nil {`, 10487 ` if err := m.validateP1(formats); err != nil {`, 10488 ` if err := m.validateTupleThingWithObjectElementItems(formats); err != nil {`, 10489 ` return errors.CompositeValidationError(res...`, 10490 `func (m *TupleThingWithObjectElement) validateP0(formats strfmt.Registry) error {`, 10491 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 10492 ` if m.P0 != nil {`, 10493 ` if err := m.P0.Validate(formats); err != nil {`, 10494 ` if ve, ok := err.(*errors.Validation); ok {`, 10495 ` return ve.ValidateName("0"`, 10496 `func (m *TupleThingWithObjectElement) validateP1(formats strfmt.Registry) error {`, 10497 `if err := validate.Required("1", "body", m.P1); err != nil {`, 10498 ` for k := range m.P1 {`, 10499 ` if err := validate.MinimumInt("1"+"."+k, "body", m.P1[k], 10, false); err != nil {`, 10500 `func (m *TupleThingWithObjectElement) validateTupleThingWithObjectElementItems(formats strfmt.Registry)` + 10501 ` error {`, 10502 ` for i := range m.TupleThingWithObjectElementItems {`, 10503 ` for k := range m.TupleThingWithObjectElementItems[i] {`, 10504 ` if err := validate.FormatOf(strconv.Itoa(i+2)+"."+k, "body", "date", ` + 10505 `m.TupleThingWithObjectElementItems[i][k].String(), formats); err != nil {`, 10506 `type TupleThingWithObjectElementItems0 struct {`, 10507 " Prop1 string `json:\"prop1,omitempty\"`", 10508 `func (m *TupleThingWithObjectElementItems0) Validate(formats strfmt.Registry) error {`, 10509 ` if err := m.validateProp1(formats); err != nil {`, 10510 ` return errors.CompositeValidationError(res...`, 10511 `func (m *TupleThingWithObjectElementItems0) validateProp1(formats strfmt.Registry) error {`, 10512 ` if swag.IsZero(m.Prop1) {`, 10513 ` if err := validate.MaxLength("prop1", "body", m.Prop1, 10); err != nil {`, 10514 }, 10515 // not expected 10516 todo, 10517 // output in log 10518 noLines, 10519 noLines) 10520 10521 expandRun.AddExpectations("tuple_thing_with_object_element.go", 10522 flattenRun.ExpectedFor("TupleThingWithObjectElement").ExpectedLines, todo, noLines, noLines) 10523 10524 // load expectations for model: tuple_thing_with_no_additional_items.go 10525 flattenRun.AddExpectations("tuple_thing_with_no_additional_items.go", []string{ 10526 `type TupleThingWithNoAdditionalItems struct {`, 10527 " P0 *string `json:\"-\"`", 10528 " P1 *int64 `json:\"-\"`", 10529 `func (m *TupleThingWithNoAdditionalItems) UnmarshalJSON(raw []byte) error {`, 10530 ` var stage1 []json.RawMessage`, 10531 ` buf := bytes.NewBuffer(raw`, 10532 ` dec := json.NewDecoder(buf`, 10533 ` dec.UseNumber(`, 10534 ` if err := dec.Decode(&stage1); err != nil {`, 10535 ` if len(stage1) > 0 {`, 10536 ` var dataP0 string`, 10537 ` buf = bytes.NewBuffer(stage1[0]`, 10538 ` dec := json.NewDecoder(buf`, 10539 ` dec.UseNumber(`, 10540 ` if err := dec.Decode(&dataP0); err != nil {`, 10541 ` m.P0 = &dataP0`, 10542 ` if len(stage1) > 1 {`, 10543 ` var dataP1 int64`, 10544 ` buf = bytes.NewBuffer(stage1[1]`, 10545 ` dec := json.NewDecoder(buf`, 10546 ` dec.UseNumber(`, 10547 ` if err := dec.Decode(&dataP1); err != nil {`, 10548 ` m.P1 = &dataP1`, 10549 `func (m TupleThingWithNoAdditionalItems) MarshalJSON() ([]byte, error) {`, 10550 ` data := []interface{}{`, 10551 ` m.P0,`, 10552 ` m.P1,`, 10553 ` return json.Marshal(data`, 10554 `func (m *TupleThingWithNoAdditionalItems) Validate(formats strfmt.Registry) error {`, 10555 ` if err := m.validateP0(formats); err != nil {`, 10556 ` if err := m.validateP1(formats); err != nil {`, 10557 ` return errors.CompositeValidationError(res...`, 10558 `func (m *TupleThingWithNoAdditionalItems) validateP0(formats strfmt.Registry) error {`, 10559 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 10560 `func (m *TupleThingWithNoAdditionalItems) validateP1(formats strfmt.Registry) error {`, 10561 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 10562 ` if err := validate.MaximumInt("1", "body", *m.P1, 10, false); err != nil {`, 10563 }, 10564 // not expected 10565 todo, 10566 // output in log 10567 noLines, 10568 noLines) 10569 10570 expandRun.AddExpectations("tuple_thing_with_no_additional_items.go", 10571 flattenRun.ExpectedFor("TupleThingWithNoAdditionalItems").ExpectedLines, todo, noLines, noLines) 10572 10573 // load expectations for model: tuple_thing_with_any_additional_items.go 10574 flattenRun.AddExpectations("tuple_thing_with_any_additional_items.go", []string{ 10575 `type TupleThingWithAnyAdditionalItems struct {`, 10576 " P0 *string `json:\"-\"`", 10577 " P1 *int64 `json:\"-\"`", 10578 " TupleThingWithAnyAdditionalItemsItems []interface{} `json:\"-\"`", 10579 `func (m *TupleThingWithAnyAdditionalItems) UnmarshalJSON(raw []byte) error {`, 10580 ` var stage1 []json.RawMessage`, 10581 ` buf := bytes.NewBuffer(raw`, 10582 ` dec := json.NewDecoder(buf`, 10583 ` dec.UseNumber(`, 10584 ` if err := dec.Decode(&stage1); err != nil {`, 10585 ` var lastIndex int`, 10586 ` if len(stage1) > 0 {`, 10587 ` var dataP0 string`, 10588 ` buf = bytes.NewBuffer(stage1[0]`, 10589 ` dec := json.NewDecoder(buf`, 10590 ` dec.UseNumber(`, 10591 ` if err := dec.Decode(&dataP0); err != nil {`, 10592 ` m.P0 = &dataP0`, 10593 ` lastIndex = 0`, 10594 ` if len(stage1) > 1 {`, 10595 ` var dataP1 int64`, 10596 ` buf = bytes.NewBuffer(stage1[1]`, 10597 ` dec := json.NewDecoder(buf`, 10598 ` dec.UseNumber(`, 10599 ` if err := dec.Decode(&dataP1); err != nil {`, 10600 ` m.P1 = &dataP1`, 10601 ` lastIndex = 1`, 10602 ` if len(stage1) > lastIndex+1 {`, 10603 ` for _, val := range stage1[lastIndex+1:] {`, 10604 ` var toadd interface{`, 10605 ` buf = bytes.NewBuffer(val`, 10606 ` dec := json.NewDecoder(buf`, 10607 ` dec.UseNumber(`, 10608 ` if err := dec.Decode(&toadd); err != nil {`, 10609 ` m.TupleThingWithAnyAdditionalItemsItems = append(m.TupleThingWithAnyAdditionalItemsItems, toadd`, 10610 `func (m TupleThingWithAnyAdditionalItems) MarshalJSON() ([]byte, error) {`, 10611 ` data := []interface{}{`, 10612 ` m.P0,`, 10613 ` m.P1,`, 10614 ` for _, v := range m.TupleThingWithAnyAdditionalItemsItems {`, 10615 ` data = append(data, v`, 10616 ` return json.Marshal(data`, 10617 `func (m *TupleThingWithAnyAdditionalItems) Validate(formats strfmt.Registry) error {`, 10618 ` if err := m.validateP0(formats); err != nil {`, 10619 ` if err := m.validateP1(formats); err != nil {`, 10620 ` if err := m.validateTupleThingWithAnyAdditionalItemsItems(formats); err != nil {`, 10621 ` return errors.CompositeValidationError(res...`, 10622 `func (m *TupleThingWithAnyAdditionalItems) validateP0(formats strfmt.Registry) error {`, 10623 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 10624 ` if err := validate.MaxLength("0", "body", *m.P0, 10); err != nil {`, 10625 `func (m *TupleThingWithAnyAdditionalItems) validateP1(formats strfmt.Registry) error {`, 10626 ` if err := validate.Required("0", "body", m.P0); err != nil {`, 10627 ` if err := validate.MaximumInt("1", "body", *m.P1, 10, false); err != nil {`, 10628 `func (m *TupleThingWithAnyAdditionalItems) ` + 10629 `validateTupleThingWithAnyAdditionalItemsItems(formats strfmt.Registry) error {`, 10630 }, 10631 // not expected 10632 todo, 10633 // output in log 10634 noLines, 10635 noLines) 10636 10637 expandRun.AddExpectations("tuple_thing_with_any_additional_items.go", 10638 flattenRun.ExpectedFor("TupleThingWithAnyAdditionalItems").ExpectedLines, todo, noLines, noLines) 10639 } 10640 10641 func initFixtureDeepMaps() { 10642 // testing fixture-deepMaps.yaml with minimal flatten 10643 10644 f := newModelFixture("../fixtures/enhancements/1572/fixture-deepMaps.yaml", "issue 1572 - deep maps") 10645 thisRun := f.AddRun(false).WithMinimalFlatten(true) 10646 10647 // load expectations for model: model_object_vanilla.go 10648 thisRun.AddExpectations("model_object_vanilla.go", []string{ 10649 `type ModelObjectVanilla struct {`, 10650 " Prop0 *ModelSanity `json:\"prop0,omitempty\"`", 10651 " Prop1 *ModelSanity `json:\"prop1\"`", 10652 " Prop2 []*ModelSanity `json:\"prop2\"`", 10653 " Prop3 *ModelSanity `json:\"prop3,omitempty\"`", 10654 " Prop4 map[string]ModelSanity `json:\"prop4,omitempty\"`", 10655 " Prop5 int64 `json:\"prop5,omitempty\"`", 10656 " ModelObjectVanilla map[string]map[string]map[string]ModelSanity `json:\"-\"`", 10657 `func (m *ModelObjectVanilla) Validate(formats strfmt.Registry) error {`, 10658 ` if err := m.validateProp0(formats); err != nil {`, 10659 ` if err := m.validateProp1(formats); err != nil {`, 10660 ` if err := m.validateProp2(formats); err != nil {`, 10661 ` if err := m.validateProp3(formats); err != nil {`, 10662 ` if err := m.validateProp4(formats); err != nil {`, 10663 ` for k := range m.ModelObjectVanilla {`, 10664 ` for kk := range m.ModelObjectVanilla[k] {`, 10665 ` for kkk := range m.ModelObjectVanilla[k][kk] {`, 10666 ` if err := validate.Required(k+"."+kk+"."+kkk, "body",` + 10667 ` m.ModelObjectVanilla[k][kk][kkk]); err != nil {`, 10668 ` if val, ok := m.ModelObjectVanilla[k][kk][kkk]; ok {`, 10669 ` if err := val.Validate(formats); err != nil {`, 10670 ` return errors.CompositeValidationError(res...`, 10671 `func (m *ModelObjectVanilla) validateProp0(formats strfmt.Registry) error {`, 10672 ` if swag.IsZero(m.Prop0) {`, 10673 ` if m.Prop0 != nil {`, 10674 ` if err := m.Prop0.Validate(formats); err != nil {`, 10675 ` if ve, ok := err.(*errors.Validation); ok {`, 10676 ` return ve.ValidateName("prop0"`, 10677 `func (m *ModelObjectVanilla) validateProp1(formats strfmt.Registry) error {`, 10678 ` if err := validate.Required("prop1", "body", m.Prop1); err != nil {`, 10679 ` if m.Prop1 != nil {`, 10680 ` if err := m.Prop1.Validate(formats); err != nil {`, 10681 ` if ve, ok := err.(*errors.Validation); ok {`, 10682 ` return ve.ValidateName("prop1"`, 10683 `func (m *ModelObjectVanilla) validateProp2(formats strfmt.Registry) error {`, 10684 ` if swag.IsZero(m.Prop2) {`, 10685 ` for i := 0; i < len(m.Prop2); i++ {`, 10686 ` if swag.IsZero(m.Prop2[i]) {`, 10687 ` if m.Prop2[i] != nil {`, 10688 ` if err := m.Prop2[i].Validate(formats); err != nil {`, 10689 ` if ve, ok := err.(*errors.Validation); ok {`, 10690 ` return ve.ValidateName("prop2" + "." + strconv.Itoa(i)`, 10691 `func (m *ModelObjectVanilla) validateProp3(formats strfmt.Registry) error {`, 10692 ` if swag.IsZero(m.Prop3) {`, 10693 ` if m.Prop3 != nil {`, 10694 ` if err := m.Prop3.Validate(formats); err != nil {`, 10695 ` if ve, ok := err.(*errors.Validation); ok {`, 10696 ` return ve.ValidateName("prop3"`, 10697 `func (m *ModelObjectVanilla) validateProp4(formats strfmt.Registry) error {`, 10698 ` if swag.IsZero(m.Prop4) {`, 10699 ` for k := range m.Prop4 {`, 10700 ` if err := validate.Required("prop4"+"."+k, "body", m.Prop4[k]); err != nil {`, 10701 ` if val, ok := m.Prop4[k]; ok {`, 10702 ` if err := val.Validate(formats); err != nil {`, 10703 }, 10704 // not expected 10705 todo, 10706 // output in log 10707 noLines, 10708 noLines) 10709 10710 // load expectations for model: model_sanity.go 10711 thisRun.AddExpectations("model_sanity.go", []string{ 10712 `type ModelSanity struct {`, 10713 " PropA string `json:\"propA,omitempty\"`", 10714 " PropB *string `json:\"propB\"`", 10715 `func (m *ModelSanity) Validate(formats strfmt.Registry) error {`, 10716 ` if err := m.validatePropB(formats); err != nil {`, 10717 ` return errors.CompositeValidationError(res...`, 10718 `func (m *ModelSanity) validatePropB(formats strfmt.Registry) error {`, 10719 ` if err := validate.Required("propB", "body", m.PropB); err != nil {`, 10720 }, 10721 // not expected 10722 todo, 10723 // output in log 10724 noLines, 10725 noLines) 10726 } 10727 10728 func initFixture1617() { 10729 // testing fixture-1617.yaml with flatten and expand (--skip-flatten) 10730 10731 f := newModelFixture("../fixtures/bugs/1617/fixture-1617.yaml", "aaa") 10732 thisRun := f.AddRun(false).WithMinimalFlatten(true) 10733 10734 // load expectations for model: artifact_info.go 10735 thisRun.AddExpectations("artifact_info.go", []string{ 10736 `type ArtifactInfo struct {`, 10737 ` ArtifactDescription`, 10738 " Path ArtifactPath `json:\"Path,omitempty\"`", 10739 " Status ArtifactStatus `json:\"Status,omitempty\"`", 10740 " Timestamp strfmt.DateTime `json:\"Timestamp,omitempty\"`", 10741 `func (m *ArtifactInfo) UnmarshalJSON(raw []byte) error {`, 10742 ` var aO0 ArtifactDescription`, 10743 ` if err := swag.ReadJSON(raw, &aO0); err != nil {`, 10744 ` m.ArtifactDescription = aO0`, 10745 ` var propsArtifactInfo struct {`, 10746 " Path ArtifactPath `json:\"Path,omitempty\"`", 10747 " Status ArtifactStatus `json:\"Status,omitempty\"`", 10748 " Timestamp strfmt.DateTime `json:\"Timestamp,omitempty\"`", 10749 ` if err := swag.ReadJSON(raw, &propsArtifactInfo); err != nil {`, 10750 ` m.Path = propsArtifactInfo.Path`, 10751 ` m.Status = propsArtifactInfo.Status`, 10752 ` m.Timestamp = propsArtifactInfo.Timestamp`, 10753 `func (m ArtifactInfo) MarshalJSON() ([]byte, error) {`, 10754 ` _parts := make([][]byte, 0, 1`, 10755 ` aO0, err := swag.WriteJSON(m.ArtifactDescription`, 10756 ` if err != nil {`, 10757 ` return nil, err`, 10758 ` _parts = append(_parts, aO0`, 10759 ` var propsArtifactInfo struct {`, 10760 " Path ArtifactPath `json:\"Path,omitempty\"`", 10761 " Status ArtifactStatus `json:\"Status,omitempty\"`", 10762 " Timestamp strfmt.DateTime `json:\"Timestamp,omitempty\"`", 10763 ` propsArtifactInfo.Path = m.Path`, 10764 ` propsArtifactInfo.Status = m.Status`, 10765 ` propsArtifactInfo.Timestamp = m.Timestamp`, 10766 ` jsonDataPropsArtifactInfo, errArtifactInfo := swag.WriteJSON(propsArtifactInfo`, 10767 ` if errArtifactInfo != nil {`, 10768 ` return nil, errArtifactInfo`, 10769 ` _parts = append(_parts, jsonDataPropsArtifactInfo`, 10770 ` return swag.ConcatJSON(_parts...), nil`, 10771 `func (m *ArtifactInfo) Validate(formats strfmt.Registry) error {`, 10772 ` if err := m.ArtifactDescription.Validate(formats); err != nil {`, 10773 ` if err := m.validatePath(formats); err != nil {`, 10774 ` if err := m.validateStatus(formats); err != nil {`, 10775 ` if err := m.validateTimestamp(formats); err != nil {`, 10776 ` return errors.CompositeValidationError(res...`, 10777 `func (m *ArtifactInfo) validatePath(formats strfmt.Registry) error {`, 10778 ` if swag.IsZero(m.Path) {`, 10779 ` if err := m.Path.Validate(formats); err != nil {`, 10780 ` if ve, ok := err.(*errors.Validation); ok {`, 10781 ` return ve.ValidateName("Path"`, 10782 `func (m *ArtifactInfo) validateStatus(formats strfmt.Registry) error {`, 10783 ` if swag.IsZero(m.Status) {`, 10784 ` if err := m.Status.Validate(formats); err != nil {`, 10785 ` if ve, ok := err.(*errors.Validation); ok {`, 10786 ` return ve.ValidateName("Status"`, 10787 `func (m *ArtifactInfo) validateTimestamp(formats strfmt.Registry) error {`, 10788 ` if swag.IsZero(m.Timestamp) {`, 10789 ` if err := validate.FormatOf("Timestamp", "body", "date-time", m.Timestamp.String(), formats); err != nil {`, 10790 `func (m *ArtifactInfo) MarshalBinary() ([]byte, error) {`, 10791 ` if m == nil {`, 10792 ` return nil, nil`, 10793 ` return swag.WriteJSON(m`, 10794 `func (m *ArtifactInfo) UnmarshalBinary(b []byte) error {`, 10795 ` var res ArtifactInfo`, 10796 ` if err := swag.ReadJSON(b, &res); err != nil {`, 10797 ` *m = res`, 10798 }, 10799 // not expected 10800 todo, 10801 // output in log 10802 noLines, 10803 noLines) 10804 } 10805 10806 func initFixtureRealiasedTypes() { 10807 /* 10808 realiased types 10809 */ 10810 10811 f := newModelFixture("../fixtures/bugs/1260/fixture-realiased-types.yaml", "test type realiasing") 10812 thisRun := f.AddRun(false).WithMinimalFlatten(true) 10813 10814 // load expectations for model: g1.go 10815 thisRun.AddExpectations("g1.go", []string{ 10816 `type G1 struct {`, 10817 " Prop1 int64 `json:\"prop1,omitempty\"`", 10818 // empty validation 10819 "func (m *G1) Validate(formats strfmt.Registry) error {\n return nil\n}", 10820 }, 10821 // not expected 10822 todo, 10823 // output in log 10824 noLines, 10825 noLines) 10826 10827 // load expectations for model: e2v.go 10828 thisRun.AddExpectations("e2v.go", []string{ 10829 `type E2v = E0v`, 10830 }, 10831 // not expected 10832 todo, 10833 // output in log 10834 noLines, 10835 noLines) 10836 10837 // load expectations for model: a1v.go 10838 thisRun.AddExpectations("a1v.go", []string{ 10839 `type A1v []int64`, 10840 `func (m A1v) Validate(formats strfmt.Registry) error {`, 10841 ` iA1vSize := int64(len(m)`, 10842 ` if err := validate.MaxItems("", "body", iA1vSize, 100); err != nil {`, 10843 ` for i := 0; i < len(m); i++ {`, 10844 ` if err := validate.MaximumInt(strconv.Itoa(i), "body", m[i], 100, false); err != nil {`, 10845 ` return errors.CompositeValidationError(res...`, 10846 }, 10847 // not expected 10848 todo, 10849 // output in log 10850 noLines, 10851 noLines) 10852 10853 // load expectations for model: f2v.go 10854 thisRun.AddExpectations("f2v.go", []string{ 10855 `type F2v = F0v`, 10856 }, 10857 // not expected 10858 todo, 10859 // output in log 10860 noLines, 10861 noLines) 10862 10863 // load expectations for model: hsubtype1.go 10864 thisRun.AddExpectations("hsubtype1.go", []string{ 10865 `type Hsubtype1 struct {`, 10866 ` h1p1Field string`, 10867 ` h1p2Field strfmt.Date`, 10868 " Hsp1 uint32 `json:\"hsp1,omitempty\"`", 10869 `func (m *Hsubtype1) H1p1() string {`, 10870 ` return m.h1p1Field`, 10871 `func (m *Hsubtype1) SetH1p1(val string) {`, 10872 ` m.h1p1Field = val`, 10873 `func (m *Hsubtype1) H1p2() strfmt.Date {`, 10874 ` return m.h1p2Field`, 10875 `func (m *Hsubtype1) SetH1p2(val strfmt.Date) {`, 10876 ` m.h1p2Field = val`, 10877 `func (m *Hsubtype1) Validate(formats strfmt.Registry) error {`, 10878 ` if err := m.validateH1p2(formats); err != nil {`, 10879 ` return errors.CompositeValidationError(res...`, 10880 `func (m *Hsubtype1) validateH1p2(formats strfmt.Registry) error {`, 10881 ` if swag.IsZero(m.H1p2()) {`, 10882 ` if err := validate.FormatOf("h1p2", "body", "date", m.H1p2().String(), formats); err != nil {`, 10883 }, 10884 // not expected 10885 todo, 10886 // output in log 10887 noLines, 10888 noLines) 10889 10890 // load expectations for model: f2.go 10891 thisRun.AddExpectations("f2.go", []string{ 10892 `type F2 = F0`, 10893 }, 10894 // not expected 10895 todo, 10896 // output in log 10897 noLines, 10898 noLines) 10899 10900 // load expectations for model: h0.go 10901 thisRun.AddExpectations("h0.go", []string{ 10902 `type H0 = H1`, 10903 `func UnmarshalH0(reader io.Reader, consumer runtime.Consumer) (H0, error) {`, 10904 ` return UnmarshalH1(reader, consumer`, 10905 `func UnmarshalH0Slice(reader io.Reader, consumer runtime.Consumer) ([]H0, error) {`, 10906 ` return UnmarshalH1Slice(reader, consumer`, 10907 }, 10908 // not expected 10909 todo, 10910 // output in log 10911 noLines, 10912 noLines) 10913 10914 // load expectations for model: c1v.go 10915 thisRun.AddExpectations("c1v.go", []string{ 10916 `type C1v interface{`, 10917 }, 10918 // not expected 10919 todo, 10920 // output in log 10921 noLines, 10922 noLines) 10923 10924 // load expectations for model: d0v.go 10925 thisRun.AddExpectations("d0v.go", []string{ 10926 `type D0v = D1v`, 10927 }, 10928 // not expected 10929 todo, 10930 // output in log 10931 noLines, 10932 noLines) 10933 10934 // load expectations for model: e2.go 10935 thisRun.AddExpectations("e2.go", []string{ 10936 `type E2 = E0`, 10937 }, 10938 // not expected 10939 todo, 10940 // output in log 10941 noLines, 10942 noLines) 10943 10944 // load expectations for model: d2v.go 10945 thisRun.AddExpectations("d2v.go", []string{ 10946 `type D2v = D0v`, 10947 }, 10948 // not expected 10949 todo, 10950 // output in log 10951 noLines, 10952 noLines) 10953 10954 // load expectations for model: b2v.go 10955 thisRun.AddExpectations("b2v.go", []string{ 10956 `type B2v = B0v`, 10957 }, 10958 // not expected 10959 todo, 10960 // output in log 10961 noLines, 10962 noLines) 10963 10964 // load expectations for model: a1.go 10965 thisRun.AddExpectations("a1.go", []string{ 10966 `type A1 []int64`, 10967 // empty validation 10968 "func (m A1) Validate(formats strfmt.Registry) error {\n return nil\n}", 10969 }, 10970 // not expected 10971 todo, 10972 // output in log 10973 noLines, 10974 noLines) 10975 10976 // load expectations for model: hsubtype2.go 10977 thisRun.AddExpectations("hsubtype2.go", []string{ 10978 `type Hsubtype2 struct {`, 10979 ` h1p1Field string`, 10980 ` h1p2Field strfmt.Date`, 10981 " Hsp2 strfmt.DateTime `json:\"hsp2,omitempty\"`", 10982 `func (m *Hsubtype2) H1p1() string {`, 10983 ` return m.h1p1Field`, 10984 `func (m *Hsubtype2) SetH1p1(val string) {`, 10985 ` m.h1p1Field = val`, 10986 `func (m *Hsubtype2) H1p2() strfmt.Date {`, 10987 ` return m.h1p2Field`, 10988 `func (m *Hsubtype2) SetH1p2(val strfmt.Date) {`, 10989 ` m.h1p2Field = val`, 10990 `func (m *Hsubtype2) Validate(formats strfmt.Registry) error {`, 10991 ` if err := m.validateH1p2(formats); err != nil {`, 10992 ` if err := m.validateHsp2(formats); err != nil {`, 10993 ` return errors.CompositeValidationError(res...`, 10994 `func (m *Hsubtype2) validateH1p2(formats strfmt.Registry) error {`, 10995 ` if swag.IsZero(m.H1p2()) {`, 10996 ` if err := validate.FormatOf("h1p2", "body", "date", m.H1p2().String(), formats); err != nil {`, 10997 `func (m *Hsubtype2) validateHsp2(formats strfmt.Registry) error {`, 10998 ` if swag.IsZero(m.Hsp2) {`, 10999 ` if err := validate.FormatOf("hsp2", "body", "date-time", m.Hsp2.String(), formats); err != nil {`, 11000 }, 11001 // not expected 11002 todo, 11003 // output in log 11004 noLines, 11005 noLines) 11006 11007 // load expectations for model: b2.go 11008 thisRun.AddExpectations("b2.go", []string{ 11009 `type B2 = B0`, 11010 }, 11011 // not expected 11012 todo, 11013 // output in log 11014 noLines, 11015 noLines) 11016 11017 // load expectations for model: b1.go 11018 thisRun.AddExpectations("b1.go", []string{ 11019 `type B1 map[string]int64`, 11020 // empty validation 11021 "func (m B1) Validate(formats strfmt.Registry) error {\n return nil\n}", 11022 }, 11023 // not expected 11024 todo, 11025 // output in log 11026 noLines, 11027 noLines) 11028 11029 // load expectations for model: d0.go 11030 thisRun.AddExpectations("d0.go", []string{ 11031 `type D0 = D1`, 11032 }, 11033 // not expected 11034 todo, 11035 // output in log 11036 noLines, 11037 noLines) 11038 11039 // load expectations for model: g1v.go 11040 thisRun.AddExpectations("g1v.go", []string{ 11041 `type G1v struct {`, 11042 " Prop1v int64 `json:\"prop1v,omitempty\"`", 11043 " Prop2v *int64 `json:\"prop2v\"`", 11044 `func (m *G1v) Validate(formats strfmt.Registry) error {`, 11045 ` if err := m.validateProp1v(formats); err != nil {`, 11046 ` if err := m.validateProp2v(formats); err != nil {`, 11047 ` return errors.CompositeValidationError(res...`, 11048 `func (m *G1v) validateProp1v(formats strfmt.Registry) error {`, 11049 ` if swag.IsZero(m.Prop1v) {`, 11050 ` if err := validate.MaximumInt("prop1v", "body", m.Prop1v, 100, false); err != nil {`, 11051 `func (m *G1v) validateProp2v(formats strfmt.Registry) error {`, 11052 ` if err := validate.Required("prop2v", "body", m.Prop2v); err != nil {`, 11053 }, 11054 // not expected 11055 todo, 11056 // output in log 11057 noLines, 11058 noLines) 11059 11060 // load expectations for model: e0.go 11061 thisRun.AddExpectations("e0.go", []string{ 11062 `type E0 = E1`, 11063 }, 11064 // not expected 11065 todo, 11066 // output in log 11067 noLines, 11068 noLines) 11069 11070 // load expectations for model: f0v.go 11071 thisRun.AddExpectations("f0v.go", []string{ 11072 `type F0v = F1v`, 11073 }, 11074 // not expected 11075 todo, 11076 // output in log 11077 noLines, 11078 noLines) 11079 11080 // load expectations for model: h2.go 11081 thisRun.AddExpectations("h2.go", []string{ 11082 `type H2 = H0`, 11083 `func UnmarshalH2(reader io.Reader, consumer runtime.Consumer) (H2, error) {`, 11084 ` return UnmarshalH0(reader, consumer`, 11085 `func UnmarshalH2Slice(reader io.Reader, consumer runtime.Consumer) ([]H2, error) {`, 11086 ` return UnmarshalH0Slice(reader, consumer`, 11087 }, 11088 // not expected 11089 todo, 11090 // output in log 11091 noLines, 11092 noLines) 11093 11094 // load expectations for model: b1v.go 11095 thisRun.AddExpectations("b1v.go", []string{ 11096 `type B1v map[string]int64`, 11097 `func (m B1v) Validate(formats strfmt.Registry) error {`, 11098 ` for k := range m {`, 11099 ` if err := validate.MaximumInt(k, "body", m[k], 100, false); err != nil {`, 11100 ` return errors.CompositeValidationError(res...`, 11101 }, 11102 // not expected 11103 todo, 11104 // output in log 11105 noLines, 11106 noLines) 11107 11108 // load expectations for model: f0.go 11109 thisRun.AddExpectations("f0.go", []string{ 11110 `type F0 = F1`, 11111 }, 11112 // not expected 11113 todo, 11114 // output in log 11115 noLines, 11116 noLines) 11117 11118 // load expectations for model: a2v.go 11119 thisRun.AddExpectations("a2v.go", []string{ 11120 `type A2v = A0v`, 11121 }, 11122 // not expected 11123 todo, 11124 // output in log 11125 noLines, 11126 noLines) 11127 11128 // load expectations for model: hs2.go 11129 thisRun.AddExpectations("hs2.go", []string{ 11130 `type Hs2 struct {`, 11131 ` Hs0`, 11132 // empty validation 11133 "func (m *Hs2) Validate(formats strfmt.Registry) error {\n return nil\n}", 11134 }, 11135 // not expected 11136 todo, 11137 // output in log 11138 noLines, 11139 noLines) 11140 11141 // load expectations for model: d1v.go 11142 thisRun.AddExpectations("d1v.go", []string{ 11143 `type D1v int64`, 11144 `func (m D1v) Validate(formats strfmt.Registry) error {`, 11145 ` if err := validate.MaximumInt("", "body", int64(m), 100, false); err != nil {`, 11146 ` return errors.CompositeValidationError(res...`, 11147 }, 11148 // not expected 11149 todo, 11150 // output in log 11151 noLines, 11152 noLines) 11153 11154 // load expectations for model: c1.go 11155 thisRun.AddExpectations("c1.go", []string{ 11156 `type C1 interface{`, 11157 }, 11158 // not expected 11159 todo, 11160 // output in log 11161 noLines, 11162 noLines) 11163 11164 // load expectations for model: c2.go 11165 thisRun.AddExpectations("c2.go", []string{ 11166 `type C2 = C0`, 11167 }, 11168 // not expected 11169 todo, 11170 // output in log 11171 noLines, 11172 noLines) 11173 11174 // load expectations for model: e0v.go 11175 thisRun.AddExpectations("e0v.go", []string{ 11176 `type E0v = E1v`, 11177 }, 11178 // not expected 11179 todo, 11180 // output in log 11181 noLines, 11182 noLines) 11183 11184 // load expectations for model: d1.go 11185 thisRun.AddExpectations("d1.go", []string{ 11186 `type D1 int64`, 11187 // empty validation 11188 "func (m D1) Validate(formats strfmt.Registry) error {\n return nil\n}", 11189 }, 11190 // not expected 11191 todo, 11192 // output in log 11193 noLines, 11194 noLines) 11195 11196 // load expectations for model: g2.go 11197 thisRun.AddExpectations("g2.go", []string{ 11198 `type G2 struct {`, 11199 ` G0`, 11200 // empty validation 11201 "func (m *G2) Validate(formats strfmt.Registry) error {\n return nil\n}", 11202 }, 11203 // not expected 11204 todo, 11205 // output in log 11206 noLines, 11207 noLines) 11208 11209 // load expectations for model: d2.go 11210 thisRun.AddExpectations("d2.go", []string{ 11211 `type D2 = D0`, 11212 }, 11213 // not expected 11214 todo, 11215 // output in log 11216 noLines, 11217 noLines) 11218 11219 // load expectations for model: b0.go 11220 thisRun.AddExpectations("b0.go", []string{ 11221 `type B0 = B1`, 11222 }, 11223 // not expected 11224 todo, 11225 // output in log 11226 noLines, 11227 noLines) 11228 11229 // load expectations for model: c2v.go 11230 thisRun.AddExpectations("c2v.go", []string{ 11231 `type C2v = C0v`, 11232 }, 11233 // not expected 11234 todo, 11235 // output in log 11236 noLines, 11237 noLines) 11238 11239 // load expectations for model: g0.go 11240 thisRun.AddExpectations("g0.go", []string{ 11241 `type G0 struct {`, 11242 ` G1`, 11243 // empty validation 11244 "func (m *G0) Validate(formats strfmt.Registry) error {\n return nil\n}", 11245 }, 11246 // not expected 11247 todo, 11248 // output in log 11249 noLines, 11250 noLines) 11251 11252 // load expectations for model: a0.go 11253 thisRun.AddExpectations("a0.go", []string{ 11254 `type A0 = A1`, 11255 }, 11256 // not expected 11257 todo, 11258 // output in log 11259 noLines, 11260 noLines) 11261 11262 // load expectations for model: a2.go 11263 thisRun.AddExpectations("a2.go", []string{ 11264 `type A2 = A0`, 11265 }, 11266 // not expected 11267 todo, 11268 // output in log 11269 noLines, 11270 noLines) 11271 11272 // load expectations for model: h1.go 11273 thisRun.AddExpectations("h1.go", []string{ 11274 `type H1 interface {`, 11275 ` runtime.Validatable`, 11276 ` H1p1() string`, 11277 ` SetH1p1(string`, 11278 ` H1p2() strfmt.Date`, 11279 ` SetH1p2(strfmt.Date`, 11280 `type h1 struct {`, 11281 ` h1p1Field string`, 11282 ` h1p2Field strfmt.Date`, 11283 `func (m *h1) H1p1() string {`, 11284 ` return m.h1p1Field`, 11285 `func (m *h1) SetH1p1(val string) {`, 11286 ` m.h1p1Field = val`, 11287 `func (m *h1) H1p2() strfmt.Date {`, 11288 ` return m.h1p2Field`, 11289 `func (m *h1) SetH1p2(val strfmt.Date) {`, 11290 ` m.h1p2Field = val`, 11291 `func UnmarshalH1Slice(reader io.Reader, consumer runtime.Consumer) ([]H1, error) {`, 11292 ` var elements []json.RawMessage`, 11293 ` if err := consumer.Consume(reader, &elements); err != nil {`, 11294 ` return nil, err`, 11295 ` var result []H1`, 11296 ` for _, element := range elements {`, 11297 ` obj, err := unmarshalH1(element, consumer`, 11298 ` if err != nil {`, 11299 ` return nil, err`, 11300 ` result = append(result, obj`, 11301 ` return result, nil`, 11302 `func UnmarshalH1(reader io.Reader, consumer runtime.Consumer) (H1, error) {`, 11303 ` data, err := ioutil.ReadAll(reader`, 11304 ` if err != nil {`, 11305 ` return nil, err`, 11306 ` return unmarshalH1(data, consumer`, 11307 `func unmarshalH1(data []byte, consumer runtime.Consumer) (H1, error) {`, 11308 ` buf := bytes.NewBuffer(data`, 11309 ` buf2 := bytes.NewBuffer(data`, 11310 ` var getType struct {`, 11311 " Htype string `json:\"htype\"`", 11312 ` if err := consumer.Consume(buf, &getType); err != nil {`, 11313 ` return nil, err`, 11314 ` if err := validate.RequiredString("htype", "body", getType.Htype); err != nil {`, 11315 ` return nil, err`, 11316 ` switch getType.Htype {`, 11317 ` case "h1":`, 11318 ` var result h1`, 11319 ` if err := consumer.Consume(buf2, &result); err != nil {`, 11320 ` return nil, err`, 11321 ` return &result, nil`, 11322 ` case "hsubtype1":`, 11323 ` var result Hsubtype1`, 11324 ` if err := consumer.Consume(buf2, &result); err != nil {`, 11325 ` return nil, err`, 11326 ` return &result, nil`, 11327 ` case "hsubtype2":`, 11328 ` var result Hsubtype2`, 11329 ` if err := consumer.Consume(buf2, &result); err != nil {`, 11330 ` return nil, err`, 11331 ` return &result, nil`, 11332 ` return nil, errors.New(422, "invalid htype value: %q", getType.Htype`, 11333 `func (m *h1) Validate(formats strfmt.Registry) error {`, 11334 ` if err := m.validateH1p2(formats); err != nil {`, 11335 ` return errors.CompositeValidationError(res...`, 11336 `func (m *h1) validateH1p2(formats strfmt.Registry) error {`, 11337 ` if swag.IsZero(m.H1p2()) {`, 11338 ` if err := validate.FormatOf("h1p2", "body", "date", m.H1p2().String(), formats); err != nil {`, 11339 }, 11340 // not expected 11341 todo, 11342 // output in log 11343 noLines, 11344 noLines) 11345 11346 // load expectations for model: c0v.go 11347 thisRun.AddExpectations("c0v.go", []string{ 11348 `type C0v = C1v`, 11349 }, 11350 // not expected 11351 todo, 11352 // output in log 11353 noLines, 11354 noLines) 11355 11356 // load expectations for model: g2v.go 11357 thisRun.AddExpectations("g2v.go", []string{ 11358 `type G2v struct {`, 11359 ` G0v`, 11360 // empty validation 11361 "func (m *G2v) Validate(formats strfmt.Registry) error {\n return nil\n}", 11362 }, 11363 // not expected 11364 todo, 11365 // output in log 11366 noLines, 11367 noLines) 11368 11369 // load expectations for model: f1.go 11370 thisRun.AddExpectations("f1.go", []string{ 11371 `type F1 strfmt.UUID`, 11372 `func (m F1) Validate(formats strfmt.Registry) error {`, 11373 ` if err := validate.FormatOf("", "body", "uuid", strfmt.UUID(m).String(), formats); err != nil {`, 11374 ` return errors.CompositeValidationError(res...`, 11375 }, 11376 // not expected 11377 todo, 11378 // output in log 11379 noLines, 11380 noLines) 11381 11382 // load expectations for model: e1.go 11383 thisRun.AddExpectations("e1.go", []string{ 11384 `type E1 strfmt.Date`, 11385 `func (m E1) Validate(formats strfmt.Registry) error {`, 11386 ` if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`, 11387 ` return errors.CompositeValidationError(res...`, 11388 }, 11389 // not expected 11390 todo, 11391 // output in log 11392 noLines, 11393 noLines) 11394 11395 // load expectations for model: a0v.go 11396 thisRun.AddExpectations("a0v.go", []string{ 11397 `type A0v = A1v`, 11398 }, 11399 // not expected 11400 todo, 11401 // output in log 11402 noLines, 11403 noLines) 11404 11405 // load expectations for model: c0.go 11406 thisRun.AddExpectations("c0.go", []string{ 11407 `type C0 = C1`, 11408 }, 11409 // not expected 11410 todo, 11411 // output in log 11412 noLines, 11413 noLines) 11414 11415 // load expectations for model: f1v.go 11416 thisRun.AddExpectations("f1v.go", []string{ 11417 `type F1v strfmt.UUID`, 11418 `func (m F1v) Validate(formats strfmt.Registry) error {`, 11419 ` if err := validate.FormatOf("", "body", "uuid", strfmt.UUID(m).String(), formats); err != nil {`, 11420 ` return errors.CompositeValidationError(res...`, 11421 }, 11422 // not expected 11423 todo, 11424 // output in log 11425 noLines, 11426 noLines) 11427 11428 // load expectations for model: e1v.go 11429 thisRun.AddExpectations("e1v.go", []string{ 11430 `type E1v strfmt.Date`, 11431 `func (m E1v) Validate(formats strfmt.Registry) error {`, 11432 ` if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`, 11433 ` return errors.CompositeValidationError(res...`, 11434 }, 11435 // not expected 11436 todo, 11437 // output in log 11438 noLines, 11439 noLines) 11440 11441 // load expectations for model: b0v.go 11442 thisRun.AddExpectations("b0v.go", []string{ 11443 `type B0v = B1v`, 11444 }, 11445 // not expected 11446 todo, 11447 // output in log 11448 noLines, 11449 noLines) 11450 11451 // load expectations for model: g0v.go 11452 thisRun.AddExpectations("g0v.go", []string{ 11453 `type G0v struct {`, 11454 ` G1v`, 11455 // empty validation 11456 "func (m *G0v) Validate(formats strfmt.Registry) error {\n return nil\n}", 11457 }, 11458 // not expected 11459 todo, 11460 // output in log 11461 noLines, 11462 noLines) 11463 11464 // load expectations for model: hs0.go 11465 thisRun.AddExpectations("hs0.go", []string{ 11466 `type Hs0 struct {`, 11467 ` Hsubtype1`, 11468 // empty validation 11469 "func (m *Hs0) Validate(formats strfmt.Registry) error {\n return nil\n}", 11470 }, 11471 // not expected 11472 todo, 11473 // output in log 11474 noLines, 11475 noLines) 11476 } 11477 11478 func initFixture1993() { 11479 /* 11480 required / non required base type 11481 */ 11482 11483 f := newModelFixture("../fixtures/bugs/1993/fixture-1993.yaml", "test required/non required base type") 11484 thisRun := f.AddRun(false).WithMinimalFlatten(true) 11485 11486 // load expectations for model: house.go 11487 thisRun.AddExpectations("house.go", []string{ 11488 `if err := validate.Required("pet", "body", m.Pet()); err != nil {`, 11489 }, 11490 // not expected 11491 todo, 11492 // output in log 11493 noLines, 11494 noLines) 11495 11496 // load expectations for model: empty_house.go 11497 thisRun.AddExpectations("empty_house.go", []string{ 11498 `if swag.IsZero(m.Pet())`, 11499 }, 11500 // not expected 11501 todo, 11502 // output in log 11503 noLines, 11504 noLines) 11505 } 11506 11507 func initFixture2364() { 11508 f := newModelFixture("../fixtures/bugs/2364/fixture-2364.yaml", "test non-nullable allOf") 11509 thisRun := f.AddRun(false).WithMinimalFlatten(true) 11510 11511 thisRun.AddExpectations("bundle_attributes_response.go", []string{ 11512 `type BundleAttributesResponse struct {`, 11513 `Items []BundleItemResponse`, 11514 `Sections []ItemBundleSectionResponse`, 11515 `NullableSections []*NullableItemBundleSectionResponse`, 11516 `OtherSections []*OtherItemBundleSectionResponse`, 11517 `Type BundleType`, 11518 }, 11519 // not expected 11520 todo, 11521 // output in log 11522 noLines, 11523 noLines) 11524 }