github.com/go-swagger/go-swagger@v0.31.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  	flattenRun.AddExpectations("nested_map.go", []string{
   178  		`type NestedMap map[string]map[string]interface{}`,
   179  		`nprops := len(m)`,
   180  		`	if nprops < 3 {`,
   181  		`		return errors.TooFewProperties("", "body", 3)`,
   182  		`	if nprops > 5 {`,
   183  		`		return errors.TooManyProperties("", "body", 5)`,
   184  		`for k := range m {`,
   185  		`nprops := len(m[k])`,
   186  		`if nprops < 4 {`,
   187  		`	return errors.TooFewProperties(k, "body", 4)`,
   188  		`if nprops > 6 {`,
   189  		`	return errors.TooManyProperties(k, "body", 6)`,
   190  	}, todo, noLines, noLines)
   191  
   192  	flattenRun.AddExpectations("deeper_nested_map.go", []string{
   193  		`type DeeperNestedMap map[string]map[string]map[string]interface{}`,
   194  		`nprops := len(m)`,
   195  		`if nprops < 3 {`,
   196  		`return errors.TooFewProperties("", "body", 3)`,
   197  		`if nprops > 5 {`,
   198  		`return errors.TooManyProperties("", "body", 5)`,
   199  		`for k := range m {`,
   200  		`nprops := len(m[k])`,
   201  		`if nprops < 4 {`,
   202  		`return errors.TooFewProperties(k, "body", 4)`,
   203  		`if nprops > 6 {`,
   204  		`return errors.TooManyProperties(k, "body", 6)`,
   205  		`for kk := range m[k] {`,
   206  		`if nprops < 5 {`,
   207  		`return errors.TooFewProperties(k+"."+kk, "body", 5)`,
   208  		`if nprops > 7 {`,
   209  		`return errors.TooManyProperties(k+"."+kk, "body", 7)`,
   210  		``,
   211  		``,
   212  		``,
   213  		``,
   214  	}, todo, noLines, noLines)
   215  }
   216  
   217  func initFixtureGuardFormats() {
   218  	f := newModelFixture("../fixtures/enhancements/guard-formats/fixture-guard-formats.yaml", "guard format validations")
   219  	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
   220  
   221  	flattenRun.AddExpectations("aliased_date.go", []string{
   222  		`type AliasedDate strfmt.Date`,
   223  		`func (m AliasedDate) Validate(formats strfmt.Registry) error {`,
   224  		`if err := validate.MinLength("", "body", strfmt.Date(m).String(), 16); err != nil {`,
   225  		`if err := validate.MaxLength("", "body", strfmt.Date(m).String(), 20); err != nil {`,
   226  		"if err := validate.Pattern(\"\", \"body\", strfmt.Date(m).String(), `(\\d+)/(\\d+)`); err != nil {",
   227  		`if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
   228  	}, todo, noLines, noLines)
   229  
   230  	flattenRun.AddExpectations("aliased_reader.go",
   231  		[]string{
   232  			`type AliasedReader io.ReadCloser`,
   233  		},
   234  		// no validations for binary
   235  		[]string{
   236  			`validate.MinLength(`,
   237  			`validate.MaxLength(`,
   238  			`validate.Pattern(`,
   239  			`validate.FormatOf(`,
   240  		},
   241  		[]string{
   242  			// disable log assertions (dodgy with parallel tests)
   243  			// `warning: validation pattern`,
   244  			// `warning: validation minLength (value: 16) not compatible with type for format "binary". Skipped`,
   245  			// `warning: validation maxLength (value: 20) not compatible with type for format "binary". Skipped`,
   246  		}, noLines,
   247  	)
   248  
   249  	flattenRun.AddExpectations("aliased_string.go", []string{
   250  		`type AliasedString string`,
   251  		`func (m AliasedString) Validate(formats strfmt.Registry) error {`,
   252  		`if err := validate.MinLength("", "body", string(m), 16); err != nil {`,
   253  		`if err := validate.MaxLength("", "body", string(m), 20); err != nil {`,
   254  		"if err := validate.Pattern(\"\", \"body\", string(m), `(\\d+)/(\\d+)`); err != nil {",
   255  	}, todo, noLines, noLines)
   256  
   257  	flattenRun.AddExpectations("object.go", []string{
   258  		`func (m *Object) Validate(formats strfmt.Registry) error {`,
   259  		`if err := m.validateP0(formats); err != nil {`,
   260  		`if err := m.validateP1(formats); err != nil {`,
   261  		`if err := m.validateP10(formats); err != nil {`,
   262  		`if err := m.validateP11(formats); err != nil {`,
   263  		`if err := m.validateP1Nullable(formats); err != nil {`,
   264  		`if err := m.validateP2(formats); err != nil {`,
   265  		`if err := m.validateP3(formats); err != nil {`,
   266  		`if err := m.validateP4(formats); err != nil {`,
   267  		`if err := m.validateP5(formats); err != nil {`,
   268  		`if err := m.validateP6(formats); err != nil {`,
   269  		`if err := m.validateP7(formats); err != nil {`,
   270  		`if err := m.validateP8(formats); err != nil {`,
   271  		`if err := m.validateP9(formats); err != nil {`,
   272  		`func (m *Object) validateP0(formats strfmt.Registry) error {`,
   273  		`if err := validate.Required("p0", "body", m.P0); err != nil {`,
   274  		`if err := validate.MinLength("p0", "body", *m.P0, 12); err != nil {`,
   275  		`if err := validate.MaxLength("p0", "body", *m.P0, 16); err != nil {`,
   276  		"if err := validate.Pattern(\"p0\", \"body\", *m.P0, `(\\d+)-(\\d+)`); err != nil {",
   277  		`func (m *Object) validateP1(formats strfmt.Registry) error {`,
   278  		`if err := validate.Required("p1", "body", m.P1); err != nil {`,
   279  		`if err := validate.MinLength("p1", "body", m.P1.String(), 12); err != nil {`,
   280  		`if err := validate.MaxLength("p1", "body", m.P1.String(), 16); err != nil {`,
   281  		"if err := validate.Pattern(\"p1\", \"body\", m.P1.String(), `(\\d+)/(\\d+)`); err != nil {",
   282  		`if err := validate.FormatOf("p1", "body", "date", m.P1.String(), formats); err != nil {`,
   283  		`func (m *Object) validateP10(formats strfmt.Registry) error {`,
   284  		`if err := validate.RequiredString("p10", "body", m.P10); err != nil {`,
   285  		`if err := validate.MinLength("p10", "body", m.P10, 12); err != nil {`,
   286  		`if err := validate.MaxLength("p10", "body", m.P10, 16); err != nil {`,
   287  		"if err := validate.Pattern(\"p10\", \"body\", m.P10, `(\\d+)-(\\d+)`); err != nil {",
   288  		`func (m *Object) validateP11(formats strfmt.Registry) error {`,
   289  		`	if err := validate.Required("p11", "body", m.P11); err != nil {`,
   290  		`	if err := validate.Required("p11", "body", m.P11); err != nil {`,
   291  		`	if m.P11 != nil {`,
   292  		`		if err := m.P11.Validate(formats); err != nil {`,
   293  		`			if ve, ok := err.(*errors.Validation); ok {`,
   294  		`				return ve.ValidateName("p11")`,
   295  		`func (m *Object) validateP1Nullable(formats strfmt.Registry) error {`,
   296  		`	if swag.IsZero(m.P1Nullable) {`,
   297  		`	if err := validate.MinLength("p1Nullable", "body", m.P1Nullable.String(), 12); err != nil {`,
   298  		`	if err := validate.MaxLength("p1Nullable", "body", m.P1Nullable.String(), 16); err != nil {`,
   299  		"	if err := validate.Pattern(\"p1Nullable\", \"body\", m.P1Nullable.String(), `(\\d+)/(\\d+)`); err != nil {",
   300  		`	if err := validate.FormatOf("p1Nullable", "body", "date", m.P1Nullable.String(), formats); err != nil {`,
   301  		`func (m *Object) validateP2(formats strfmt.Registry) error {`,
   302  		`	if swag.IsZero(m.P2) {`,
   303  		`	if err := validate.MinLength("p2", "body", m.P2.String(), 12); err != nil {`,
   304  		`	if err := validate.MaxLength("p2", "body", m.P2.String(), 16); err != nil {`,
   305  		"	if err := validate.Pattern(\"p2\", \"body\", m.P2.String(), `(\\d+)-(\\d+)`); err != nil {",
   306  		`	if err := validate.FormatOf("p2", "body", "uuid", m.P2.String(), formats); err != nil {`,
   307  		`func (m *Object) validateP3(formats strfmt.Registry) error {`,
   308  		`	if swag.IsZero(m.P3) {`,
   309  		`	if err := validate.MinLength("p3", "body", m.P3.String(), 12); err != nil {`,
   310  		`	if err := validate.MaxLength("p3", "body", m.P3.String(), 16); err != nil {`,
   311  		"	if err := validate.Pattern(\"p3\", \"body\", m.P3.String(), `(\\d+)-(\\d+)`); err != nil {",
   312  		`	if err := validate.FormatOf("p3", "body", "datetime", m.P3.String(), formats); err != nil {`,
   313  		`func (m *Object) validateP4(formats strfmt.Registry) error {`,
   314  		`	if swag.IsZero(m.P4) {`,
   315  		`	if err := validate.MinLength("p4", "body", m.P4.String(), 12); err != nil {`,
   316  		`	if err := validate.MaxLength("p4", "body", m.P4.String(), 16); err != nil {`,
   317  		"	if err := validate.Pattern(\"p4\", \"body\", m.P4.String(), `(\\d+)-(\\d+)`); err != nil {",
   318  		`	if err := validate.FormatOf("p4", "body", "bsonobjectid", m.P4.String(), formats); err != nil {`,
   319  		`func (m *Object) validateP5(formats strfmt.Registry) error {`,
   320  		`	if swag.IsZero(m.P5) {`,
   321  		`	if err := validate.MinLength("p5", "body", m.P5.String(), 12); err != nil {`,
   322  		`	if err := validate.MaxLength("p5", "body", m.P5.String(), 16); err != nil {`,
   323  		"	if err := validate.Pattern(\"p5\", \"body\", m.P5.String(), `(\\d+)-(\\d+)`); err != nil {",
   324  		`	if err := validate.FormatOf("p5", "body", "duration", m.P5.String(), formats); err != nil {`,
   325  		`func (m *Object) validateP6(formats strfmt.Registry) error {`,
   326  		`	if swag.IsZero(m.P6) {`,
   327  		`	if err := validate.MinLength("p6", "body", m.P6.String(), 12); err != nil {`,
   328  		`	if err := validate.MaxLength("p6", "body", m.P6.String(), 16); err != nil {`,
   329  		"	if err := validate.Pattern(\"p6\", \"body\", m.P6.String(), `(\\d+)-(\\d+)`); err != nil {",
   330  		`func (m *Object) validateP7(formats strfmt.Registry) error {`,
   331  		`	if err := validate.Required("p7", "body", io.ReadCloser(m.P7)); err != nil {`,
   332  		`func (m *Object) validateP8(formats strfmt.Registry) error {`,
   333  		`	if err := validate.Required("p8", "body", m.P8); err != nil {`,
   334  		`	if err := validate.Required("p8", "body", m.P8); err != nil {`,
   335  		`	if m.P8 != nil {`,
   336  		`		if err := m.P8.Validate(formats); err != nil {`,
   337  		`			if ve, ok := err.(*errors.Validation); ok {`,
   338  		`				return ve.ValidateName("p8")`,
   339  		`func (m *Object) validateP9(formats strfmt.Registry) error {`,
   340  		`	if err := validate.Required("p9", "body", AliasedReader(m.P9)); err != nil {`,
   341  	}, todo,
   342  		[]string{
   343  			// disable log assertions (dodgy with parallel tests)
   344  			// warnings about no validations for binary
   345  			// `warning: validation minLength (value: 12) not compatible with type for format "binary". Skipped`,
   346  			// `warning: validation maxLength (value: 16) not compatible with type for format "binary". Skipped`,
   347  			// `warning: validation pattern`,
   348  		}, noLines)
   349  }
   350  
   351  func initFixture2448() {
   352  	f := newModelFixture("../fixtures/bugs/2448/fixture-2448.yaml", "numerical validations")
   353  	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
   354  
   355  	flattenRun.AddExpectations("integers.go", []string{
   356  		`if err := validate.MinimumInt("i0", "body", m.I0, 10, true); err != nil {`,
   357  		`if err := validate.MaximumInt("i0", "body", m.I0, 100, true); err != nil {`,
   358  		`if err := validate.MultipleOfInt("i0", "body", m.I0, 10); err != nil {`,
   359  		`if err := validate.MinimumInt("i1", "body", int64(m.I1), 10, true); err != nil {`,
   360  		`if err := validate.MaximumInt("i1", "body", int64(m.I1), 100, true); err != nil {`,
   361  		`if err := validate.MultipleOfInt("i1", "body", int64(m.I1), 10); err != nil {`,
   362  		`if err := validate.MinimumInt("i2", "body", m.I2, 10, true); err != nil {`,
   363  		`if err := validate.MaximumInt("i2", "body", m.I2, 100, true); err != nil {`,
   364  		`if err := validate.MultipleOfInt("i2", "body", m.I2, 10); err != nil {`,
   365  		`if err := validate.MinimumInt("i3", "body", int64(m.I3), 10, true); err != nil {`,
   366  		`if err := validate.MaximumInt("i3", "body", int64(m.I3), 100, true); err != nil {`,
   367  		`if err := validate.MultipleOfInt("i3", "body", int64(m.I3), 10); err != nil {`,
   368  		`if err := validate.MultipleOf("i4", "body", float64(m.I4), 10.5); err != nil {`,
   369  		`if err := validate.MinimumUint("ui1", "body", uint64(m.Ui1), 10, true); err != nil {`,
   370  		`if err := validate.MaximumUint("ui1", "body", uint64(m.Ui1), 100, true); err != nil {`,
   371  		`if err := validate.MultipleOfUint("ui1", "body", uint64(m.Ui1), 10); err != nil {`,
   372  		`if err := validate.MinimumUint("ui2", "body", m.Ui2, 10, true); err != nil {`,
   373  		`if err := validate.MaximumUint("ui2", "body", m.Ui2, 100, true); err != nil {`,
   374  		`if err := validate.MultipleOfUint("ui2", "body", m.Ui2, 10); err != nil {`,
   375  		`if err := validate.MinimumUint("ui3", "body", uint64(m.Ui3), 10, true); err != nil {`,
   376  		`if err := validate.MaximumUint("ui3", "body", uint64(m.Ui3), 100, true); err != nil {`,
   377  		`if err := validate.MultipleOfUint("ui3", "body", uint64(m.Ui3), 10); err != nil {`,
   378  		`if err := validate.MultipleOf("ui4", "body", float64(m.Ui4), 10.5); err != nil {`,
   379  	}, todo, noLines, noLines)
   380  
   381  	flattenRun.AddExpectations("numbers.go", []string{
   382  		`if err := validate.Minimum("f0", "body", m.F0, 10, true); err != nil {`,
   383  		`if err := validate.Maximum("f0", "body", m.F0, 100, true); err != nil {`,
   384  		`if err := validate.MultipleOf("f0", "body", m.F0, 10); err != nil {`,
   385  		`if err := validate.Minimum("f1", "body", float64(m.F1), 10, true); err != nil {`,
   386  		`if err := validate.Maximum("f1", "body", float64(m.F1), 100, true); err != nil {`,
   387  		`if err := validate.MultipleOf("f1", "body", float64(m.F1), 10); err != nil {`,
   388  		`if err := validate.Minimum("f2", "body", m.F2, 10, true); err != nil {`,
   389  		`if err := validate.Maximum("f2", "body", m.F2, 100, true); err != nil {`,
   390  		`if err := validate.MultipleOf("f2", "body", m.F2, 10); err != nil {`,
   391  	}, todo, noLines, noLines)
   392  }
   393  
   394  func initFixture2400() {
   395  	f := newModelFixture("../fixtures/bugs/2400/fixture-2400.yaml", "required aliased primitive")
   396  	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
   397  
   398  	flattenRun.AddExpectations("signup_request.go", []string{
   399  		`type SignupRequest struct {`,
   400  		`Email *string`,
   401  	}, todo, noLines, noLines)
   402  	flattenRun.AddExpectations("signup_request2.go", []string{
   403  		`type SignupRequest2 struct {`,
   404  		`Email *Email`,
   405  	}, todo, noLines, noLines)
   406  }
   407  
   408  func initFixture2381() {
   409  	f := newModelFixture("../fixtures/bugs/2381/fixture-2381.yaml", "required $ref primitive")
   410  	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
   411  	expandRun := f.AddRun(true)
   412  
   413  	flattenRun.AddExpectations("my_object.go", []string{
   414  		`RequiredReferencedObject MyObjectRef`,  // this is an interface{}
   415  		`RequiredReferencedString *MyStringRef`, // alias to primitive
   416  		`RequiredString *string`,                // unaliased primitive
   417  		`RequiredReferencedArray MyArrayRef`,    // no need to use a pointer
   418  		`RequiredReferencedMap MyMapRef`,        // no need to use a pointer
   419  		`RequiredReferencedStruct *MyStructRef`, // pointer to struct
   420  		`func (m *MyObject) validateRequiredReferencedObject(formats strfmt.Registry) error {`,
   421  		`	if m.RequiredReferencedObject == nil {`,
   422  		`		return errors.Required("required_referenced_object", "body", nil)`,
   423  		`func (m *MyObject) validateRequiredReferencedString(formats strfmt.Registry) error {`,
   424  		`	if err := validate.Required("required_referenced_string", "body", m.RequiredReferencedString); err != nil {`,
   425  		`	if err := m.RequiredReferencedString.Validate(formats); err != nil {`,
   426  		`		if ve, ok := err.(*errors.Validation); ok {`,
   427  		`			return ve.ValidateName("required_referenced_string")`,
   428  		`func (m *MyObject) validateRequiredString(formats strfmt.Registry) error {`,
   429  		`	if err := validate.Required("required_string", "body", m.RequiredString); err != nil {`,
   430  		`func (m *MyObject) validateRequiredReferencedStruct(formats strfmt.Registry) error {`,
   431  		`if err := validate.Required("required_referenced_struct", "body", m.RequiredReferencedStruct); err != nil {`,
   432  		`func (m *MyObject) validateRequiredReferencedArray(formats strfmt.Registry) error {`,
   433  		`if err := validate.Required("required_referenced_array", "body", m.RequiredReferencedArray); err != nil {`,
   434  		`func (m *MyObject) validateRequiredReferencedMap(formats strfmt.Registry) error {`,
   435  		`if err := validate.Required("required_referenced_map", "body", m.RequiredReferencedMap); err != nil {`,
   436  	}, todo, noLines, noLines)
   437  
   438  	expandRun.AddExpectations("my_object.go", []string{
   439  		`func (m *MyObject) validateRequiredReferencedObject(formats strfmt.Registry) error {`,
   440  		`	if m.RequiredReferencedObject == nil {`,
   441  		`		return errors.Required("required_referenced_object", "body", nil)`,
   442  		`func (m *MyObject) validateRequiredReferencedString(formats strfmt.Registry) error {`,
   443  		`	if err := validate.Required("required_referenced_string", "body", m.RequiredReferencedString); err != nil {`,
   444  		`func (m *MyObject) validateRequiredString(formats strfmt.Registry) error {`,
   445  		`	if err := validate.Required("required_string", "body", m.RequiredString); err != nil {`,
   446  	}, todo, noLines, noLines)
   447  }
   448  
   449  func initFixture2300() {
   450  	f := newModelFixture("../fixtures/bugs/2300/fixture-2300.yaml", "required interface{} is validated with against nil")
   451  	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
   452  
   453  	// test behaviour with all structs made anonymous (inlined)
   454  	expandRun := f.AddRun(true)
   455  
   456  	flattenRun.AddExpectations("obj.go", []string{
   457  		`func (m *Obj) validateReq1(formats strfmt.Registry) error {`,
   458  		`	if m.Req1 == nil {`,
   459  		`		return errors.Required("req1", "body", nil)`,
   460  		`func (m *Obj) validateReq2(formats strfmt.Registry) error {`,
   461  		`	if m.Req2 == nil {`,
   462  		`		return errors.Required("req2", "body", nil)`,
   463  		`func (m *Obj) validateReq3(formats strfmt.Registry) error {`,
   464  		`	if m.Req3 == nil {`,
   465  		`		return errors.Required("req3", "body", nil)`,
   466  		`func (m *Obj) validateReq4(formats strfmt.Registry) error {`,
   467  		`	if err := validate.Required("req4", "body", m.Req4); err != nil {`,
   468  		`	if m.Req4 != nil {`,
   469  		`		if err := m.Req4.Validate(formats); err != nil {`,
   470  		`func (m *Obj) validateReq5(formats strfmt.Registry) error {`,
   471  		`	if err := validate.Required("req5", "body", m.Req5); err != nil {`,
   472  		`	if m.Req5 != nil {`,
   473  		`		if err := m.Req5.Validate(formats); err != nil {`,
   474  	}, todo, noLines, noLines)
   475  
   476  	// on anonymous
   477  	expandRun.AddExpectations("obj.go", []string{
   478  		`Req4 map[string]interface{}`,
   479  		`func (m *Obj) validateReq1(formats strfmt.Registry) error {`,
   480  		`	if m.Req1 == nil {`,
   481  		`		return errors.Required("req1", "body", nil)`,
   482  		`func (m *Obj) validateReq2(formats strfmt.Registry) error {`,
   483  		`	if m.Req2 == nil {`,
   484  		`		return errors.Required("req2", "body", nil)`,
   485  		`func (m *Obj) validateReq3(formats strfmt.Registry) error {`,
   486  		`	if m.Req3 == nil {`,
   487  		`		return errors.Required("req3", "body", nil)`,
   488  		`func (m *Obj) validateReq4(formats strfmt.Registry) error {`,
   489  		`if err := validate.Required("req4", "body", m.Req4); err != nil {`,
   490  		`for k := range m.Req4 {`,
   491  		`if err := validate.Required("req4"+"."+k, "body", m.Req4[k]); err != nil {`,
   492  		`func (m *Obj) validateReq5(formats strfmt.Registry) error {`,
   493  		`	if err := validate.Required("req5", "body", m.Req5); err != nil {`,
   494  		`	if m.Req5 != nil {`,
   495  		`		if err := m.Req5.Validate(formats); err != nil {`,
   496  	}, todo, noLines, noLines)
   497  }
   498  
   499  func initFixture2081() {
   500  	f := newModelFixture("../fixtures/bugs/2081/fixture-2081.yaml", "required interface{} is validated with against nil")
   501  	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
   502  
   503  	// interface{}
   504  	flattenRun.AddExpectations("event.go", []string{
   505  		`func (m *Event) validateValue(formats strfmt.Registry) error {`,
   506  		`if m.Value == nil {`,
   507  		`return errors.Required("value", "body", nil)`,
   508  	}, todo, noLines, noLines)
   509  
   510  	flattenRun.AddExpectations("events.go", []string{
   511  		`func (m *EventsItems0) validateA(formats strfmt.Registry) error {`,
   512  		`if m.A == nil {`,
   513  		`return errors.Required("a", "body", nil)`,
   514  	}, todo, noLines, noLines)
   515  }
   516  
   517  func initFixture936ReadOnly() {
   518  	f := newModelFixture("../fixtures/enhancements/936/fixture-936.yml", "check ReadOnly ContextValidate is generated properly")
   519  	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
   520  
   521  	// object simple has 2 read only feilds
   522  	flattenRun.AddExpectations("object1.go", []string{
   523  		// object1
   524  		`func (m *Object1) ContextValidate(ctx context.Context, formats strfmt.Registry)`,
   525  		`m.contextValidateID(ctx, formats)`,
   526  		`m.contextValidateName(ctx, formats)`,
   527  		`) contextValidateID(ctx context.Context, formats strfmt.Registry)`,
   528  		`) contextValidateName(ctx context.Context, formats strfmt.Registry)`,
   529  		`validate.ReadOnly(ctx`,
   530  	}, todo, noLines, noLines)
   531  
   532  	// object2 composed of object1
   533  	flattenRun.AddExpectations("object2.go", []string{
   534  		`) ContextValidate(ctx context.Context, formats strfmt.Registry)`,
   535  		`contextValidateObjectRef(ctx, formats)`,
   536  		`) contextValidateObjectRef(ctx context.Context, formats strfmt.Registry) `,
   537  		`m.ObjectRef.ContextValidate(ctx, formats)`,
   538  	}, todo, noLines, noLines)
   539  
   540  	// object3 has inline object
   541  	flattenRun.AddExpectations("object3.go", []string{
   542  		`) ContextValidate(ctx context.Context, formats strfmt.Registry)`,
   543  		`contextValidateName(ctx, formats)`,
   544  		`) contextValidateName(ctx context.Context, formats strfmt.Registry)`,
   545  		`validate.ReadOnly(ctx`,
   546  	}, todo, noLines, noLines)
   547  
   548  	// object4 is array with readonly string element
   549  	flattenRun.AddExpectations("object4.go", []string{
   550  		`) ContextValidate(ctx context.Context, formats strfmt.Registry)`,
   551  		`for i := 0; i < len(m); i++`,
   552  		`validate.ReadOnly(ctx`,
   553  	}, todo, noLines, noLines)
   554  
   555  	// object5 is string alias
   556  	flattenRun.AddExpectations("object5.go", []string{
   557  		`) ContextValidate(ctx context.Context, formats strfmt.Registry)`,
   558  		`validate.ReadOnly(ctx`,
   559  	}, todo, noLines, noLines)
   560  
   561  	// object6 is array of object5
   562  	flattenRun.AddExpectations("object6.go", []string{
   563  		`) ContextValidate(ctx context.Context, formats strfmt.Registry)`,
   564  		`for i := 0; i < len(m); i++`,
   565  		`m[i].ContextValidate(ctx, formats)`,
   566  	}, todo, noLines, noLines)
   567  
   568  	// object7 is all of object5 and object4 and fields
   569  	flattenRun.AddExpectations("object7.go", []string{
   570  		`) ContextValidate(ctx context.Context, formats strfmt.Registry)`,
   571  		`m.Object5.ContextValidate(ctx, formats)`,
   572  		`m.Object4.ContextValidate(ctx, formats)`,
   573  		// field one
   574  		`m.contextValidateObject7Field1(ctx, formats)`,
   575  		`contextValidateObject7Field1(ctx context.Context, formats strfmt.Registry)`,
   576  		// field two should missing since not readOnly
   577  		// field three
   578  		`m.contextValidateObject7Field3(ctx, formats)`,
   579  		`contextValidateObject7Field3(ctx context.Context, formats strfmt.Registry)`,
   580  		`m.Object7Field3.ContextValidate(ctx, formats)`,
   581  	}, todo, noLines,
   582  		[]string{
   583  			`m.contextValidateObject7Field2(ctx, formats)`,
   584  		})
   585  	// x go type
   586  	flattenRun.AddExpectations("time.go", []string{
   587  		`) ContextValidate(ctx context.Context, formats strfmt.Registry) error`,
   588  		`var f interface{} = m.Time`,
   589  	}, todo, noLines, noLines)
   590  	// additional properties
   591  	flattenRun.AddExpectations("object8.go", []string{
   592  		`) ContextValidate(ctx context.Context, formats strfmt.Registry) error`,
   593  		`for k := range m`,
   594  		`validate.ReadOnly(ctx`,
   595  	}, todo, noLines, noLines)
   596  	flattenRun.AddExpectations("object9.go", []string{
   597  		`) ContextValidate(ctx context.Context, formats strfmt.Registry) error`,
   598  		`m.contextValidateObject9Field1(ctx, formats)`,
   599  		`validate.ReadOnly(ctx`,
   600  	}, todo, noLines, noLines)
   601  }
   602  
   603  func initFixture2220() {
   604  	// NOTE(fred): this test merely asserts that template refactoring (essentially dealing with hite space gobbling etc)
   605  	// properly runs against the case of base type with additionalProperties.
   606  	//
   607  	// TODO(fred): should actually fix the problem in base type model rendering
   608  	f := newModelFixture("../fixtures/bugs/2220/fixture-2220.yaml", "check base type with additional properties")
   609  	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
   610  
   611  	flattenRun.AddExpectations("object.go", []string{
   612  		// This asserts our template announcement about forthcoming fix (used to  be a func commented out of luck)
   613  		`// AdditionalProperties in base type shoud be handled just like regular properties`,
   614  		`// At this moment, the base type property is pushed down to the subtype`,
   615  	}, todo, noLines, noLines)
   616  
   617  	flattenRun.AddExpectations("component.go", []string{
   618  		// This asserts the current schema layout, which works but does not honour inheritance from the base type
   619  		"ObjectAdditionalProperties map[string]interface{} `json:\"-\"`",
   620  	}, todo, noLines, noLines)
   621  }
   622  
   623  func initFixture2116() {
   624  	f := newModelFixture("../fixtures/bugs/2116/fixture-2116.yaml", "check x-omitempty and x-nullable with $ref")
   625  	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
   626  
   627  	flattenRun.AddExpectations("case1_fail_omitempty_false_not_hoisted_by_ref.go", []string{
   628  		"Body *ObjectWithOmitemptyFalse `json:\"Body\"`",
   629  	}, todo, noLines, noLines)
   630  
   631  	flattenRun.AddExpectations("case2_fail_omitempty_false_not_overridden_by_ref_sibling.go", []string{
   632  		"Body *ObjectWithOmitemptyTrue `json:\"Body,omitempty\"`",
   633  	}, todo, noLines, noLines)
   634  
   635  	flattenRun.AddExpectations("case3_pass_object_nullable_false_hoisted_by_ref.go", []string{
   636  		"Body ObjectWithNullableFalse `json:\"Body,omitempty\"`",
   637  	}, todo, noLines, noLines)
   638  
   639  	flattenRun.AddExpectations("case4_pass_object_nullable_false_overridden_by_ref_sibling.go", []string{
   640  		"Body *ObjectWithNullableTrue `json:\"Body,omitempty\"`",
   641  	}, todo, noLines, noLines)
   642  
   643  	flattenRun.AddExpectations("array_with_default.go", []string{
   644  		"type ArrayWithDefault []string",
   645  	}, append(todo, "omitempty"), noLines, noLines)
   646  
   647  	flattenRun.AddExpectations("array_with_no_omit_empty.go", []string{
   648  		"type ArrayWithNoOmitEmpty []string",
   649  	}, append(todo, "omitempty"), noLines, noLines)
   650  
   651  	flattenRun.AddExpectations("array_with_nullable.go", []string{
   652  		"type ArrayWithNullable []string",
   653  	}, todo, noLines, noLines)
   654  
   655  	flattenRun.AddExpectations("array_with_nullable_items.go", []string{
   656  		"type ArrayWithNullableItems []*string",
   657  	}, todo, noLines, noLines)
   658  
   659  	flattenRun.AddExpectations("array_with_omit_empty.go", []string{
   660  		"type ArrayWithOmitEmpty []string",
   661  	}, append(todo, "omitempty"), noLines, noLines)
   662  
   663  	flattenRun.AddExpectations("object_with_arrays.go", []string{
   664  		"Array0 ArrayWithDefault `json:\"array0,omitempty\"`",
   665  		"Array1 []string `json:\"array1\"`",
   666  		"Array11 []string `json:\"array11,omitempty\"`",
   667  		"Array12 []string `json:\"array12\"`",
   668  		"Array2 ArrayWithOmitEmpty `json:\"array2,omitempty\"`",
   669  		"Array3 ArrayWithNoOmitEmpty `json:\"array3\"`",
   670  	}, todo, noLines, noLines)
   671  
   672  	flattenRun.AddExpectations("object_with_nullable_false.go", []string{
   673  		"Data interface{} `json:\"Data,omitempty\"`",
   674  	}, todo, noLines, noLines)
   675  
   676  	flattenRun.AddExpectations("object_with_nullable_true.go", []string{
   677  		"Data interface{} `json:\"Data,omitempty\"`",
   678  	}, todo, noLines, noLines)
   679  
   680  	flattenRun.AddExpectations("object_with_omitempty_false.go", []string{
   681  		"Data interface{} `json:\"Data,omitempty\"`",
   682  	}, todo, noLines, noLines)
   683  
   684  	flattenRun.AddExpectations("object_with_omitempty_true.go", []string{
   685  		"Data interface{} `json:\"Data,omitempty\"`",
   686  	}, todo, noLines, noLines)
   687  
   688  	flattenRun.AddExpectations("array_with_omit_empty_items.go", []string{
   689  		"type ArrayWithOmitEmptyItems []string",
   690  	}, append(todo, "omitempty"), noLines, noLines)
   691  }
   692  
   693  func initFixture2071() {
   694  	f := newModelFixture("../fixtures/bugs/2071/fixture-2071.yaml", "check allOf serializer when x-go-name is present")
   695  	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
   696  	flattenRun.AddExpectations("cat.go", []string{
   697  		"var dataAO1 struct {\n\t\tSomeAbility *string `json:\"ability,omitempty\"`",
   698  	},
   699  		// not expected
   700  		append(todo, "SomeAbility *string `json:\"SomeAbility,omitempty\"`"),
   701  		// output in log
   702  		noLines,
   703  		noLines)
   704  }
   705  
   706  func initFixture1479Part() {
   707  	// testing ../fixtures/bugs/1479/fixture-1479-part.yaml with flatten and expand (--skip-flatten)
   708  
   709  	/*
   710  		The breakage with allOf occurs when a schema with an allOf has itself a
   711  		property which is an allOf construct
   712  	*/
   713  
   714  	f := newModelFixture("../fixtures/bugs/1479/fixture-1479-part.yaml", "check nested AllOf validations (from Pouch Engine API)")
   715  	flattenRun := f.AddRun(false)
   716  	expandRun := f.AddRun(true)
   717  
   718  	// load expectations for model: container_create_config_all_of1.go
   719  	flattenRun.AddExpectations("container_create_config_all_of1.go", []string{
   720  		`type ContainerCreateConfigAllOf1 struct {`,
   721  		"	HostConfig *HostConfig `json:\"HostConfig,omitempty\"`",
   722  		"	NetworkingConfig *NetworkingConfig `json:\"NetworkingConfig,omitempty\"`",
   723  		`func (m *ContainerCreateConfigAllOf1) Validate(formats strfmt.Registry) error {`,
   724  		`	if err := m.validateHostConfig(formats); err != nil {`,
   725  		`	if err := m.validateNetworkingConfig(formats); err != nil {`,
   726  		`		return errors.CompositeValidationError(res...`,
   727  		`func (m *ContainerCreateConfigAllOf1) validateHostConfig(formats strfmt.Registry) error {`,
   728  		`	if swag.IsZero(m.HostConfig) {`,
   729  		`	if m.HostConfig != nil {`,
   730  		`		if err := m.HostConfig.Validate(formats); err != nil {`,
   731  		`			if ve, ok := err.(*errors.Validation); ok {`,
   732  		`				return ve.ValidateName("HostConfig"`,
   733  		`func (m *ContainerCreateConfigAllOf1) validateNetworkingConfig(formats strfmt.Registry) error {`,
   734  		`	if swag.IsZero(m.NetworkingConfig) {`,
   735  		`	if m.NetworkingConfig != nil {`,
   736  		`		if err := m.NetworkingConfig.Validate(formats); err != nil {`,
   737  		`			if ve, ok := err.(*errors.Validation); ok {`,
   738  		`				return ve.ValidateName("NetworkingConfig"`,
   739  	},
   740  		// not expected
   741  		todo,
   742  		// output in log
   743  		noLines,
   744  		noLines)
   745  
   746  	// load expectations for model: container_config.go
   747  	flattenRun.AddExpectations("container_config.go", []string{
   748  		`type ContainerConfig struct {`,
   749  		"	ArgsEscaped bool `json:\"ArgsEscaped,omitempty\"`",
   750  		"	AttachStderr bool `json:\"AttachStderr,omitempty\"`",
   751  		"	AttachStdin bool `json:\"AttachStdin,omitempty\"`",
   752  		"	AttachStdout bool `json:\"AttachStdout,omitempty\"`",
   753  		"	Cmd []string `json:\"Cmd\"`",
   754  		"	DiskQuota map[string]string `json:\"DiskQuota,omitempty\"`",
   755  		"	Domainname string `json:\"Domainname,omitempty\"`",
   756  		"	Entrypoint []string `json:\"Entrypoint\"`",
   757  		"	Env []string `json:\"Env\"`",
   758  		"	ExposedPorts map[string]interface{} `json:\"ExposedPorts,omitempty\"`",
   759  		"	Hostname strfmt.Hostname `json:\"Hostname,omitempty\"`",
   760  		"	Image string `json:\"Image\"`",
   761  		"	InitScript string `json:\"InitScript,omitempty\"`",
   762  		"	Labels map[string]string `json:\"Labels,omitempty\"`",
   763  		"	MacAddress string `json:\"MacAddress,omitempty\"`",
   764  		"	NetworkDisabled bool `json:\"NetworkDisabled,omitempty\"`",
   765  		"	OnBuild []string `json:\"OnBuild\"`",
   766  		"	OpenStdin bool `json:\"OpenStdin,omitempty\"`",
   767  		"	QuotaID string `json:\"QuotaID,omitempty\"`",
   768  		"	Rich bool `json:\"Rich,omitempty\"`",
   769  		"	RichMode string `json:\"RichMode,omitempty\"`",
   770  		"	Shell []string `json:\"Shell\"`",
   771  		"	SpecAnnotation map[string]string `json:\"SpecAnnotation,omitempty\"`",
   772  		"	StdinOnce bool `json:\"StdinOnce,omitempty\"`",
   773  		"	StopSignal string `json:\"StopSignal,omitempty\"`",
   774  		"	StopTimeout *int64 `json:\"StopTimeout,omitempty\"`",
   775  		"	Tty bool `json:\"Tty,omitempty\"`",
   776  		"	User string `json:\"User,omitempty\"`",
   777  		"	Volumes map[string]interface{} `json:\"Volumes,omitempty\"`",
   778  		"	WorkingDir string `json:\"WorkingDir,omitempty\"`",
   779  		`func (m *ContainerConfig) Validate(formats strfmt.Registry) error {`,
   780  		`	if err := m.validateExposedPorts(formats); err != nil {`,
   781  		`	if err := m.validateHostname(formats); err != nil {`,
   782  		`	if err := m.validateImage(formats); err != nil {`,
   783  		`	if err := m.validateRichMode(formats); err != nil {`,
   784  		`	if err := m.validateVolumes(formats); err != nil {`,
   785  		`		return errors.CompositeValidationError(res...`,
   786  		`var containerConfigExposedPortsValueEnum []interface{`,
   787  		`	var res []interface{`,
   788  		"	if err := json.Unmarshal([]byte(`[{}]`), &res); err != nil {",
   789  		`	for _, v := range res {`,
   790  		`		containerConfigExposedPortsValueEnum = append(containerConfigExposedPortsValueEnum, v`,
   791  		`func (m *ContainerConfig) validateExposedPortsValueEnum(path, location string, value interface{}) error {`,
   792  		`	if err := validate.EnumCase(path, location, value, containerConfigExposedPortsValueEnum, true); err != nil {`,
   793  		`func (m *ContainerConfig) validateExposedPorts(formats strfmt.Registry) error {`,
   794  		`	if swag.IsZero(m.ExposedPorts) {`,
   795  		`	for k := range m.ExposedPorts {`,
   796  		`		if err := m.validateExposedPortsValueEnum("ExposedPorts"+"."+k, "body", m.ExposedPorts[k]); err != nil {`,
   797  		`func (m *ContainerConfig) validateHostname(formats strfmt.Registry) error {`,
   798  		`	if swag.IsZero(m.Hostname) {`,
   799  		`	if err := validate.MinLength("Hostname", "body", m.Hostname.String(), 1); err != nil {`,
   800  		`	if err := validate.FormatOf("Hostname", "body", "hostname", m.Hostname.String(), formats); err != nil {`,
   801  		`func (m *ContainerConfig) validateImage(formats strfmt.Registry) error {`,
   802  		`	if err := validate.RequiredString("Image", "body", m.Image); err != nil {`,
   803  		`var containerConfigTypeRichModePropEnum []interface{`,
   804  		`	var res []string`,
   805  		"	if err := json.Unmarshal([]byte(`[\"dumb-init\",\"sbin-init\",\"systemd\"]`), &res); err != nil {",
   806  		`	for _, v := range res {`,
   807  		`		containerConfigTypeRichModePropEnum = append(containerConfigTypeRichModePropEnum, v`,
   808  		`	ContainerConfigRichModeDumbDashInit string = "dumb-init"`,
   809  		`	ContainerConfigRichModeSbinDashInit string = "sbin-init"`,
   810  		`	ContainerConfigRichModeSystemd string = "systemd"`,
   811  		`func (m *ContainerConfig) validateRichModeEnum(path, location string, value string) error {`,
   812  		`	if err := validate.EnumCase(path, location, value, containerConfigTypeRichModePropEnum, true); err != nil {`,
   813  		`func (m *ContainerConfig) validateRichMode(formats strfmt.Registry) error {`,
   814  		`	if swag.IsZero(m.RichMode) {`,
   815  		`	if err := m.validateRichModeEnum("RichMode", "body", m.RichMode); err != nil {`,
   816  		`var containerConfigVolumesValueEnum []interface{`,
   817  		`	var res []interface{`,
   818  		"	if err := json.Unmarshal([]byte(`[{}]`), &res); err != nil {",
   819  		`	for _, v := range res {`,
   820  		`		containerConfigVolumesValueEnum = append(containerConfigVolumesValueEnum, v`,
   821  		`func (m *ContainerConfig) validateVolumesValueEnum(path, location string, value interface{}) error {`,
   822  		`	if err := validate.EnumCase(path, location, value, containerConfigVolumesValueEnum, true); err != nil {`,
   823  		`func (m *ContainerConfig) validateVolumes(formats strfmt.Registry) error {`,
   824  		`	if swag.IsZero(m.Volumes) {`,
   825  		`	for k := range m.Volumes {`,
   826  		`		if err := m.validateVolumesValueEnum("Volumes"+"."+k, "body", m.Volumes[k]); err != nil {`,
   827  	},
   828  		// not expected
   829  		todo,
   830  		// output in log
   831  		noLines,
   832  		noLines)
   833  
   834  	expandRun.AddExpectations("container_config.go", flattenRun.ExpectedFor("ContainerConfig").ExpectedLines, todo, noLines, noLines)
   835  
   836  	// load expectations for model: host_config_all_of0_log_config.go
   837  	flattenRun.AddExpectations("host_config_all_of0_log_config.go", []string{
   838  		`type HostConfigAllOf0LogConfig struct {`,
   839  		"	Config map[string]string `json:\"Config,omitempty\"`",
   840  		"	Type string `json:\"Type,omitempty\"`",
   841  		`func (m *HostConfigAllOf0LogConfig) Validate(formats strfmt.Registry) error {`,
   842  		`	if err := m.validateType(formats); err != nil {`,
   843  		`		return errors.CompositeValidationError(res...`,
   844  		`var hostConfigAllOf0LogConfigTypeTypePropEnum []interface{`,
   845  		`	var res []string`,
   846  		"	if err := json.Unmarshal([]byte(`[\"json-file\",\"syslog\",\"journald\",\"gelf\",\"fluentd\",\"awslogs\",\"splunk\",\"etwlogs\",\"none\"]`), &res); err != nil {",
   847  		`	for _, v := range res {`,
   848  		`		hostConfigAllOf0LogConfigTypeTypePropEnum = append(hostConfigAllOf0LogConfigTypeTypePropEnum, v`,
   849  		`	HostConfigAllOf0LogConfigTypeJSONDashFile string = "json-file"`,
   850  		`	HostConfigAllOf0LogConfigTypeSyslog string = "syslog"`,
   851  		`	HostConfigAllOf0LogConfigTypeJournald string = "journald"`,
   852  		`	HostConfigAllOf0LogConfigTypeGelf string = "gelf"`,
   853  		`	HostConfigAllOf0LogConfigTypeFluentd string = "fluentd"`,
   854  		`	HostConfigAllOf0LogConfigTypeAwslogs string = "awslogs"`,
   855  		`	HostConfigAllOf0LogConfigTypeSplunk string = "splunk"`,
   856  		`	HostConfigAllOf0LogConfigTypeEtwlogs string = "etwlogs"`,
   857  		`	HostConfigAllOf0LogConfigTypeNone string = "none"`,
   858  		`func (m *HostConfigAllOf0LogConfig) validateTypeEnum(path, location string, value string) error {`,
   859  		`	if err := validate.EnumCase(path, location, value, hostConfigAllOf0LogConfigTypeTypePropEnum, true); err != nil {`,
   860  		`func (m *HostConfigAllOf0LogConfig) validateType(formats strfmt.Registry) error {`,
   861  		`	if swag.IsZero(m.Type) {`,
   862  		`	if err := m.validateTypeEnum("Type", "body", m.Type); err != nil {`,
   863  	},
   864  		// not expected
   865  		todo,
   866  		// output in log
   867  		noLines,
   868  		noLines)
   869  
   870  	// load expectations for model: restart_policy.go
   871  	flattenRun.AddExpectations("restart_policy.go", []string{
   872  		`type RestartPolicy struct {`,
   873  		"	MaximumRetryCount int64 `json:\"MaximumRetryCount,omitempty\"`",
   874  		"	Name string `json:\"Name,omitempty\"`",
   875  		// empty validation
   876  		"func (m *RestartPolicy) Validate(formats strfmt.Registry) error {\n	return nil\n}",
   877  	},
   878  		// not expected
   879  		todo,
   880  		// output in log
   881  		noLines,
   882  		noLines)
   883  
   884  	expandRun.AddExpectations("restart_policy.go", flattenRun.ExpectedFor("RestartPolicy").ExpectedLines, todo, noLines, noLines)
   885  
   886  	// load expectations for model: endpoint_ip_a_m_config.go
   887  	flattenRun.AddExpectations("endpoint_ip_a_m_config.go", []string{
   888  		`type EndpointIPAMConfig struct {`,
   889  		"	IPV4Address string `json:\"IPv4Address,omitempty\"`",
   890  		"	IPV6Address string `json:\"IPv6Address,omitempty\"`",
   891  		"	LinkLocalIPs []string `json:\"LinkLocalIPs\"`",
   892  		// empty validation
   893  		"func (m *EndpointIPAMConfig) Validate(formats strfmt.Registry) error {\n	return nil\n}",
   894  	},
   895  		// not expected
   896  		todo,
   897  		// output in log
   898  		noLines,
   899  		noLines)
   900  
   901  	expandRun.AddExpectations("endpoint_ip_a_m_config.go", flattenRun.ExpectedFor("EndpointIPAMConfig").ExpectedLines, todo, noLines, noLines)
   902  
   903  	// load expectations for model: host_config_all_of0.go
   904  	flattenRun.AddExpectations("host_config_all_of0.go", []string{
   905  		`type HostConfigAllOf0 struct {`,
   906  		"	AutoRemove bool `json:\"AutoRemove,omitempty\"`",
   907  		"	Binds []string `json:\"Binds\"`",
   908  		"	CapAdd []string `json:\"CapAdd\"`",
   909  		"	CapDrop []string `json:\"CapDrop\"`",
   910  		"	Cgroup string `json:\"Cgroup,omitempty\"`",
   911  		"	ConsoleSize []*int64 `json:\"ConsoleSize\"`",
   912  		"	ContainerIDFile string `json:\"ContainerIDFile,omitempty\"`",
   913  		"	DNS []string `json:\"Dns\"`",
   914  		"	DNSOptions []string `json:\"DnsOptions\"`",
   915  		"	DNSSearch []string `json:\"DnsSearch\"`",
   916  		"	EnableLxcfs bool `json:\"EnableLxcfs,omitempty\"`",
   917  		"	ExtraHosts []string `json:\"ExtraHosts\"`",
   918  		"	GroupAdd []string `json:\"GroupAdd\"`",
   919  		"	InitScript string `json:\"InitScript,omitempty\"`",
   920  		"	IpcMode string `json:\"IpcMode,omitempty\"`",
   921  		"	Isolation string `json:\"Isolation,omitempty\"`",
   922  		"	Links []string `json:\"Links\"`",
   923  		"	LogConfig *HostConfigAllOf0LogConfig `json:\"LogConfig,omitempty\"`",
   924  		"	NetworkMode string `json:\"NetworkMode,omitempty\"`",
   925  		"	OomScoreAdj int64 `json:\"OomScoreAdj,omitempty\"`",
   926  		"	PidMode string `json:\"PidMode,omitempty\"`",
   927  		"	Privileged bool `json:\"Privileged,omitempty\"`",
   928  		"	PublishAllPorts bool `json:\"PublishAllPorts,omitempty\"`",
   929  		"	ReadonlyRootfs bool `json:\"ReadonlyRootfs,omitempty\"`",
   930  		"	RestartPolicy *RestartPolicy `json:\"RestartPolicy,omitempty\"`",
   931  		"	Rich bool `json:\"Rich,omitempty\"`",
   932  		"	RichMode string `json:\"RichMode,omitempty\"`",
   933  		"	Runtime string `json:\"Runtime,omitempty\"`",
   934  		"	SecurityOpt []string `json:\"SecurityOpt\"`",
   935  		"	ShmSize *int64 `json:\"ShmSize,omitempty\"`",
   936  		"	StorageOpt map[string]string `json:\"StorageOpt,omitempty\"`",
   937  		"	Sysctls map[string]string `json:\"Sysctls,omitempty\"`",
   938  		"	Tmpfs map[string]string `json:\"Tmpfs,omitempty\"`",
   939  		"	UTSMode string `json:\"UTSMode,omitempty\"`",
   940  		"	UsernsMode string `json:\"UsernsMode,omitempty\"`",
   941  		"	VolumeDriver string `json:\"VolumeDriver,omitempty\"`",
   942  		"	VolumesFrom []string `json:\"VolumesFrom\"`",
   943  		`func (m *HostConfigAllOf0) Validate(formats strfmt.Registry) error {`,
   944  		`	if err := m.validateConsoleSize(formats); err != nil {`,
   945  		`	if err := m.validateIsolation(formats); err != nil {`,
   946  		`	if err := m.validateLogConfig(formats); err != nil {`,
   947  		`	if err := m.validateOomScoreAdj(formats); err != nil {`,
   948  		`	if err := m.validateRestartPolicy(formats); err != nil {`,
   949  		`	if err := m.validateRichMode(formats); err != nil {`,
   950  		`	if err := m.validateShmSize(formats); err != nil {`,
   951  		`		return errors.CompositeValidationError(res...`,
   952  		`func (m *HostConfigAllOf0) validateConsoleSize(formats strfmt.Registry) error {`,
   953  		`	if swag.IsZero(m.ConsoleSize) {`,
   954  		`	iConsoleSizeSize := int64(len(m.ConsoleSize)`,
   955  		`	if err := validate.MinItems("ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`,
   956  		`	if err := validate.MaxItems("ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`,
   957  		`	for i := 0; i < len(m.ConsoleSize); i++ {`,
   958  		// do we need...?
   959  		`		if swag.IsZero(m.ConsoleSize[i]) {`,
   960  		`		if err := validate.MinimumInt("ConsoleSize"+"."+strconv.Itoa(i), "body", *m.ConsoleSize[i], 0, false); err != nil {`,
   961  		`var hostConfigAllOf0TypeIsolationPropEnum []interface{`,
   962  		`	var res []string`,
   963  		"	if err := json.Unmarshal([]byte(`[\"default\",\"process\",\"hyperv\"]`), &res); err != nil {",
   964  		`	for _, v := range res {`,
   965  		`		hostConfigAllOf0TypeIsolationPropEnum = append(hostConfigAllOf0TypeIsolationPropEnum, v`,
   966  		`	HostConfigAllOf0IsolationDefault string = "default"`,
   967  		`	HostConfigAllOf0IsolationProcess string = "process"`,
   968  		`	HostConfigAllOf0IsolationHyperv string = "hyperv"`,
   969  		`func (m *HostConfigAllOf0) validateIsolationEnum(path, location string, value string) error {`,
   970  		`	if err := validate.EnumCase(path, location, value, hostConfigAllOf0TypeIsolationPropEnum, true); err != nil {`,
   971  		`func (m *HostConfigAllOf0) validateIsolation(formats strfmt.Registry) error {`,
   972  		`	if swag.IsZero(m.Isolation) {`,
   973  		`	if err := m.validateIsolationEnum("Isolation", "body", m.Isolation); err != nil {`,
   974  		`func (m *HostConfigAllOf0) validateLogConfig(formats strfmt.Registry) error {`,
   975  		`	if swag.IsZero(m.LogConfig) {`,
   976  		`	if m.LogConfig != nil {`,
   977  		`		if err := m.LogConfig.Validate(formats); err != nil {`,
   978  		`			if ve, ok := err.(*errors.Validation); ok {`,
   979  		`				return ve.ValidateName("LogConfig"`,
   980  		`func (m *HostConfigAllOf0) validateOomScoreAdj(formats strfmt.Registry) error {`,
   981  		`	if swag.IsZero(m.OomScoreAdj) {`,
   982  		`	if err := validate.MinimumInt("OomScoreAdj", "body", m.OomScoreAdj, -1000, false); err != nil {`,
   983  		`	if err := validate.MaximumInt("OomScoreAdj", "body", m.OomScoreAdj, 1000, false); err != nil {`,
   984  		`func (m *HostConfigAllOf0) validateRestartPolicy(formats strfmt.Registry) error {`,
   985  		`	if swag.IsZero(m.RestartPolicy) {`,
   986  		`	if m.RestartPolicy != nil {`,
   987  		`		if err := m.RestartPolicy.Validate(formats); err != nil {`,
   988  		`			if ve, ok := err.(*errors.Validation); ok {`,
   989  		`				return ve.ValidateName("RestartPolicy"`,
   990  		`var hostConfigAllOf0TypeRichModePropEnum []interface{`,
   991  		`	var res []string`,
   992  		"	if err := json.Unmarshal([]byte(`[\"dumb-init\",\"sbin-init\",\"systemd\"]`), &res); err != nil {",
   993  		`	for _, v := range res {`,
   994  		`		hostConfigAllOf0TypeRichModePropEnum = append(hostConfigAllOf0TypeRichModePropEnum, v`,
   995  		`	HostConfigAllOf0RichModeDumbDashInit string = "dumb-init"`,
   996  		`	HostConfigAllOf0RichModeSbinDashInit string = "sbin-init"`,
   997  		`	HostConfigAllOf0RichModeSystemd string = "systemd"`,
   998  		`func (m *HostConfigAllOf0) validateRichModeEnum(path, location string, value string) error {`,
   999  		`	if err := validate.EnumCase(path, location, value, hostConfigAllOf0TypeRichModePropEnum, true); err != nil {`,
  1000  		`func (m *HostConfigAllOf0) validateRichMode(formats strfmt.Registry) error {`,
  1001  		`	if swag.IsZero(m.RichMode) {`,
  1002  		`	if err := m.validateRichModeEnum("RichMode", "body", m.RichMode); err != nil {`,
  1003  		`func (m *HostConfigAllOf0) validateShmSize(formats strfmt.Registry) error {`,
  1004  		`	if swag.IsZero(m.ShmSize) {`,
  1005  		`	if err := validate.MinimumInt("ShmSize", "body", *m.ShmSize, 0, false); err != nil {`,
  1006  	},
  1007  		// not expected
  1008  		todo,
  1009  		// output in log
  1010  		noLines,
  1011  		noLines)
  1012  
  1013  	// load expectations for model: host_config.go
  1014  	flattenRun.AddExpectations("host_config.go", []string{
  1015  		`type HostConfig struct {`,
  1016  		`	HostConfigAllOf0`,
  1017  		`	Resources`,
  1018  		`func (m *HostConfig) Validate(formats strfmt.Registry) error {`,
  1019  		`	if err := m.HostConfigAllOf0.Validate(formats); err != nil {`,
  1020  		`	if err := m.Resources.Validate(formats); err != nil {`,
  1021  		`		return errors.CompositeValidationError(res...`,
  1022  	},
  1023  		// not expected
  1024  		todo,
  1025  		// output in log
  1026  		noLines,
  1027  		noLines)
  1028  
  1029  	expandRun.AddExpectations("host_config.go", []string{
  1030  		`type HostConfig struct {`,
  1031  		"	AutoRemove bool `json:\"AutoRemove,omitempty\"`",
  1032  		"	Binds []string `json:\"Binds\"`",
  1033  		"	CapAdd []string `json:\"CapAdd\"`",
  1034  		"	CapDrop []string `json:\"CapDrop\"`",
  1035  		"	Cgroup string `json:\"Cgroup,omitempty\"`",
  1036  		"	ConsoleSize []*int64 `json:\"ConsoleSize\"`",
  1037  		"	ContainerIDFile string `json:\"ContainerIDFile,omitempty\"`",
  1038  		"	DNS []string `json:\"Dns\"`",
  1039  		"	DNSOptions []string `json:\"DnsOptions\"`",
  1040  		"	DNSSearch []string `json:\"DnsSearch\"`",
  1041  		"	EnableLxcfs bool `json:\"EnableLxcfs,omitempty\"`",
  1042  		"	ExtraHosts []string `json:\"ExtraHosts\"`",
  1043  		"	GroupAdd []string `json:\"GroupAdd\"`",
  1044  		"	InitScript string `json:\"InitScript,omitempty\"`",
  1045  		"	IpcMode string `json:\"IpcMode,omitempty\"`",
  1046  		"	Isolation string `json:\"Isolation,omitempty\"`",
  1047  		"	Links []string `json:\"Links\"`",
  1048  		"	LogConfig *HostConfigAO0LogConfig `json:\"LogConfig,omitempty\"`",
  1049  		"	NetworkMode string `json:\"NetworkMode,omitempty\"`",
  1050  		"	OomScoreAdj int64 `json:\"OomScoreAdj,omitempty\"`",
  1051  		"	PidMode string `json:\"PidMode,omitempty\"`",
  1052  		"	Privileged bool `json:\"Privileged,omitempty\"`",
  1053  		"	PublishAllPorts bool `json:\"PublishAllPorts,omitempty\"`",
  1054  		"	ReadonlyRootfs bool `json:\"ReadonlyRootfs,omitempty\"`",
  1055  		"	RestartPolicy *HostConfigAO0RestartPolicy `json:\"RestartPolicy,omitempty\"`",
  1056  		"	Rich bool `json:\"Rich,omitempty\"`",
  1057  		"	RichMode string `json:\"RichMode,omitempty\"`",
  1058  		"	Runtime string `json:\"Runtime,omitempty\"`",
  1059  		"	SecurityOpt []string `json:\"SecurityOpt\"`",
  1060  		"	ShmSize *int64 `json:\"ShmSize,omitempty\"`",
  1061  		"	StorageOpt map[string]string `json:\"StorageOpt,omitempty\"`",
  1062  		"	Sysctls map[string]string `json:\"Sysctls,omitempty\"`",
  1063  		"	Tmpfs map[string]string `json:\"Tmpfs,omitempty\"`",
  1064  		"	UTSMode string `json:\"UTSMode,omitempty\"`",
  1065  		"	UsernsMode string `json:\"UsernsMode,omitempty\"`",
  1066  		"	VolumeDriver string `json:\"VolumeDriver,omitempty\"`",
  1067  		"	VolumesFrom []string `json:\"VolumesFrom\"`",
  1068  		"	BlkioWeight uint16 `json:\"BlkioWeight,omitempty\"`",
  1069  		"	CgroupParent string `json:\"CgroupParent,omitempty\"`",
  1070  		"	CPUShares int64 `json:\"CpuShares,omitempty\"`",
  1071  		"	Memory int64 `json:\"Memory,omitempty\"`",
  1072  		`func (m *HostConfig) Validate(formats strfmt.Registry) error {`,
  1073  		`	if err := m.validateConsoleSize(formats); err != nil {`,
  1074  		`	if err := m.validateIsolation(formats); err != nil {`,
  1075  		`	if err := m.validateLogConfig(formats); err != nil {`,
  1076  		`	if err := m.validateOomScoreAdj(formats); err != nil {`,
  1077  		`	if err := m.validateRestartPolicy(formats); err != nil {`,
  1078  		`	if err := m.validateRichMode(formats); err != nil {`,
  1079  		`	if err := m.validateShmSize(formats); err != nil {`,
  1080  		`	if err := m.validateBlkioWeight(formats); err != nil {`,
  1081  		`		return errors.CompositeValidationError(res...`,
  1082  		`func (m *HostConfig) validateConsoleSize(formats strfmt.Registry) error {`,
  1083  		`	if swag.IsZero(m.ConsoleSize) {`,
  1084  		`	iConsoleSizeSize := int64(len(m.ConsoleSize)`,
  1085  		`	if err := validate.MinItems("ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`,
  1086  		`	if err := validate.MaxItems("ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`,
  1087  		`	for i := 0; i < len(m.ConsoleSize); i++ {`,
  1088  		// do we need...
  1089  		`		if swag.IsZero(m.ConsoleSize[i]) {`,
  1090  		`		if err := validate.MinimumInt("ConsoleSize"+"."+strconv.Itoa(i), "body", *m.ConsoleSize[i], 0, false); err != nil {`,
  1091  		`var hostConfigTypeIsolationPropEnum []interface{`,
  1092  		`	var res []string`,
  1093  		"	if err := json.Unmarshal([]byte(`[\"default\",\"process\",\"hyperv\"]`), &res); err != nil {",
  1094  		`	for _, v := range res {`,
  1095  		`		hostConfigTypeIsolationPropEnum = append(hostConfigTypeIsolationPropEnum, v`,
  1096  		`func (m *HostConfig) validateIsolationEnum(path, location string, value string) error {`,
  1097  		`	if err := validate.EnumCase(path, location, value, hostConfigTypeIsolationPropEnum, true); err != nil {`,
  1098  		`func (m *HostConfig) validateIsolation(formats strfmt.Registry) error {`,
  1099  		`	if swag.IsZero(m.Isolation) {`,
  1100  		`	if err := m.validateIsolationEnum("Isolation", "body", m.Isolation); err != nil {`,
  1101  		`func (m *HostConfig) validateLogConfig(formats strfmt.Registry) error {`,
  1102  		`	if swag.IsZero(m.LogConfig) {`,
  1103  		`	if m.LogConfig != nil {`,
  1104  		`		if err := m.LogConfig.Validate(formats); err != nil {`,
  1105  		`			if ve, ok := err.(*errors.Validation); ok {`,
  1106  		`				return ve.ValidateName("LogConfig"`,
  1107  		`func (m *HostConfig) validateOomScoreAdj(formats strfmt.Registry) error {`,
  1108  		`	if swag.IsZero(m.OomScoreAdj) {`,
  1109  		`	if err := validate.MinimumInt("OomScoreAdj", "body", m.OomScoreAdj, -1000, false); err != nil {`,
  1110  		`	if err := validate.MaximumInt("OomScoreAdj", "body", m.OomScoreAdj, 1000, false); err != nil {`,
  1111  		`func (m *HostConfig) validateRestartPolicy(formats strfmt.Registry) error {`,
  1112  		`	if swag.IsZero(m.RestartPolicy) {`,
  1113  		`	if m.RestartPolicy != nil {`,
  1114  		`		if err := m.RestartPolicy.Validate(formats); err != nil {`,
  1115  		`			if ve, ok := err.(*errors.Validation); ok {`,
  1116  		`				return ve.ValidateName("RestartPolicy"`,
  1117  		`var hostConfigTypeRichModePropEnum []interface{`,
  1118  		`	var res []string`,
  1119  		"	if err := json.Unmarshal([]byte(`[\"dumb-init\",\"sbin-init\",\"systemd\"]`), &res); err != nil {",
  1120  		`	for _, v := range res {`,
  1121  		`		hostConfigTypeRichModePropEnum = append(hostConfigTypeRichModePropEnum, v`,
  1122  		`func (m *HostConfig) validateRichModeEnum(path, location string, value string) error {`,
  1123  		`	if err := validate.EnumCase(path, location, value, hostConfigTypeRichModePropEnum, true); err != nil {`,
  1124  		`func (m *HostConfig) validateRichMode(formats strfmt.Registry) error {`,
  1125  		`	if swag.IsZero(m.RichMode) {`,
  1126  		`	if err := m.validateRichModeEnum("RichMode", "body", m.RichMode); err != nil {`,
  1127  		`func (m *HostConfig) validateShmSize(formats strfmt.Registry) error {`,
  1128  		`	if swag.IsZero(m.ShmSize) {`,
  1129  		`	if err := validate.MinimumInt("ShmSize", "body", *m.ShmSize, 0, false); err != nil {`,
  1130  		`func (m *HostConfig) validateBlkioWeight(formats strfmt.Registry) error {`,
  1131  		`	if swag.IsZero(m.BlkioWeight) {`,
  1132  		`	if err := validate.MinimumUint("BlkioWeight", "body", uint64(m.BlkioWeight), 0, false); err != nil {`,
  1133  		`	if err := validate.MaximumUint("BlkioWeight", "body", uint64(m.BlkioWeight), 1000, false); err != nil {`,
  1134  		`type HostConfigAO0LogConfig struct {`,
  1135  		"	Config map[string]string `json:\"Config,omitempty\"`",
  1136  		"	Type string `json:\"Type,omitempty\"`",
  1137  		`func (m *HostConfigAO0LogConfig) Validate(formats strfmt.Registry) error {`,
  1138  		`	if err := m.validateType(formats); err != nil {`,
  1139  		`		return errors.CompositeValidationError(res...`,
  1140  		`var hostConfigAO0LogConfigTypeTypePropEnum []interface{`,
  1141  		`	var res []string`,
  1142  		"	if err := json.Unmarshal([]byte(`[\"json-file\",\"syslog\",\"journald\",\"gelf\",\"fluentd\",\"awslogs\",\"splunk\",\"etwlogs\",\"none\"]`), &res); err != nil {",
  1143  		`	for _, v := range res {`,
  1144  		`		hostConfigAO0LogConfigTypeTypePropEnum = append(hostConfigAO0LogConfigTypeTypePropEnum, v`,
  1145  		`	HostConfigAO0LogConfigTypeJSONDashFile string = "json-file"`,
  1146  		`	HostConfigAO0LogConfigTypeSyslog string = "syslog"`,
  1147  		`	HostConfigAO0LogConfigTypeJournald string = "journald"`,
  1148  		`	HostConfigAO0LogConfigTypeGelf string = "gelf"`,
  1149  		`	HostConfigAO0LogConfigTypeFluentd string = "fluentd"`,
  1150  		`	HostConfigAO0LogConfigTypeAwslogs string = "awslogs"`,
  1151  		`	HostConfigAO0LogConfigTypeSplunk string = "splunk"`,
  1152  		`	HostConfigAO0LogConfigTypeEtwlogs string = "etwlogs"`,
  1153  		`	HostConfigAO0LogConfigTypeNone string = "none"`,
  1154  		`func (m *HostConfigAO0LogConfig) validateTypeEnum(path, location string, value string) error {`,
  1155  		`	if err := validate.EnumCase(path, location, value, hostConfigAO0LogConfigTypeTypePropEnum, true); err != nil {`,
  1156  		`func (m *HostConfigAO0LogConfig) validateType(formats strfmt.Registry) error {`,
  1157  		`	if swag.IsZero(m.Type) {`,
  1158  		`	if err := m.validateTypeEnum("LogConfig"+"."+"Type", "body", m.Type); err != nil {`,
  1159  		`type HostConfigAO0RestartPolicy struct {`,
  1160  		"	MaximumRetryCount int64 `json:\"MaximumRetryCount,omitempty\"`",
  1161  		"	Name string `json:\"Name,omitempty\"`",
  1162  		`func (m *HostConfigAO0RestartPolicy) Validate(formats strfmt.Registry) error {`,
  1163  		`		return errors.CompositeValidationError(res...`,
  1164  	},
  1165  		// not expected
  1166  		todo,
  1167  		// output in log
  1168  		noLines,
  1169  		noLines)
  1170  
  1171  	// load expectations for model: container_create_config.go
  1172  	flattenRun.AddExpectations("container_create_config.go", []string{
  1173  		`type ContainerCreateConfig struct {`,
  1174  		`	ContainerConfig`,
  1175  		`	ContainerCreateConfigAllOf1`,
  1176  		`func (m *ContainerCreateConfig) Validate(formats strfmt.Registry) error {`,
  1177  		`	if err := m.ContainerConfig.Validate(formats); err != nil {`,
  1178  		`	if err := m.ContainerCreateConfigAllOf1.Validate(formats); err != nil {`,
  1179  		`		return errors.CompositeValidationError(res...`,
  1180  	},
  1181  		// not expected
  1182  		todo,
  1183  		// output in log
  1184  		noLines,
  1185  		noLines)
  1186  
  1187  	expandRun.AddExpectations("container_create_config.go", []string{
  1188  		`type ContainerCreateConfig struct {`,
  1189  		"	ArgsEscaped bool `json:\"ArgsEscaped,omitempty\"`",
  1190  		"	AttachStderr bool `json:\"AttachStderr,omitempty\"`",
  1191  		"	AttachStdin bool `json:\"AttachStdin,omitempty\"`",
  1192  		"	AttachStdout bool `json:\"AttachStdout,omitempty\"`",
  1193  		"	Cmd []string `json:\"Cmd\"`",
  1194  		"	DiskQuota map[string]string `json:\"DiskQuota,omitempty\"`",
  1195  		"	Domainname string `json:\"Domainname,omitempty\"`",
  1196  		"	Entrypoint []string `json:\"Entrypoint\"`",
  1197  		"	Env []string `json:\"Env\"`",
  1198  		"	ExposedPorts map[string]interface{} `json:\"ExposedPorts,omitempty\"`",
  1199  		"	Hostname strfmt.Hostname `json:\"Hostname,omitempty\"`",
  1200  		"	Image string `json:\"Image\"`",
  1201  		"	InitScript string `json:\"InitScript,omitempty\"`",
  1202  		"	Labels map[string]string `json:\"Labels,omitempty\"`",
  1203  		"	MacAddress string `json:\"MacAddress,omitempty\"`",
  1204  		"	NetworkDisabled bool `json:\"NetworkDisabled,omitempty\"`",
  1205  		"	OnBuild []string `json:\"OnBuild\"`",
  1206  		"	OpenStdin bool `json:\"OpenStdin,omitempty\"`",
  1207  		"	QuotaID string `json:\"QuotaID,omitempty\"`",
  1208  		"	Rich bool `json:\"Rich,omitempty\"`",
  1209  		"	RichMode string `json:\"RichMode,omitempty\"`",
  1210  		"	Shell []string `json:\"Shell\"`",
  1211  		"	SpecAnnotation map[string]string `json:\"SpecAnnotation,omitempty\"`",
  1212  		"	StdinOnce bool `json:\"StdinOnce,omitempty\"`",
  1213  		"	StopSignal string `json:\"StopSignal,omitempty\"`",
  1214  		"	StopTimeout *int64 `json:\"StopTimeout,omitempty\"`",
  1215  		"	Tty bool `json:\"Tty,omitempty\"`",
  1216  		"	User string `json:\"User,omitempty\"`",
  1217  		"	Volumes map[string]interface{} `json:\"Volumes,omitempty\"`",
  1218  		"	WorkingDir string `json:\"WorkingDir,omitempty\"`",
  1219  		`	HostConfig struct {`,
  1220  		"		AutoRemove bool `json:\"AutoRemove,omitempty\"`",
  1221  		"		Binds []string `json:\"Binds\"`",
  1222  		"		CapAdd []string `json:\"CapAdd\"`",
  1223  		"		CapDrop []string `json:\"CapDrop\"`",
  1224  		"		Cgroup string `json:\"Cgroup,omitempty\"`",
  1225  		"		ConsoleSize []*int64 `json:\"ConsoleSize\"`",
  1226  		"		ContainerIDFile string `json:\"ContainerIDFile,omitempty\"`",
  1227  		"		DNS []string `json:\"Dns\"`",
  1228  		"		DNSOptions []string `json:\"DnsOptions\"`",
  1229  		"		DNSSearch []string `json:\"DnsSearch\"`",
  1230  		"		EnableLxcfs bool `json:\"EnableLxcfs,omitempty\"`",
  1231  		"		ExtraHosts []string `json:\"ExtraHosts\"`",
  1232  		"		GroupAdd []string `json:\"GroupAdd\"`",
  1233  		"		InitScript string `json:\"InitScript,omitempty\"`",
  1234  		"		IpcMode string `json:\"IpcMode,omitempty\"`",
  1235  		"		Isolation string `json:\"Isolation,omitempty\"`",
  1236  		"		Links []string `json:\"Links\"`",
  1237  		"		LogConfig *ContainerCreateConfigHostConfigAO0LogConfig `json:\"LogConfig,omitempty\"`",
  1238  		"		NetworkMode string `json:\"NetworkMode,omitempty\"`",
  1239  		"		OomScoreAdj int64 `json:\"OomScoreAdj,omitempty\"`",
  1240  		"		PidMode string `json:\"PidMode,omitempty\"`",
  1241  		"		Privileged bool `json:\"Privileged,omitempty\"`",
  1242  		"		PublishAllPorts bool `json:\"PublishAllPorts,omitempty\"`",
  1243  		"		ReadonlyRootfs bool `json:\"ReadonlyRootfs,omitempty\"`",
  1244  		"		RestartPolicy *ContainerCreateConfigHostConfigAO0RestartPolicy `json:\"RestartPolicy,omitempty\"`",
  1245  		"		Rich bool `json:\"Rich,omitempty\"`",
  1246  		"		RichMode string `json:\"RichMode,omitempty\"`",
  1247  		"		Runtime string `json:\"Runtime,omitempty\"`",
  1248  		"		SecurityOpt []string `json:\"SecurityOpt\"`",
  1249  		"		ShmSize *int64 `json:\"ShmSize,omitempty\"`",
  1250  		"		StorageOpt map[string]string `json:\"StorageOpt,omitempty\"`",
  1251  		"		Sysctls map[string]string `json:\"Sysctls,omitempty\"`",
  1252  		"		Tmpfs map[string]string `json:\"Tmpfs,omitempty\"`",
  1253  		"		UTSMode string `json:\"UTSMode,omitempty\"`",
  1254  		"		UsernsMode string `json:\"UsernsMode,omitempty\"`",
  1255  		"		VolumeDriver string `json:\"VolumeDriver,omitempty\"`",
  1256  		"		VolumesFrom []string `json:\"VolumesFrom\"`",
  1257  		"		BlkioWeight uint16 `json:\"BlkioWeight,omitempty\"`",
  1258  		"		CgroupParent string `json:\"CgroupParent,omitempty\"`",
  1259  		"		CPUShares int64 `json:\"CpuShares,omitempty\"`",
  1260  		"		Memory int64 `json:\"Memory,omitempty\"`",
  1261  		"	} `json:\"HostConfig,omitempty\"`",
  1262  		"	NetworkingConfig *ContainerCreateConfigAO1NetworkingConfig `json:\"NetworkingConfig,omitempty\"`",
  1263  		`func (m *ContainerCreateConfig) Validate(formats strfmt.Registry) error {`,
  1264  		`	if err := m.validateExposedPorts(formats); err != nil {`,
  1265  		`	if err := m.validateHostname(formats); err != nil {`,
  1266  		`	if err := m.validateImage(formats); err != nil {`,
  1267  		`	if err := m.validateRichMode(formats); err != nil {`,
  1268  		`	if err := m.validateVolumes(formats); err != nil {`,
  1269  		`	if err := m.validateHostConfig(formats); err != nil {`,
  1270  		`	if err := m.validateNetworkingConfig(formats); err != nil {`,
  1271  		`		return errors.CompositeValidationError(res...`,
  1272  		`var containerCreateConfigExposedPortsValueEnum []interface{`,
  1273  		`	var res []interface{`,
  1274  		"	if err := json.Unmarshal([]byte(`[{}]`), &res); err != nil {",
  1275  		`	for _, v := range res {`,
  1276  		`		containerCreateConfigExposedPortsValueEnum = append(containerCreateConfigExposedPortsValueEnum, v`,
  1277  		`func (m *ContainerCreateConfig) validateExposedPortsValueEnum(path, location string, value interface{}) error {`,
  1278  		`	if err := validate.EnumCase(path, location, value, containerCreateConfigExposedPortsValueEnum, true); err != nil {`,
  1279  		`func (m *ContainerCreateConfig) validateExposedPorts(formats strfmt.Registry) error {`,
  1280  		`	if swag.IsZero(m.ExposedPorts) {`,
  1281  		`	for k := range m.ExposedPorts {`,
  1282  		`		if err := m.validateExposedPortsValueEnum("ExposedPorts"+"."+k, "body", m.ExposedPorts[k]); err != nil {`,
  1283  		`func (m *ContainerCreateConfig) validateHostname(formats strfmt.Registry) error {`,
  1284  		`	if swag.IsZero(m.Hostname) {`,
  1285  		`	if err := validate.MinLength("Hostname", "body", m.Hostname.String(), 1); err != nil {`,
  1286  		`	if err := validate.FormatOf("Hostname", "body", "hostname", m.Hostname.String(), formats); err != nil {`,
  1287  		`func (m *ContainerCreateConfig) validateImage(formats strfmt.Registry) error {`,
  1288  		`	if err := validate.RequiredString("Image", "body", m.Image); err != nil {`,
  1289  		`var containerCreateConfigTypeRichModePropEnum []interface{`,
  1290  		`	var res []string`,
  1291  		"	if err := json.Unmarshal([]byte(`[\"dumb-init\",\"sbin-init\",\"systemd\"]`), &res); err != nil {",
  1292  		`	for _, v := range res {`,
  1293  		`		containerCreateConfigTypeRichModePropEnum = append(containerCreateConfigTypeRichModePropEnum, v`,
  1294  		`func (m *ContainerCreateConfig) validateRichModeEnum(path, location string, value string) error {`,
  1295  		`	if err := validate.EnumCase(path, location, value, containerCreateConfigTypeRichModePropEnum, true); err != nil {`,
  1296  		`func (m *ContainerCreateConfig) validateRichMode(formats strfmt.Registry) error {`,
  1297  		`	if swag.IsZero(m.RichMode) {`,
  1298  		`	if err := m.validateRichModeEnum("RichMode", "body", m.RichMode); err != nil {`,
  1299  		`var containerCreateConfigVolumesValueEnum []interface{`,
  1300  		`	var res []interface{`,
  1301  		"	if err := json.Unmarshal([]byte(`[{}]`), &res); err != nil {",
  1302  		`	for _, v := range res {`,
  1303  		`		containerCreateConfigVolumesValueEnum = append(containerCreateConfigVolumesValueEnum, v`,
  1304  		`func (m *ContainerCreateConfig) validateVolumesValueEnum(path, location string, value interface{}) error {`,
  1305  		`	if err := validate.EnumCase(path, location, value, containerCreateConfigVolumesValueEnum, true); err != nil {`,
  1306  		`func (m *ContainerCreateConfig) validateVolumes(formats strfmt.Registry) error {`,
  1307  		`	if swag.IsZero(m.Volumes) {`,
  1308  		`	for k := range m.Volumes {`,
  1309  		`		if err := m.validateVolumesValueEnum("Volumes"+"."+k, "body", m.Volumes[k]); err != nil {`,
  1310  		`func (m *ContainerCreateConfig) validateHostConfig(formats strfmt.Registry) error {`,
  1311  		`	if swag.IsZero(m.HostConfig) {`,
  1312  		`	iConsoleSizeSize := int64(len(m.HostConfig.ConsoleSize)`,
  1313  		`	if err := validate.MinItems("HostConfig"+"."+"ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`,
  1314  		`	if err := validate.MaxItems("HostConfig"+"."+"ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`,
  1315  		`	for i := 0; i < len(m.HostConfig.ConsoleSize); i++ {`,
  1316  		// do we need... ?
  1317  		`		if swag.IsZero(m.HostConfig.ConsoleSize[i]) {`,
  1318  		`		if err := validate.MinimumInt("HostConfig"+"."+"ConsoleSize"+"."+strconv.Itoa(i), "body", *m.HostConfig.ConsoleSize[i], 0, false); err != nil {`,
  1319  		// TODO: enum if anonymous allOf is not honored (missing func)
  1320  		// => will do that with Enum refactoring
  1321  		`	if err := m.validateIsolationEnum("HostConfig"+"."+"Isolation", "body", m.HostConfig.Isolation); err != nil {`,
  1322  		`	if m.HostConfig.LogConfig != nil {`,
  1323  		`		if err := m.HostConfig.LogConfig.Validate(formats); err != nil {`,
  1324  		`			if ve, ok := err.(*errors.Validation); ok {`,
  1325  		`				return ve.ValidateName("HostConfig" + "." + "LogConfig"`,
  1326  		`	if err := validate.MinimumInt("HostConfig"+"."+"OomScoreAdj", "body", m.HostConfig.OomScoreAdj, -1000, false); err != nil {`,
  1327  		`	if err := validate.MaximumInt("HostConfig"+"."+"OomScoreAdj", "body", m.HostConfig.OomScoreAdj, 1000, false); err != nil {`,
  1328  		`	if m.HostConfig.RestartPolicy != nil {`,
  1329  		`		if err := m.HostConfig.RestartPolicy.Validate(formats); err != nil {`,
  1330  		`			if ve, ok := err.(*errors.Validation); ok {`,
  1331  		`				return ve.ValidateName("HostConfig" + "." + "RestartPolicy"`,
  1332  		`	if err := m.validateRichModeEnum("HostConfig"+"."+"RichMode", "body", m.HostConfig.RichMode); err != nil {`,
  1333  		`	if err := validate.MinimumInt("HostConfig"+"."+"ShmSize", "body", *m.HostConfig.ShmSize, 0, false); err != nil {`,
  1334  		`	if err := validate.MinimumUint("HostConfig"+"."+"BlkioWeight", "body", uint64(m.HostConfig.BlkioWeight), 0, false); err != nil {`,
  1335  		`	if err := validate.MaximumUint("HostConfig"+"."+"BlkioWeight", "body", uint64(m.HostConfig.BlkioWeight), 1000, false); err != nil {`,
  1336  		`func (m *ContainerCreateConfig) validateNetworkingConfig(formats strfmt.Registry) error {`,
  1337  		`	if swag.IsZero(m.NetworkingConfig) {`,
  1338  		`	if m.NetworkingConfig != nil {`,
  1339  		`		if err := m.NetworkingConfig.Validate(formats); err != nil {`,
  1340  		`			if ve, ok := err.(*errors.Validation); ok {`,
  1341  		`				return ve.ValidateName("NetworkingConfig"`,
  1342  		`type ContainerCreateConfigAO1NetworkingConfig struct {`,
  1343  		"	EndpointsConfig map[string]ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnon `json:\"EndpointsConfig,omitempty\"`",
  1344  		`func (m *ContainerCreateConfigAO1NetworkingConfig) Validate(formats strfmt.Registry) error {`,
  1345  		`	if err := m.validateEndpointsConfig(formats); err != nil {`,
  1346  		`		return errors.CompositeValidationError(res...`,
  1347  		`func (m *ContainerCreateConfigAO1NetworkingConfig) validateEndpointsConfig(formats strfmt.Registry) error {`,
  1348  		`	if swag.IsZero(m.EndpointsConfig) {`,
  1349  		`	for k := range m.EndpointsConfig {`,
  1350  		`		if swag.IsZero(m.EndpointsConfig[k]) {`,
  1351  		`		if val, ok := m.EndpointsConfig[k]; ok {`,
  1352  		// NOTE: fixed incorrect IsNullable status in map element
  1353  		`				if err := val.Validate(formats); err != nil {`,
  1354  		`type ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnon struct {`,
  1355  		"	Aliases []string `json:\"Aliases\"`",
  1356  		"	DriverOpts map[string]string `json:\"DriverOpts,omitempty\"`",
  1357  		"	EndpointID string `json:\"EndpointID,omitempty\"`",
  1358  		"	Gateway string `json:\"Gateway,omitempty\"`",
  1359  		"	GlobalIPV6Address string `json:\"GlobalIPv6Address,omitempty\"`",
  1360  		"	GlobalIPV6PrefixLen int64 `json:\"GlobalIPv6PrefixLen,omitempty\"`",
  1361  		"	IPAMConfig *ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnonIPAMConfig `json:\"IPAMConfig,omitempty\"`",
  1362  		"	IPAddress string `json:\"IPAddress,omitempty\"`",
  1363  		"	IPPrefixLen int64 `json:\"IPPrefixLen,omitempty\"`",
  1364  		"	IPV6Gateway string `json:\"IPv6Gateway,omitempty\"`",
  1365  		"	Links []string `json:\"Links\"`",
  1366  		"	MacAddress string `json:\"MacAddress,omitempty\"`",
  1367  		"	NetworkID string `json:\"NetworkID,omitempty\"`",
  1368  		`func (m *ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnon) Validate(formats strfmt.Registry) error {`,
  1369  		`	if err := m.validateIPAMConfig(formats); err != nil {`,
  1370  		`		return errors.CompositeValidationError(res...`,
  1371  		`func (m *ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnon) validateIPAMConfig(formats strfmt.Registry) error {`,
  1372  		`	if swag.IsZero(m.IPAMConfig) {`,
  1373  		`	if m.IPAMConfig != nil {`,
  1374  		`		if err := m.IPAMConfig.Validate(formats); err != nil {`,
  1375  		`			if ve, ok := err.(*errors.Validation); ok {`,
  1376  		`				return ve.ValidateName("IPAMConfig"`,
  1377  		`type ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnonIPAMConfig struct {`,
  1378  		"	IPV4Address string `json:\"IPv4Address,omitempty\"`",
  1379  		"	IPV6Address string `json:\"IPv6Address,omitempty\"`",
  1380  		"	LinkLocalIPs []string `json:\"LinkLocalIPs\"`",
  1381  		`func (m *ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnonIPAMConfig) Validate(formats strfmt.Registry) error {`,
  1382  		`		return errors.CompositeValidationError(res...`,
  1383  		`type ContainerCreateConfigHostConfigAO0LogConfig struct {`,
  1384  		"	Config map[string]string `json:\"Config,omitempty\"`",
  1385  		"	Type string `json:\"Type,omitempty\"`",
  1386  		`func (m *ContainerCreateConfigHostConfigAO0LogConfig) Validate(formats strfmt.Registry) error {`,
  1387  		`	if err := m.validateType(formats); err != nil {`,
  1388  		`		return errors.CompositeValidationError(res...`,
  1389  		`var containerCreateConfigHostConfigAO0LogConfigTypeTypePropEnum []interface{`,
  1390  		`	var res []string`,
  1391  		"	if err := json.Unmarshal([]byte(`[\"json-file\",\"syslog\",\"journald\",\"gelf\",\"fluentd\",\"awslogs\",\"splunk\",\"etwlogs\",\"none\"]`), &res); err != nil {",
  1392  		`	for _, v := range res {`,
  1393  		`		containerCreateConfigHostConfigAO0LogConfigTypeTypePropEnum = append(containerCreateConfigHostConfigAO0LogConfigTypeTypePropEnum, v`,
  1394  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeJSONDashFile string = "json-file"`,
  1395  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeSyslog string = "syslog"`,
  1396  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeJournald string = "journald"`,
  1397  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeGelf string = "gelf"`,
  1398  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeFluentd string = "fluentd"`,
  1399  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeAwslogs string = "awslogs"`,
  1400  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeSplunk string = "splunk"`,
  1401  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeEtwlogs string = "etwlogs"`,
  1402  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeNone string = "none"`,
  1403  		`func (m *ContainerCreateConfigHostConfigAO0LogConfig) validateTypeEnum(path, location string, value string) error {`,
  1404  		`	if err := validate.EnumCase(path, location, value, containerCreateConfigHostConfigAO0LogConfigTypeTypePropEnum, true); err != nil {`,
  1405  		`func (m *ContainerCreateConfigHostConfigAO0LogConfig) validateType(formats strfmt.Registry) error {`,
  1406  		`	if swag.IsZero(m.Type) {`,
  1407  		`	if err := m.validateTypeEnum("HostConfig"+"."+"LogConfig"+"."+"Type", "body", m.Type); err != nil {`,
  1408  		`type ContainerCreateConfigHostConfigAO0RestartPolicy struct {`,
  1409  		"	MaximumRetryCount int64 `json:\"MaximumRetryCount,omitempty\"`",
  1410  		"	Name string `json:\"Name,omitempty\"`",
  1411  		`func (m *ContainerCreateConfigHostConfigAO0RestartPolicy) Validate(formats strfmt.Registry) error {`,
  1412  		`		return errors.CompositeValidationError(res...`,
  1413  	}, []string{
  1414  		// not expected
  1415  		`			if val != nil {`,
  1416  	},
  1417  		// output in log
  1418  		noLines,
  1419  		noLines)
  1420  
  1421  	// load expectations for model: resources.go
  1422  	flattenRun.AddExpectations("resources.go", []string{
  1423  		`type Resources struct {`,
  1424  		"	BlkioWeight uint16 `json:\"BlkioWeight,omitempty\"`",
  1425  		"	CgroupParent string `json:\"CgroupParent,omitempty\"`",
  1426  		"	CPUShares int64 `json:\"CpuShares,omitempty\"`",
  1427  		"	Memory int64 `json:\"Memory,omitempty\"`",
  1428  		`func (m *Resources) Validate(formats strfmt.Registry) error {`,
  1429  		`	if err := m.validateBlkioWeight(formats); err != nil {`,
  1430  		`		return errors.CompositeValidationError(res...`,
  1431  		`func (m *Resources) validateBlkioWeight(formats strfmt.Registry) error {`,
  1432  		`	if swag.IsZero(m.BlkioWeight) {`,
  1433  		`	if err := validate.MinimumUint("BlkioWeight", "body", uint64(m.BlkioWeight), 0, false); err != nil {`,
  1434  		`	if err := validate.MaximumUint("BlkioWeight", "body", uint64(m.BlkioWeight), 1000, false); err != nil {`,
  1435  	},
  1436  		// not expected
  1437  		todo,
  1438  		// output in log
  1439  		noLines,
  1440  		noLines)
  1441  
  1442  	expandRun.AddExpectations("resources.go", flattenRun.ExpectedFor("Resources").ExpectedLines, todo, noLines, noLines)
  1443  
  1444  	// load expectations for model: networking_config.go
  1445  	flattenRun.AddExpectations("networking_config.go", []string{
  1446  		`type NetworkingConfig struct {`,
  1447  		// maps are now simple types
  1448  		"	EndpointsConfig map[string]*EndpointSettings `json:\"EndpointsConfig,omitempty\"`",
  1449  		`func (m *NetworkingConfig) Validate(formats strfmt.Registry) error {`,
  1450  		`	if err := m.validateEndpointsConfig(formats); err != nil {`,
  1451  		`		return errors.CompositeValidationError(res...`,
  1452  		`func (m *NetworkingConfig) validateEndpointsConfig(formats strfmt.Registry) error {`,
  1453  		`	if swag.IsZero(m.EndpointsConfig) {`,
  1454  		`       for k := range m.EndpointsConfig {`,
  1455  		`	if err := validate.Required("EndpointsConfig"+"."+k, "body", m.EndpointsConfig[k]); err != nil {`,
  1456  		`       	if val, ok := m.EndpointsConfig[k]; ok {`,
  1457  		`          		if err := val.Validate(formats); err != nil {`,
  1458  	},
  1459  		// not expected
  1460  		todo,
  1461  		// output in log
  1462  		noLines,
  1463  		noLines)
  1464  
  1465  	// NOTE(fredbi): maps are now simple types: this definition disappears
  1466  
  1467  	// load expectations for model: endpoint_settings.go
  1468  	flattenRun.AddExpectations("endpoint_settings.go", []string{
  1469  		`type EndpointSettings struct {`,
  1470  		"	Aliases []string `json:\"Aliases\"`",
  1471  		"	DriverOpts map[string]string `json:\"DriverOpts,omitempty\"`",
  1472  		"	EndpointID string `json:\"EndpointID,omitempty\"`",
  1473  		"	Gateway string `json:\"Gateway,omitempty\"`",
  1474  		"	GlobalIPV6Address string `json:\"GlobalIPv6Address,omitempty\"`",
  1475  		"	GlobalIPV6PrefixLen int64 `json:\"GlobalIPv6PrefixLen,omitempty\"`",
  1476  		"	IPAMConfig *EndpointIPAMConfig `json:\"IPAMConfig,omitempty\"`",
  1477  		"	IPAddress string `json:\"IPAddress,omitempty\"`",
  1478  		"	IPPrefixLen int64 `json:\"IPPrefixLen,omitempty\"`",
  1479  		"	IPV6Gateway string `json:\"IPv6Gateway,omitempty\"`",
  1480  		"	Links []string `json:\"Links\"`",
  1481  		"	MacAddress string `json:\"MacAddress,omitempty\"`",
  1482  		"	NetworkID string `json:\"NetworkID,omitempty\"`",
  1483  		`func (m *EndpointSettings) Validate(formats strfmt.Registry) error {`,
  1484  		`	if err := m.validateIPAMConfig(formats); err != nil {`,
  1485  		`		return errors.CompositeValidationError(res...`,
  1486  		`func (m *EndpointSettings) validateIPAMConfig(formats strfmt.Registry) error {`,
  1487  		`	if swag.IsZero(m.IPAMConfig) {`,
  1488  		`	if m.IPAMConfig != nil {`,
  1489  		`		if err := m.IPAMConfig.Validate(formats); err != nil {`,
  1490  		`			if ve, ok := err.(*errors.Validation); ok {`,
  1491  		`				return ve.ValidateName("IPAMConfig"`,
  1492  	},
  1493  		// not expected
  1494  		todo,
  1495  		// output in log
  1496  		noLines,
  1497  		noLines)
  1498  
  1499  	expandRun.AddExpectations("endpoint_settings.go", []string{
  1500  		`type EndpointSettings struct {`,
  1501  		"	Aliases []string `json:\"Aliases\"`",
  1502  		"	DriverOpts map[string]string `json:\"DriverOpts,omitempty\"`",
  1503  		"	EndpointID string `json:\"EndpointID,omitempty\"`",
  1504  		"	Gateway string `json:\"Gateway,omitempty\"`",
  1505  		"	GlobalIPV6Address string `json:\"GlobalIPv6Address,omitempty\"`",
  1506  		"	GlobalIPV6PrefixLen int64 `json:\"GlobalIPv6PrefixLen,omitempty\"`",
  1507  		"	IPAMConfig *EndpointSettingsIPAMConfig `json:\"IPAMConfig,omitempty\"`",
  1508  		"	IPAddress string `json:\"IPAddress,omitempty\"`",
  1509  		"	IPPrefixLen int64 `json:\"IPPrefixLen,omitempty\"`",
  1510  		"	IPV6Gateway string `json:\"IPv6Gateway,omitempty\"`",
  1511  		"	Links []string `json:\"Links\"`",
  1512  		"	MacAddress string `json:\"MacAddress,omitempty\"`",
  1513  		"	NetworkID string `json:\"NetworkID,omitempty\"`",
  1514  		`func (m *EndpointSettings) Validate(formats strfmt.Registry) error {`,
  1515  		`	if err := m.validateIPAMConfig(formats); err != nil {`,
  1516  		`		return errors.CompositeValidationError(res...`,
  1517  		`func (m *EndpointSettings) validateIPAMConfig(formats strfmt.Registry) error {`,
  1518  		`	if swag.IsZero(m.IPAMConfig) {`,
  1519  		`	if m.IPAMConfig != nil {`,
  1520  		`		if err := m.IPAMConfig.Validate(formats); err != nil {`,
  1521  		`			if ve, ok := err.(*errors.Validation); ok {`,
  1522  		`				return ve.ValidateName("IPAMConfig"`,
  1523  		`type EndpointSettingsIPAMConfig struct {`,
  1524  		"	IPV4Address string `json:\"IPv4Address,omitempty\"`",
  1525  		"	IPV6Address string `json:\"IPv6Address,omitempty\"`",
  1526  		"	LinkLocalIPs []string `json:\"LinkLocalIPs\"`",
  1527  		`func (m *EndpointSettingsIPAMConfig) Validate(formats strfmt.Registry) error {`,
  1528  		`		return errors.CompositeValidationError(res...`,
  1529  	},
  1530  		// not expected
  1531  		noLines,
  1532  		// output in log
  1533  		noLines,
  1534  		noLines)
  1535  
  1536  	// load expectations for model: networking_config_endpoints_config.go
  1537  	// NOTE(fredbi): maps are now simple types - this definition disappears
  1538  }
  1539  
  1540  func initFixtureSimpleAllOf() {
  1541  	// testing ../fixtures/bugs/1487/fixture-simple-allOf.yaml with flatten and expand (--skip-flatten)
  1542  
  1543  	/* we test various composition combinations, including nested, and nested isolated with a properties (e.g. issue #1479) */
  1544  
  1545  	f := newModelFixture("../fixtures/bugs/1487/fixture-simple-allOf.yaml", "fixture for nested allOf with ref")
  1546  	flattenRun := f.AddRun(false)
  1547  	expandRun := f.AddRun(true)
  1548  
  1549  	// load expectations for model: not_really_composed_thing_all_of0.go
  1550  	flattenRun.AddExpectations("not_really_composed_thing_all_of0.go", []string{
  1551  		`type NotReallyComposedThingAllOf0 struct {`,
  1552  		"	Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
  1553  		`func (m *NotReallyComposedThingAllOf0) Validate(formats strfmt.Registry) error {`,
  1554  		`	if err := m.validateProp0(formats); err != nil {`,
  1555  		`		return errors.CompositeValidationError(res...`,
  1556  		`func (m *NotReallyComposedThingAllOf0) validateProp0(formats strfmt.Registry) error {`,
  1557  		`	if swag.IsZero(m.Prop0) {`,
  1558  		`	if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`,
  1559  	},
  1560  		// not expected
  1561  		todo,
  1562  		// output in log
  1563  		noLines,
  1564  		noLines)
  1565  
  1566  	// load expectations for model: not_really_composed_thing.go
  1567  	expandRun.AddExpectations("not_really_composed_thing.go", []string{
  1568  		`type NotReallyComposedThing struct {`,
  1569  		"	Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
  1570  		`func (m *NotReallyComposedThing) UnmarshalJSON(raw []byte) error {`,
  1571  		`	var dataAO0 struct {`,
  1572  		"		Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
  1573  		`	if err := swag.ReadJSON(raw, &dataAO0); err != nil {`,
  1574  		`	m.Prop0 = dataAO0.Prop0`,
  1575  		`func (m NotReallyComposedThing) MarshalJSON() ([]byte, error) {`,
  1576  		`	_parts := make([][]byte, 0, 1`,
  1577  		`	var dataAO0 struct {`,
  1578  		"		Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
  1579  		`	dataAO0.Prop0 = m.Prop0`,
  1580  		`	jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`,
  1581  		`	if errAO0 != nil {`,
  1582  		`		return nil, errAO0`,
  1583  		`	_parts = append(_parts, jsonDataAO0`,
  1584  		`	return swag.ConcatJSON(_parts...), nil`,
  1585  		`func (m *NotReallyComposedThing) Validate(formats strfmt.Registry) error {`,
  1586  		`	if err := m.validateProp0(formats); err != nil {`,
  1587  		`		return errors.CompositeValidationError(res...`,
  1588  		`func (m *NotReallyComposedThing) validateProp0(formats strfmt.Registry) error {`,
  1589  		`	if swag.IsZero(m.Prop0) {`,
  1590  		`	if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`,
  1591  		`func (m *NotReallyComposedThing) MarshalBinary() ([]byte, error) {`,
  1592  		`	if m == nil {`,
  1593  		`		return nil, nil`,
  1594  		`	return swag.WriteJSON(m`,
  1595  		`func (m *NotReallyComposedThing) UnmarshalBinary(b []byte) error {`,
  1596  		`	var res NotReallyComposedThing`,
  1597  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1598  		`	*m = res`,
  1599  	},
  1600  		// not expected
  1601  		noLines,
  1602  		// output in log
  1603  		noLines,
  1604  		noLines)
  1605  
  1606  	// load expectations for model: simple_nested_object_all_of1.go
  1607  	flattenRun.AddExpectations("simple_nested_object_all_of1.go", []string{
  1608  		`type SimpleNestedObjectAllOf1 struct {`,
  1609  		"	Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1610  		`func (m *SimpleNestedObjectAllOf1) Validate(formats strfmt.Registry) error {`,
  1611  		`	if err := m.validateProp3(formats); err != nil {`,
  1612  		`		return errors.CompositeValidationError(res...`,
  1613  		`func (m *SimpleNestedObjectAllOf1) validateProp3(formats strfmt.Registry) error {`,
  1614  		`	if swag.IsZero(m.Prop3) {`,
  1615  		`	if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`,
  1616  	},
  1617  		// not expected
  1618  		todo,
  1619  		// output in log
  1620  		noLines,
  1621  		noLines)
  1622  
  1623  	// load expectations for model: break_nested_object_all_of1_prop7.go
  1624  	flattenRun.AddExpectations("break_nested_object_all_of1_prop7.go", []string{
  1625  		`type BreakNestedObjectAllOf1Prop7 struct {`,
  1626  		`	BreakNestedObjectAllOf1Prop7AllOf0`,
  1627  		`	BreakNestedObjectAllOf1Prop7AllOf1`,
  1628  		`func (m *BreakNestedObjectAllOf1Prop7) Validate(formats strfmt.Registry) error {`,
  1629  		`	if err := m.BreakNestedObjectAllOf1Prop7AllOf0.Validate(formats); err != nil {`,
  1630  		`	if err := m.BreakNestedObjectAllOf1Prop7AllOf1.Validate(formats); err != nil {`,
  1631  		`		return errors.CompositeValidationError(res...`,
  1632  	},
  1633  		// not expected
  1634  		todo,
  1635  		// output in log
  1636  		noLines,
  1637  		noLines)
  1638  
  1639  	// load expectations for model: composed_thing.go
  1640  	flattenRun.AddExpectations("composed_thing.go", []string{
  1641  		`type ComposedThing struct {`,
  1642  		`	ComposedThingAllOf0`,
  1643  		`	ComposedThingAllOf1`,
  1644  		`func (m *ComposedThing) Validate(formats strfmt.Registry) error {`,
  1645  		`	if err := m.ComposedThingAllOf0.Validate(formats); err != nil {`,
  1646  		`	if err := m.ComposedThingAllOf1.Validate(formats); err != nil {`,
  1647  		`		return errors.CompositeValidationError(res...`,
  1648  	},
  1649  		// not expected
  1650  		todo,
  1651  		// output in log
  1652  		noLines,
  1653  		noLines)
  1654  
  1655  	// load expectations for model: composed_thing.go
  1656  	expandRun.AddExpectations("composed_thing.go", []string{
  1657  		`type ComposedThing struct {`,
  1658  		"	Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1659  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1660  		`func (m *ComposedThing) UnmarshalJSON(raw []byte) error {`,
  1661  		`	var dataAO0 struct {`,
  1662  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1663  		`	if err := swag.ReadJSON(raw, &dataAO0); err != nil {`,
  1664  		`	m.Prop1 = dataAO0.Prop1`,
  1665  		`	var dataAO1 struct {`,
  1666  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1667  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  1668  		`	m.Prop2 = dataAO1.Prop2`,
  1669  		`func (m ComposedThing) MarshalJSON() ([]byte, error) {`,
  1670  		`	_parts := make([][]byte, 0, 2`,
  1671  		`	var dataAO0 struct {`,
  1672  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1673  		`	dataAO0.Prop1 = m.Prop1`,
  1674  		`	jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`,
  1675  		`	if errAO0 != nil {`,
  1676  		`		return nil, errAO0`,
  1677  		`	_parts = append(_parts, jsonDataAO0`,
  1678  		`	var dataAO1 struct {`,
  1679  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1680  		`	dataAO1.Prop2 = m.Prop2`,
  1681  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  1682  		`	if errAO1 != nil {`,
  1683  		`		return nil, errAO1`,
  1684  		`	_parts = append(_parts, jsonDataAO1`,
  1685  		`	return swag.ConcatJSON(_parts...), nil`,
  1686  		`func (m *ComposedThing) Validate(formats strfmt.Registry) error {`,
  1687  		`	if err := m.validateProp1(formats); err != nil {`,
  1688  		`	if err := m.validateProp2(formats); err != nil {`,
  1689  		`		return errors.CompositeValidationError(res...`,
  1690  		`func (m *ComposedThing) validateProp1(formats strfmt.Registry) error {`,
  1691  		`	if swag.IsZero(m.Prop1) {`,
  1692  		`	if err := validate.FormatOf("prop1", "body", "uuid", m.Prop1.String(), formats); err != nil {`,
  1693  		`func (m *ComposedThing) validateProp2(formats strfmt.Registry) error {`,
  1694  		`	if swag.IsZero(m.Prop2) {`,
  1695  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  1696  		`func (m *ComposedThing) MarshalBinary() ([]byte, error) {`,
  1697  		`	if m == nil {`,
  1698  		`		return nil, nil`,
  1699  		`	return swag.WriteJSON(m`,
  1700  		`func (m *ComposedThing) UnmarshalBinary(b []byte) error {`,
  1701  		`	var res ComposedThing`,
  1702  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1703  		`	*m = res`,
  1704  	},
  1705  		// not expected
  1706  		noLines,
  1707  		// output in log
  1708  		noLines,
  1709  		noLines)
  1710  
  1711  	// load expectations for model: break_nested_object.go
  1712  	flattenRun.AddExpectations("break_nested_object.go", []string{
  1713  		`type BreakNestedObject struct {`,
  1714  		`	SimpleNestedObject`,
  1715  		`	BreakNestedObjectAllOf1`,
  1716  		`func (m *BreakNestedObject) Validate(formats strfmt.Registry) error {`,
  1717  		`	if err := m.SimpleNestedObject.Validate(formats); err != nil {`,
  1718  		`	if err := m.BreakNestedObjectAllOf1.Validate(formats); err != nil {`,
  1719  		`		return errors.CompositeValidationError(res...`,
  1720  	},
  1721  		// not expected
  1722  		todo,
  1723  		// output in log
  1724  		noLines,
  1725  		noLines)
  1726  
  1727  	// load expectations for model: break_nested_object.go
  1728  	expandRun.AddExpectations("break_nested_object.go", []string{
  1729  		`type BreakNestedObject struct {`,
  1730  		`	BreakNestedObjectAllOf0`,
  1731  		"	Prop6 strfmt.UUID `json:\"prop6,omitempty\"`",
  1732  		`	Prop7 struct {`,
  1733  		"		Prop8 int64 `json:\"prop8,omitempty\"`",
  1734  		"		Prop9 int64 `json:\"prop9,omitempty\"`",
  1735  		"	} `json:\"prop7,omitempty\"`",
  1736  		`func (m *BreakNestedObject) UnmarshalJSON(raw []byte) error {`,
  1737  		`	var aO0 BreakNestedObjectAllOf0`,
  1738  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  1739  		`	m.BreakNestedObjectAllOf0 = aO0`,
  1740  		`	var dataAO1 struct {`,
  1741  		"		Prop6 strfmt.UUID `json:\"prop6,omitempty\"`",
  1742  		`		Prop7 struct {`,
  1743  		"			Prop8 int64 `json:\"prop8,omitempty\"`",
  1744  		"			Prop9 int64 `json:\"prop9,omitempty\"`",
  1745  		"		} `json:\"prop7,omitempty\"`",
  1746  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  1747  		`	m.Prop6 = dataAO1.Prop6`,
  1748  		`	m.Prop7 = dataAO1.Prop7`,
  1749  		`func (m BreakNestedObject) MarshalJSON() ([]byte, error) {`,
  1750  		`	_parts := make([][]byte, 0, 2`,
  1751  		`	aO0, err := swag.WriteJSON(m.BreakNestedObjectAllOf0`,
  1752  		`	if err != nil {`,
  1753  		`		return nil, err`,
  1754  		`	_parts = append(_parts, aO0`,
  1755  		`	var dataAO1 struct {`,
  1756  		"		Prop6 strfmt.UUID `json:\"prop6,omitempty\"`",
  1757  		`		Prop7 struct {`,
  1758  		"			Prop8 int64 `json:\"prop8,omitempty\"`",
  1759  		"			Prop9 int64 `json:\"prop9,omitempty\"`",
  1760  		"		} `json:\"prop7,omitempty\"`",
  1761  		`	dataAO1.Prop6 = m.Prop6`,
  1762  		`	dataAO1.Prop7 = m.Prop7`,
  1763  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  1764  		`	if errAO1 != nil {`,
  1765  		`		return nil, errAO1`,
  1766  		`	_parts = append(_parts, jsonDataAO1`,
  1767  		`	return swag.ConcatJSON(_parts...), nil`,
  1768  		`func (m *BreakNestedObject) Validate(formats strfmt.Registry) error {`,
  1769  		`	if err := m.BreakNestedObjectAllOf0.Validate(formats); err != nil {`,
  1770  		`	if err := m.validateProp6(formats); err != nil {`,
  1771  		`	if err := m.validateProp7(formats); err != nil {`,
  1772  		`		return errors.CompositeValidationError(res...`,
  1773  		`func (m *BreakNestedObject) validateProp6(formats strfmt.Registry) error {`,
  1774  		`	if swag.IsZero(m.Prop6) {`,
  1775  		`	if err := validate.FormatOf("prop6", "body", "uuid", m.Prop6.String(), formats); err != nil {`,
  1776  		`func (m *BreakNestedObject) validateProp7(formats strfmt.Registry) error {`,
  1777  		`	if swag.IsZero(m.Prop7) {`,
  1778  		`	if err := validate.MinimumInt("prop7"+"."+"prop8", "body", m.Prop7.Prop8, 12, false); err != nil {`,
  1779  		`	if err := validate.MaximumInt("prop7"+"."+"prop9", "body", m.Prop7.Prop9, 12, false); err != nil {`,
  1780  		`func (m *BreakNestedObject) MarshalBinary() ([]byte, error) {`,
  1781  		`	if m == nil {`,
  1782  		`		return nil, nil`,
  1783  		`	return swag.WriteJSON(m`,
  1784  		`func (m *BreakNestedObject) UnmarshalBinary(b []byte) error {`,
  1785  		`	var res BreakNestedObject`,
  1786  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1787  		`	*m = res`,
  1788  		`type BreakNestedObjectAllOf0 struct {`,
  1789  		`	BreakNestedObjectAllOf0AllOf0`,
  1790  		"	Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1791  		`func (m *BreakNestedObjectAllOf0) UnmarshalJSON(raw []byte) error {`,
  1792  		`	var aO0 BreakNestedObjectAllOf0AllOf0`,
  1793  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  1794  		`	m.BreakNestedObjectAllOf0AllOf0 = aO0`,
  1795  		`	var dataAO1 struct {`,
  1796  		"		Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1797  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  1798  		`	m.Prop3 = dataAO1.Prop3`,
  1799  		`func (m BreakNestedObjectAllOf0) MarshalJSON() ([]byte, error) {`,
  1800  		`	_parts := make([][]byte, 0, 2`,
  1801  		`	aO0, err := swag.WriteJSON(m.BreakNestedObjectAllOf0AllOf0`,
  1802  		`	if err != nil {`,
  1803  		`		return nil, err`,
  1804  		`	_parts = append(_parts, aO0`,
  1805  		`	var dataAO1 struct {`,
  1806  		"		Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1807  		`	dataAO1.Prop3 = m.Prop3`,
  1808  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  1809  		`	if errAO1 != nil {`,
  1810  		`		return nil, errAO1`,
  1811  		`	_parts = append(_parts, jsonDataAO1`,
  1812  		`	return swag.ConcatJSON(_parts...), nil`,
  1813  		`func (m *BreakNestedObjectAllOf0) Validate(formats strfmt.Registry) error {`,
  1814  		`	if err := m.BreakNestedObjectAllOf0AllOf0.Validate(formats); err != nil {`,
  1815  		`	if err := m.validateProp3(formats); err != nil {`,
  1816  		`		return errors.CompositeValidationError(res...`,
  1817  		`func (m *BreakNestedObjectAllOf0) validateProp3(formats strfmt.Registry) error {`,
  1818  		`	if swag.IsZero(m.Prop3) {`,
  1819  		`	if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`,
  1820  		`func (m *BreakNestedObjectAllOf0) MarshalBinary() ([]byte, error) {`,
  1821  		`	if m == nil {`,
  1822  		`		return nil, nil`,
  1823  		`	return swag.WriteJSON(m`,
  1824  		`func (m *BreakNestedObjectAllOf0) UnmarshalBinary(b []byte) error {`,
  1825  		`	var res BreakNestedObjectAllOf0`,
  1826  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1827  		`	*m = res`,
  1828  		`type BreakNestedObjectAllOf0AllOf0 struct {`,
  1829  		"	Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1830  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1831  		`func (m *BreakNestedObjectAllOf0AllOf0) UnmarshalJSON(raw []byte) error {`,
  1832  		`	var dataAO0 struct {`,
  1833  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1834  		`	if err := swag.ReadJSON(raw, &dataAO0); err != nil {`,
  1835  		`	m.Prop1 = dataAO0.Prop1`,
  1836  		`	var dataAO1 struct {`,
  1837  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1838  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  1839  		`	m.Prop2 = dataAO1.Prop2`,
  1840  		`func (m BreakNestedObjectAllOf0AllOf0) MarshalJSON() ([]byte, error) {`,
  1841  		`	_parts := make([][]byte, 0, 2`,
  1842  		`	var dataAO0 struct {`,
  1843  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1844  		`	dataAO0.Prop1 = m.Prop1`,
  1845  		`	jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`,
  1846  		`	if errAO0 != nil {`,
  1847  		`		return nil, errAO0`,
  1848  		`	_parts = append(_parts, jsonDataAO0`,
  1849  		`	var dataAO1 struct {`,
  1850  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1851  		`	dataAO1.Prop2 = m.Prop2`,
  1852  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  1853  		`	if errAO1 != nil {`,
  1854  		`		return nil, errAO1`,
  1855  		`	_parts = append(_parts, jsonDataAO1`,
  1856  		`	return swag.ConcatJSON(_parts...), nil`,
  1857  		`func (m *BreakNestedObjectAllOf0AllOf0) Validate(formats strfmt.Registry) error {`,
  1858  		`	if err := m.validateProp1(formats); err != nil {`,
  1859  		`	if err := m.validateProp2(formats); err != nil {`,
  1860  		`		return errors.CompositeValidationError(res...`,
  1861  		`func (m *BreakNestedObjectAllOf0AllOf0) validateProp1(formats strfmt.Registry) error {`,
  1862  		`	if swag.IsZero(m.Prop1) {`,
  1863  		`	if err := validate.FormatOf("prop1", "body", "uuid", m.Prop1.String(), formats); err != nil {`,
  1864  		`func (m *BreakNestedObjectAllOf0AllOf0) validateProp2(formats strfmt.Registry) error {`,
  1865  		`	if swag.IsZero(m.Prop2) {`,
  1866  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  1867  		`func (m *BreakNestedObjectAllOf0AllOf0) MarshalBinary() ([]byte, error) {`,
  1868  		`	if m == nil {`,
  1869  		`		return nil, nil`,
  1870  		`	return swag.WriteJSON(m`,
  1871  		`func (m *BreakNestedObjectAllOf0AllOf0) UnmarshalBinary(b []byte) error {`,
  1872  		`	var res BreakNestedObjectAllOf0AllOf0`,
  1873  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1874  		`	*m = res`,
  1875  	},
  1876  		// not expected
  1877  		noLines,
  1878  		// output in log
  1879  		noLines,
  1880  		noLines)
  1881  
  1882  	// load expectations for model: deep_nested_object_all_of1_all_of1.go
  1883  	flattenRun.AddExpectations("deep_nested_object_all_of1_all_of1.go", []string{
  1884  		`type DeepNestedObjectAllOf1AllOf1 struct {`,
  1885  		"	Prop5 strfmt.Date `json:\"prop5,omitempty\"`",
  1886  		`func (m *DeepNestedObjectAllOf1AllOf1) Validate(formats strfmt.Registry) error {`,
  1887  		`	if err := m.validateProp5(formats); err != nil {`,
  1888  		`		return errors.CompositeValidationError(res...`,
  1889  		`func (m *DeepNestedObjectAllOf1AllOf1) validateProp5(formats strfmt.Registry) error {`,
  1890  		`	if swag.IsZero(m.Prop5) {`,
  1891  		`	if err := validate.FormatOf("prop5", "body", "date", m.Prop5.String(), formats); err != nil {`,
  1892  	},
  1893  		// not expected
  1894  		todo,
  1895  		// output in log
  1896  		noLines,
  1897  		noLines)
  1898  
  1899  	// load expectations for model: deep_nested_object.go
  1900  	flattenRun.AddExpectations("deep_nested_object.go", []string{
  1901  		`type DeepNestedObject struct {`,
  1902  		`	SimpleNestedObject`,
  1903  		`	DeepNestedObjectAllOf1`,
  1904  		`func (m *DeepNestedObject) Validate(formats strfmt.Registry) error {`,
  1905  		`	if err := m.SimpleNestedObject.Validate(formats); err != nil {`,
  1906  		`	if err := m.DeepNestedObjectAllOf1.Validate(formats); err != nil {`,
  1907  		`		return errors.CompositeValidationError(res...`,
  1908  	},
  1909  		// not expected
  1910  		todo,
  1911  		// output in log
  1912  		noLines,
  1913  		noLines)
  1914  
  1915  	// load expectations for model: deep_nested_object.go
  1916  	expandRun.AddExpectations("deep_nested_object.go", []string{
  1917  		`type DeepNestedObject struct {`,
  1918  		`	DeepNestedObjectAllOf0`,
  1919  		`	DeepNestedObjectAllOf1`,
  1920  		`func (m *DeepNestedObject) UnmarshalJSON(raw []byte) error {`,
  1921  		`	var aO0 DeepNestedObjectAllOf0`,
  1922  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  1923  		`	m.DeepNestedObjectAllOf0 = aO0`,
  1924  		`	var aO1 DeepNestedObjectAllOf1`,
  1925  		`	if err := swag.ReadJSON(raw, &aO1); err != nil {`,
  1926  		`	m.DeepNestedObjectAllOf1 = aO1`,
  1927  		`func (m DeepNestedObject) MarshalJSON() ([]byte, error) {`,
  1928  		`	_parts := make([][]byte, 0, 2`,
  1929  		`	aO0, err := swag.WriteJSON(m.DeepNestedObjectAllOf0`,
  1930  		`	if err != nil {`,
  1931  		`		return nil, err`,
  1932  		`	_parts = append(_parts, aO0`,
  1933  		`	aO1, err := swag.WriteJSON(m.DeepNestedObjectAllOf1`,
  1934  		`	if err != nil {`,
  1935  		`		return nil, err`,
  1936  		`	_parts = append(_parts, aO1`,
  1937  		`	return swag.ConcatJSON(_parts...), nil`,
  1938  		`func (m *DeepNestedObject) Validate(formats strfmt.Registry) error {`,
  1939  		`	if err := m.DeepNestedObjectAllOf0.Validate(formats); err != nil {`,
  1940  		`	if err := m.DeepNestedObjectAllOf1.Validate(formats); err != nil {`,
  1941  		`		return errors.CompositeValidationError(res...`,
  1942  		`func (m *DeepNestedObject) MarshalBinary() ([]byte, error) {`,
  1943  		`	if m == nil {`,
  1944  		`		return nil, nil`,
  1945  		`	return swag.WriteJSON(m`,
  1946  		`func (m *DeepNestedObject) UnmarshalBinary(b []byte) error {`,
  1947  		`	var res DeepNestedObject`,
  1948  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1949  		`	*m = res`,
  1950  		`type DeepNestedObjectAllOf0 struct {`,
  1951  		`	DeepNestedObjectAllOf0AllOf0`,
  1952  		"	Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1953  		`func (m *DeepNestedObjectAllOf0) UnmarshalJSON(raw []byte) error {`,
  1954  		`	var aO0 DeepNestedObjectAllOf0AllOf0`,
  1955  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  1956  		`	m.DeepNestedObjectAllOf0AllOf0 = aO0`,
  1957  		`	var dataAO1 struct {`,
  1958  		"		Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1959  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  1960  		`	m.Prop3 = dataAO1.Prop3`,
  1961  		`func (m DeepNestedObjectAllOf0) MarshalJSON() ([]byte, error) {`,
  1962  		`	_parts := make([][]byte, 0, 2`,
  1963  		`	aO0, err := swag.WriteJSON(m.DeepNestedObjectAllOf0AllOf0`,
  1964  		`	if err != nil {`,
  1965  		`		return nil, err`,
  1966  		`	_parts = append(_parts, aO0`,
  1967  		`	var dataAO1 struct {`,
  1968  		"		Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1969  		`	dataAO1.Prop3 = m.Prop3`,
  1970  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  1971  		`	if errAO1 != nil {`,
  1972  		`		return nil, errAO1`,
  1973  		`	_parts = append(_parts, jsonDataAO1`,
  1974  		`	return swag.ConcatJSON(_parts...), nil`,
  1975  		`func (m *DeepNestedObjectAllOf0) Validate(formats strfmt.Registry) error {`,
  1976  		`	if err := m.DeepNestedObjectAllOf0AllOf0.Validate(formats); err != nil {`,
  1977  		`	if err := m.validateProp3(formats); err != nil {`,
  1978  		`		return errors.CompositeValidationError(res...`,
  1979  		`func (m *DeepNestedObjectAllOf0) validateProp3(formats strfmt.Registry) error {`,
  1980  		`	if swag.IsZero(m.Prop3) {`,
  1981  		`	if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`,
  1982  		`func (m *DeepNestedObjectAllOf0) MarshalBinary() ([]byte, error) {`,
  1983  		`	if m == nil {`,
  1984  		`		return nil, nil`,
  1985  		`	return swag.WriteJSON(m`,
  1986  		`func (m *DeepNestedObjectAllOf0) UnmarshalBinary(b []byte) error {`,
  1987  		`	var res DeepNestedObjectAllOf0`,
  1988  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1989  		`	*m = res`,
  1990  		`type DeepNestedObjectAllOf0AllOf0 struct {`,
  1991  		"	Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1992  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1993  		`func (m *DeepNestedObjectAllOf0AllOf0) UnmarshalJSON(raw []byte) error {`,
  1994  		`	var dataAO0 struct {`,
  1995  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1996  		`	if err := swag.ReadJSON(raw, &dataAO0); err != nil {`,
  1997  		`	m.Prop1 = dataAO0.Prop1`,
  1998  		`	var dataAO1 struct {`,
  1999  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  2000  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  2001  		`	m.Prop2 = dataAO1.Prop2`,
  2002  		`func (m DeepNestedObjectAllOf0AllOf0) MarshalJSON() ([]byte, error) {`,
  2003  		`	_parts := make([][]byte, 0, 2`,
  2004  		`	var dataAO0 struct {`,
  2005  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  2006  		`	dataAO0.Prop1 = m.Prop1`,
  2007  		`	jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`,
  2008  		`	if errAO0 != nil {`,
  2009  		`		return nil, errAO0`,
  2010  		`	_parts = append(_parts, jsonDataAO0`,
  2011  		`	var dataAO1 struct {`,
  2012  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  2013  		`	dataAO1.Prop2 = m.Prop2`,
  2014  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  2015  		`	if errAO1 != nil {`,
  2016  		`		return nil, errAO1`,
  2017  		`	_parts = append(_parts, jsonDataAO1`,
  2018  		`	return swag.ConcatJSON(_parts...), nil`,
  2019  		`func (m *DeepNestedObjectAllOf0AllOf0) Validate(formats strfmt.Registry) error {`,
  2020  		`	if err := m.validateProp1(formats); err != nil {`,
  2021  		`	if err := m.validateProp2(formats); err != nil {`,
  2022  		`		return errors.CompositeValidationError(res...`,
  2023  		`func (m *DeepNestedObjectAllOf0AllOf0) validateProp1(formats strfmt.Registry) error {`,
  2024  		`	if swag.IsZero(m.Prop1) {`,
  2025  		`	if err := validate.FormatOf("prop1", "body", "uuid", m.Prop1.String(), formats); err != nil {`,
  2026  		`func (m *DeepNestedObjectAllOf0AllOf0) validateProp2(formats strfmt.Registry) error {`,
  2027  		`	if swag.IsZero(m.Prop2) {`,
  2028  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  2029  		`func (m *DeepNestedObjectAllOf0AllOf0) MarshalBinary() ([]byte, error) {`,
  2030  		`	if m == nil {`,
  2031  		`		return nil, nil`,
  2032  		`	return swag.WriteJSON(m`,
  2033  		`func (m *DeepNestedObjectAllOf0AllOf0) UnmarshalBinary(b []byte) error {`,
  2034  		`	var res DeepNestedObjectAllOf0AllOf0`,
  2035  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  2036  		`	*m = res`,
  2037  		`type DeepNestedObjectAllOf1 struct {`,
  2038  		"	Prop4 strfmt.UUID `json:\"prop4,omitempty\"`",
  2039  		"	Prop5 strfmt.Date `json:\"prop5,omitempty\"`",
  2040  		`func (m *DeepNestedObjectAllOf1) UnmarshalJSON(raw []byte) error {`,
  2041  		`	var dataAO0 struct {`,
  2042  		"		Prop4 strfmt.UUID `json:\"prop4,omitempty\"`",
  2043  		`	if err := swag.ReadJSON(raw, &dataAO0); err != nil {`,
  2044  		`	m.Prop4 = dataAO0.Prop4`,
  2045  		`	var dataAO1 struct {`,
  2046  		"		Prop5 strfmt.Date `json:\"prop5,omitempty\"`",
  2047  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  2048  		`	m.Prop5 = dataAO1.Prop5`,
  2049  		`func (m DeepNestedObjectAllOf1) MarshalJSON() ([]byte, error) {`,
  2050  		`	_parts := make([][]byte, 0, 2`,
  2051  		`	var dataAO0 struct {`,
  2052  		"		Prop4 strfmt.UUID `json:\"prop4,omitempty\"`",
  2053  		`	dataAO0.Prop4 = m.Prop4`,
  2054  		`	jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`,
  2055  		`	if errAO0 != nil {`,
  2056  		`		return nil, errAO0`,
  2057  		`	_parts = append(_parts, jsonDataAO0`,
  2058  		`	var dataAO1 struct {`,
  2059  		"		Prop5 strfmt.Date `json:\"prop5,omitempty\"`",
  2060  		`	dataAO1.Prop5 = m.Prop5`,
  2061  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  2062  		`	if errAO1 != nil {`,
  2063  		`		return nil, errAO1`,
  2064  		`	_parts = append(_parts, jsonDataAO1`,
  2065  		`	return swag.ConcatJSON(_parts...), nil`,
  2066  		`func (m *DeepNestedObjectAllOf1) Validate(formats strfmt.Registry) error {`,
  2067  		`	if err := m.validateProp4(formats); err != nil {`,
  2068  		`	if err := m.validateProp5(formats); err != nil {`,
  2069  		`		return errors.CompositeValidationError(res...`,
  2070  		`func (m *DeepNestedObjectAllOf1) validateProp4(formats strfmt.Registry) error {`,
  2071  		`	if swag.IsZero(m.Prop4) {`,
  2072  		`	if err := validate.FormatOf("prop4", "body", "uuid", m.Prop4.String(), formats); err != nil {`,
  2073  		`func (m *DeepNestedObjectAllOf1) validateProp5(formats strfmt.Registry) error {`,
  2074  		`	if swag.IsZero(m.Prop5) {`,
  2075  		`	if err := validate.FormatOf("prop5", "body", "date", m.Prop5.String(), formats); err != nil {`,
  2076  		`func (m *DeepNestedObjectAllOf1) MarshalBinary() ([]byte, error) {`,
  2077  		`	if m == nil {`,
  2078  		`		return nil, nil`,
  2079  		`	return swag.WriteJSON(m`,
  2080  		`func (m *DeepNestedObjectAllOf1) UnmarshalBinary(b []byte) error {`,
  2081  		`	var res DeepNestedObjectAllOf1`,
  2082  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  2083  		`	*m = res`,
  2084  	},
  2085  		// not expected
  2086  		noLines,
  2087  		// output in log
  2088  		noLines,
  2089  		noLines)
  2090  
  2091  	// load expectations for model: break_nested_object_all_of1.go
  2092  	flattenRun.AddExpectations("break_nested_object_all_of1.go", []string{
  2093  		`type BreakNestedObjectAllOf1 struct {`,
  2094  		"	Prop6 strfmt.UUID `json:\"prop6,omitempty\"`",
  2095  		"	Prop7 *BreakNestedObjectAllOf1Prop7 `json:\"prop7,omitempty\"`",
  2096  		`func (m *BreakNestedObjectAllOf1) Validate(formats strfmt.Registry) error {`,
  2097  		`	if err := m.validateProp6(formats); err != nil {`,
  2098  		`	if err := m.validateProp7(formats); err != nil {`,
  2099  		`		return errors.CompositeValidationError(res...`,
  2100  		`func (m *BreakNestedObjectAllOf1) validateProp6(formats strfmt.Registry) error {`,
  2101  		`	if swag.IsZero(m.Prop6) {`,
  2102  		`	if err := validate.FormatOf("prop6", "body", "uuid", m.Prop6.String(), formats); err != nil {`,
  2103  		`func (m *BreakNestedObjectAllOf1) validateProp7(formats strfmt.Registry) error {`,
  2104  		`	if swag.IsZero(m.Prop7) {`,
  2105  		`	if m.Prop7 != nil {`,
  2106  		`		if err := m.Prop7.Validate(formats); err != nil {`,
  2107  		`			if ve, ok := err.(*errors.Validation); ok {`,
  2108  		`				return ve.ValidateName("prop7"`,
  2109  	},
  2110  		// not expected
  2111  		todo,
  2112  		// output in log
  2113  		noLines,
  2114  		noLines)
  2115  
  2116  	// load expectations for model: not_really_composed_thing.go
  2117  	flattenRun.AddExpectations("not_really_composed_thing.go", []string{
  2118  		`type NotReallyComposedThing struct {`,
  2119  		`	NotReallyComposedThingAllOf0`,
  2120  		`func (m *NotReallyComposedThing) Validate(formats strfmt.Registry) error {`,
  2121  		`	if err := m.NotReallyComposedThingAllOf0.Validate(formats); err != nil {`,
  2122  		`		return errors.CompositeValidationError(res...`,
  2123  	},
  2124  		// not expected
  2125  		todo,
  2126  		// output in log
  2127  		noLines,
  2128  		noLines)
  2129  
  2130  	expandRun.AddExpectations("not_really_composed_thing.go", []string{
  2131  		`type NotReallyComposedThing struct {`,
  2132  		"	Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
  2133  		`func (m *NotReallyComposedThing) Validate(formats strfmt.Registry) error {`,
  2134  		`	if err := m.validateProp0(formats); err != nil {`,
  2135  		`		return errors.CompositeValidationError(res...`,
  2136  		`func (m *NotReallyComposedThing) validateProp0(formats strfmt.Registry) error {`,
  2137  		`	if swag.IsZero(m.Prop0) {`,
  2138  		`	if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`,
  2139  	},
  2140  		// not expected
  2141  		noLines,
  2142  		// output in log
  2143  		noLines,
  2144  		noLines)
  2145  
  2146  	// load expectations for model: simple_nested_object.go
  2147  	flattenRun.AddExpectations("simple_nested_object.go", []string{
  2148  		`type SimpleNestedObject struct {`,
  2149  		`	ComposedThing`,
  2150  		`	SimpleNestedObjectAllOf1`,
  2151  		`func (m *SimpleNestedObject) Validate(formats strfmt.Registry) error {`,
  2152  		`	if err := m.ComposedThing.Validate(formats); err != nil {`,
  2153  		`	if err := m.SimpleNestedObjectAllOf1.Validate(formats); err != nil {`,
  2154  		`		return errors.CompositeValidationError(res...`,
  2155  	},
  2156  		// not expected
  2157  		todo,
  2158  		// output in log
  2159  		noLines,
  2160  		noLines)
  2161  
  2162  	// load expectations for model: simple_nested_object.go
  2163  	expandRun.AddExpectations("simple_nested_object.go", []string{
  2164  		`type SimpleNestedObject struct {`,
  2165  		`	SimpleNestedObjectAllOf0`,
  2166  		"	Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  2167  		`func (m *SimpleNestedObject) UnmarshalJSON(raw []byte) error {`,
  2168  		`	var aO0 SimpleNestedObjectAllOf0`,
  2169  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  2170  		`	m.SimpleNestedObjectAllOf0 = aO0`,
  2171  		`	var dataAO1 struct {`,
  2172  		"		Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  2173  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  2174  		`	m.Prop3 = dataAO1.Prop3`,
  2175  		`func (m SimpleNestedObject) MarshalJSON() ([]byte, error) {`,
  2176  		`	_parts := make([][]byte, 0, 2`,
  2177  		`	aO0, err := swag.WriteJSON(m.SimpleNestedObjectAllOf0`,
  2178  		`	if err != nil {`,
  2179  		`		return nil, err`,
  2180  		`	_parts = append(_parts, aO0`,
  2181  		`	var dataAO1 struct {`,
  2182  		"		Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  2183  		`	dataAO1.Prop3 = m.Prop3`,
  2184  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  2185  		`	if errAO1 != nil {`,
  2186  		`		return nil, errAO1`,
  2187  		`	_parts = append(_parts, jsonDataAO1`,
  2188  		`	return swag.ConcatJSON(_parts...), nil`,
  2189  		`func (m *SimpleNestedObject) Validate(formats strfmt.Registry) error {`,
  2190  		`	if err := m.SimpleNestedObjectAllOf0.Validate(formats); err != nil {`,
  2191  		`	if err := m.validateProp3(formats); err != nil {`,
  2192  		`		return errors.CompositeValidationError(res...`,
  2193  		`func (m *SimpleNestedObject) validateProp3(formats strfmt.Registry) error {`,
  2194  		`	if swag.IsZero(m.Prop3) {`,
  2195  		`	if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`,
  2196  		`func (m *SimpleNestedObject) MarshalBinary() ([]byte, error) {`,
  2197  		`	if m == nil {`,
  2198  		`		return nil, nil`,
  2199  		`	return swag.WriteJSON(m`,
  2200  		`func (m *SimpleNestedObject) UnmarshalBinary(b []byte) error {`,
  2201  		`	var res SimpleNestedObject`,
  2202  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  2203  		`	*m = res`,
  2204  		`type SimpleNestedObjectAllOf0 struct {`,
  2205  		"	Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  2206  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  2207  		`func (m *SimpleNestedObjectAllOf0) UnmarshalJSON(raw []byte) error {`,
  2208  		`	var dataAO0 struct {`,
  2209  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  2210  		`	if err := swag.ReadJSON(raw, &dataAO0); err != nil {`,
  2211  		`	m.Prop1 = dataAO0.Prop1`,
  2212  		`	var dataAO1 struct {`,
  2213  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  2214  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  2215  		`	m.Prop2 = dataAO1.Prop2`,
  2216  		`func (m SimpleNestedObjectAllOf0) MarshalJSON() ([]byte, error) {`,
  2217  		`	_parts := make([][]byte, 0, 2`,
  2218  		`	var dataAO0 struct {`,
  2219  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  2220  		`	dataAO0.Prop1 = m.Prop1`,
  2221  		`	jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`,
  2222  		`	if errAO0 != nil {`,
  2223  		`		return nil, errAO0`,
  2224  		`	_parts = append(_parts, jsonDataAO0`,
  2225  		`	var dataAO1 struct {`,
  2226  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  2227  		`	dataAO1.Prop2 = m.Prop2`,
  2228  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  2229  		`	if errAO1 != nil {`,
  2230  		`		return nil, errAO1`,
  2231  		`	_parts = append(_parts, jsonDataAO1`,
  2232  		`	return swag.ConcatJSON(_parts...), nil`,
  2233  		`func (m *SimpleNestedObjectAllOf0) Validate(formats strfmt.Registry) error {`,
  2234  		`	if err := m.validateProp1(formats); err != nil {`,
  2235  		`	if err := m.validateProp2(formats); err != nil {`,
  2236  		`		return errors.CompositeValidationError(res...`,
  2237  		`func (m *SimpleNestedObjectAllOf0) validateProp1(formats strfmt.Registry) error {`,
  2238  		`	if swag.IsZero(m.Prop1) {`,
  2239  		`	if err := validate.FormatOf("prop1", "body", "uuid", m.Prop1.String(), formats); err != nil {`,
  2240  		`func (m *SimpleNestedObjectAllOf0) validateProp2(formats strfmt.Registry) error {`,
  2241  		`	if swag.IsZero(m.Prop2) {`,
  2242  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  2243  		`func (m *SimpleNestedObjectAllOf0) MarshalBinary() ([]byte, error) {`,
  2244  		`	if m == nil {`,
  2245  		`		return nil, nil`,
  2246  		`	return swag.WriteJSON(m`,
  2247  		`func (m *SimpleNestedObjectAllOf0) UnmarshalBinary(b []byte) error {`,
  2248  		`	var res SimpleNestedObjectAllOf0`,
  2249  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  2250  		`	*m = res`,
  2251  	},
  2252  		// not expected
  2253  		noLines,
  2254  		// output in log
  2255  		noLines,
  2256  		noLines)
  2257  
  2258  	// load expectations for model: break_nested_object_all_of1_prop7_all_of0.go
  2259  	flattenRun.AddExpectations("break_nested_object_all_of1_prop7_all_of0.go", []string{
  2260  		`type BreakNestedObjectAllOf1Prop7AllOf0 struct {`,
  2261  		"	Prop8 int64 `json:\"prop8,omitempty\"`",
  2262  		`func (m *BreakNestedObjectAllOf1Prop7AllOf0) Validate(formats strfmt.Registry) error {`,
  2263  		`	if err := m.validateProp8(formats); err != nil {`,
  2264  		`		return errors.CompositeValidationError(res...`,
  2265  		`func (m *BreakNestedObjectAllOf1Prop7AllOf0) validateProp8(formats strfmt.Registry) error {`,
  2266  		`	if swag.IsZero(m.Prop8) {`,
  2267  		`	if err := validate.MinimumInt("prop8", "body", m.Prop8, 12, false); err != nil {`,
  2268  	},
  2269  		// not expected
  2270  		todo,
  2271  		// output in log
  2272  		noLines,
  2273  		noLines)
  2274  
  2275  	// load expectations for model: deep_nested_object_all_of1_all_of0.go
  2276  	flattenRun.AddExpectations("deep_nested_object_all_of1_all_of0.go", []string{
  2277  		`type DeepNestedObjectAllOf1AllOf0 struct {`,
  2278  		"	Prop4 strfmt.UUID `json:\"prop4,omitempty\"`",
  2279  		`func (m *DeepNestedObjectAllOf1AllOf0) Validate(formats strfmt.Registry) error {`,
  2280  		`	if err := m.validateProp4(formats); err != nil {`,
  2281  		`		return errors.CompositeValidationError(res...`,
  2282  		`func (m *DeepNestedObjectAllOf1AllOf0) validateProp4(formats strfmt.Registry) error {`,
  2283  		`	if swag.IsZero(m.Prop4) {`,
  2284  		`	if err := validate.FormatOf("prop4", "body", "uuid", m.Prop4.String(), formats); err != nil {`,
  2285  	},
  2286  		// not expected
  2287  		todo,
  2288  		// output in log
  2289  		noLines,
  2290  		noLines)
  2291  
  2292  	// load expectations for model: break_nested_object_all_of1_prop7_all_of1.go
  2293  	flattenRun.AddExpectations("break_nested_object_all_of1_prop7_all_of1.go", []string{
  2294  		`type BreakNestedObjectAllOf1Prop7AllOf1 struct {`,
  2295  		"	Prop9 int64 `json:\"prop9,omitempty\"`",
  2296  		`func (m *BreakNestedObjectAllOf1Prop7AllOf1) Validate(formats strfmt.Registry) error {`,
  2297  		`	if err := m.validateProp9(formats); err != nil {`,
  2298  		`		return errors.CompositeValidationError(res...`,
  2299  		`func (m *BreakNestedObjectAllOf1Prop7AllOf1) validateProp9(formats strfmt.Registry) error {`,
  2300  		`	if swag.IsZero(m.Prop9) {`,
  2301  		`	if err := validate.MaximumInt("prop9", "body", m.Prop9, 12, false); err != nil {`,
  2302  	},
  2303  		// not expected
  2304  		todo,
  2305  		// output in log
  2306  		noLines,
  2307  		noLines)
  2308  
  2309  	// load expectations for model: composed_thing_all_of0.go
  2310  	flattenRun.AddExpectations("composed_thing_all_of0.go", []string{
  2311  		`type ComposedThingAllOf0 struct {`,
  2312  		"	Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  2313  		`func (m *ComposedThingAllOf0) Validate(formats strfmt.Registry) error {`,
  2314  		`	if err := m.validateProp1(formats); err != nil {`,
  2315  		`		return errors.CompositeValidationError(res...`,
  2316  		`func (m *ComposedThingAllOf0) validateProp1(formats strfmt.Registry) error {`,
  2317  		`	if swag.IsZero(m.Prop1) {`,
  2318  		`	if err := validate.FormatOf("prop1", "body", "uuid", m.Prop1.String(), formats); err != nil {`,
  2319  	},
  2320  		// not expected
  2321  		todo,
  2322  		// output in log
  2323  		noLines,
  2324  		noLines)
  2325  
  2326  	// load expectations for model: composed_thing_all_of1.go
  2327  	flattenRun.AddExpectations("composed_thing_all_of1.go", []string{
  2328  		`type ComposedThingAllOf1 struct {`,
  2329  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  2330  		`func (m *ComposedThingAllOf1) Validate(formats strfmt.Registry) error {`,
  2331  		`	if err := m.validateProp2(formats); err != nil {`,
  2332  		`		return errors.CompositeValidationError(res...`,
  2333  		`func (m *ComposedThingAllOf1) validateProp2(formats strfmt.Registry) error {`,
  2334  		`	if swag.IsZero(m.Prop2) {`,
  2335  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  2336  	},
  2337  		// not expected
  2338  		todo,
  2339  		// output in log
  2340  		noLines,
  2341  		noLines)
  2342  
  2343  	// load expectations for model: deep_nested_object_all_of1.go
  2344  	flattenRun.AddExpectations("deep_nested_object_all_of1.go", []string{
  2345  		`type DeepNestedObjectAllOf1 struct {`,
  2346  		`	DeepNestedObjectAllOf1AllOf0`,
  2347  		`	DeepNestedObjectAllOf1AllOf1`,
  2348  		`func (m *DeepNestedObjectAllOf1) Validate(formats strfmt.Registry) error {`,
  2349  		`	if err := m.DeepNestedObjectAllOf1AllOf0.Validate(formats); err != nil {`,
  2350  		`	if err := m.DeepNestedObjectAllOf1AllOf1.Validate(formats); err != nil {`,
  2351  		`		return errors.CompositeValidationError(res...`,
  2352  	},
  2353  		// not expected
  2354  		todo,
  2355  		// output in log
  2356  		noLines,
  2357  		noLines)
  2358  }
  2359  
  2360  func initFixtureComplexAllOf() {
  2361  	// testing ../fixtures/bugs/1487/fixture-complex-allOf.yaml with flatten and expand (--skip-flatten)
  2362  
  2363  	/*
  2364  	 */
  2365  	f := newModelFixture("../fixtures/bugs/1487/fixture-complex-allOf.yaml", "fixture for nested allOf with ref")
  2366  	flattenRun := f.AddRun(false)
  2367  	expandRun := f.AddRun(true)
  2368  
  2369  	// load expectations for model: aliased_date.go
  2370  	flattenRun.AddExpectations("aliased_date.go", []string{
  2371  		`type AliasedDate strfmt.Date`,
  2372  		`func (m AliasedDate) Validate(formats strfmt.Registry) error {`,
  2373  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  2374  		`		return errors.CompositeValidationError(res...`,
  2375  	},
  2376  		// not expected
  2377  		todo,
  2378  		// output in log
  2379  		noLines,
  2380  		noLines)
  2381  
  2382  	expandRun.AddExpectations("aliased_date.go", flattenRun.ExpectedFor("AliasedDate").ExpectedLines, todo, noLines, noLines)
  2383  
  2384  	// load expectations for model: object_mix_all_of2.go
  2385  	flattenRun.AddExpectations("object_mix_all_of2.go", []string{
  2386  		`type ObjectMixAllOf2 struct {`,
  2387  		"	Prop2 *ObjectMixAllOf2Prop2 `json:\"prop2,omitempty\"`",
  2388  		`func (m *ObjectMixAllOf2) Validate(formats strfmt.Registry) error {`,
  2389  		`	if err := m.validateProp2(formats); err != nil {`,
  2390  		`		return errors.CompositeValidationError(res...`,
  2391  		`func (m *ObjectMixAllOf2) validateProp2(formats strfmt.Registry) error {`,
  2392  		`	if swag.IsZero(m.Prop2) {`,
  2393  		`	if m.Prop2 != nil {`,
  2394  		`		if err := m.Prop2.Validate(formats); err != nil {`,
  2395  		`			if ve, ok := err.(*errors.Validation); ok {`,
  2396  		`				return ve.ValidateName("prop2"`,
  2397  	},
  2398  		// not expected
  2399  		todo,
  2400  		// output in log
  2401  		noLines,
  2402  		noLines)
  2403  
  2404  	// load expectations for model: object_mix.go
  2405  	flattenRun.AddExpectations("object_mix.go", []string{
  2406  		`type ObjectMix struct {`,
  2407  		`	ObjectMixAllOf1`,
  2408  		`	ObjectMixAllOf2`,
  2409  		`func (m *ObjectMix) Validate(formats strfmt.Registry) error {`,
  2410  		`	if err := m.ObjectMixAllOf1.Validate(formats); err != nil {`,
  2411  		`	if err := m.ObjectMixAllOf2.Validate(formats); err != nil {`,
  2412  		`		return errors.CompositeValidationError(res...`,
  2413  	},
  2414  		// not expected
  2415  		todo,
  2416  		// output in log
  2417  		noLines,
  2418  		noLines)
  2419  
  2420  	expandRun.AddExpectations("object_mix.go", []string{
  2421  		`type ObjectMix struct {`,
  2422  		`	Prop1 struct {`,
  2423  		`		ObjectMixProp1AllOf0`,
  2424  		`		ObjectMixProp1AllOf1`,
  2425  		"	} `json:\"prop1,omitempty\"`",
  2426  		`	Prop2 struct {`,
  2427  		`		ObjectMixProp2AllOf0`,
  2428  		`		ObjectMixProp2AllOf1`,
  2429  		"	} `json:\"prop2,omitempty\"`",
  2430  		`func (m *ObjectMix) Validate(formats strfmt.Registry) error {`,
  2431  		`	if err := m.validateProp1(formats); err != nil {`,
  2432  		`	if err := m.validateProp2(formats); err != nil {`,
  2433  		`		return errors.CompositeValidationError(res...`,
  2434  		`func (m *ObjectMix) validateProp1(formats strfmt.Registry) error {`,
  2435  		`	if swag.IsZero(m.Prop1) {`,
  2436  		`func (m *ObjectMix) validateProp2(formats strfmt.Registry) error {`,
  2437  		`	if swag.IsZero(m.Prop2) {`,
  2438  		`type ObjectMixProp1AllOf0 strfmt.Date`,
  2439  		`func (m ObjectMixProp1AllOf0) Validate(formats strfmt.Registry) error {`,
  2440  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  2441  		`		return errors.CompositeValidationError(res...`,
  2442  		`type ObjectMixProp1AllOf1 strfmt.Date`,
  2443  		`func (m ObjectMixProp1AllOf1) Validate(formats strfmt.Registry) error {`,
  2444  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  2445  		`		return errors.CompositeValidationError(res...`,
  2446  		`type ObjectMixProp2AllOf0 strfmt.Date`,
  2447  		`func (m ObjectMixProp2AllOf0) Validate(formats strfmt.Registry) error {`,
  2448  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  2449  		`		return errors.CompositeValidationError(res...`,
  2450  		`type ObjectMixProp2AllOf1 strfmt.Date`,
  2451  		`func (m ObjectMixProp2AllOf1) Validate(formats strfmt.Registry) error {`,
  2452  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  2453  		`		return errors.CompositeValidationError(res...`,
  2454  	},
  2455  		// not expected
  2456  		noLines,
  2457  		// output in log
  2458  		noLines,
  2459  		noLines)
  2460  
  2461  	// load expectations for model: all_of_slices_of_aliases.go
  2462  	flattenRun.AddExpectations("all_of_slices_of_aliases.go", []string{
  2463  		`type AllOfSlicesOfAliases struct {`,
  2464  		`	AllOfSlicesOfAliasesAllOf0`,
  2465  		`	AllOfSlicesOfAliasesAllOf1`,
  2466  		`func (m *AllOfSlicesOfAliases) Validate(formats strfmt.Registry) error {`,
  2467  		`	if err := m.AllOfSlicesOfAliasesAllOf0.Validate(formats); err != nil {`,
  2468  		`	if err := m.AllOfSlicesOfAliasesAllOf1.Validate(formats); err != nil {`,
  2469  		`		return errors.CompositeValidationError(res...`,
  2470  	},
  2471  		// not expected
  2472  		todo,
  2473  		// output in log
  2474  		noLines,
  2475  		noLines)
  2476  
  2477  	expandRun.AddExpectations("all_of_slices_of_aliases.go", []string{
  2478  		`type AllOfSlicesOfAliases struct {`,
  2479  		"	Prop1 []strfmt.Date `json:\"prop1\"`",
  2480  		"	Prop2 []*strfmt.Date `json:\"prop2\"`",
  2481  		`func (m *AllOfSlicesOfAliases) Validate(formats strfmt.Registry) error {`,
  2482  		`	if err := m.validateProp1(formats); err != nil {`,
  2483  		`	if err := m.validateProp2(formats); err != nil {`,
  2484  		`		return errors.CompositeValidationError(res...`,
  2485  		`func (m *AllOfSlicesOfAliases) validateProp1(formats strfmt.Registry) error {`,
  2486  		`	if swag.IsZero(m.Prop1) {`,
  2487  		`	iProp1Size := int64(len(m.Prop1)`,
  2488  		`	if err := validate.MaxItems("prop1", "body", iProp1Size, 10); err != nil {`,
  2489  		`	for i := 0; i < len(m.Prop1); i++ {`,
  2490  		`		if err := validate.FormatOf("prop1"+"."+strconv.Itoa(i), "body", "date", m.Prop1[i].String(), formats); err != nil {`,
  2491  		`func (m *AllOfSlicesOfAliases) validateProp2(formats strfmt.Registry) error {`,
  2492  		`	if swag.IsZero(m.Prop2) {`,
  2493  		`	iProp2Size := int64(len(m.Prop2)`,
  2494  		`	if err := validate.MaxItems("prop2", "body", iProp2Size, 20); err != nil {`,
  2495  		`	for i := 0; i < len(m.Prop2); i++ {`,
  2496  		// do we need Required when item is nullable?
  2497  		// nullable not required:
  2498  		`		if swag.IsZero(m.Prop2[i]) {`,
  2499  		// nullable required:
  2500  		`		if err := validate.FormatOf("prop2"+"."+strconv.Itoa(i), "body", "date", m.Prop2[i].String(), formats); err != nil {`,
  2501  	},
  2502  		// not expected
  2503  		noLines,
  2504  		// output in log
  2505  		noLines,
  2506  		noLines)
  2507  
  2508  	// load expectations for model: all_of_aliases.go
  2509  	flattenRun.AddExpectations("all_of_aliases.go", []string{
  2510  		`type AllOfAliases struct {`,
  2511  		`	AliasedDate`,
  2512  		`	AliasedNullableDate`,
  2513  		`func (m *AllOfAliases) Validate(formats strfmt.Registry) error {`,
  2514  		`	if err := m.AliasedDate.Validate(formats); err != nil {`,
  2515  		`	if err := m.AliasedNullableDate.Validate(formats); err != nil {`,
  2516  		`		return errors.CompositeValidationError(res...`,
  2517  	},
  2518  		// not expected
  2519  		todo,
  2520  		// output in log
  2521  		noLines,
  2522  		noLines)
  2523  
  2524  	expandRun.AddExpectations("all_of_aliases.go", []string{
  2525  		`type AllOfAliases struct {`,
  2526  		`	AllOfAliasesAllOf0`,
  2527  		`	AllOfAliasesAllOf1`,
  2528  		`func (m *AllOfAliases) Validate(formats strfmt.Registry) error {`,
  2529  		`	if err := m.AllOfAliasesAllOf0.Validate(formats); err != nil {`,
  2530  		`	if err := m.AllOfAliasesAllOf1.Validate(formats); err != nil {`,
  2531  		`		return errors.CompositeValidationError(res...`,
  2532  		`type AllOfAliasesAllOf0 strfmt.Date`,
  2533  		`func (m AllOfAliasesAllOf0) Validate(formats strfmt.Registry) error {`,
  2534  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  2535  		`		return errors.CompositeValidationError(res...`,
  2536  		// NOTE: the x-nullable has not been honored here
  2537  		// so we don't have: `type AllOfAliasesAllOf1 *strfmt.Date`,
  2538  		// this is by design, since nullability is honored by the container of the alias, not the
  2539  		// alias itself. An allOf branch container is composing types, not pointers.
  2540  		`type AllOfAliasesAllOf1 strfmt.Date`,
  2541  		`func (m AllOfAliasesAllOf1) Validate(formats strfmt.Registry) error {`,
  2542  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  2543  		`		return errors.CompositeValidationError(res...`,
  2544  	},
  2545  		// not expected
  2546  		noLines,
  2547  		// output in log
  2548  		noLines,
  2549  		noLines)
  2550  
  2551  	// load expectations for model: object_mix_all_of1.go
  2552  	flattenRun.AddExpectations("object_mix_all_of1.go", []string{
  2553  		`type ObjectMixAllOf1 struct {`,
  2554  		"	Prop1 *ObjectMixAllOf1Prop1 `json:\"prop1,omitempty\"`",
  2555  		`func (m *ObjectMixAllOf1) Validate(formats strfmt.Registry) error {`,
  2556  		`	if err := m.validateProp1(formats); err != nil {`,
  2557  		`		return errors.CompositeValidationError(res...`,
  2558  		`func (m *ObjectMixAllOf1) validateProp1(formats strfmt.Registry) error {`,
  2559  		`	if swag.IsZero(m.Prop1) {`,
  2560  		`	if m.Prop1 != nil {`,
  2561  		`		if err := m.Prop1.Validate(formats); err != nil {`,
  2562  		`			if ve, ok := err.(*errors.Validation); ok {`,
  2563  		`				return ve.ValidateName("prop1"`,
  2564  	},
  2565  		// not expected
  2566  		todo,
  2567  		// output in log
  2568  		noLines,
  2569  		noLines)
  2570  
  2571  	// load expectations for model: all_of_slices_of_aliases_all_of0.go
  2572  	flattenRun.AddExpectations("all_of_slices_of_aliases_all_of0.go", []string{
  2573  		`type AllOfSlicesOfAliasesAllOf0 struct {`,
  2574  		"	Prop1 []AliasedDate `json:\"prop1\"`",
  2575  		`func (m *AllOfSlicesOfAliasesAllOf0) Validate(formats strfmt.Registry) error {`,
  2576  		`	if err := m.validateProp1(formats); err != nil {`,
  2577  		`		return errors.CompositeValidationError(res...`,
  2578  		`func (m *AllOfSlicesOfAliasesAllOf0) validateProp1(formats strfmt.Registry) error {`,
  2579  		`	if swag.IsZero(m.Prop1) {`,
  2580  		`	iProp1Size := int64(len(m.Prop1)`,
  2581  		`	if err := validate.MaxItems("prop1", "body", iProp1Size, 10); err != nil {`,
  2582  		`	for i := 0; i < len(m.Prop1); i++ {`,
  2583  		`		if err := m.Prop1[i].Validate(formats); err != nil {`,
  2584  		`			if ve, ok := err.(*errors.Validation); ok {`,
  2585  		`				return ve.ValidateName("prop1" + "." + strconv.Itoa(i)`,
  2586  	},
  2587  		// not expected
  2588  		todo,
  2589  		// output in log
  2590  		noLines,
  2591  		noLines)
  2592  
  2593  	// load expectations for model: slice_of_all_of.go
  2594  	flattenRun.AddExpectations("slice_of_all_of.go", []string{
  2595  		`type SliceOfAllOf []*SliceOfAllOfItems`,
  2596  		`func (m SliceOfAllOf) Validate(formats strfmt.Registry) error {`,
  2597  		`	if err := validate.UniqueItems("", "body", m); err != nil {`,
  2598  		`	for i := 0; i < len(m); i++ {`,
  2599  		// do we need Required when item is nullable?
  2600  		// nullable not required:
  2601  		`		if swag.IsZero(m[i]) {`,
  2602  		// nullable required:
  2603  		`		if m[i] != nil {`,
  2604  		`			if err := m[i].Validate(formats); err != nil {`,
  2605  		`				if ve, ok := err.(*errors.Validation); ok {`,
  2606  		`					return ve.ValidateName(strconv.Itoa(i)`,
  2607  		`		return errors.CompositeValidationError(res...`,
  2608  	},
  2609  		// not expected
  2610  		todo,
  2611  		// output in log
  2612  		noLines,
  2613  		noLines)
  2614  
  2615  	expandRun.AddExpectations("slice_of_all_of.go", []string{
  2616  		`type SliceOfAllOf []*SliceOfAllOfItems0`,
  2617  		`func (m SliceOfAllOf) Validate(formats strfmt.Registry) error {`,
  2618  		`	if err := validate.UniqueItems("", "body", m); err != nil {`,
  2619  		`	for i := 0; i < len(m); i++ {`,
  2620  		// do we need Required when item is nullable?
  2621  		// nullable not required:
  2622  		`		if swag.IsZero(m[i]) {`,
  2623  		// nullable required:
  2624  		`		if m[i] != nil {`,
  2625  		`			if err := m[i].Validate(formats); err != nil {`,
  2626  		`				if ve, ok := err.(*errors.Validation); ok {`,
  2627  		`					return ve.ValidateName(strconv.Itoa(i)`,
  2628  		`		return errors.CompositeValidationError(res...`,
  2629  		`type SliceOfAllOfItems0 struct {`,
  2630  		"	Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
  2631  		`	SliceOfAllOfItems0AllOf1`,
  2632  		`func (m *SliceOfAllOfItems0) Validate(formats strfmt.Registry) error {`,
  2633  		`	if err := m.validateProp0(formats); err != nil {`,
  2634  		`		return errors.CompositeValidationError(res...`,
  2635  		`func (m *SliceOfAllOfItems0) validateProp0(formats strfmt.Registry) error {`,
  2636  		`	if swag.IsZero(m.Prop0) {`,
  2637  		`	if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`,
  2638  		`type SliceOfAllOfItems0AllOf1 []interface{`,
  2639  		// empty validation
  2640  		"func (m SliceOfAllOfItems0AllOf1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  2641  	},
  2642  		// not expected
  2643  		noLines,
  2644  		// output in log
  2645  		noLines,
  2646  		noLines)
  2647  
  2648  	// load expectations for model: object_mix_all_of2_prop2.go
  2649  	flattenRun.AddExpectations("object_mix_all_of2_prop2.go", []string{
  2650  		`type ObjectMixAllOf2Prop2 struct {`,
  2651  		`	AliasedDate`,
  2652  		`	AliasedNullableDate`,
  2653  		`func (m *ObjectMixAllOf2Prop2) Validate(formats strfmt.Registry) error {`,
  2654  		`	if err := m.AliasedDate.Validate(formats); err != nil {`,
  2655  		`	if err := m.AliasedNullableDate.Validate(formats); err != nil {`,
  2656  		`		return errors.CompositeValidationError(res...`,
  2657  	},
  2658  		// not expected
  2659  		todo,
  2660  		// output in log
  2661  		noLines,
  2662  		noLines)
  2663  
  2664  	// load expectations for model: slice_of_all_of_items_all_of0.go
  2665  	flattenRun.AddExpectations("slice_of_all_of_items_all_of0.go", []string{
  2666  		`type SliceOfAllOfItemsAllOf0 struct {`,
  2667  		"	Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
  2668  		`func (m *SliceOfAllOfItemsAllOf0) Validate(formats strfmt.Registry) error {`,
  2669  		`	if err := m.validateProp0(formats); err != nil {`,
  2670  		`		return errors.CompositeValidationError(res...`,
  2671  		`func (m *SliceOfAllOfItemsAllOf0) validateProp0(formats strfmt.Registry) error {`,
  2672  		`	if swag.IsZero(m.Prop0) {`,
  2673  		`	if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`,
  2674  	},
  2675  		// not expected
  2676  		todo,
  2677  		// output in log
  2678  		noLines,
  2679  		noLines)
  2680  
  2681  	// load expectations for model: slice_of_interfaces.go
  2682  	flattenRun.AddExpectations("slice_of_interfaces.go", []string{
  2683  		`type SliceOfInterfaces []interface{`,
  2684  		// empty validation
  2685  		"func (m SliceOfInterfaces) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  2686  	},
  2687  		// not expected
  2688  		todo,
  2689  		// output in log
  2690  		noLines,
  2691  		noLines)
  2692  
  2693  	expandRun.AddExpectations("slice_of_interfaces.go", flattenRun.ExpectedFor("SliceOfInterfaces").ExpectedLines, todo, noLines, noLines)
  2694  
  2695  	// load expectations for model: slice_of_interfaces_with_validation.go
  2696  	flattenRun.AddExpectations("slice_of_interfaces_with_validation.go", []string{
  2697  		`type SliceOfInterfacesWithValidation []interface{`,
  2698  		`func (m SliceOfInterfacesWithValidation) Validate(formats strfmt.Registry) error {`,
  2699  		`	iSliceOfInterfacesWithValidationSize := int64(len(m)`,
  2700  		`	if err := validate.MaxItems("", "body", iSliceOfInterfacesWithValidationSize, 10); err != nil {`,
  2701  		`		return errors.CompositeValidationError(res...`,
  2702  	},
  2703  		// not expected
  2704  		todo,
  2705  		// output in log
  2706  		noLines,
  2707  		noLines)
  2708  
  2709  	expandRun.AddExpectations("slice_of_interfaces_with_validation.go", flattenRun.ExpectedFor("SliceOfInterfacesWithValidation").ExpectedLines, todo, noLines, noLines)
  2710  
  2711  	// load expectations for model: aliased_nullable_date.go
  2712  	flattenRun.AddExpectations("aliased_nullable_date.go", []string{
  2713  		`type AliasedNullableDate strfmt.Date`,
  2714  		`func (m AliasedNullableDate) Validate(formats strfmt.Registry) error {`,
  2715  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  2716  		`		return errors.CompositeValidationError(res...`,
  2717  	},
  2718  		// not expected
  2719  		todo,
  2720  		// output in log
  2721  		noLines,
  2722  		noLines)
  2723  
  2724  	expandRun.AddExpectations("aliased_nullable_date.go", flattenRun.ExpectedFor("AliasedNullableDate").ExpectedLines, todo, noLines, noLines)
  2725  
  2726  	// load expectations for model: slice_mix.go
  2727  	flattenRun.AddExpectations("slice_mix.go", []string{
  2728  		`type SliceMix struct {`,
  2729  		`	SliceOfAllOf`,
  2730  		`	SliceOfInterfaces`,
  2731  		`func (m *SliceMix) Validate(formats strfmt.Registry) error {`,
  2732  		`	if err := m.SliceOfAllOf.Validate(formats); err != nil {`,
  2733  		`	if err := m.SliceOfInterfaces.Validate(formats); err != nil {`,
  2734  		`		return errors.CompositeValidationError(res...`,
  2735  	},
  2736  		// not expected
  2737  		todo,
  2738  		// disable log assertions (dodgy with parallel tests)
  2739  		// output in log
  2740  		// warning,
  2741  		noLines,
  2742  		noLines)
  2743  
  2744  	expandRun.AddExpectations("slice_mix.go", []string{
  2745  		`type SliceMix struct {`,
  2746  		`	SliceMixAllOf0`,
  2747  		`	SliceMixAllOf1`,
  2748  		`func (m *SliceMix) Validate(formats strfmt.Registry) error {`,
  2749  		`	if err := m.SliceMixAllOf0.Validate(formats); err != nil {`,
  2750  		`		return errors.CompositeValidationError(res...`,
  2751  		`type SliceMixAllOf0 []*SliceMixAllOf0Items0`,
  2752  		`func (m SliceMixAllOf0) Validate(formats strfmt.Registry) error {`,
  2753  		`	if err := validate.UniqueItems("", "body", m); err != nil {`,
  2754  		`	for i := 0; i < len(m); i++ {`,
  2755  		// do we need Required when item is nullable?
  2756  		// nullable not required:
  2757  		`		if swag.IsZero(m[i]) {`,
  2758  		// nullable required:
  2759  		`		if m[i] != nil {`,
  2760  		`			if err := m[i].Validate(formats); err != nil {`,
  2761  		`				if ve, ok := err.(*errors.Validation); ok {`,
  2762  		`					return ve.ValidateName(strconv.Itoa(i)`,
  2763  		`		return errors.CompositeValidationError(res...`,
  2764  		`type SliceMixAllOf0Items0 struct {`,
  2765  		"	Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
  2766  		`	SliceMixAllOf0Items0AllOf1`,
  2767  		`func (m *SliceMixAllOf0Items0) Validate(formats strfmt.Registry) error {`,
  2768  		`	if err := m.validateProp0(formats); err != nil {`,
  2769  		`		return errors.CompositeValidationError(res...`,
  2770  		`func (m *SliceMixAllOf0Items0) validateProp0(formats strfmt.Registry) error {`,
  2771  		`	if swag.IsZero(m.Prop0) {`,
  2772  		`	if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`,
  2773  		`type SliceMixAllOf0Items0AllOf1 []interface{`,
  2774  		`type SliceMixAllOf1 []interface{`,
  2775  		// empty validation
  2776  		"func (m SliceMixAllOf0Items0AllOf1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  2777  	},
  2778  		// not expected
  2779  		noLines,
  2780  		// output in log
  2781  		noLines,
  2782  		noLines)
  2783  
  2784  	// load expectations for model: object_mix_all_of1_prop1.go
  2785  	flattenRun.AddExpectations("object_mix_all_of1_prop1.go", []string{
  2786  		`type ObjectMixAllOf1Prop1 struct {`,
  2787  		`	AliasedDate`,
  2788  		`	AliasedNullableDate`,
  2789  		`func (m *ObjectMixAllOf1Prop1) Validate(formats strfmt.Registry) error {`,
  2790  		`	if err := m.AliasedDate.Validate(formats); err != nil {`,
  2791  		`	if err := m.AliasedNullableDate.Validate(formats); err != nil {`,
  2792  		`		return errors.CompositeValidationError(res...`,
  2793  	},
  2794  		// not expected
  2795  		todo,
  2796  		// output in log
  2797  		noLines,
  2798  		noLines)
  2799  
  2800  	// load expectations for model: slice_of_all_of_items.go
  2801  	flattenRun.AddExpectations("slice_of_all_of_items.go", []string{
  2802  		`type SliceOfAllOfItems struct {`,
  2803  		`	SliceOfAllOfItemsAllOf0`,
  2804  		`	SliceOfInterfaces`,
  2805  		`func (m *SliceOfAllOfItems) Validate(formats strfmt.Registry) error {`,
  2806  		`	if err := m.SliceOfAllOfItemsAllOf0.Validate(formats); err != nil {`,
  2807  		`	if err := m.SliceOfInterfaces.Validate(formats); err != nil {`,
  2808  		`		return errors.CompositeValidationError(res...`,
  2809  	},
  2810  		// not expected
  2811  		todo,
  2812  		// output in log
  2813  		noLines,
  2814  		noLines)
  2815  
  2816  	// load expectations for model: all_of_slices_of_aliases_all_of1.go
  2817  	flattenRun.AddExpectations("all_of_slices_of_aliases_all_of1.go", []string{
  2818  		`type AllOfSlicesOfAliasesAllOf1 struct {`,
  2819  		"	Prop2 []*AliasedNullableDate `json:\"prop2\"`",
  2820  		`func (m *AllOfSlicesOfAliasesAllOf1) Validate(formats strfmt.Registry) error {`,
  2821  		`	if err := m.validateProp2(formats); err != nil {`,
  2822  		`		return errors.CompositeValidationError(res...`,
  2823  		`func (m *AllOfSlicesOfAliasesAllOf1) validateProp2(formats strfmt.Registry) error {`,
  2824  		`	if swag.IsZero(m.Prop2) {`,
  2825  		`	iProp2Size := int64(len(m.Prop2)`,
  2826  		`	if err := validate.MaxItems("prop2", "body", iProp2Size, 20); err != nil {`,
  2827  		`	for i := 0; i < len(m.Prop2); i++ {`,
  2828  		// do we need Required when item is nullable?
  2829  		// nullable not required:
  2830  		`		if swag.IsZero(m.Prop2[i]) {`,
  2831  		// nullable required:
  2832  		`		if m.Prop2[i] != nil {`,
  2833  		`			if err := m.Prop2[i].Validate(formats); err != nil {`,
  2834  		`				if ve, ok := err.(*errors.Validation); ok {`,
  2835  		`					return ve.ValidateName("prop2" + "." + strconv.Itoa(i)`,
  2836  	},
  2837  		// not expected
  2838  		todo,
  2839  		// output in log
  2840  		noLines,
  2841  		noLines)
  2842  }
  2843  
  2844  func initFixtureIsNullable() {
  2845  	// testing ../fixtures/bugs/1487/fixture-is-nullable.yaml with flatten and expand (--skip-flatten)
  2846  
  2847  	/* just an elementary check with the x-nullable tag
  2848  	 */
  2849  	f := newModelFixture("../fixtures/bugs/1487/fixture-is-nullable.yaml", "fixture for x-nullable flag")
  2850  	flattenRun := f.AddRun(false)
  2851  	expandRun := f.AddRun(true)
  2852  
  2853  	// load expectations for model: thing_with_nullable_dates.go
  2854  	flattenRun.AddExpectations("thing_with_nullable_dates.go", []string{
  2855  		`type ThingWithNullableDates struct {`,
  2856  		"	Prop1 strfmt.Date `json:\"prop1,omitempty\"`",
  2857  		"	Prop2 *strfmt.Date `json:\"prop2,omitempty\"`",
  2858  		`func (m *ThingWithNullableDates) Validate(formats strfmt.Registry) error {`,
  2859  		`	if err := m.validateProp1(formats); err != nil {`,
  2860  		`	if err := m.validateProp2(formats); err != nil {`,
  2861  		`		return errors.CompositeValidationError(res...`,
  2862  		`func (m *ThingWithNullableDates) validateProp1(formats strfmt.Registry) error {`,
  2863  		`	if swag.IsZero(m.Prop1) {`,
  2864  		`	if err := validate.FormatOf("prop1", "body", "date", m.Prop1.String(), formats); err != nil {`,
  2865  		`func (m *ThingWithNullableDates) validateProp2(formats strfmt.Registry) error {`,
  2866  		`	if swag.IsZero(m.Prop2) {`,
  2867  		`	if err := validate.FormatOf("prop2", "body", "date", m.Prop2.String(), formats); err != nil {`,
  2868  	},
  2869  		// not expected
  2870  		todo,
  2871  		// output in log
  2872  		noLines,
  2873  		noLines)
  2874  
  2875  	expandRun.AddExpectations("thing_with_nullable_dates.go", flattenRun.ExpectedFor("ThingWithNullableDates").ExpectedLines, todo, noLines, noLines)
  2876  }
  2877  
  2878  func initFixtureItching() {
  2879  	// testing ../fixtures/bugs/1487/fixture-itching.yaml with flatten and expand (--skip-flatten)
  2880  
  2881  	/*
  2882  		This one regroups a number of itching cases, essentially around additionalProperties.
  2883  		In particular, we test some things with empty objects (no properties) which have additionalProperties of diverse sorts.
  2884  		We also added here some funny models using the special types Files, string format: binary and interface{}
  2885  		These special cases do not correspond to actual API specs: we use them to verify the internal behavior of the general.
  2886  	*/
  2887  	f := newModelFixture("../fixtures/bugs/1487/fixture-itching.yaml", "fixture for additionalProperties")
  2888  	flattenRun := f.AddRun(false)
  2889  	expandRun := f.AddRun(true)
  2890  
  2891  	// load expectations for model: top_level_format_issue_my_alternate_file.go
  2892  	flattenRun.AddExpectations("top_level_format_issue_my_alternate_file.go", []string{
  2893  		`import "io"`,
  2894  		`type TopLevelFormatIssueMyAlternateFile io.ReadCloser`,
  2895  	},
  2896  		// not expected
  2897  		todo,
  2898  		// output in log
  2899  		noLines,
  2900  		noLines)
  2901  
  2902  	// load expectations for model: not_validated_additional_props.go
  2903  	flattenRun.AddExpectations("not_validated_additional_props.go", []string{
  2904  		`type NotValidatedAdditionalProps struct {`,
  2905  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  2906  		"	NotValidatedAdditionalProps map[string]map[string]map[string]string `json:\"-\"`",
  2907  		`func (m *NotValidatedAdditionalProps) Validate(formats strfmt.Registry) error {`,
  2908  		`	if err := m.validateProp2(formats); err != nil {`,
  2909  		`		return errors.CompositeValidationError(res...`,
  2910  		`func (m *NotValidatedAdditionalProps) validateProp2(formats strfmt.Registry) error {`,
  2911  		`	if swag.IsZero(m.Prop2) {`,
  2912  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  2913  	},
  2914  		// not expected
  2915  		todo,
  2916  		// output in log
  2917  		noLines,
  2918  		noLines)
  2919  
  2920  	expandRun.AddExpectations("not_validated_additional_props.go", flattenRun.ExpectedFor("NotValidatedAdditionalProps").ExpectedLines, todo, noLines, noLines)
  2921  
  2922  	// load expectations for model: aliased_nullable_file.go
  2923  	flattenRun.AddExpectations("aliased_nullable_file.go", []string{
  2924  		`import "io"`,
  2925  		`type AliasedNullableFile io.ReadCloser`,
  2926  	},
  2927  		// not expected
  2928  		todo,
  2929  		// output in log
  2930  		noLines,
  2931  		noLines)
  2932  
  2933  	expandRun.AddExpectations("aliased_nullable_file.go", flattenRun.ExpectedFor("AliasedNullableFile").ExpectedLines, todo, noLines, noLines)
  2934  
  2935  	// load expectations for model: empty_object_with_additional_nullable_primitive.go
  2936  	flattenRun.AddExpectations("empty_object_with_additional_nullable_primitive.go", []string{
  2937  		`type EmptyObjectWithAdditionalNullablePrimitive map[string]*strfmt.Date`,
  2938  		`func (m EmptyObjectWithAdditionalNullablePrimitive) Validate(formats strfmt.Registry) error {`,
  2939  		`	for k := range m {`,
  2940  		`		if swag.IsZero(m[k]) {`,
  2941  		`		if err := validate.FormatOf(k, "body", "date", m[k].String(), formats); err != nil {`,
  2942  		`		return errors.CompositeValidationError(res...`,
  2943  	},
  2944  		// not expected
  2945  		todo,
  2946  		// output in log
  2947  		noLines,
  2948  		noLines)
  2949  
  2950  	expandRun.AddExpectations("empty_object_with_additional_nullable_primitive.go", flattenRun.ExpectedFor("EmptyObjectWithAdditionalNullablePrimitive").ExpectedLines, todo, noLines, noLines)
  2951  
  2952  	// load expectations for model: empty_object_with_additional_alias.go
  2953  	flattenRun.AddExpectations("empty_object_with_additional_alias.go", []string{
  2954  		`type EmptyObjectWithAdditionalAlias map[string]AliasedThing`,
  2955  		`func (m EmptyObjectWithAdditionalAlias) Validate(formats strfmt.Registry) error {`,
  2956  		`	for k := range m {`,
  2957  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  2958  		`		if val, ok := m[k]; ok {`,
  2959  		`			if err := val.Validate(formats); err != nil {`,
  2960  		`		return errors.CompositeValidationError(res...`,
  2961  	},
  2962  		// not expected
  2963  		todo,
  2964  		// output in log
  2965  		noLines,
  2966  		noLines)
  2967  
  2968  	expandRun.AddExpectations("empty_object_with_additional_alias.go", []string{
  2969  		`type EmptyObjectWithAdditionalAlias map[string]EmptyObjectWithAdditionalAliasAnon`,
  2970  		`func (m EmptyObjectWithAdditionalAlias) Validate(formats strfmt.Registry) error {`,
  2971  		`	for k := range m {`,
  2972  		`		if swag.IsZero(m[k]) {`,
  2973  		`		if val, ok := m[k]; ok {`,
  2974  		`			if err := val.Validate(formats); err != nil {`,
  2975  		`		return errors.CompositeValidationError(res...`,
  2976  		`type EmptyObjectWithAdditionalAliasAnon struct {`,
  2977  		"	Prop1 strfmt.Date `json:\"prop1,omitempty\"`",
  2978  		`func (m *EmptyObjectWithAdditionalAliasAnon) Validate(formats strfmt.Registry) error {`,
  2979  		`	if err := m.validateProp1(formats); err != nil {`,
  2980  		`		return errors.CompositeValidationError(res...`,
  2981  		`func (m *EmptyObjectWithAdditionalAliasAnon) validateProp1(formats strfmt.Registry) error {`,
  2982  		`	if swag.IsZero(m.Prop1) {`,
  2983  		`	if err := validate.FormatOf("prop1", "body", "date", m.Prop1.String(), formats); err != nil {`,
  2984  	},
  2985  		// not expected
  2986  		noLines,
  2987  		// output in log
  2988  		noLines,
  2989  		noLines)
  2990  
  2991  	// load expectations for model: nullable_thing.go
  2992  	flattenRun.AddExpectations("nullable_thing.go", []string{
  2993  		`type NullableThing strfmt.Date`,
  2994  		`func (m NullableThing) Validate(formats strfmt.Registry) error {`,
  2995  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  2996  		`		return errors.CompositeValidationError(res...`,
  2997  	},
  2998  		// not expected
  2999  		todo,
  3000  		// output in log
  3001  		noLines,
  3002  		noLines)
  3003  
  3004  	expandRun.AddExpectations("nullable_thing.go", flattenRun.ExpectedFor("NullableThing").ExpectedLines, todo, noLines, noLines)
  3005  
  3006  	// load expectations for model: slice_of_aliased_files.go
  3007  	flattenRun.AddExpectations("slice_of_aliased_files.go", []string{
  3008  		`type SliceOfAliasedFiles []AliasedFile`,
  3009  		`func (m SliceOfAliasedFiles) Validate(formats strfmt.Registry) error {`,
  3010  		`	iSliceOfAliasedFilesSize := int64(len(m)`,
  3011  		`	if err := validate.MinItems("", "body", iSliceOfAliasedFilesSize, 4); err != nil {`,
  3012  		`		return errors.CompositeValidationError(res...`,
  3013  	},
  3014  		// not expected
  3015  		todo,
  3016  		// output in log
  3017  		noLines,
  3018  		noLines)
  3019  
  3020  	expandRun.AddExpectations("slice_of_aliased_files.go", []string{
  3021  		`type SliceOfAliasedFiles []io.ReadCloser`,
  3022  		`func (m SliceOfAliasedFiles) Validate(formats strfmt.Registry) error {`,
  3023  		`	iSliceOfAliasedFilesSize := int64(len(m)`,
  3024  		`	if err := validate.MinItems("", "body", iSliceOfAliasedFilesSize, 4); err != nil {`,
  3025  		`		return errors.CompositeValidationError(res...`,
  3026  	},
  3027  		// not expected
  3028  		noLines,
  3029  		// output in log
  3030  		noLines,
  3031  		noLines)
  3032  
  3033  	// load expectations for model: empty_object_with_additional_non_nullable_primitive.go
  3034  	flattenRun.AddExpectations("empty_object_with_additional_non_nullable_primitive.go", []string{
  3035  		`type EmptyObjectWithAdditionalNonNullablePrimitive map[string]strfmt.Date`,
  3036  		`func (m EmptyObjectWithAdditionalNonNullablePrimitive) Validate(formats strfmt.Registry) error {`,
  3037  		`	for k := range m {`,
  3038  		// fix undue IsZero call
  3039  		`		if err := validate.FormatOf(k, "body", "date", m[k].String(), formats); err != nil {`,
  3040  		`		return errors.CompositeValidationError(res...`,
  3041  	},
  3042  		// not expected
  3043  		todo,
  3044  		// output in log
  3045  		noLines,
  3046  		noLines)
  3047  
  3048  	expandRun.AddExpectations("empty_object_with_additional_non_nullable_primitive.go", flattenRun.ExpectedFor("EmptyObjectWithAdditionalNonNullablePrimitive").ExpectedLines, todo, noLines, noLines)
  3049  
  3050  	// load expectations for model: good_old_format_issue.go
  3051  	flattenRun.AddExpectations("good_old_format_issue.go", []string{
  3052  		`type GoodOldFormatIssue struct {`,
  3053  		"	AlternateFile GoodOldFormatIssueAlternateFile `json:\"alternateFile,omitempty\"`",
  3054  		"	AnotherFile io.ReadCloser `json:\"anotherFile,omitempty\"`",
  3055  		"	MyBytes strfmt.Base64 `json:\"myBytes,omitempty\"`",
  3056  		"	MyFile io.ReadCloser `json:\"myFile\"`",
  3057  		"	ThisAliasedFile AliasedFile `json:\"thisAliasedFile,omitempty\"`",
  3058  		"	ThisAlternateAliasedFile AliasedTypeFile `json:\"thisAlternateAliasedFile,omitempty\"`",
  3059  		"	ThisNullableAliasedFile *AliasedNullableFile `json:\"thisNullableAliasedFile,omitempty\"`",
  3060  		"	ThisNullableAlternateAliasedFile *AliasedTypeNullableFile `json:\"thisNullableAlternateAliasedFile,omitempty\"`",
  3061  		`func (m *GoodOldFormatIssue) Validate(formats strfmt.Registry) error {`,
  3062  		`	if err := m.validateMyFile(formats); err != nil {`,
  3063  		`		return errors.CompositeValidationError(res...`,
  3064  		`func (m *GoodOldFormatIssue) validateMyFile(formats strfmt.Registry) error {`,
  3065  		`	if err := validate.Required("myFile", "body", io.ReadCloser(m.MyFile)); err != nil {`,
  3066  	},
  3067  		// not expected
  3068  		[]string{
  3069  			`	if err := m.validateMyBytes(formats); err != nil {`,
  3070  			`func (m *GoodOldFormatIssue) validateMyBytes(formats strfmt.Registry) error {`,
  3071  			`	if err := validate.FormatOf("myBytes", "body", "byte", m.MyBytes.String(), formats); err != nil {`,
  3072  		},
  3073  		// output in log
  3074  		noLines,
  3075  		noLines)
  3076  
  3077  	expandRun.AddExpectations("good_old_format_issue.go", []string{
  3078  		`type GoodOldFormatIssue struct {`,
  3079  		"	AlternateFile io.ReadCloser `json:\"alternateFile,omitempty\"`",
  3080  		"	AnotherFile io.ReadCloser `json:\"anotherFile,omitempty\"`",
  3081  		"	MyBytes strfmt.Base64 `json:\"myBytes,omitempty\"`",
  3082  		"	MyFile io.ReadCloser `json:\"myFile\"`",
  3083  		"	ThisAliasedFile io.ReadCloser `json:\"thisAliasedFile,omitempty\"`",
  3084  		"	ThisAlternateAliasedFile io.ReadCloser `json:\"thisAlternateAliasedFile,omitempty\"`",
  3085  		"	ThisNullableAliasedFile io.ReadCloser `json:\"thisNullableAliasedFile,omitempty\"`",
  3086  		"	ThisNullableAlternateAliasedFile io.ReadCloser `json:\"thisNullableAlternateAliasedFile,omitempty\"`",
  3087  		`func (m *GoodOldFormatIssue) Validate(formats strfmt.Registry) error {`,
  3088  		`	if err := m.validateMyFile(formats); err != nil {`,
  3089  		`		return errors.CompositeValidationError(res...`,
  3090  		`func (m *GoodOldFormatIssue) validateMyFile(formats strfmt.Registry) error {`,
  3091  		`	if err := validate.Required("myFile", "body", io.ReadCloser(m.MyFile)); err != nil {`,
  3092  	},
  3093  		// not expected
  3094  		[]string{
  3095  			`	if err := m.validateMyBytes(formats); err != nil {`,
  3096  			`func (m *GoodOldFormatIssue) validateMyBytes(formats strfmt.Registry) error {`,
  3097  			`	if err := validate.FormatOf("myBytes", "body", "byte", m.MyBytes.String(), formats); err != nil {`,
  3098  		},
  3099  		// output in log
  3100  		noLines,
  3101  		noLines)
  3102  
  3103  	// load expectations for model: empty_object_with_additional_slice_additional_properties_items.go
  3104  	flattenRun.AddExpectations("empty_object_with_additional_slice_additional_properties_items.go", []string{
  3105  		`type EmptyObjectWithAdditionalSliceAdditionalPropertiesItems struct {`,
  3106  		"	DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`",
  3107  		`func (m *EmptyObjectWithAdditionalSliceAdditionalPropertiesItems) Validate(formats strfmt.Registry) error {`,
  3108  		`	if err := m.validateDummyProp1(formats); err != nil {`,
  3109  		`		return errors.CompositeValidationError(res...`,
  3110  		`func (m *EmptyObjectWithAdditionalSliceAdditionalPropertiesItems) validateDummyProp1(formats strfmt.Registry) error {`,
  3111  		`	if swag.IsZero(m.DummyProp1) {`,
  3112  		`	if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`,
  3113  	},
  3114  		// not expected
  3115  		todo,
  3116  		// output in log
  3117  		noLines,
  3118  		noLines)
  3119  
  3120  	// load expectations for model: not_validated_additional_props_slice.go
  3121  	flattenRun.AddExpectations("not_validated_additional_props_slice.go", []string{
  3122  		`type NotValidatedAdditionalPropsSlice struct {`,
  3123  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  3124  		"	NotValidatedAdditionalPropsSlice map[string][]map[string]map[string]string `json:\"-\"`",
  3125  		`func (m *NotValidatedAdditionalPropsSlice) Validate(formats strfmt.Registry) error {`,
  3126  		`	if err := m.validateProp2(formats); err != nil {`,
  3127  		`		return errors.CompositeValidationError(res...`,
  3128  		`func (m *NotValidatedAdditionalPropsSlice) validateProp2(formats strfmt.Registry) error {`,
  3129  		`	if swag.IsZero(m.Prop2) {`,
  3130  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  3131  	},
  3132  		// not expected
  3133  		todo,
  3134  		// output in log
  3135  		noLines,
  3136  		noLines)
  3137  
  3138  	// load expectations for model: aliased_type_file.go
  3139  	flattenRun.AddExpectations("aliased_type_file.go", []string{
  3140  		`import "io"`,
  3141  		`type AliasedTypeFile io.ReadCloser`,
  3142  	},
  3143  		// not expected
  3144  		todo,
  3145  		// output in log
  3146  		noLines,
  3147  		noLines)
  3148  
  3149  	expandRun.AddExpectations("aliased_type_file.go", flattenRun.ExpectedFor("AliasedTypeFile").ExpectedLines, todo, noLines, noLines)
  3150  
  3151  	// load expectations for model: object_with_empty_object.go
  3152  	flattenRun.AddExpectations("object_with_empty_object.go", []string{
  3153  		`type ObjectWithEmptyObject struct {`,
  3154  		"	EmptyObj EmptyObjectWithAdditionalAlias `json:\"emptyObj,omitempty\"`",
  3155  		"	NonEmptyObj *NullableThing `json:\"nonEmptyObj,omitempty\"`",
  3156  		`func (m *ObjectWithEmptyObject) Validate(formats strfmt.Registry) error {`,
  3157  		`	if err := m.validateEmptyObj(formats); err != nil {`,
  3158  		`	if err := m.validateNonEmptyObj(formats); err != nil {`,
  3159  		`		return errors.CompositeValidationError(res...`,
  3160  		`func (m *ObjectWithEmptyObject) validateEmptyObj(formats strfmt.Registry) error {`,
  3161  		`	if swag.IsZero(m.EmptyObj) {`,
  3162  		`	if err := m.EmptyObj.Validate(formats); err != nil {`,
  3163  		`		if ve, ok := err.(*errors.Validation); ok {`,
  3164  		`			return ve.ValidateName("emptyObj"`,
  3165  		`func (m *ObjectWithEmptyObject) validateNonEmptyObj(formats strfmt.Registry) error {`,
  3166  		`	if swag.IsZero(m.NonEmptyObj) {`,
  3167  		`	if m.NonEmptyObj != nil {`,
  3168  		`		if err := m.NonEmptyObj.Validate(formats); err != nil {`,
  3169  		`			if ve, ok := err.(*errors.Validation); ok {`,
  3170  		`				return ve.ValidateName("nonEmptyObj"`,
  3171  	},
  3172  		// not expected
  3173  		todo,
  3174  		// output in log
  3175  		noLines,
  3176  		noLines)
  3177  
  3178  	expandRun.AddExpectations("object_with_empty_object.go", []string{
  3179  		`type ObjectWithEmptyObject struct {`,
  3180  		"	EmptyObj map[string]ObjectWithEmptyObjectEmptyObjAnon `json:\"emptyObj,omitempty\"`",
  3181  		"	NonEmptyObj *strfmt.Date `json:\"nonEmptyObj,omitempty\"`",
  3182  		`func (m *ObjectWithEmptyObject) Validate(formats strfmt.Registry) error {`,
  3183  		`	if err := m.validateEmptyObj(formats); err != nil {`,
  3184  		`	if err := m.validateNonEmptyObj(formats); err != nil {`,
  3185  		`		return errors.CompositeValidationError(res...`,
  3186  		`func (m *ObjectWithEmptyObject) validateEmptyObj(formats strfmt.Registry) error {`,
  3187  		`	if swag.IsZero(m.EmptyObj) {`,
  3188  		`	for k := range m.EmptyObj {`,
  3189  		`		if swag.IsZero(m.EmptyObj[k]) {`,
  3190  		`		if val, ok := m.EmptyObj[k]; ok {`,
  3191  		`			if err := val.Validate(formats); err != nil {`,
  3192  		`func (m *ObjectWithEmptyObject) validateNonEmptyObj(formats strfmt.Registry) error {`,
  3193  		`	if swag.IsZero(m.NonEmptyObj) {`,
  3194  		`	if err := validate.FormatOf("nonEmptyObj", "body", "date", m.NonEmptyObj.String(), formats); err != nil {`,
  3195  		`type ObjectWithEmptyObjectEmptyObjAnon struct {`,
  3196  		"	Prop1 strfmt.Date `json:\"prop1,omitempty\"`",
  3197  		`func (m *ObjectWithEmptyObjectEmptyObjAnon) Validate(formats strfmt.Registry) error {`,
  3198  		`	if err := m.validateProp1(formats); err != nil {`,
  3199  		`		return errors.CompositeValidationError(res...`,
  3200  		`func (m *ObjectWithEmptyObjectEmptyObjAnon) validateProp1(formats strfmt.Registry) error {`,
  3201  		`	if swag.IsZero(m.Prop1) {`,
  3202  		`	if err := validate.FormatOf("prop1", "body", "date", m.Prop1.String(), formats); err != nil {`,
  3203  	},
  3204  		// not expected
  3205  		noLines,
  3206  		// output in log
  3207  		noLines,
  3208  		noLines)
  3209  
  3210  	// load expectations for model: aliased_file.go
  3211  	flattenRun.AddExpectations("aliased_file.go", []string{
  3212  		`import "io"`,
  3213  		`type AliasedFile io.ReadCloser`,
  3214  	},
  3215  		// not expected
  3216  		todo,
  3217  		// output in log
  3218  		noLines,
  3219  		noLines)
  3220  
  3221  	expandRun.AddExpectations("aliased_file.go", flattenRun.ExpectedFor("AliasedFile").ExpectedLines, todo, noLines, noLines)
  3222  
  3223  	// load expectations for model: empty_object_with_additional_slice.go
  3224  	flattenRun.AddExpectations("empty_object_with_additional_slice.go", []string{
  3225  		`type EmptyObjectWithAdditionalSlice map[string][]EmptyObjectWithAdditionalSliceAdditionalPropertiesItems`,
  3226  		`func (m EmptyObjectWithAdditionalSlice) Validate(formats strfmt.Registry) error {`,
  3227  		// fixed undue Required on this aliased type
  3228  		`	for k := range m {`,
  3229  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  3230  		`		for i := 0; i < len(m[k]); i++ {`,
  3231  		`			if err := m[k][i].Validate(formats); err != nil {`,
  3232  		`				if ve, ok := err.(*errors.Validation); ok {`,
  3233  		`					return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  3234  		`		return errors.CompositeValidationError(res...`,
  3235  	},
  3236  		// not expected
  3237  		todo,
  3238  		// output in log
  3239  		noLines,
  3240  		noLines)
  3241  
  3242  	expandRun.AddExpectations("empty_object_with_additional_slice.go", []string{
  3243  		`type EmptyObjectWithAdditionalSlice map[string][]EmptyObjectWithAdditionalSliceItems0`,
  3244  		`func (m EmptyObjectWithAdditionalSlice) Validate(formats strfmt.Registry) error {`,
  3245  		// fixed undue Required on this aliased type
  3246  		`	for k := range m {`,
  3247  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  3248  		`		for i := 0; i < len(m[k]); i++ {`,
  3249  		`			if err := m[k][i].Validate(formats); err != nil {`,
  3250  		`				if ve, ok := err.(*errors.Validation); ok {`,
  3251  		`					return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  3252  		`		return errors.CompositeValidationError(res...`,
  3253  		`type EmptyObjectWithAdditionalSliceItems0 struct {`,
  3254  		"	DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`",
  3255  		`func (m *EmptyObjectWithAdditionalSliceItems0) Validate(formats strfmt.Registry) error {`,
  3256  		`	if err := m.validateDummyProp1(formats); err != nil {`,
  3257  		`		return errors.CompositeValidationError(res...`,
  3258  		`func (m *EmptyObjectWithAdditionalSliceItems0) validateDummyProp1(formats strfmt.Registry) error {`,
  3259  		`	if swag.IsZero(m.DummyProp1) {`,
  3260  		`	if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`,
  3261  	},
  3262  		// not expected
  3263  		noLines,
  3264  		// output in log
  3265  		noLines,
  3266  		noLines)
  3267  
  3268  	// load expectations for model: additional_aliased_file.go
  3269  	flattenRun.AddExpectations("additional_aliased_file.go", []string{
  3270  		`type AdditionalAliasedFile interface{`,
  3271  	},
  3272  		// not expected
  3273  		todo,
  3274  		// output in log
  3275  		noLines,
  3276  		noLines)
  3277  
  3278  	expandRun.AddExpectations("additional_aliased_file.go", flattenRun.ExpectedFor("AdditionalAliasedFile").ExpectedLines, todo, noLines, noLines)
  3279  
  3280  	// load expectations for model: good_old_format_issue_alternate_file.go
  3281  	flattenRun.AddExpectations("good_old_format_issue_alternate_file.go", []string{
  3282  		`import "io"`,
  3283  		`type GoodOldFormatIssueAlternateFile io.ReadCloser`,
  3284  	},
  3285  		// not expected
  3286  		todo,
  3287  		// output in log
  3288  		noLines,
  3289  		noLines)
  3290  
  3291  	// load expectations for model: empty_object_with_additional_nested_slice_additional_properties_items_items_items.go
  3292  	flattenRun.AddExpectations("empty_object_with_additional_nested_slice_additional_properties_items_items_items.go", []string{
  3293  		`type EmptyObjectWithAdditionalNestedSliceAdditionalPropertiesItemsItemsItems struct {`,
  3294  		"	DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`",
  3295  		`func (m *EmptyObjectWithAdditionalNestedSliceAdditionalPropertiesItemsItemsItems) Validate(formats strfmt.Registry) error {`,
  3296  		`	if err := m.validateDummyProp1(formats); err != nil {`,
  3297  		`		return errors.CompositeValidationError(res...`,
  3298  		`func (m *EmptyObjectWithAdditionalNestedSliceAdditionalPropertiesItemsItemsItems) validateDummyProp1(formats strfmt.Registry) error {`,
  3299  		`	if swag.IsZero(m.DummyProp1) {`,
  3300  		`	if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`,
  3301  	},
  3302  		// not expected
  3303  		todo,
  3304  		// output in log
  3305  		noLines,
  3306  		noLines)
  3307  
  3308  	// load expectations for model: aliased_thing.go
  3309  	flattenRun.AddExpectations("aliased_thing.go", []string{
  3310  		`type AliasedThing struct {`,
  3311  		"	Prop1 strfmt.Date `json:\"prop1,omitempty\"`",
  3312  		`func (m *AliasedThing) Validate(formats strfmt.Registry) error {`,
  3313  		`	if err := m.validateProp1(formats); err != nil {`,
  3314  		`		return errors.CompositeValidationError(res...`,
  3315  		`func (m *AliasedThing) validateProp1(formats strfmt.Registry) error {`,
  3316  		`	if swag.IsZero(m.Prop1) {`,
  3317  		`	if err := validate.FormatOf("prop1", "body", "date", m.Prop1.String(), formats); err != nil {`,
  3318  	},
  3319  		// not expected
  3320  		todo,
  3321  		// output in log
  3322  		noLines,
  3323  		noLines)
  3324  
  3325  	expandRun.AddExpectations("aliased_thing.go", flattenRun.ExpectedFor("AliasedThing").ExpectedLines, todo, noLines, noLines)
  3326  
  3327  	// load expectations for model: additional_file.go
  3328  	flattenRun.AddExpectations("additional_file.go", []string{
  3329  		`type AdditionalFile struct {`,
  3330  		"	DirName string `json:\"dirName,omitempty\"`",
  3331  		"	AdditionalFile map[string]io.ReadCloser `json:\"-\"`",
  3332  		// empty validation
  3333  		"func (m *AdditionalFile) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  3334  	},
  3335  		// not expected
  3336  		todo,
  3337  		// output in log
  3338  		noLines,
  3339  		noLines)
  3340  
  3341  	expandRun.AddExpectations("additional_file.go", flattenRun.ExpectedFor("AdditionalFile").ExpectedLines, todo, noLines, noLines)
  3342  
  3343  	// load expectations for model: aliased_type_nullable_file.go
  3344  	flattenRun.AddExpectations("aliased_type_nullable_file.go", []string{
  3345  		`import "io"`,
  3346  		`type AliasedTypeNullableFile io.ReadCloser`,
  3347  	},
  3348  		// not expected
  3349  		validatable,
  3350  		// output in log
  3351  		noLines,
  3352  		noLines)
  3353  
  3354  	expandRun.AddExpectations("aliased_type_nullable_file.go", flattenRun.ExpectedFor("AliasedTypeNullableFile").ExpectedLines, validatable, noLines, noLines)
  3355  
  3356  	// load expectations for model: top_level_format_issue.go
  3357  	flattenRun.AddExpectations("top_level_format_issue.go", []string{
  3358  		`type TopLevelFormatIssue struct {`,
  3359  		"	MyAlternateFile TopLevelFormatIssueMyAlternateFile `json:\"myAlternateFile,omitempty\"`",
  3360  		"	MyFile io.ReadCloser `json:\"myFile,omitempty\"`",
  3361  		// empty validation
  3362  		"func (m *TopLevelFormatIssue) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  3363  	},
  3364  		// not expected
  3365  		todo,
  3366  		// output in log
  3367  		noLines,
  3368  		noLines)
  3369  
  3370  	expandRun.AddExpectations("top_level_format_issue.go", []string{
  3371  		`type TopLevelFormatIssue struct {`,
  3372  		"	MyAlternateFile io.ReadCloser `json:\"myAlternateFile,omitempty\"`",
  3373  		"	MyFile io.ReadCloser `json:\"myFile,omitempty\"`",
  3374  		// empty validation
  3375  		"func (m *TopLevelFormatIssue) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  3376  	},
  3377  		// not expected
  3378  		noLines,
  3379  		// output in log
  3380  		noLines,
  3381  		noLines)
  3382  
  3383  	// load expectations for model: enums_with_additional_props.go
  3384  	flattenRun.AddExpectations("enums_with_additional_props.go", []string{
  3385  		`type EnumsWithAdditionalProps map[string]interface{`,
  3386  		`var enumsWithAdditionalPropsEnum []interface{`,
  3387  		`	var res []EnumsWithAdditionalProps`,
  3388  		"	if err := json.Unmarshal([]byte(`[\"{ \\\"a\\\": 1, \\\"b\\\": 2 }\",\"{ \\\"a\\\": 3, \\\"b\\\": 4 }\"]`), &res); err != nil {",
  3389  		`	for _, v := range res {`,
  3390  		`		enumsWithAdditionalPropsEnum = append(enumsWithAdditionalPropsEnum, v`,
  3391  		`func (m *EnumsWithAdditionalProps) validateEnumsWithAdditionalPropsEnum(path, location string, value EnumsWithAdditionalProps) error {`,
  3392  		`	if err := validate.EnumCase(path, location, value, enumsWithAdditionalPropsEnum, true); err != nil {`,
  3393  		`var enumsWithAdditionalPropsValueEnum []interface{`,
  3394  		`	var res []interface{`,
  3395  		"	if err := json.Unmarshal([]byte(`[\"{ \\\"b\\\": 2 }\",\"{ \\\"b\\\": 4 }\"]`), &res); err != nil {",
  3396  		`	for _, v := range res {`,
  3397  		`		enumsWithAdditionalPropsValueEnum = append(enumsWithAdditionalPropsValueEnum, v`,
  3398  		`func (m *EnumsWithAdditionalProps) validateEnumsWithAdditionalPropsValueEnum(path, location string, value interface{}) error {`,
  3399  		`	if err := validate.EnumCase(path, location, value, enumsWithAdditionalPropsValueEnum, true); err != nil {`,
  3400  		`func (m EnumsWithAdditionalProps) Validate(formats strfmt.Registry) error {`,
  3401  		`	for k := range m {`,
  3402  		`		if err := m.validateEnumsWithAdditionalPropsValueEnum(k, "body", m[k]); err != nil {`,
  3403  		`	if err := m.validateEnumsWithAdditionalPropsEnum("", "body", m); err != nil {`,
  3404  		`		return errors.CompositeValidationError(res...`,
  3405  	},
  3406  		// not expected
  3407  		todo,
  3408  		// output in log
  3409  		noLines,
  3410  		noLines)
  3411  
  3412  	expandRun.AddExpectations("enums_with_additional_props.go", flattenRun.ExpectedFor("EnumsWithAdditionalProps").ExpectedLines, todo, noLines, noLines)
  3413  
  3414  	// load expectations for model: empty_object_with_additional_nested_slice.go
  3415  	flattenRun.AddExpectations("empty_object_with_additional_nested_slice.go", []string{
  3416  		`type EmptyObjectWithAdditionalNestedSlice map[string][][][]EmptyObjectWithAdditionalNestedSliceAdditionalPropertiesItemsItemsItems`,
  3417  		`func (m EmptyObjectWithAdditionalNestedSlice) Validate(formats strfmt.Registry) error {`,
  3418  		`	for k := range m {`,
  3419  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  3420  		`		for i := 0; i < len(m[k]); i++ {`,
  3421  		`			for ii := 0; ii < len(m[k][i]); ii++ {`,
  3422  		`				for iii := 0; iii < len(m[k][i][ii]); iii++ {`,
  3423  		`					if err := m[k][i][ii][iii].Validate(formats); err != nil {`,
  3424  		`						if ve, ok := err.(*errors.Validation); ok {`,
  3425  		`							return ve.ValidateName(k + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii) + "." + strconv.Itoa(iii)`,
  3426  		`		return errors.CompositeValidationError(res...`,
  3427  	},
  3428  		// not expected
  3429  		todo,
  3430  		// output in log
  3431  		noLines,
  3432  		noLines)
  3433  
  3434  	expandRun.AddExpectations("empty_object_with_additional_nested_slice.go", []string{
  3435  		`type EmptyObjectWithAdditionalNestedSlice map[string][][][]EmptyObjectWithAdditionalNestedSliceItems0`,
  3436  		`func (m EmptyObjectWithAdditionalNestedSlice) Validate(formats strfmt.Registry) error {`,
  3437  		`	for k := range m {`,
  3438  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  3439  		`		for i := 0; i < len(m[k]); i++ {`,
  3440  		`			for ii := 0; ii < len(m[k][i]); ii++ {`,
  3441  		`				for iii := 0; iii < len(m[k][i][ii]); iii++ {`,
  3442  		`					if err := m[k][i][ii][iii].Validate(formats); err != nil {`,
  3443  		`						if ve, ok := err.(*errors.Validation); ok {`,
  3444  		`							return ve.ValidateName(k + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii) + "." + strconv.Itoa(iii)`,
  3445  		`		return errors.CompositeValidationError(res...`,
  3446  		`type EmptyObjectWithAdditionalNestedSliceItems0 struct {`,
  3447  		"	DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`",
  3448  		`func (m *EmptyObjectWithAdditionalNestedSliceItems0) Validate(formats strfmt.Registry) error {`,
  3449  		`	if err := m.validateDummyProp1(formats); err != nil {`,
  3450  		`		return errors.CompositeValidationError(res...`,
  3451  		`func (m *EmptyObjectWithAdditionalNestedSliceItems0) validateDummyProp1(formats strfmt.Registry) error {`,
  3452  		`	if swag.IsZero(m.DummyProp1) {`,
  3453  		`	if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`,
  3454  	},
  3455  		// not expected
  3456  		noLines,
  3457  		// output in log
  3458  		noLines,
  3459  		noLines)
  3460  
  3461  	// load expectations for model: empty_object_with_additional_nullable.go
  3462  	// fixed nullability of aliased type
  3463  	flattenRun.AddExpectations("empty_object_with_additional_nullable.go", []string{
  3464  		`type EmptyObjectWithAdditionalNullable map[string]*NullableThing`,
  3465  		`func (m EmptyObjectWithAdditionalNullable) Validate(formats strfmt.Registry) error {`,
  3466  		`	for k := range m {`,
  3467  		`		if swag.IsZero(m[k]) {`,
  3468  		`		if val, ok := m[k]; ok {`,
  3469  		`			if err := val.Validate(formats); err != nil {`,
  3470  		`		return errors.CompositeValidationError(res...`,
  3471  	},
  3472  		// not expected
  3473  		todo,
  3474  		// output in log
  3475  		noLines,
  3476  		noLines)
  3477  
  3478  	expandRun.AddExpectations("empty_object_with_additional_nullable.go", []string{
  3479  		`type EmptyObjectWithAdditionalNullable map[string]*strfmt.Date`,
  3480  		`func (m EmptyObjectWithAdditionalNullable) Validate(formats strfmt.Registry) error {`,
  3481  		`	for k := range m {`,
  3482  		`		if swag.IsZero(m[k]) {`,
  3483  		`		if err := validate.FormatOf(k, "body", "date", m[k].String(), formats); err != nil {`,
  3484  		`		return errors.CompositeValidationError(res...`,
  3485  	},
  3486  		// not expected
  3487  		noLines,
  3488  		// output in log
  3489  		noLines,
  3490  		noLines)
  3491  
  3492  	// load expectations for model: not_validated_at_all.go
  3493  	flattenRun.AddExpectations("not_validated_at_all.go", []string{
  3494  		`type NotValidatedAtAll struct {`,
  3495  		"	Prop2 string `json:\"prop2,omitempty\"`",
  3496  		"	NotValidatedAtAll map[string][]map[string]map[string]string `json:\"-\"`",
  3497  		// empty validation
  3498  		"func (m *NotValidatedAtAll) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  3499  	},
  3500  		// not expected
  3501  		todo,
  3502  		// output in log
  3503  		noLines,
  3504  		noLines)
  3505  
  3506  	expandRun.AddExpectations("not_validated_at_all.go", flattenRun.ExpectedFor("NotValidatedAtAll").ExpectedLines, todo, noLines, noLines)
  3507  }
  3508  
  3509  func initFixtureAdditionalProps() {
  3510  	// testing ../fixtures/bugs/1487/fixture-additionalProps.yaml with flatten and expand (--skip-flatten)
  3511  
  3512  	/*
  3513  		various patterns of additionalProperties
  3514  	*/
  3515  	f := newModelFixture("../fixtures/bugs/1487/fixture-additionalProps.yaml", "fixture for additionalProperties")
  3516  	flattenRun := f.AddRun(false)
  3517  	expandRun := f.AddRun(true)
  3518  
  3519  	// load expectations for model: additional_object_with_formated_thing.go
  3520  	flattenRun.AddExpectations("additional_object_with_formated_thing.go", []string{
  3521  		`type AdditionalObjectWithFormatedThing struct {`,
  3522  		"	Blob *int64 `json:\"blob\"`",
  3523  		"	AdditionalObjectWithFormatedThing map[string]strfmt.Date `json:\"-\"`",
  3524  		`func (m *AdditionalObjectWithFormatedThing) Validate(formats strfmt.Registry) error {`,
  3525  		`	if err := m.validateBlob(formats); err != nil {`,
  3526  		`	for k := range m.AdditionalObjectWithFormatedThing {`,
  3527  		// removed undue IZero call
  3528  		`		if err := validate.FormatOf(k, "body", "date", m.AdditionalObjectWithFormatedThing[k].String(), formats); err != nil {`,
  3529  		`		return errors.CompositeValidationError(res...`,
  3530  		`func (m *AdditionalObjectWithFormatedThing) validateBlob(formats strfmt.Registry) error {`,
  3531  		`	if err := validate.Required("blob", "body", m.Blob); err != nil {`,
  3532  		`	if err := validate.MinimumInt("blob", "body", *m.Blob, 1, false); err != nil {`,
  3533  	},
  3534  		// not expected
  3535  		todo,
  3536  		// output in log
  3537  		noLines,
  3538  		noLines)
  3539  
  3540  	expandRun.AddExpectations("additional_object_with_formated_thing.go", flattenRun.ExpectedFor("AdditionalObjectWithFormatedThing").ExpectedLines, todo, noLines, noLines)
  3541  
  3542  	// load expectations for model: aliased_date.go
  3543  	flattenRun.AddExpectations("aliased_date.go", []string{
  3544  		`type AliasedDate strfmt.Date`,
  3545  		`func (m AliasedDate) Validate(formats strfmt.Registry) error {`,
  3546  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  3547  		`		return errors.CompositeValidationError(res...`,
  3548  	},
  3549  		// not expected
  3550  		todo,
  3551  		// output in log
  3552  		noLines,
  3553  		noLines)
  3554  
  3555  	expandRun.AddExpectations("aliased_date.go", flattenRun.ExpectedFor("AliasedDate").ExpectedLines, todo, noLines, noLines)
  3556  
  3557  	// load expectations for model: additional_array_of_refed_thing.go
  3558  	flattenRun.AddExpectations("additional_array_of_refed_thing.go", []string{
  3559  		`type AdditionalArrayOfRefedThing struct {`,
  3560  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  3561  		"	AdditionalArrayOfRefedThing map[string][]AliasedDate `json:\"-\"`",
  3562  		`func (m *AdditionalArrayOfRefedThing) Validate(formats strfmt.Registry) error {`,
  3563  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  3564  		`	for k := range m.AdditionalArrayOfRefedThing {`,
  3565  		// removed undue IsZero call
  3566  		`		if err := validate.UniqueItems(k, "body", m.AdditionalArrayOfRefedThing[k]); err != nil {`,
  3567  		`		for i := 0; i < len(m.AdditionalArrayOfRefedThing[k]); i++ {`,
  3568  		`			if err := m.AdditionalArrayOfRefedThing[k][i].Validate(formats); err != nil {`,
  3569  		`				if ve, ok := err.(*errors.Validation); ok {`,
  3570  		`					return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  3571  		`		return errors.CompositeValidationError(res...`,
  3572  		`func (m *AdditionalArrayOfRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  3573  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  3574  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`,
  3575  	},
  3576  		// not expected
  3577  		todo,
  3578  		// output in log
  3579  		noLines,
  3580  		noLines)
  3581  
  3582  	expandRun.AddExpectations("additional_array_of_refed_thing.go", []string{
  3583  		`type AdditionalArrayOfRefedThing struct {`,
  3584  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  3585  		"	AdditionalArrayOfRefedThing map[string][]strfmt.Date `json:\"-\"`",
  3586  		`func (m *AdditionalArrayOfRefedThing) Validate(formats strfmt.Registry) error {`,
  3587  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  3588  		`	for k := range m.AdditionalArrayOfRefedThing {`,
  3589  		// removed undue IsZero() call
  3590  		`		if err := validate.UniqueItems(k, "body", m.AdditionalArrayOfRefedThing[k]); err != nil {`,
  3591  		`		for i := 0; i < len(m.AdditionalArrayOfRefedThing[k]); i++ {`,
  3592  		`			if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "date", m.AdditionalArrayOfRefedThing[k][i].String(), formats); err != nil {`,
  3593  		`		return errors.CompositeValidationError(res...`,
  3594  		`func (m *AdditionalArrayOfRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  3595  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  3596  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`,
  3597  	},
  3598  		// not expected
  3599  		todo,
  3600  		// output in log
  3601  		noLines,
  3602  		noLines)
  3603  
  3604  	// load expectations for model: additional_object_with_nullable_thing.go
  3605  	flattenRun.AddExpectations("additional_object_with_nullable_thing.go", []string{
  3606  		`type AdditionalObjectWithNullableThing struct {`,
  3607  		"	Blob int64 `json:\"blob,omitempty\"`",
  3608  		"	AdditionalObjectWithNullableThing map[string]*AliasedNullableDate `json:\"-\"`",
  3609  		`func (m *AdditionalObjectWithNullableThing) Validate(formats strfmt.Registry) error {`,
  3610  		`	if err := m.validateBlob(formats); err != nil {`,
  3611  		`	for k := range m.AdditionalObjectWithNullableThing {`,
  3612  		`		if swag.IsZero(m.AdditionalObjectWithNullableThing[k]) {`,
  3613  		`		if val, ok := m.AdditionalObjectWithNullableThing[k]; ok {`,
  3614  		`			if val != nil {`,
  3615  		`				if err := val.Validate(formats); err != nil {`,
  3616  		`		return errors.CompositeValidationError(res...`,
  3617  		`func (m *AdditionalObjectWithNullableThing) validateBlob(formats strfmt.Registry) error {`,
  3618  		`	if swag.IsZero(m.Blob) {`,
  3619  		`	if err := validate.MinimumInt("blob", "body", m.Blob, 1, false); err != nil {`,
  3620  	},
  3621  		// not expected
  3622  		todo,
  3623  		// output in log
  3624  		noLines,
  3625  		noLines)
  3626  
  3627  	expandRun.AddExpectations("additional_object_with_nullable_thing.go", []string{
  3628  		`type AdditionalObjectWithNullableThing struct {`,
  3629  		"	Blob int64 `json:\"blob,omitempty\"`",
  3630  		"	AdditionalObjectWithNullableThing map[string]*strfmt.Date `json:\"-\"`",
  3631  		`func (m *AdditionalObjectWithNullableThing) Validate(formats strfmt.Registry) error {`,
  3632  		`	if err := m.validateBlob(formats); err != nil {`,
  3633  		`	for k := range m.AdditionalObjectWithNullableThing {`,
  3634  		`		if swag.IsZero(m.AdditionalObjectWithNullableThing[k]) {`,
  3635  		`		if err := validate.FormatOf(k, "body", "date", m.AdditionalObjectWithNullableThing[k].String(), formats); err != nil {`,
  3636  		`		return errors.CompositeValidationError(res...`,
  3637  		`func (m *AdditionalObjectWithNullableThing) validateBlob(formats strfmt.Registry) error {`,
  3638  		`	if swag.IsZero(m.Blob) {`,
  3639  		`	if err := validate.MinimumInt("blob", "body", m.Blob, 1, false); err != nil {`,
  3640  	},
  3641  		// not expected
  3642  		todo,
  3643  		// output in log
  3644  		noLines,
  3645  		noLines)
  3646  
  3647  	// load expectations for model: additional_things.go
  3648  	flattenRun.AddExpectations("additional_things.go", []string{
  3649  		`type AdditionalThings struct {`,
  3650  		"	Origin *string `json:\"origin\"`",
  3651  		"	Status string `json:\"status,omitempty\"`",
  3652  		"	AdditionalThings map[string]string `json:\"-\"`",
  3653  		`var additionalThingsValueEnum []interface{`,
  3654  		`	var res []string`,
  3655  		"	if err := json.Unmarshal([]byte(`[\"bookshop\",\"amazon\",\"library\"]`), &res); err != nil {",
  3656  		`	for _, v := range res {`,
  3657  		`		additionalThingsValueEnum = append(additionalThingsValueEnum, v`,
  3658  		`func (m *AdditionalThings) validateAdditionalThingsValueEnum(path, location string, value string) error {`,
  3659  		`	if err := validate.EnumCase(path, location, value, additionalThingsValueEnum, true); err != nil {`,
  3660  		`func (m *AdditionalThings) Validate(formats strfmt.Registry) error {`,
  3661  		`	if err := m.validateOrigin(formats); err != nil {`,
  3662  		`	if err := m.validateStatus(formats); err != nil {`,
  3663  		`	for k := range m.AdditionalThings {`,
  3664  		// removed undue IsZero call
  3665  		`		if err := m.validateAdditionalThingsValueEnum(k, "body", m.AdditionalThings[k]); err != nil {`,
  3666  		`		return errors.CompositeValidationError(res...`,
  3667  		`var additionalThingsTypeOriginPropEnum []interface{`,
  3668  		`	var res []string`,
  3669  		"	if err := json.Unmarshal([]byte(`[\"print\",\"e-book\",\"collection\",\"museum\"]`), &res); err != nil {",
  3670  		`	for _, v := range res {`,
  3671  		`		additionalThingsTypeOriginPropEnum = append(additionalThingsTypeOriginPropEnum, v`,
  3672  		`	AdditionalThingsOriginPrint string = "print"`,
  3673  		`	AdditionalThingsOriginEDashBook string = "e-book"`,
  3674  		`	AdditionalThingsOriginCollection string = "collection"`,
  3675  		`	AdditionalThingsOriginMuseum string = "museum"`,
  3676  		`func (m *AdditionalThings) validateOriginEnum(path, location string, value string) error {`,
  3677  		`	if err := validate.EnumCase(path, location, value, additionalThingsTypeOriginPropEnum, true); err != nil {`,
  3678  		`func (m *AdditionalThings) validateOrigin(formats strfmt.Registry) error {`,
  3679  		`	if err := validate.Required("origin", "body", m.Origin); err != nil {`,
  3680  		`	if err := m.validateOriginEnum("origin", "body", *m.Origin); err != nil {`,
  3681  		`var additionalThingsTypeStatusPropEnum []interface{`,
  3682  		`	var res []string`,
  3683  		"	if err := json.Unmarshal([]byte(`[\"OK\",\"KO\"]`), &res); err != nil {",
  3684  		`	for _, v := range res {`,
  3685  		`		additionalThingsTypeStatusPropEnum = append(additionalThingsTypeStatusPropEnum, v`,
  3686  		`	AdditionalThingsStatusOK string = "OK"`,
  3687  		`	AdditionalThingsStatusKO string = "KO"`,
  3688  		`func (m *AdditionalThings) validateStatusEnum(path, location string, value string) error {`,
  3689  		`	if err := validate.EnumCase(path, location, value, additionalThingsTypeStatusPropEnum, true); err != nil {`,
  3690  		`func (m *AdditionalThings) validateStatus(formats strfmt.Registry) error {`,
  3691  		`	if swag.IsZero(m.Status) {`,
  3692  		`	if err := m.validateStatusEnum("status", "body", m.Status); err != nil {`,
  3693  	},
  3694  		// not expected
  3695  		todo,
  3696  		// output in log
  3697  		noLines,
  3698  		noLines)
  3699  
  3700  	expandRun.AddExpectations("additional_things.go", flattenRun.ExpectedFor("AdditionalThings").ExpectedLines, todo, noLines, noLines)
  3701  
  3702  	// load expectations for model: transitive_refed_thing_additional_properties.go
  3703  	flattenRun.AddExpectations("transitive_refed_thing_additional_properties.go", []string{
  3704  		`type TransitiveRefedThingAdditionalProperties struct {`,
  3705  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  3706  		"	TransitiveRefedThingAdditionalProperties map[string]*NoValidationThing `json:\"-\"`",
  3707  		`func (m *TransitiveRefedThingAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  3708  		`	if err := m.validateA1(formats); err != nil {`,
  3709  		`	for k := range m.TransitiveRefedThingAdditionalProperties {`,
  3710  		`		if val, ok := m.TransitiveRefedThingAdditionalProperties[k]; ok {`,
  3711  		`			if val != nil {`,
  3712  		`				if err := val.Validate(formats); err != nil {`,
  3713  		`		return errors.CompositeValidationError(res...`,
  3714  		`func (m *TransitiveRefedThingAdditionalProperties) validateA1(formats strfmt.Registry) error {`,
  3715  		`	if swag.IsZero(m.A1) {`,
  3716  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  3717  	},
  3718  		// not expected
  3719  		todo,
  3720  		// output in log
  3721  		noLines,
  3722  		noLines)
  3723  
  3724  	// load expectations for model: additional_object.go
  3725  	flattenRun.AddExpectations("additional_object.go", []string{
  3726  		`type AdditionalObject struct {`,
  3727  		"	MockID float64 `json:\"mockId,omitempty\"`",
  3728  		"	AdditionalObject map[string]*AdditionalObjectAdditionalProperties `json:\"-\"`",
  3729  		`func (m *AdditionalObject) Validate(formats strfmt.Registry) error {`,
  3730  		`	for k := range m.AdditionalObject {`,
  3731  		`		if val, ok := m.AdditionalObject[k]; ok {`,
  3732  		`			if val != nil {`,
  3733  		`				if err := val.Validate(formats); err != nil {`,
  3734  		`		return errors.CompositeValidationError(res...`,
  3735  	},
  3736  		// not expected
  3737  		todo,
  3738  		// output in log
  3739  		noLines,
  3740  		noLines)
  3741  
  3742  	expandRun.AddExpectations("additional_object.go", []string{
  3743  		`type AdditionalObject struct {`,
  3744  		"	MockID float64 `json:\"mockId,omitempty\"`",
  3745  		"	AdditionalObject map[string]*AdditionalObjectAnon `json:\"-\"`",
  3746  		`func (m *AdditionalObject) Validate(formats strfmt.Registry) error {`,
  3747  		`	for k := range m.AdditionalObject {`,
  3748  		`		if val, ok := m.AdditionalObject[k]; ok {`,
  3749  		`			if val != nil {`,
  3750  		`				if err := val.Validate(formats); err != nil {`,
  3751  		`		return errors.CompositeValidationError(res...`,
  3752  		`type AdditionalObjectAnon struct {`,
  3753  		"	MockA string `json:\"mockA,omitempty\"`",
  3754  		"	MockB *string `json:\"mockB\"`",
  3755  		"	MockC float64 `json:\"mockC,omitempty\"`",
  3756  		`func (m *AdditionalObjectAnon) Validate(formats strfmt.Registry) error {`,
  3757  		`	if err := m.validateMockA(formats); err != nil {`,
  3758  		`	if err := m.validateMockB(formats); err != nil {`,
  3759  		`		return errors.CompositeValidationError(res...`,
  3760  		`func (m *AdditionalObjectAnon) validateMockA(formats strfmt.Registry) error {`,
  3761  		`	if swag.IsZero(m.MockA) {`,
  3762  		"	if err := validate.Pattern(\"mockA\", \"body\", m.MockA, `^[A-Z]$`); err != nil {",
  3763  		`func (m *AdditionalObjectAnon) validateMockB(formats strfmt.Registry) error {`,
  3764  		`	if err := validate.Required("mockB", "body", m.MockB); err != nil {`,
  3765  		`	if err := validate.MinLength("mockB", "body", *m.MockB, 1); err != nil {`,
  3766  	},
  3767  		// not expected
  3768  		todo,
  3769  		// output in log
  3770  		noLines,
  3771  		noLines)
  3772  
  3773  	// load expectations for model: additional_slice_of_objects_additional_properties_items.go
  3774  	flattenRun.AddExpectations("additional_slice_of_objects_additional_properties_items.go", []string{
  3775  		`type AdditionalSliceOfObjectsAdditionalPropertiesItems struct {`,
  3776  		"	Prop2 int64 `json:\"prop2,omitempty\"`",
  3777  		// empty validation
  3778  		"func (m *AdditionalSliceOfObjectsAdditionalPropertiesItems) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  3779  	},
  3780  		// not expected
  3781  		todo,
  3782  		// output in log
  3783  		noLines,
  3784  		noLines)
  3785  
  3786  	// load expectations for model: additional_slice_of_aliased_nullable_primitives.go
  3787  	flattenRun.AddExpectations("additional_slice_of_aliased_nullable_primitives.go", []string{
  3788  		`type AdditionalSliceOfAliasedNullablePrimitives struct {`,
  3789  		"	Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  3790  		"	AdditionalSliceOfAliasedNullablePrimitives map[string][]*AliasedNullableDate `json:\"-\"`",
  3791  		`func (m *AdditionalSliceOfAliasedNullablePrimitives) Validate(formats strfmt.Registry) error {`,
  3792  		`	if err := m.validateProp3(formats); err != nil {`,
  3793  		`	for k := range m.AdditionalSliceOfAliasedNullablePrimitives {`,
  3794  		// removed undue IsSzero call
  3795  		`		iAdditionalSliceOfAliasedNullablePrimitivesSize := int64(len(m.AdditionalSliceOfAliasedNullablePrimitives[k])`,
  3796  		`		if err := validate.MinItems(k, "body", iAdditionalSliceOfAliasedNullablePrimitivesSize, 10); err != nil {`,
  3797  		`		for i := 0; i < len(m.AdditionalSliceOfAliasedNullablePrimitives[k]); i++ {`,
  3798  		// do we need Required when item is nullable?
  3799  		// nullable not required:
  3800  		`			if swag.IsZero(m.AdditionalSliceOfAliasedNullablePrimitives[k][i]) {`,
  3801  		// nullable required:
  3802  		`			if m.AdditionalSliceOfAliasedNullablePrimitives[k][i] != nil {`,
  3803  		`				if err := m.AdditionalSliceOfAliasedNullablePrimitives[k][i].Validate(formats); err != nil {`,
  3804  		`					if ve, ok := err.(*errors.Validation); ok {`,
  3805  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  3806  		`		return errors.CompositeValidationError(res...`,
  3807  		`func (m *AdditionalSliceOfAliasedNullablePrimitives) validateProp3(formats strfmt.Registry) error {`,
  3808  		`	if swag.IsZero(m.Prop3) {`,
  3809  		`	if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`,
  3810  	},
  3811  		// not expected
  3812  		todo,
  3813  		// output in log
  3814  		noLines,
  3815  		noLines)
  3816  
  3817  	expandRun.AddExpectations("additional_slice_of_aliased_nullable_primitives.go", []string{
  3818  		`type AdditionalSliceOfAliasedNullablePrimitives struct {`,
  3819  		"	Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  3820  		"	AdditionalSliceOfAliasedNullablePrimitives map[string][]*strfmt.Date `json:\"-\"`",
  3821  		`func (m *AdditionalSliceOfAliasedNullablePrimitives) Validate(formats strfmt.Registry) error {`,
  3822  		`	if err := m.validateProp3(formats); err != nil {`,
  3823  		`	for k := range m.AdditionalSliceOfAliasedNullablePrimitives {`,
  3824  		`		iAdditionalSliceOfAliasedNullablePrimitivesSize := int64(len(m.AdditionalSliceOfAliasedNullablePrimitives[k])`,
  3825  		`		if err := validate.MinItems(k, "body", iAdditionalSliceOfAliasedNullablePrimitivesSize, 10); err != nil {`,
  3826  		`		for i := 0; i < len(m.AdditionalSliceOfAliasedNullablePrimitives[k]); i++ {`,
  3827  		// do we need Required when item is nullable?
  3828  		// nullable not required:
  3829  		`			if swag.IsZero(m.AdditionalSliceOfAliasedNullablePrimitives[k][i]) {`,
  3830  		// nullable required:
  3831  		`			if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "date", m.AdditionalSliceOfAliasedNullablePrimitives[k][i].String(), formats); err != nil {`,
  3832  		`		return errors.CompositeValidationError(res...`,
  3833  		`func (m *AdditionalSliceOfAliasedNullablePrimitives) validateProp3(formats strfmt.Registry) error {`,
  3834  		`	if swag.IsZero(m.Prop3) {`,
  3835  		`	if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`,
  3836  	},
  3837  		// not expected
  3838  		todo,
  3839  		// output in log
  3840  		noLines,
  3841  		noLines)
  3842  
  3843  	// load expectations for model: additional_slice_of_slice.go
  3844  	flattenRun.AddExpectations("additional_slice_of_slice.go", []string{
  3845  		`type AdditionalSliceOfSlice struct {`,
  3846  		"	Prop4 strfmt.UUID `json:\"prop4,omitempty\"`",
  3847  		"	AdditionalSliceOfSlice map[string][][]*AdditionalSliceOfSliceAdditionalPropertiesItemsItems `json:\"-\"`",
  3848  		`func (m *AdditionalSliceOfSlice) Validate(formats strfmt.Registry) error {`,
  3849  		`	if err := m.validateProp4(formats); err != nil {`,
  3850  		`	for k := range m.AdditionalSliceOfSlice {`,
  3851  		`		if err := validate.Required(k, "body", m.AdditionalSliceOfSlice[k]); err != nil {`,
  3852  		`		for i := 0; i < len(m.AdditionalSliceOfSlice[k]); i++ {`,
  3853  		`			iiAdditionalSliceOfSliceSize := int64(len(m.AdditionalSliceOfSlice[k][i])`,
  3854  		`			if err := validate.MaxItems(k+"."+strconv.Itoa(i), "body", iiAdditionalSliceOfSliceSize, 10); err != nil {`,
  3855  		`			for ii := 0; ii < len(m.AdditionalSliceOfSlice[k][i]); ii++ {`,
  3856  		// do we need Required when item is nullable?
  3857  		// nullable not required:
  3858  		`				if swag.IsZero(m.AdditionalSliceOfSlice[k][i][ii]) {`,
  3859  		// nullable not required:
  3860  		`				if m.AdditionalSliceOfSlice[k][i][ii] != nil {`,
  3861  		`					if err := m.AdditionalSliceOfSlice[k][i][ii].Validate(formats); err != nil {`,
  3862  		`						if ve, ok := err.(*errors.Validation); ok {`,
  3863  		`							return ve.ValidateName(k + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)`,
  3864  		`		return errors.CompositeValidationError(res...`,
  3865  		`func (m *AdditionalSliceOfSlice) validateProp4(formats strfmt.Registry) error {`,
  3866  		`	if swag.IsZero(m.Prop4) {`,
  3867  		`	if err := validate.FormatOf("prop4", "body", "uuid", m.Prop4.String(), formats); err != nil {`,
  3868  	},
  3869  		// not expected
  3870  		todo,
  3871  		// output in log
  3872  		noLines,
  3873  		noLines)
  3874  
  3875  	expandRun.AddExpectations("additional_slice_of_slice.go", []string{
  3876  		`type AdditionalSliceOfSlice struct {`,
  3877  		"	Prop4 strfmt.UUID `json:\"prop4,omitempty\"`",
  3878  		"	AdditionalSliceOfSlice map[string][][]*AdditionalSliceOfSliceItems0 `json:\"-\"`",
  3879  		`func (m *AdditionalSliceOfSlice) Validate(formats strfmt.Registry) error {`,
  3880  		`	if err := m.validateProp4(formats); err != nil {`,
  3881  		`	for k := range m.AdditionalSliceOfSlice {`,
  3882  		`		if err := validate.Required(k, "body", m.AdditionalSliceOfSlice[k]); err != nil {`,
  3883  		`		for i := 0; i < len(m.AdditionalSliceOfSlice[k]); i++ {`,
  3884  		`			iiAdditionalSliceOfSliceSize := int64(len(m.AdditionalSliceOfSlice[k][i])`,
  3885  		`			if err := validate.MaxItems(k+"."+strconv.Itoa(i), "body", iiAdditionalSliceOfSliceSize, 10); err != nil {`,
  3886  		`			for ii := 0; ii < len(m.AdditionalSliceOfSlice[k][i]); ii++ {`,
  3887  		// do we need Required when item is nullable?
  3888  		// nullable not required:
  3889  		`				if swag.IsZero(m.AdditionalSliceOfSlice[k][i][ii]) {`,
  3890  		// nullable required:
  3891  		`				if m.AdditionalSliceOfSlice[k][i][ii] != nil {`,
  3892  		`					if err := m.AdditionalSliceOfSlice[k][i][ii].Validate(formats); err != nil {`,
  3893  		`						if ve, ok := err.(*errors.Validation); ok {`,
  3894  		`							return ve.ValidateName(k + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)`,
  3895  		`		return errors.CompositeValidationError(res...`,
  3896  		`func (m *AdditionalSliceOfSlice) validateProp4(formats strfmt.Registry) error {`,
  3897  		`	if swag.IsZero(m.Prop4) {`,
  3898  		`	if err := validate.FormatOf("prop4", "body", "uuid", m.Prop4.String(), formats); err != nil {`,
  3899  		`type AdditionalSliceOfSliceItems0 struct {`,
  3900  		"	Prop5 int64 `json:\"prop5,omitempty\"`",
  3901  		`func (m *AdditionalSliceOfSliceItems0) Validate(formats strfmt.Registry) error {`,
  3902  		`	if err := m.validateProp5(formats); err != nil {`,
  3903  		`		return errors.CompositeValidationError(res...`,
  3904  		`func (m *AdditionalSliceOfSliceItems0) validateProp5(formats strfmt.Registry) error {`,
  3905  		`	if swag.IsZero(m.Prop5) {`,
  3906  		`	if err := validate.MaximumInt("prop5", "body", m.Prop5, 10, false); err != nil {`,
  3907  	},
  3908  		// not expected
  3909  		todo,
  3910  		// output in log
  3911  		noLines,
  3912  		noLines)
  3913  
  3914  	// load expectations for model: additional_object_with_aliased_thing.go
  3915  	flattenRun.AddExpectations("additional_object_with_aliased_thing.go", []string{
  3916  		`type AdditionalObjectWithAliasedThing struct {`,
  3917  		"	Blob int64 `json:\"blob,omitempty\"`",
  3918  		"	AdditionalObjectWithAliasedThing map[string]AliasedDate `json:\"-\"`",
  3919  		`func (m *AdditionalObjectWithAliasedThing) Validate(formats strfmt.Registry) error {`,
  3920  		`	if err := m.validateBlob(formats); err != nil {`,
  3921  		`	for k := range m.AdditionalObjectWithAliasedThing {`,
  3922  		// removed undue IsZero call
  3923  		`		if val, ok := m.AdditionalObjectWithAliasedThing[k]; ok {`,
  3924  		`			if err := val.Validate(formats); err != nil {`,
  3925  		`		return errors.CompositeValidationError(res...`,
  3926  		`func (m *AdditionalObjectWithAliasedThing) validateBlob(formats strfmt.Registry) error {`,
  3927  		`	if swag.IsZero(m.Blob) {`,
  3928  		`	if err := validate.MinimumInt("blob", "body", m.Blob, 1, false); err != nil {`,
  3929  	},
  3930  		// not expected
  3931  		todo,
  3932  		// output in log
  3933  		noLines,
  3934  		noLines)
  3935  
  3936  	expandRun.AddExpectations("additional_object_with_aliased_thing.go", []string{
  3937  		`type AdditionalObjectWithAliasedThing struct {`,
  3938  		"	Blob int64 `json:\"blob,omitempty\"`",
  3939  		"	AdditionalObjectWithAliasedThing map[string]strfmt.Date `json:\"-\"`",
  3940  		`func (m *AdditionalObjectWithAliasedThing) Validate(formats strfmt.Registry) error {`,
  3941  		`	if err := m.validateBlob(formats); err != nil {`,
  3942  		`	for k := range m.AdditionalObjectWithAliasedThing {`,
  3943  		`		if err := validate.FormatOf(k, "body", "date", m.AdditionalObjectWithAliasedThing[k].String(), formats); err != nil {`,
  3944  		`		return errors.CompositeValidationError(res...`,
  3945  		`func (m *AdditionalObjectWithAliasedThing) validateBlob(formats strfmt.Registry) error {`,
  3946  		`	if swag.IsZero(m.Blob) {`,
  3947  		`	if err := validate.MinimumInt("blob", "body", m.Blob, 1, false); err != nil {`,
  3948  	},
  3949  		// not expected
  3950  		todo,
  3951  		// output in log
  3952  		noLines,
  3953  		noLines)
  3954  
  3955  	// load expectations for model: additional_things_nested_additional_properties.go
  3956  	flattenRun.AddExpectations("additional_things_nested_additional_properties.go", []string{
  3957  		`type AdditionalThingsNestedAdditionalProperties struct {`,
  3958  		"	PrinterAddress string `json:\"printerAddress,omitempty\"`",
  3959  		"	PrinterCountry string `json:\"printerCountry,omitempty\"`",
  3960  		"	PrinterDate strfmt.Date `json:\"printerDate,omitempty\"`",
  3961  		"	AdditionalThingsNestedAdditionalProperties map[string]*AdditionalThingsNestedAdditionalPropertiesAdditionalProperties `json:\"-\"`",
  3962  		`func (m *AdditionalThingsNestedAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  3963  		`	if err := m.validatePrinterCountry(formats); err != nil {`,
  3964  		`	if err := m.validatePrinterDate(formats); err != nil {`,
  3965  		`	for k := range m.AdditionalThingsNestedAdditionalProperties {`,
  3966  		`		if val, ok := m.AdditionalThingsNestedAdditionalProperties[k]; ok {`,
  3967  		`			if val != nil {`,
  3968  		`				if err := val.Validate(formats); err != nil {`,
  3969  		`		return errors.CompositeValidationError(res...`,
  3970  		`var additionalThingsNestedAdditionalPropertiesTypePrinterCountryPropEnum []interface{`,
  3971  		`	var res []string`,
  3972  		"	if err := json.Unmarshal([]byte(`[\"US\",\"FR\",\"UK\",\"BE\",\"CA\",\"DE\"]`), &res); err != nil {",
  3973  		`	for _, v := range res {`,
  3974  		`		additionalThingsNestedAdditionalPropertiesTypePrinterCountryPropEnum = append(additionalThingsNestedAdditionalPropertiesTypePrinterCountryPropEnum, v`,
  3975  		`	AdditionalThingsNestedAdditionalPropertiesPrinterCountryUS string = "US"`,
  3976  		`	AdditionalThingsNestedAdditionalPropertiesPrinterCountryFR string = "FR"`,
  3977  		`	AdditionalThingsNestedAdditionalPropertiesPrinterCountryUK string = "UK"`,
  3978  		`	AdditionalThingsNestedAdditionalPropertiesPrinterCountryBE string = "BE"`,
  3979  		`	AdditionalThingsNestedAdditionalPropertiesPrinterCountryCA string = "CA"`,
  3980  		`	AdditionalThingsNestedAdditionalPropertiesPrinterCountryDE string = "DE"`,
  3981  		`func (m *AdditionalThingsNestedAdditionalProperties) validatePrinterCountryEnum(path, location string, value string) error {`,
  3982  		`	if err := validate.EnumCase(path, location, value, additionalThingsNestedAdditionalPropertiesTypePrinterCountryPropEnum, true); err != nil {`,
  3983  		`func (m *AdditionalThingsNestedAdditionalProperties) validatePrinterCountry(formats strfmt.Registry) error {`,
  3984  		`	if swag.IsZero(m.PrinterCountry) {`,
  3985  		`	if err := m.validatePrinterCountryEnum("printerCountry", "body", m.PrinterCountry); err != nil {`,
  3986  		`func (m *AdditionalThingsNestedAdditionalProperties) validatePrinterDate(formats strfmt.Registry) error {`,
  3987  		`	if swag.IsZero(m.PrinterDate) {`,
  3988  		`	if err := validate.FormatOf("printerDate", "body", "date", m.PrinterDate.String(), formats); err != nil {`,
  3989  	},
  3990  		// not expected
  3991  		todo,
  3992  		// output in log
  3993  		noLines,
  3994  		noLines)
  3995  
  3996  	// load expectations for model: empty_object_with_additional_slice_additional_properties_items.go
  3997  	flattenRun.AddExpectations("empty_object_with_additional_slice_additional_properties_items.go", []string{
  3998  		`type EmptyObjectWithAdditionalSliceAdditionalPropertiesItems struct {`,
  3999  		"	DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`",
  4000  		`func (m *EmptyObjectWithAdditionalSliceAdditionalPropertiesItems) Validate(formats strfmt.Registry) error {`,
  4001  		`	if err := m.validateDummyProp1(formats); err != nil {`,
  4002  		`		return errors.CompositeValidationError(res...`,
  4003  		`func (m *EmptyObjectWithAdditionalSliceAdditionalPropertiesItems) validateDummyProp1(formats strfmt.Registry) error {`,
  4004  		`	if swag.IsZero(m.DummyProp1) {`,
  4005  		`	if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`,
  4006  	},
  4007  		// not expected
  4008  		todo,
  4009  		// output in log
  4010  		noLines,
  4011  		noLines)
  4012  
  4013  	// load expectations for model: additional_things_nested_additional_properties_additional_properties.go
  4014  	flattenRun.AddExpectations("additional_things_nested_additional_properties_additional_properties.go", []string{
  4015  		`type AdditionalThingsNestedAdditionalPropertiesAdditionalProperties struct {`,
  4016  		"	AverageDelay strfmt.Duration `json:\"averageDelay,omitempty\"`",
  4017  		`func (m *AdditionalThingsNestedAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  4018  		`	if err := m.validateAverageDelay(formats); err != nil {`,
  4019  		`		return errors.CompositeValidationError(res...`,
  4020  		`func (m *AdditionalThingsNestedAdditionalPropertiesAdditionalProperties) validateAverageDelay(formats strfmt.Registry) error {`,
  4021  		`	if swag.IsZero(m.AverageDelay) {`,
  4022  		`	if err := validate.FormatOf("averageDelay", "body", "duration", m.AverageDelay.String(), formats); err != nil {`,
  4023  	},
  4024  		// not expected
  4025  		todo,
  4026  		// output in log
  4027  		noLines,
  4028  		noLines)
  4029  
  4030  	// load expectations for model: additional_slice_of_slice_additional_properties_items_items.go
  4031  	flattenRun.AddExpectations("additional_slice_of_slice_additional_properties_items_items.go", []string{
  4032  		`type AdditionalSliceOfSliceAdditionalPropertiesItemsItems struct {`,
  4033  		"	Prop5 int64 `json:\"prop5,omitempty\"`",
  4034  		`func (m *AdditionalSliceOfSliceAdditionalPropertiesItemsItems) Validate(formats strfmt.Registry) error {`,
  4035  		`	if err := m.validateProp5(formats); err != nil {`,
  4036  		`		return errors.CompositeValidationError(res...`,
  4037  		`func (m *AdditionalSliceOfSliceAdditionalPropertiesItemsItems) validateProp5(formats strfmt.Registry) error {`,
  4038  		`	if swag.IsZero(m.Prop5) {`,
  4039  		`	if err := validate.MaximumInt("prop5", "body", m.Prop5, 10, false); err != nil {`,
  4040  	},
  4041  		// not expected
  4042  		todo,
  4043  		// output in log
  4044  		noLines,
  4045  		noLines)
  4046  
  4047  	// load expectations for model: additional_object_additional_properties.go
  4048  	flattenRun.AddExpectations("additional_object_additional_properties.go", []string{
  4049  		`type AdditionalObjectAdditionalProperties struct {`,
  4050  		"	MockA string `json:\"mockA,omitempty\"`",
  4051  		"	MockB *string `json:\"mockB\"`",
  4052  		"	MockC float64 `json:\"mockC,omitempty\"`",
  4053  		`func (m *AdditionalObjectAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  4054  		`	if err := m.validateMockA(formats); err != nil {`,
  4055  		`	if err := m.validateMockB(formats); err != nil {`,
  4056  		`		return errors.CompositeValidationError(res...`,
  4057  		`func (m *AdditionalObjectAdditionalProperties) validateMockA(formats strfmt.Registry) error {`,
  4058  		`	if swag.IsZero(m.MockA) {`,
  4059  		"	if err := validate.Pattern(\"mockA\", \"body\", m.MockA, `^[A-Z]$`); err != nil {",
  4060  		`func (m *AdditionalObjectAdditionalProperties) validateMockB(formats strfmt.Registry) error {`,
  4061  		`	if err := validate.Required("mockB", "body", m.MockB); err != nil {`,
  4062  		`	if err := validate.MinLength("mockB", "body", *m.MockB, 1); err != nil {`,
  4063  	},
  4064  		// not expected
  4065  		todo,
  4066  		// output in log
  4067  		noLines,
  4068  		noLines)
  4069  
  4070  	// load expectations for model: additional_transitive_refed_thing.go
  4071  	flattenRun.AddExpectations("additional_transitive_refed_thing.go", []string{
  4072  		`type AdditionalTransitiveRefedThing struct {`,
  4073  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  4074  		"	AdditionalTransitiveRefedThing map[string][]*TransitiveRefedThing `json:\"-\"`",
  4075  		`func (m *AdditionalTransitiveRefedThing) Validate(formats strfmt.Registry) error {`,
  4076  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  4077  		`	for k := range m.AdditionalTransitiveRefedThing {`,
  4078  		`		if err := validate.Required(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  4079  		`		if err := validate.UniqueItems(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  4080  		`		for i := 0; i < len(m.AdditionalTransitiveRefedThing[k]); i++ {`,
  4081  		// do we need Required when item is nullable?
  4082  		// nullable not required:
  4083  		`			if swag.IsZero(m.AdditionalTransitiveRefedThing[k][i]) {`,
  4084  		// nullable required:
  4085  		`			if m.AdditionalTransitiveRefedThing[k][i] != nil {`,
  4086  		`				if err := m.AdditionalTransitiveRefedThing[k][i].Validate(formats); err != nil {`,
  4087  		`					if ve, ok := err.(*errors.Validation); ok {`,
  4088  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  4089  		`		return errors.CompositeValidationError(res...`,
  4090  		`func (m *AdditionalTransitiveRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  4091  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  4092  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`,
  4093  	},
  4094  		// not expected
  4095  		todo,
  4096  		// output in log
  4097  		noLines,
  4098  		noLines)
  4099  
  4100  	expandRun.AddExpectations("additional_transitive_refed_thing.go", []string{
  4101  		`type AdditionalTransitiveRefedThing struct {`,
  4102  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  4103  		"	AdditionalTransitiveRefedThing map[string][]*AdditionalTransitiveRefedThingItems0 `json:\"-\"`",
  4104  		`func (m *AdditionalTransitiveRefedThing) Validate(formats strfmt.Registry) error {`,
  4105  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  4106  		`	for k := range m.AdditionalTransitiveRefedThing {`,
  4107  		`		if err := validate.Required(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  4108  		`		if err := validate.UniqueItems(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  4109  		`		for i := 0; i < len(m.AdditionalTransitiveRefedThing[k]); i++ {`,
  4110  		// do we need Required when item is nullable?
  4111  		// nullable not required:
  4112  		`			if swag.IsZero(m.AdditionalTransitiveRefedThing[k][i]) {`,
  4113  		// nullable required:
  4114  		`			if m.AdditionalTransitiveRefedThing[k][i] != nil {`,
  4115  		`				if err := m.AdditionalTransitiveRefedThing[k][i].Validate(formats); err != nil {`,
  4116  		`					if ve, ok := err.(*errors.Validation); ok {`,
  4117  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  4118  		`		return errors.CompositeValidationError(res...`,
  4119  		`func (m *AdditionalTransitiveRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  4120  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  4121  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`,
  4122  		`type AdditionalTransitiveRefedThingItems0 struct {`,
  4123  		"	ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`",
  4124  		"	AdditionalTransitiveRefedThingItems0 map[string]*AdditionalTransitiveRefedThingItems0Anon `json:\"-\"`",
  4125  		`func (m *AdditionalTransitiveRefedThingItems0) Validate(formats strfmt.Registry) error {`,
  4126  		`	if err := m.validateThisOneNotRequiredEither(formats); err != nil {`,
  4127  		`	for k := range m.AdditionalTransitiveRefedThingItems0 {`,
  4128  		`		if val, ok := m.AdditionalTransitiveRefedThingItems0[k]; ok {`,
  4129  		`			if val != nil {`,
  4130  		`				if err := val.Validate(formats); err != nil {`,
  4131  		`		return errors.CompositeValidationError(res...`,
  4132  		`func (m *AdditionalTransitiveRefedThingItems0) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`,
  4133  		`	if swag.IsZero(m.ThisOneNotRequiredEither) {`,
  4134  		`	if err := validate.MaximumInt("thisOneNotRequiredEither", "body", m.ThisOneNotRequiredEither, 20, false); err != nil {`,
  4135  		`type AdditionalTransitiveRefedThingItems0Anon struct {`,
  4136  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  4137  		"	AdditionalTransitiveRefedThingItems0Anon map[string]*AdditionalTransitiveRefedThingItems0AnonAnon `json:\"-\"`",
  4138  		`func (m *AdditionalTransitiveRefedThingItems0Anon) Validate(formats strfmt.Registry) error {`,
  4139  		`	if err := m.validateA1(formats); err != nil {`,
  4140  		`	for k := range m.AdditionalTransitiveRefedThingItems0Anon {`,
  4141  		`		if val, ok := m.AdditionalTransitiveRefedThingItems0Anon[k]; ok {`,
  4142  		`			if val != nil {`,
  4143  		`				if err := val.Validate(formats); err != nil {`,
  4144  		`		return errors.CompositeValidationError(res...`,
  4145  		`func (m *AdditionalTransitiveRefedThingItems0Anon) validateA1(formats strfmt.Registry) error {`,
  4146  		`	if swag.IsZero(m.A1) {`,
  4147  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  4148  		`type AdditionalTransitiveRefedThingItems0AnonAnon struct {`,
  4149  		"	Discourse string `json:\"discourse,omitempty\"`",
  4150  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  4151  		"	AdditionalTransitiveRefedThingItems0AnonAnonAdditionalProperties map[string]interface{} `json:\"-\"`",
  4152  		// empty validation
  4153  		"func (m *AdditionalTransitiveRefedThingItems0AnonAnon) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  4154  	},
  4155  		// not expected
  4156  		todo,
  4157  		// output in log
  4158  		noLines,
  4159  		noLines)
  4160  
  4161  	// load expectations for model: additional_nullable_array_thing.go
  4162  	flattenRun.AddExpectations("additional_nullable_array_thing.go", []string{
  4163  		`type AdditionalNullableArrayThing struct {`,
  4164  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  4165  		"	AdditionalNullableArrayThing map[string][]strfmt.ISBN `json:\"-\"`",
  4166  		`func (m *AdditionalNullableArrayThing) Validate(formats strfmt.Registry) error {`,
  4167  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  4168  		`	for k := range m.AdditionalNullableArrayThing {`,
  4169  		`		if err := validate.UniqueItems(k, "body", m.AdditionalNullableArrayThing[k]); err != nil {`,
  4170  		`		for i := 0; i < len(m.AdditionalNullableArrayThing[k]); i++ {`,
  4171  		`			if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "isbn", m.AdditionalNullableArrayThing[k][i].String(), formats); err != nil {`,
  4172  		`		return errors.CompositeValidationError(res...`,
  4173  		`func (m *AdditionalNullableArrayThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  4174  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  4175  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`,
  4176  	},
  4177  		// not expected
  4178  		todo,
  4179  		// output in log
  4180  		noLines,
  4181  		noLines)
  4182  
  4183  	expandRun.AddExpectations("additional_nullable_array_thing.go", flattenRun.ExpectedFor("AdditionalNullableArrayThing").ExpectedLines, todo, noLines, noLines)
  4184  
  4185  	// load expectations for model: additional_slice_of_primitives.go
  4186  	flattenRun.AddExpectations("additional_slice_of_primitives.go", []string{
  4187  		`type AdditionalSliceOfPrimitives struct {`,
  4188  		"	Prop1 string `json:\"prop1,omitempty\"`",
  4189  		"	AdditionalSliceOfPrimitives map[string][]strfmt.Date `json:\"-\"`",
  4190  		`func (m *AdditionalSliceOfPrimitives) Validate(formats strfmt.Registry) error {`,
  4191  		`	for k := range m.AdditionalSliceOfPrimitives {`,
  4192  		`		if err := validate.UniqueItems(k, "body", m.AdditionalSliceOfPrimitives[k]); err != nil {`,
  4193  		`		for i := 0; i < len(m.AdditionalSliceOfPrimitives[k]); i++ {`,
  4194  		`			if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "date", m.AdditionalSliceOfPrimitives[k][i].String(), formats); err != nil {`,
  4195  		`		return errors.CompositeValidationError(res...`,
  4196  	},
  4197  		// not expected
  4198  		todo,
  4199  		// output in log
  4200  		noLines,
  4201  		noLines)
  4202  
  4203  	expandRun.AddExpectations("additional_slice_of_primitives.go", flattenRun.ExpectedFor("AdditionalSliceOfPrimitives").ExpectedLines, todo, noLines, noLines)
  4204  
  4205  	// load expectations for model: additional_array_thing.go
  4206  	flattenRun.AddExpectations("additional_array_thing.go", []string{
  4207  		`type AdditionalArrayThing struct {`,
  4208  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  4209  		"	AdditionalArrayThing map[string][]strfmt.UUID `json:\"-\"`",
  4210  		`func (m *AdditionalArrayThing) Validate(formats strfmt.Registry) error {`,
  4211  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  4212  		`	for k := range m.AdditionalArrayThing {`,
  4213  		`		if err := validate.UniqueItems(k, "body", m.AdditionalArrayThing[k]); err != nil {`,
  4214  		`		for i := 0; i < len(m.AdditionalArrayThing[k]); i++ {`,
  4215  		`			if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "uuid", m.AdditionalArrayThing[k][i].String(), formats); err != nil {`,
  4216  		`		return errors.CompositeValidationError(res...`,
  4217  		`func (m *AdditionalArrayThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  4218  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  4219  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`,
  4220  	},
  4221  		// not expected
  4222  		todo,
  4223  		// output in log
  4224  		noLines,
  4225  		noLines)
  4226  
  4227  	expandRun.AddExpectations("additional_array_thing.go", flattenRun.ExpectedFor("AdditionalArrayThing").ExpectedLines, todo, noLines, noLines)
  4228  
  4229  	// load expectations for model: interface_thing.go
  4230  	flattenRun.AddExpectations("interface_thing.go", []string{
  4231  		`type InterfaceThing interface{}`,
  4232  	},
  4233  		// not expected
  4234  		todo,
  4235  		// output in log
  4236  		noLines,
  4237  		noLines)
  4238  
  4239  	expandRun.AddExpectations("interface_thing.go", flattenRun.ExpectedFor("InterfaceThing").ExpectedLines, todo, noLines, noLines)
  4240  
  4241  	// load expectations for model: empty_object_with_additional_slice.go
  4242  	flattenRun.AddExpectations("empty_object_with_additional_slice.go", []string{
  4243  		`type EmptyObjectWithAdditionalSlice map[string][]EmptyObjectWithAdditionalSliceAdditionalPropertiesItems`,
  4244  		`func (m EmptyObjectWithAdditionalSlice) Validate(formats strfmt.Registry) error {`,
  4245  		`	for k := range m {`,
  4246  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  4247  		`		for i := 0; i < len(m[k]); i++ {`,
  4248  		`			if err := m[k][i].Validate(formats); err != nil {`,
  4249  		`				if ve, ok := err.(*errors.Validation); ok {`,
  4250  		`					return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  4251  		`		return errors.CompositeValidationError(res...`,
  4252  	},
  4253  		// not expected
  4254  		todo,
  4255  		// output in log
  4256  		noLines,
  4257  		noLines)
  4258  
  4259  	expandRun.AddExpectations("empty_object_with_additional_slice.go", []string{
  4260  		`type EmptyObjectWithAdditionalSlice map[string][]EmptyObjectWithAdditionalSliceItems0`,
  4261  		`func (m EmptyObjectWithAdditionalSlice) Validate(formats strfmt.Registry) error {`,
  4262  		`	for k := range m {`,
  4263  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  4264  		`		for i := 0; i < len(m[k]); i++ {`,
  4265  		`			if err := m[k][i].Validate(formats); err != nil {`,
  4266  		`				if ve, ok := err.(*errors.Validation); ok {`,
  4267  		`					return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  4268  		`		return errors.CompositeValidationError(res...`,
  4269  		`type EmptyObjectWithAdditionalSliceItems0 struct {`,
  4270  		"	DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`",
  4271  		`func (m *EmptyObjectWithAdditionalSliceItems0) Validate(formats strfmt.Registry) error {`,
  4272  		`	if err := m.validateDummyProp1(formats); err != nil {`,
  4273  		`		return errors.CompositeValidationError(res...`,
  4274  		`func (m *EmptyObjectWithAdditionalSliceItems0) validateDummyProp1(formats strfmt.Registry) error {`,
  4275  		`	if swag.IsZero(m.DummyProp1) {`,
  4276  		`	if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`,
  4277  	},
  4278  		// not expected
  4279  		todo,
  4280  		// output in log
  4281  		noLines,
  4282  		noLines)
  4283  
  4284  	// load expectations for model: additional_slice_of_objects.go
  4285  	flattenRun.AddExpectations("additional_slice_of_objects.go", []string{
  4286  		`type AdditionalSliceOfObjects struct {`,
  4287  		"	Prop1 string `json:\"prop1,omitempty\"`",
  4288  		"	AdditionalSliceOfObjects map[string][]*AdditionalSliceOfObjectsAdditionalPropertiesItems `json:\"-\"`",
  4289  		`func (m *AdditionalSliceOfObjects) Validate(formats strfmt.Registry) error {`,
  4290  		`	for k := range m.AdditionalSliceOfObjects {`,
  4291  		`		if err := validate.Required(k, "body", m.AdditionalSliceOfObjects[k]); err != nil {`,
  4292  		`		if err := validate.UniqueItems(k, "body", m.AdditionalSliceOfObjects[k]); err != nil {`,
  4293  		`		for i := 0; i < len(m.AdditionalSliceOfObjects[k]); i++ {`,
  4294  		// do we need Required when item is nullable?
  4295  		// nullable not required:
  4296  		`			if swag.IsZero(m.AdditionalSliceOfObjects[k][i]) {`,
  4297  		// nullable required:
  4298  		`			if m.AdditionalSliceOfObjects[k][i] != nil {`,
  4299  		`				if err := m.AdditionalSliceOfObjects[k][i].Validate(formats); err != nil {`,
  4300  		`					if ve, ok := err.(*errors.Validation); ok {`,
  4301  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  4302  		`		return errors.CompositeValidationError(res...`,
  4303  	},
  4304  		// not expected
  4305  		todo,
  4306  		// output in log
  4307  		noLines,
  4308  		noLines)
  4309  
  4310  	expandRun.AddExpectations("additional_slice_of_objects.go", []string{
  4311  		`type AdditionalSliceOfObjects struct {`,
  4312  		"	Prop1 string `json:\"prop1,omitempty\"`",
  4313  		"	AdditionalSliceOfObjects map[string][]*AdditionalSliceOfObjectsItems0 `json:\"-\"`",
  4314  		`func (m *AdditionalSliceOfObjects) Validate(formats strfmt.Registry) error {`,
  4315  		`	for k := range m.AdditionalSliceOfObjects {`,
  4316  		`		if err := validate.Required(k, "body", m.AdditionalSliceOfObjects[k]); err != nil {`,
  4317  		`		if err := validate.UniqueItems(k, "body", m.AdditionalSliceOfObjects[k]); err != nil {`,
  4318  		`		for i := 0; i < len(m.AdditionalSliceOfObjects[k]); i++ {`,
  4319  		// do we need Required when item is nullable?
  4320  		// nullable not required:
  4321  		`			if swag.IsZero(m.AdditionalSliceOfObjects[k][i]) {`,
  4322  		// nullable required:
  4323  		`			if m.AdditionalSliceOfObjects[k][i] != nil {`,
  4324  		`				if err := m.AdditionalSliceOfObjects[k][i].Validate(formats); err != nil {`,
  4325  		`					if ve, ok := err.(*errors.Validation); ok {`,
  4326  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  4327  		`		return errors.CompositeValidationError(res...`,
  4328  		`type AdditionalSliceOfObjectsItems0 struct {`,
  4329  		"	Prop2 int64 `json:\"prop2,omitempty\"`",
  4330  		// empty validation
  4331  		"func (m *AdditionalSliceOfObjectsItems0) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  4332  	},
  4333  		// not expected
  4334  		todo,
  4335  		// output in log
  4336  		noLines,
  4337  		noLines)
  4338  
  4339  	// load expectations for model: additional_things_nested.go
  4340  	flattenRun.AddExpectations("additional_things_nested.go", []string{
  4341  		`type AdditionalThingsNested struct {`,
  4342  		"	Origin string `json:\"origin,omitempty\"`",
  4343  		"	AdditionalThingsNested map[string]*AdditionalThingsNestedAdditionalProperties `json:\"-\"`",
  4344  		`func (m *AdditionalThingsNested) Validate(formats strfmt.Registry) error {`,
  4345  		`	if err := m.validateOrigin(formats); err != nil {`,
  4346  		`	for k := range m.AdditionalThingsNested {`,
  4347  		`		if val, ok := m.AdditionalThingsNested[k]; ok {`,
  4348  		`			if val != nil {`,
  4349  		`				if err := val.Validate(formats); err != nil {`,
  4350  		`		return errors.CompositeValidationError(res...`,
  4351  		`var additionalThingsNestedTypeOriginPropEnum []interface{`,
  4352  		`	var res []string`,
  4353  		"	if err := json.Unmarshal([]byte(`[\"goPrint\",\"goE-book\",\"goCollection\",\"goMuseum\"]`), &res); err != nil {",
  4354  		`	for _, v := range res {`,
  4355  		`		additionalThingsNestedTypeOriginPropEnum = append(additionalThingsNestedTypeOriginPropEnum, v`,
  4356  		`	AdditionalThingsNestedOriginGoPrint string = "goPrint"`,
  4357  		`	AdditionalThingsNestedOriginGoEDashBook string = "goE-book"`,
  4358  		`	AdditionalThingsNestedOriginGoCollection string = "goCollection"`,
  4359  		`	AdditionalThingsNestedOriginGoMuseum string = "goMuseum"`,
  4360  		`func (m *AdditionalThingsNested) validateOriginEnum(path, location string, value string) error {`,
  4361  		`	if err := validate.EnumCase(path, location, value, additionalThingsNestedTypeOriginPropEnum, true); err != nil {`,
  4362  		`func (m *AdditionalThingsNested) validateOrigin(formats strfmt.Registry) error {`,
  4363  		`	if swag.IsZero(m.Origin) {`,
  4364  		`	if err := m.validateOriginEnum("origin", "body", m.Origin); err != nil {`,
  4365  	},
  4366  		// not expected
  4367  		todo,
  4368  		// output in log
  4369  		noLines,
  4370  		noLines)
  4371  
  4372  	expandRun.AddExpectations("additional_things_nested.go", []string{
  4373  		`type AdditionalThingsNested struct {`,
  4374  		"	Origin string `json:\"origin,omitempty\"`",
  4375  		"	AdditionalThingsNested map[string]*AdditionalThingsNestedAnon `json:\"-\"`",
  4376  		`func (m *AdditionalThingsNested) Validate(formats strfmt.Registry) error {`,
  4377  		`	if err := m.validateOrigin(formats); err != nil {`,
  4378  		`	for k := range m.AdditionalThingsNested {`,
  4379  		`		if val, ok := m.AdditionalThingsNested[k]; ok {`,
  4380  		`			if val != nil {`,
  4381  		`				if err := val.Validate(formats); err != nil {`,
  4382  		`		return errors.CompositeValidationError(res...`,
  4383  		`var additionalThingsNestedTypeOriginPropEnum []interface{`,
  4384  		`	var res []string`,
  4385  		"	if err := json.Unmarshal([]byte(`[\"goPrint\",\"goE-book\",\"goCollection\",\"goMuseum\"]`), &res); err != nil {",
  4386  		`	for _, v := range res {`,
  4387  		`		additionalThingsNestedTypeOriginPropEnum = append(additionalThingsNestedTypeOriginPropEnum, v`,
  4388  		`	AdditionalThingsNestedOriginGoPrint string = "goPrint"`,
  4389  		`	AdditionalThingsNestedOriginGoEDashBook string = "goE-book"`,
  4390  		`	AdditionalThingsNestedOriginGoCollection string = "goCollection"`,
  4391  		`	AdditionalThingsNestedOriginGoMuseum string = "goMuseum"`,
  4392  		`func (m *AdditionalThingsNested) validateOriginEnum(path, location string, value string) error {`,
  4393  		`	if err := validate.EnumCase(path, location, value, additionalThingsNestedTypeOriginPropEnum, true); err != nil {`,
  4394  		`func (m *AdditionalThingsNested) validateOrigin(formats strfmt.Registry) error {`,
  4395  		`	if swag.IsZero(m.Origin) {`,
  4396  		`	if err := m.validateOriginEnum("origin", "body", m.Origin); err != nil {`,
  4397  		`type AdditionalThingsNestedAnon struct {`,
  4398  		"	PrinterAddress string `json:\"printerAddress,omitempty\"`",
  4399  		"	PrinterCountry string `json:\"printerCountry,omitempty\"`",
  4400  		"	PrinterDate strfmt.Date `json:\"printerDate,omitempty\"`",
  4401  		"	AdditionalThingsNestedAnon map[string]*AdditionalThingsNestedAnonAnon `json:\"-\"`",
  4402  		`func (m *AdditionalThingsNestedAnon) Validate(formats strfmt.Registry) error {`,
  4403  		`	if err := m.validatePrinterCountry(formats); err != nil {`,
  4404  		`	if err := m.validatePrinterDate(formats); err != nil {`,
  4405  		`	for k := range m.AdditionalThingsNestedAnon {`,
  4406  		`		if val, ok := m.AdditionalThingsNestedAnon[k]; ok {`,
  4407  		`			if val != nil {`,
  4408  		`				if err := val.Validate(formats); err != nil {`,
  4409  		`		return errors.CompositeValidationError(res...`,
  4410  		`var additionalThingsNestedAnonTypePrinterCountryPropEnum []interface{`,
  4411  		`	var res []string`,
  4412  		"	if err := json.Unmarshal([]byte(`[\"US\",\"FR\",\"UK\",\"BE\",\"CA\",\"DE\"]`), &res); err != nil {",
  4413  		`	for _, v := range res {`,
  4414  		`		additionalThingsNestedAnonTypePrinterCountryPropEnum = append(additionalThingsNestedAnonTypePrinterCountryPropEnum, v`,
  4415  		`	AdditionalThingsNestedAnonPrinterCountryUS string = "US"`,
  4416  		`	AdditionalThingsNestedAnonPrinterCountryFR string = "FR"`,
  4417  		`	AdditionalThingsNestedAnonPrinterCountryUK string = "UK"`,
  4418  		`	AdditionalThingsNestedAnonPrinterCountryBE string = "BE"`,
  4419  		`	AdditionalThingsNestedAnonPrinterCountryCA string = "CA"`,
  4420  		`	AdditionalThingsNestedAnonPrinterCountryDE string = "DE"`,
  4421  		`func (m *AdditionalThingsNestedAnon) validatePrinterCountryEnum(path, location string, value string) error {`,
  4422  		`	if err := validate.EnumCase(path, location, value, additionalThingsNestedAnonTypePrinterCountryPropEnum, true); err != nil {`,
  4423  		`func (m *AdditionalThingsNestedAnon) validatePrinterCountry(formats strfmt.Registry) error {`,
  4424  		`	if swag.IsZero(m.PrinterCountry) {`,
  4425  		`	if err := m.validatePrinterCountryEnum("printerCountry", "body", m.PrinterCountry); err != nil {`,
  4426  		`func (m *AdditionalThingsNestedAnon) validatePrinterDate(formats strfmt.Registry) error {`,
  4427  		`	if swag.IsZero(m.PrinterDate) {`,
  4428  		`	if err := validate.FormatOf("printerDate", "body", "date", m.PrinterDate.String(), formats); err != nil {`,
  4429  		`type AdditionalThingsNestedAnonAnon struct {`,
  4430  		"	AverageDelay strfmt.Duration `json:\"averageDelay,omitempty\"`",
  4431  		`func (m *AdditionalThingsNestedAnonAnon) Validate(formats strfmt.Registry) error {`,
  4432  		`	if err := m.validateAverageDelay(formats); err != nil {`,
  4433  		`		return errors.CompositeValidationError(res...`,
  4434  		`func (m *AdditionalThingsNestedAnonAnon) validateAverageDelay(formats strfmt.Registry) error {`,
  4435  		`	if swag.IsZero(m.AverageDelay) {`,
  4436  		`	if err := validate.FormatOf("averageDelay", "body", "duration", m.AverageDelay.String(), formats); err != nil {`,
  4437  	},
  4438  		// not expected
  4439  		todo,
  4440  		// output in log
  4441  		noLines,
  4442  		noLines)
  4443  
  4444  	// load expectations for model: no_validation_thing.go
  4445  	flattenRun.AddExpectations("no_validation_thing.go", []string{
  4446  		`type NoValidationThing struct {`,
  4447  		"	Discourse string `json:\"discourse,omitempty\"`",
  4448  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  4449  		"	NoValidationThingAdditionalProperties map[string]interface{} `json:\"-\"`",
  4450  		// empty validation
  4451  		"func (m *NoValidationThing) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  4452  	},
  4453  		// not expected
  4454  		todo,
  4455  		// output in log
  4456  		noLines,
  4457  		noLines)
  4458  
  4459  	expandRun.AddExpectations("no_validation_thing.go", flattenRun.ExpectedFor("NoValidationThing").ExpectedLines, todo, noLines, noLines)
  4460  
  4461  	// load expectations for model: additional_array_of_interface.go
  4462  	flattenRun.AddExpectations("additional_array_of_interface.go", []string{
  4463  		`type AdditionalArrayOfInterface struct {`,
  4464  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  4465  		"	AdditionalArrayOfInterface map[string][]interface{} `json:\"-\"`",
  4466  		`func (m *AdditionalArrayOfInterface) Validate(formats strfmt.Registry) error {`,
  4467  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  4468  		`	for k := range m.AdditionalArrayOfInterface {`,
  4469  		// remove undue IsZero call
  4470  		`		if err := validate.UniqueItems(k, "body", m.AdditionalArrayOfInterface[k]); err != nil {`,
  4471  		`		return errors.CompositeValidationError(res...`,
  4472  		`func (m *AdditionalArrayOfInterface) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  4473  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  4474  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`,
  4475  	},
  4476  		// not expected
  4477  		todo,
  4478  		// output in log
  4479  		noLines,
  4480  		noLines)
  4481  
  4482  	expandRun.AddExpectations("additional_array_of_interface.go", flattenRun.ExpectedFor("AdditionalArrayOfInterface").ExpectedLines, todo, noLines, noLines)
  4483  
  4484  	// load expectations for model: additional_formated_thing.go
  4485  	flattenRun.AddExpectations("additional_formated_thing.go", []string{
  4486  		`type AdditionalFormatedThing map[string]strfmt.Date`,
  4487  		`func (m AdditionalFormatedThing) Validate(formats strfmt.Registry) error {`,
  4488  		`	for k := range m {`,
  4489  		`		if err := validate.FormatOf(k, "body", "date", m[k].String(), formats); err != nil {`,
  4490  		`		return errors.CompositeValidationError(res...`,
  4491  	},
  4492  		// not expected
  4493  		todo,
  4494  		// output in log
  4495  		noLines,
  4496  		noLines)
  4497  
  4498  	expandRun.AddExpectations("additional_formated_thing.go", flattenRun.ExpectedFor("AdditionalFormatedThing").ExpectedLines, todo, noLines, noLines)
  4499  
  4500  	// load expectations for model: aliased_nullable_date.go
  4501  	flattenRun.AddExpectations("aliased_nullable_date.go", []string{
  4502  		`type AliasedNullableDate strfmt.Date`,
  4503  		`func (m AliasedNullableDate) Validate(formats strfmt.Registry) error {`,
  4504  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  4505  		`		return errors.CompositeValidationError(res...`,
  4506  	},
  4507  		// not expected
  4508  		todo,
  4509  		// output in log
  4510  		noLines,
  4511  		noLines)
  4512  
  4513  	expandRun.AddExpectations("aliased_nullable_date.go", flattenRun.ExpectedFor("AliasedNullableDate").ExpectedLines, todo, noLines, noLines)
  4514  
  4515  	// load expectations for model: additional_array_of_refed_object.go
  4516  	flattenRun.AddExpectations("additional_array_of_refed_object.go", []string{
  4517  		`type AdditionalArrayOfRefedObject struct {`,
  4518  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  4519  		"	AdditionalArrayOfRefedObject map[string][]*NoValidationThing `json:\"-\"`",
  4520  		`func (m *AdditionalArrayOfRefedObject) Validate(formats strfmt.Registry) error {`,
  4521  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  4522  		`	for k := range m.AdditionalArrayOfRefedObject {`,
  4523  		`		if err := validate.Required(k, "body", m.AdditionalArrayOfRefedObject[k]); err != nil {`,
  4524  		`		if err := validate.UniqueItems(k, "body", m.AdditionalArrayOfRefedObject[k]); err != nil {`,
  4525  		`		for i := 0; i < len(m.AdditionalArrayOfRefedObject[k]); i++ {`,
  4526  		// do we need Required when item is nullable?
  4527  		// nullable not required:
  4528  		`			if swag.IsZero(m.AdditionalArrayOfRefedObject[k][i]) {`,
  4529  		// nullable required:
  4530  		`			if m.AdditionalArrayOfRefedObject[k][i] != nil {`,
  4531  		`				if err := m.AdditionalArrayOfRefedObject[k][i].Validate(formats); err != nil {`,
  4532  		`					if ve, ok := err.(*errors.Validation); ok {`,
  4533  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  4534  		`		return errors.CompositeValidationError(res...`,
  4535  		`func (m *AdditionalArrayOfRefedObject) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  4536  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  4537  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`,
  4538  	},
  4539  		// not expected
  4540  		todo,
  4541  		// output in log
  4542  		noLines,
  4543  		noLines)
  4544  
  4545  	expandRun.AddExpectations("additional_array_of_refed_object.go", []string{
  4546  		`type AdditionalArrayOfRefedObject struct {`,
  4547  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  4548  		"	AdditionalArrayOfRefedObject map[string][]*AdditionalArrayOfRefedObjectItems0 `json:\"-\"`",
  4549  		`func (m *AdditionalArrayOfRefedObject) Validate(formats strfmt.Registry) error {`,
  4550  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  4551  		`	for k := range m.AdditionalArrayOfRefedObject {`,
  4552  		`		if err := validate.Required(k, "body", m.AdditionalArrayOfRefedObject[k]); err != nil {`,
  4553  		`		if err := validate.UniqueItems(k, "body", m.AdditionalArrayOfRefedObject[k]); err != nil {`,
  4554  		`		for i := 0; i < len(m.AdditionalArrayOfRefedObject[k]); i++ {`,
  4555  		// do we need Required when item is nullable?
  4556  		// nullable not required:
  4557  		`			if swag.IsZero(m.AdditionalArrayOfRefedObject[k][i]) {`,
  4558  		// nullable required:
  4559  		`			if m.AdditionalArrayOfRefedObject[k][i] != nil {`,
  4560  		`				if err := m.AdditionalArrayOfRefedObject[k][i].Validate(formats); err != nil {`,
  4561  		`					if ve, ok := err.(*errors.Validation); ok {`,
  4562  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  4563  		`		return errors.CompositeValidationError(res...`,
  4564  		`func (m *AdditionalArrayOfRefedObject) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  4565  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  4566  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`,
  4567  		`type AdditionalArrayOfRefedObjectItems0 struct {`,
  4568  		"	Discourse string `json:\"discourse,omitempty\"`",
  4569  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  4570  		"	AdditionalArrayOfRefedObjectItems0AdditionalProperties map[string]interface{} `json:\"-\"`",
  4571  		// empty validation
  4572  		"func (m *AdditionalArrayOfRefedObjectItems0) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  4573  	},
  4574  		// not expected
  4575  		todo,
  4576  		// output in log
  4577  		noLines,
  4578  		noLines)
  4579  
  4580  	// load expectations for model: additional_slice_of_aliased_primitives.go
  4581  	flattenRun.AddExpectations("additional_slice_of_aliased_primitives.go", []string{
  4582  		`type AdditionalSliceOfAliasedPrimitives struct {`,
  4583  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  4584  		"	AdditionalSliceOfAliasedPrimitives map[string][]AliasedDate `json:\"-\"`",
  4585  		`func (m *AdditionalSliceOfAliasedPrimitives) Validate(formats strfmt.Registry) error {`,
  4586  		`	if err := m.validateProp2(formats); err != nil {`,
  4587  		`	for k := range m.AdditionalSliceOfAliasedPrimitives {`,
  4588  		// removed undue IsZero call
  4589  		`		iAdditionalSliceOfAliasedPrimitivesSize := int64(len(m.AdditionalSliceOfAliasedPrimitives[k])`,
  4590  		`		if err := validate.MaxItems(k, "body", iAdditionalSliceOfAliasedPrimitivesSize, 10); err != nil {`,
  4591  		`		for i := 0; i < len(m.AdditionalSliceOfAliasedPrimitives[k]); i++ {`,
  4592  		`			if err := m.AdditionalSliceOfAliasedPrimitives[k][i].Validate(formats); err != nil {`,
  4593  		`				if ve, ok := err.(*errors.Validation); ok {`,
  4594  		`					return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  4595  		`		return errors.CompositeValidationError(res...`,
  4596  		`func (m *AdditionalSliceOfAliasedPrimitives) validateProp2(formats strfmt.Registry) error {`,
  4597  		`	if swag.IsZero(m.Prop2) {`,
  4598  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  4599  	},
  4600  		// not expected
  4601  		todo,
  4602  		// output in log
  4603  		noLines,
  4604  		noLines)
  4605  
  4606  	expandRun.AddExpectations("additional_slice_of_aliased_primitives.go", []string{
  4607  		`type AdditionalSliceOfAliasedPrimitives struct {`,
  4608  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  4609  		"	AdditionalSliceOfAliasedPrimitives map[string][]strfmt.Date `json:\"-\"`",
  4610  		`func (m *AdditionalSliceOfAliasedPrimitives) Validate(formats strfmt.Registry) error {`,
  4611  		`	if err := m.validateProp2(formats); err != nil {`,
  4612  		`	for k := range m.AdditionalSliceOfAliasedPrimitives {`,
  4613  		`		iAdditionalSliceOfAliasedPrimitivesSize := int64(len(m.AdditionalSliceOfAliasedPrimitives[k])`,
  4614  		`		if err := validate.MaxItems(k, "body", iAdditionalSliceOfAliasedPrimitivesSize, 10); err != nil {`,
  4615  		`		for i := 0; i < len(m.AdditionalSliceOfAliasedPrimitives[k]); i++ {`,
  4616  		`			if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "date", m.AdditionalSliceOfAliasedPrimitives[k][i].String(), formats); err != nil {`,
  4617  		`		return errors.CompositeValidationError(res...`,
  4618  		`func (m *AdditionalSliceOfAliasedPrimitives) validateProp2(formats strfmt.Registry) error {`,
  4619  		`	if swag.IsZero(m.Prop2) {`,
  4620  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  4621  	},
  4622  		// not expected
  4623  		todo,
  4624  		// output in log
  4625  		noLines,
  4626  		noLines)
  4627  
  4628  	// load expectations for model: transitive_refed_thing.go
  4629  	flattenRun.AddExpectations("transitive_refed_thing.go", []string{
  4630  		`type TransitiveRefedThing struct {`,
  4631  		"	ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`",
  4632  		"	TransitiveRefedThing map[string]*TransitiveRefedThingAdditionalProperties `json:\"-\"`",
  4633  		`func (m *TransitiveRefedThing) Validate(formats strfmt.Registry) error {`,
  4634  		`	if err := m.validateThisOneNotRequiredEither(formats); err != nil {`,
  4635  		`	for k := range m.TransitiveRefedThing {`,
  4636  		`		if val, ok := m.TransitiveRefedThing[k]; ok {`,
  4637  		`			if val != nil {`,
  4638  		`				if err := val.Validate(formats); err != nil {`,
  4639  		`		return errors.CompositeValidationError(res...`,
  4640  		`func (m *TransitiveRefedThing) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`,
  4641  		`	if swag.IsZero(m.ThisOneNotRequiredEither) {`,
  4642  		`	if err := validate.MaximumInt("thisOneNotRequiredEither", "body", m.ThisOneNotRequiredEither, 20, false); err != nil {`,
  4643  	},
  4644  		// not expected
  4645  		todo,
  4646  		// output in log
  4647  		noLines,
  4648  		noLines)
  4649  
  4650  	expandRun.AddExpectations("transitive_refed_thing.go", []string{
  4651  		`type TransitiveRefedThing struct {`,
  4652  		"	ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`",
  4653  		"	TransitiveRefedThing map[string]*TransitiveRefedThingAnon `json:\"-\"`",
  4654  		`func (m *TransitiveRefedThing) Validate(formats strfmt.Registry) error {`,
  4655  		`	if err := m.validateThisOneNotRequiredEither(formats); err != nil {`,
  4656  		`	for k := range m.TransitiveRefedThing {`,
  4657  		`		if val, ok := m.TransitiveRefedThing[k]; ok {`,
  4658  		`			if val != nil {`,
  4659  		`				if err := val.Validate(formats); err != nil {`,
  4660  		`		return errors.CompositeValidationError(res...`,
  4661  		`func (m *TransitiveRefedThing) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`,
  4662  		`	if swag.IsZero(m.ThisOneNotRequiredEither) {`,
  4663  		`	if err := validate.MaximumInt("thisOneNotRequiredEither", "body", m.ThisOneNotRequiredEither, 20, false); err != nil {`,
  4664  		`type TransitiveRefedThingAnon struct {`,
  4665  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  4666  		"	TransitiveRefedThingAnon map[string]*TransitiveRefedThingAnonAnon `json:\"-\"`",
  4667  		`func (m *TransitiveRefedThingAnon) Validate(formats strfmt.Registry) error {`,
  4668  		`	if err := m.validateA1(formats); err != nil {`,
  4669  		`	for k := range m.TransitiveRefedThingAnon {`,
  4670  		`		if val, ok := m.TransitiveRefedThingAnon[k]; ok {`,
  4671  		`			if val != nil {`,
  4672  		`				if err := val.Validate(formats); err != nil {`,
  4673  		`		return errors.CompositeValidationError(res...`,
  4674  		`func (m *TransitiveRefedThingAnon) validateA1(formats strfmt.Registry) error {`,
  4675  		`	if swag.IsZero(m.A1) {`,
  4676  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  4677  		`type TransitiveRefedThingAnonAnon struct {`,
  4678  		"	Discourse string `json:\"discourse,omitempty\"`",
  4679  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  4680  		"	TransitiveRefedThingAnonAnonAdditionalProperties map[string]interface{} `json:\"-\"`",
  4681  		// empty validation
  4682  		"func (m *TransitiveRefedThingAnonAnon) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  4683  	},
  4684  		// not expected
  4685  		todo,
  4686  		// output in log
  4687  		noLines,
  4688  		noLines)
  4689  
  4690  	// load expectations for model: additional_empty_object.go
  4691  	flattenRun.AddExpectations("additional_empty_object.go", []string{
  4692  		`type AdditionalEmptyObject struct {`,
  4693  		"	PropA interface{} `json:\"propA,omitempty\"`",
  4694  		"	AdditionalEmptyObject map[string]interface{} `json:\"-\"`",
  4695  		// empty validation
  4696  		"func (m *AdditionalEmptyObject) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  4697  	},
  4698  		// not expected
  4699  		todo,
  4700  		// output in log
  4701  		noLines,
  4702  		noLines)
  4703  
  4704  	expandRun.AddExpectations("additional_empty_object.go", flattenRun.ExpectedFor("AdditionalEmptyObject").ExpectedLines, todo, noLines, noLines)
  4705  
  4706  	// load expectations for model: additional_date_with_nullable_thing.go
  4707  	flattenRun.AddExpectations("additional_date_with_nullable_thing.go", []string{
  4708  		`type AdditionalDateWithNullableThing struct {`,
  4709  		"	Blob int64 `json:\"blob,omitempty\"`",
  4710  		"	NullableDate *AliasedNullableDate `json:\"nullableDate,omitempty\"`",
  4711  		"	AdditionalDateWithNullableThing map[string]*AliasedNullableDate `json:\"-\"`",
  4712  		`func (m *AdditionalDateWithNullableThing) Validate(formats strfmt.Registry) error {`,
  4713  		`	if err := m.validateBlob(formats); err != nil {`,
  4714  		`	if err := m.validateNullableDate(formats); err != nil {`,
  4715  		`	for k := range m.AdditionalDateWithNullableThing {`,
  4716  		`		if swag.IsZero(m.AdditionalDateWithNullableThing[k]) {`,
  4717  		`		if val, ok := m.AdditionalDateWithNullableThing[k]; ok {`,
  4718  		`			if val != nil {`,
  4719  		`				if err := val.Validate(formats); err != nil {`,
  4720  		`		return errors.CompositeValidationError(res...`,
  4721  		`func (m *AdditionalDateWithNullableThing) validateBlob(formats strfmt.Registry) error {`,
  4722  		`	if swag.IsZero(m.Blob) {`,
  4723  		`	if err := validate.MinimumInt("blob", "body", m.Blob, 1, false); err != nil {`,
  4724  		`func (m *AdditionalDateWithNullableThing) validateNullableDate(formats strfmt.Registry) error {`,
  4725  		`	if swag.IsZero(m.NullableDate) {`,
  4726  		`	if m.NullableDate != nil {`,
  4727  		`		if err := m.NullableDate.Validate(formats); err != nil {`,
  4728  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4729  		`				return ve.ValidateName("nullableDate"`,
  4730  	},
  4731  		// not expected
  4732  		todo,
  4733  		// output in log
  4734  		noLines,
  4735  		noLines)
  4736  
  4737  	expandRun.AddExpectations("additional_date_with_nullable_thing.go", []string{
  4738  		`type AdditionalDateWithNullableThing struct {`,
  4739  		"	Blob int64 `json:\"blob,omitempty\"`",
  4740  		"	NullableDate *strfmt.Date `json:\"nullableDate,omitempty\"`",
  4741  		"	AdditionalDateWithNullableThing map[string]*strfmt.Date `json:\"-\"`",
  4742  		`func (m *AdditionalDateWithNullableThing) Validate(formats strfmt.Registry) error {`,
  4743  		`	if err := m.validateBlob(formats); err != nil {`,
  4744  		`	if err := m.validateNullableDate(formats); err != nil {`,
  4745  		`	for k := range m.AdditionalDateWithNullableThing {`,
  4746  		`		if swag.IsZero(m.AdditionalDateWithNullableThing[k]) {`,
  4747  		`		if err := validate.FormatOf(k, "body", "date", m.AdditionalDateWithNullableThing[k].String(), formats); err != nil {`,
  4748  		`		return errors.CompositeValidationError(res...`,
  4749  		`func (m *AdditionalDateWithNullableThing) validateBlob(formats strfmt.Registry) error {`,
  4750  		`	if swag.IsZero(m.Blob) {`,
  4751  		`	if err := validate.MinimumInt("blob", "body", m.Blob, 1, false); err != nil {`,
  4752  		`func (m *AdditionalDateWithNullableThing) validateNullableDate(formats strfmt.Registry) error {`,
  4753  		`	if swag.IsZero(m.NullableDate) {`,
  4754  		`	if err := validate.FormatOf("nullableDate", "body", "date", m.NullableDate.String(), formats); err != nil {`,
  4755  	},
  4756  		// not expected
  4757  		todo,
  4758  		// output in log
  4759  		noLines,
  4760  		noLines)
  4761  }
  4762  
  4763  func initFixtureTuple() {
  4764  	// testing ../fixtures/bugs/1487/fixture-tuple.yaml with expand (--skip-flatten)
  4765  
  4766  	/* check different patterns of additionalItems validations or absence thereof
  4767  	 */
  4768  	f := newModelFixture("../fixtures/bugs/1487/fixture-tuple.yaml", "fixture for tuples and additionalItems")
  4769  	flattenRun := f.AddRun(false)
  4770  	expandRun := f.AddRun(true)
  4771  
  4772  	// load expectations for model: classics.go
  4773  	flattenRun.AddExpectations("classics.go", []string{
  4774  		`type Classics struct {`,
  4775  		"	P0 *int64 `json:\"-\"`",
  4776  		"	P1 *strfmt.ISBN `json:\"-\"`",
  4777  		"	P2 Comics `json:\"-\"`",
  4778  		"	ClassicsItems []ClassicsTupleAdditionalItems `json:\"-\"`",
  4779  		`func (m *Classics) Validate(formats strfmt.Registry) error {`,
  4780  		`	if err := m.validateP0(formats); err != nil {`,
  4781  		`	if err := m.validateP1(formats); err != nil {`,
  4782  		`	if err := m.validateP2(formats); err != nil {`,
  4783  		`	if err := m.validateClassicsItems(formats); err != nil {`,
  4784  		`		return errors.CompositeValidationError(res...`,
  4785  		`func (m *Classics) validateP0(formats strfmt.Registry) error {`,
  4786  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  4787  		`func (m *Classics) validateP1(formats strfmt.Registry) error {`,
  4788  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  4789  		`	if err := validate.FormatOf("1", "body", "isbn", m.P1.String(), formats); err != nil {`,
  4790  		`func (m *Classics) validateP2(formats strfmt.Registry) error {`,
  4791  		`	if err := m.P2.Validate(formats); err != nil {`,
  4792  		`		if ve, ok := err.(*errors.Validation); ok {`,
  4793  		`			return ve.ValidateName("2"`,
  4794  		`func (m *Classics) validateClassicsItems(formats strfmt.Registry) error {`,
  4795  		`	for i := range m.ClassicsItems {`,
  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  	},
  4800  		// not expected
  4801  		todo,
  4802  		// output in log
  4803  		noLines,
  4804  		noLines)
  4805  
  4806  	expandRun.AddExpectations("classics.go", []string{
  4807  		`type Classics struct {`,
  4808  		"	P0 *int64 `json:\"-\"`",
  4809  		"	P1 *strfmt.ISBN `json:\"-\"`",
  4810  		"	P2 *ClassicsTuple0 `json:\"-\"`",
  4811  		// TODO: items should not be pointer
  4812  		"	ClassicsItems []*ClassicsClassicsItemsTuple0 `json:\"-\"`",
  4813  		`func (m *Classics) Validate(formats strfmt.Registry) error {`,
  4814  		`	if err := m.validateP0(formats); err != nil {`,
  4815  		`	if err := m.validateP1(formats); err != nil {`,
  4816  		`	if err := m.validateP2(formats); err != nil {`,
  4817  		`	if err := m.validateClassicsItems(formats); err != nil {`,
  4818  		`		return errors.CompositeValidationError(res...`,
  4819  		`func (m *Classics) validateP0(formats strfmt.Registry) error {`,
  4820  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  4821  		`func (m *Classics) validateP1(formats strfmt.Registry) error {`,
  4822  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  4823  		`	if err := validate.FormatOf("1", "body", "isbn", m.P1.String(), formats); err != nil {`,
  4824  		`func (m *Classics) validateP2(formats strfmt.Registry) error {`,
  4825  		`	if err := validate.Required("2", "body", m.P2); err != nil {`,
  4826  		`	if m.P2 != nil {`,
  4827  		`		if err := m.P2.Validate(formats); err != nil {`,
  4828  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4829  		`				return ve.ValidateName("2"`,
  4830  		`func (m *Classics) validateClassicsItems(formats strfmt.Registry) error {`,
  4831  		`	for i := range m.ClassicsItems {`,
  4832  		`		if m.ClassicsItems[i] != nil {`,
  4833  		`			if err := m.ClassicsItems[i].Validate(formats); err != nil {`,
  4834  		`				if ve, ok := err.(*errors.Validation); ok {`,
  4835  		`					return ve.ValidateName(strconv.Itoa(i + 3)`,
  4836  		`type ClassicsClassicsItemsTuple0 struct {`,
  4837  		"	P0 *ClassicsClassicsItemsTuple0P0 `json:\"-\"`",
  4838  		"	P1 []strfmt.Date `json:\"-\"`",
  4839  		"	P2 *ClassicsClassicsItemsTuple0P2 `json:\"-\"`",
  4840  		"	P3 *ClassicsClassicsItemsTuple0P3Tuple0 `json:\"-\"`",
  4841  		`func (m *ClassicsClassicsItemsTuple0) Validate(formats strfmt.Registry) error {`,
  4842  		`	if err := m.validateP0(formats); err != nil {`,
  4843  		`	if err := m.validateP1(formats); err != nil {`,
  4844  		`	if err := m.validateP2(formats); err != nil {`,
  4845  		`	if err := m.validateP3(formats); err != nil {`,
  4846  		`		return errors.CompositeValidationError(res...`,
  4847  		`func (m *ClassicsClassicsItemsTuple0) validateP0(formats strfmt.Registry) error {`,
  4848  		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
  4849  		`	if m.P0 != nil {`,
  4850  		`		if err := m.P0.Validate(formats); err != nil {`,
  4851  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4852  		`				return ve.ValidateName("P0"`,
  4853  		`func (m *ClassicsClassicsItemsTuple0) validateP1(formats strfmt.Registry) error {`,
  4854  		`	if err := validate.Required("P1", "body", m.P1); err != nil {`,
  4855  		`	for i := 0; i < len(m.P1); i++ {`,
  4856  		`		if err := validate.FormatOf("P1"+"."+strconv.Itoa(i), "body", "date", m.P1[i].String(), formats); err != nil {`,
  4857  		`func (m *ClassicsClassicsItemsTuple0) validateP2(formats strfmt.Registry) error {`,
  4858  		`	if err := validate.Required("P2", "body", m.P2); err != nil {`,
  4859  		`	if m.P2 != nil {`,
  4860  		`		if err := m.P2.Validate(formats); err != nil {`,
  4861  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4862  		`				return ve.ValidateName("P2"`,
  4863  		`func (m *ClassicsClassicsItemsTuple0) validateP3(formats strfmt.Registry) error {`,
  4864  		`	if err := validate.Required("P3", "body", m.P3); err != nil {`,
  4865  		`	if m.P3 != nil {`,
  4866  		`		if err := m.P3.Validate(formats); err != nil {`,
  4867  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4868  		`				return ve.ValidateName("P3"`,
  4869  		`type ClassicsClassicsItemsTuple0P0 struct {`,
  4870  		"	Period *string `json:\"period,omitempty\"`",
  4871  		"	Title *string `json:\"title,omitempty\"`",
  4872  		`func (m *ClassicsClassicsItemsTuple0P0) Validate(formats strfmt.Registry) error {`,
  4873  		`	if err := m.validateTitle(formats); err != nil {`,
  4874  		`		return errors.CompositeValidationError(res...`,
  4875  		`var classicsClassicsItemsTuple0P0TypeTitlePropEnum []interface{`,
  4876  		`	var res []string`,
  4877  		"	if err := json.Unmarshal([]byte(`[\"Les Misérables\",\"Bleak House\",\"Sherlock Holmes\",\"Siddhartha\"]`), &res); err != nil {",
  4878  		`	for _, v := range res {`,
  4879  		`		classicsClassicsItemsTuple0P0TypeTitlePropEnum = append(classicsClassicsItemsTuple0P0TypeTitlePropEnum, v`,
  4880  		`	ClassicsClassicsItemsTuple0P0TitleLesMisérables string = "Les Misérables"`,
  4881  		`	ClassicsClassicsItemsTuple0P0TitleBleakHouse string = "Bleak House"`,
  4882  		`	ClassicsClassicsItemsTuple0P0TitleSherlockHolmes string = "Sherlock Holmes"`,
  4883  		`	ClassicsClassicsItemsTuple0P0TitleSiddhartha string = "Siddhartha"`,
  4884  		`func (m *ClassicsClassicsItemsTuple0P0) validateTitleEnum(path, location string, value string) error {`,
  4885  		`	if err := validate.EnumCase(path, location, value, classicsClassicsItemsTuple0P0TypeTitlePropEnum, true); err != nil {`,
  4886  		`func (m *ClassicsClassicsItemsTuple0P0) validateTitle(formats strfmt.Registry) error {`,
  4887  		`	if swag.IsZero(m.Title) {`,
  4888  		`	if err := m.validateTitleEnum("P0"+"."+"title", "body", *m.Title); err != nil {`,
  4889  		`type ClassicsClassicsItemsTuple0P2 struct {`,
  4890  		"	Origin *string `json:\"origin,omitempty\"`",
  4891  		"	ClassicsClassicsItemsTuple0P2 map[string]string `json:\"-\"`",
  4892  		`var classicsClassicsItemsTuple0P2ValueEnum []interface{`,
  4893  		`	var res []string`,
  4894  		"	if err := json.Unmarshal([]byte(`[\"bookshop\",\"amazon\",\"library\"]`), &res); err != nil {",
  4895  		`	for _, v := range res {`,
  4896  		`		classicsClassicsItemsTuple0P2ValueEnum = append(classicsClassicsItemsTuple0P2ValueEnum, v`,
  4897  		`func (m *ClassicsClassicsItemsTuple0P2) validateClassicsClassicsItemsTuple0P2ValueEnum(path, location string, value string) error {`,
  4898  		`	if err := validate.EnumCase(path, location, value, classicsClassicsItemsTuple0P2ValueEnum, true); err != nil {`,
  4899  		`func (m *ClassicsClassicsItemsTuple0P2) Validate(formats strfmt.Registry) error {`,
  4900  		`	if err := m.validateOrigin(formats); err != nil {`,
  4901  		`	for k := range m.ClassicsClassicsItemsTuple0P2 {`,
  4902  		// removed undue IsZero() call
  4903  		`		if err := m.validateClassicsClassicsItemsTuple0P2ValueEnum("P2"+"."+k, "body", m.ClassicsClassicsItemsTuple0P2[k]); err != nil {`,
  4904  		`		return errors.CompositeValidationError(res...`,
  4905  		`var classicsClassicsItemsTuple0P2TypeOriginPropEnum []interface{`,
  4906  		`	var res []string`,
  4907  		"	if err := json.Unmarshal([]byte(`[\"print\",\"e-book\",\"collection\",\"museum\"]`), &res); err != nil {",
  4908  		`	for _, v := range res {`,
  4909  		`		classicsClassicsItemsTuple0P2TypeOriginPropEnum = append(classicsClassicsItemsTuple0P2TypeOriginPropEnum, v`,
  4910  		`	ClassicsClassicsItemsTuple0P2OriginPrint string = "print"`,
  4911  		`	ClassicsClassicsItemsTuple0P2OriginEDashBook string = "e-book"`,
  4912  		`	ClassicsClassicsItemsTuple0P2OriginCollection string = "collection"`,
  4913  		`	ClassicsClassicsItemsTuple0P2OriginMuseum string = "museum"`,
  4914  		`func (m *ClassicsClassicsItemsTuple0P2) validateOriginEnum(path, location string, value string) error {`,
  4915  		`	if err := validate.EnumCase(path, location, value, classicsClassicsItemsTuple0P2TypeOriginPropEnum, true); err != nil {`,
  4916  		`func (m *ClassicsClassicsItemsTuple0P2) validateOrigin(formats strfmt.Registry) error {`,
  4917  		`	if swag.IsZero(m.Origin) {`,
  4918  		`	if err := m.validateOriginEnum("P2"+"."+"origin", "body", *m.Origin); err != nil {`,
  4919  		`type ClassicsClassicsItemsTuple0P3Tuple0 struct {`,
  4920  		"	P0 *string `json:\"-\"`",
  4921  		"	P1 *ClassicsClassicsItemsTuple0P3Tuple0P1 `json:\"-\"`",
  4922  		"	P2 *ClassicsClassicsItemsTuple0P3Tuple0P2 `json:\"-\"`",
  4923  		"	P3 *ClassicsClassicsItemsTuple0P3Tuple0P3 `json:\"-\"`",
  4924  		"	P4 []strfmt.ISBN `json:\"-\"`",
  4925  		"	P5 *int64 `json:\"-\"`",
  4926  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0) Validate(formats strfmt.Registry) error {`,
  4927  		`	if err := m.validateP0(formats); err != nil {`,
  4928  		`	if err := m.validateP1(formats); err != nil {`,
  4929  		`	if err := m.validateP2(formats); err != nil {`,
  4930  		`	if err := m.validateP3(formats); err != nil {`,
  4931  		`	if err := m.validateP4(formats); err != nil {`,
  4932  		`	if err := m.validateP5(formats); err != nil {`,
  4933  		`		return errors.CompositeValidationError(res...`,
  4934  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP0(formats strfmt.Registry) error {`,
  4935  		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
  4936  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP1(formats strfmt.Registry) error {`,
  4937  		`	if err := validate.Required("P1", "body", m.P1); err != nil {`,
  4938  		`	if m.P1 != nil {`,
  4939  		`		if err := m.P1.Validate(formats); err != nil {`,
  4940  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4941  		`				return ve.ValidateName("P1"`,
  4942  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP2(formats strfmt.Registry) error {`,
  4943  		`	if err := validate.Required("P2", "body", m.P2); err != nil {`,
  4944  		`	if m.P2 != nil {`,
  4945  		`		if err := m.P2.Validate(formats); err != nil {`,
  4946  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4947  		`				return ve.ValidateName("P2"`,
  4948  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP3(formats strfmt.Registry) error {`,
  4949  		`	if err := validate.Required("P3", "body", m.P3); err != nil {`,
  4950  		`	if m.P3 != nil {`,
  4951  		`		if err := m.P3.Validate(formats); err != nil {`,
  4952  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4953  		`				return ve.ValidateName("P3"`,
  4954  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP4(formats strfmt.Registry) error {`,
  4955  		`	if err := validate.Required("P4", "body", m.P4); err != nil {`,
  4956  		`	for i := 0; i < len(m.P4); i++ {`,
  4957  		`		if err := validate.FormatOf("P4"+"."+strconv.Itoa(i), "body", "isbn", m.P4[i].String(), formats); err != nil {`,
  4958  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP5(formats strfmt.Registry) error {`,
  4959  		`	if err := validate.Required("P5", "body", m.P5); err != nil {`,
  4960  		`type ClassicsClassicsItemsTuple0P3Tuple0P1 struct {`,
  4961  		"	Narrative *string `json:\"narrative\"`",
  4962  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0P1) Validate(formats strfmt.Registry) error {`,
  4963  		`	if err := m.validateNarrative(formats); err != nil {`,
  4964  		`		return errors.CompositeValidationError(res...`,
  4965  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0P1) validateNarrative(formats strfmt.Registry) error {`,
  4966  		`	if err := validate.Required("P1"+"."+"narrative", "body", m.Narrative); err != nil {`,
  4967  		`type ClassicsClassicsItemsTuple0P3Tuple0P2 struct {`,
  4968  		"	MarketingBS *string `json:\"marketingBS,omitempty\"`",
  4969  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0P2) Validate(formats strfmt.Registry) error {`,
  4970  		`		return errors.CompositeValidationError(res...`,
  4971  		`type ClassicsClassicsItemsTuple0P3Tuple0P3 struct {`,
  4972  		"	Author *string `json:\"author,omitempty\"`",
  4973  		"	Character *string `json:\"character,omitempty\"`",
  4974  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0P3) Validate(formats strfmt.Registry) error {`,
  4975  		`	if err := m.validateAuthor(formats); err != nil {`,
  4976  		`	if err := m.validateCharacter(formats); err != nil {`,
  4977  		`		return errors.CompositeValidationError(res...`,
  4978  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0P3) validateAuthor(formats strfmt.Registry) error {`,
  4979  		`	if swag.IsZero(m.Author) {`,
  4980  		`	if err := validate.MinLength("P3"+"."+"author", "body", *m.Author, 1); err != nil {`,
  4981  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0P3) validateCharacter(formats strfmt.Registry) error {`,
  4982  		`	if swag.IsZero(m.Character) {`,
  4983  		"	if err := validate.Pattern(\"P3\"+\".\"+\"character\", \"body\", *m.Character, `^[A-Z]+$`); err != nil {",
  4984  		`type ClassicsTuple0 struct {`,
  4985  		"	P0 *string `json:\"-\"`",
  4986  		"	P1 *ClassicsTuple0P1 `json:\"-\"`",
  4987  		"	P2 *ClassicsTuple0P2 `json:\"-\"`",
  4988  		"	P3 *ClassicsTuple0P3 `json:\"-\"`",
  4989  		"	P4 []strfmt.ISBN `json:\"-\"`",
  4990  		"	P5 *int64 `json:\"-\"`",
  4991  		`func (m *ClassicsTuple0) Validate(formats strfmt.Registry) error {`,
  4992  		`	if err := m.validateP0(formats); err != nil {`,
  4993  		`	if err := m.validateP1(formats); err != nil {`,
  4994  		`	if err := m.validateP2(formats); err != nil {`,
  4995  		`	if err := m.validateP3(formats); err != nil {`,
  4996  		`	if err := m.validateP4(formats); err != nil {`,
  4997  		`	if err := m.validateP5(formats); err != nil {`,
  4998  		`		return errors.CompositeValidationError(res...`,
  4999  		`func (m *ClassicsTuple0) validateP0(formats strfmt.Registry) error {`,
  5000  		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
  5001  		`func (m *ClassicsTuple0) validateP1(formats strfmt.Registry) error {`,
  5002  		`	if err := validate.Required("P1", "body", m.P1); err != nil {`,
  5003  		`	if m.P1 != nil {`,
  5004  		`		if err := m.P1.Validate(formats); err != nil {`,
  5005  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5006  		`				return ve.ValidateName("P1"`,
  5007  		`func (m *ClassicsTuple0) validateP2(formats strfmt.Registry) error {`,
  5008  		`	if err := validate.Required("P2", "body", m.P2); err != nil {`,
  5009  		`	if m.P2 != nil {`,
  5010  		`		if err := m.P2.Validate(formats); err != nil {`,
  5011  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5012  		`				return ve.ValidateName("P2"`,
  5013  		`func (m *ClassicsTuple0) validateP3(formats strfmt.Registry) error {`,
  5014  		`	if err := validate.Required("P3", "body", m.P3); err != nil {`,
  5015  		`	if m.P3 != nil {`,
  5016  		`		if err := m.P3.Validate(formats); err != nil {`,
  5017  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5018  		`				return ve.ValidateName("P3"`,
  5019  		`func (m *ClassicsTuple0) validateP4(formats strfmt.Registry) error {`,
  5020  		`	if err := validate.Required("P4", "body", m.P4); err != nil {`,
  5021  		`	for i := 0; i < len(m.P4); i++ {`,
  5022  		`		if err := validate.FormatOf("P4"+"."+strconv.Itoa(i), "body", "isbn", m.P4[i].String(), formats); err != nil {`,
  5023  		`func (m *ClassicsTuple0) validateP5(formats strfmt.Registry) error {`,
  5024  		`	if err := validate.Required("P5", "body", m.P5); err != nil {`,
  5025  		`type ClassicsTuple0P1 struct {`,
  5026  		"	Narrative *string `json:\"narrative\"`",
  5027  		`func (m *ClassicsTuple0P1) Validate(formats strfmt.Registry) error {`,
  5028  		`	if err := m.validateNarrative(formats); err != nil {`,
  5029  		`		return errors.CompositeValidationError(res...`,
  5030  		`func (m *ClassicsTuple0P1) validateNarrative(formats strfmt.Registry) error {`,
  5031  		`	if err := validate.Required("P1"+"."+"narrative", "body", m.Narrative); err != nil {`,
  5032  		`type ClassicsTuple0P2 struct {`,
  5033  		"	MarketingBS *string `json:\"marketingBS,omitempty\"`",
  5034  		`func (m *ClassicsTuple0P2) Validate(formats strfmt.Registry) error {`,
  5035  		`		return errors.CompositeValidationError(res...`,
  5036  		`type ClassicsTuple0P3 struct {`,
  5037  		"	Author *string `json:\"author,omitempty\"`",
  5038  		"	Character *string `json:\"character,omitempty\"`",
  5039  		`func (m *ClassicsTuple0P3) Validate(formats strfmt.Registry) error {`,
  5040  		`	if err := m.validateAuthor(formats); err != nil {`,
  5041  		`	if err := m.validateCharacter(formats); err != nil {`,
  5042  		`		return errors.CompositeValidationError(res...`,
  5043  		`func (m *ClassicsTuple0P3) validateAuthor(formats strfmt.Registry) error {`,
  5044  		`	if swag.IsZero(m.Author) {`,
  5045  		`	if err := validate.MinLength("P3"+"."+"author", "body", *m.Author, 1); err != nil {`,
  5046  		`func (m *ClassicsTuple0P3) validateCharacter(formats strfmt.Registry) error {`,
  5047  		`	if swag.IsZero(m.Character) {`,
  5048  		"	if err := validate.Pattern(\"P3\"+\".\"+\"character\", \"body\", *m.Character, `^[A-Z]+$`); err != nil {",
  5049  	},
  5050  		// not expected
  5051  		todo,
  5052  		// output in log
  5053  		noLines,
  5054  		noLines)
  5055  
  5056  	// load expectations for model: comics_items2.go
  5057  	flattenRun.AddExpectations("comics_items2.go", []string{
  5058  		`type ComicsItems2 struct {`,
  5059  		"	MarketingBS string `json:\"marketingBS,omitempty\"`",
  5060  		// empty validation
  5061  		"func (m *ComicsItems2) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  5062  	},
  5063  		// not expected
  5064  		todo,
  5065  		// output in log
  5066  		noLines,
  5067  		noLines)
  5068  
  5069  	// load expectations for model: classics_items_additional_items_items2.go
  5070  	flattenRun.AddExpectations("classics_items_additional_items_items2.go", []string{
  5071  		`type ClassicsItemsAdditionalItemsItems2 struct {`,
  5072  		"	Origin string `json:\"origin,omitempty\"`",
  5073  		"	ClassicsItemsAdditionalItemsItems2 map[string]string `json:\"-\"`",
  5074  		`var classicsItemsAdditionalItemsItems2ValueEnum []interface{`,
  5075  		`	var res []string`,
  5076  		"	if err := json.Unmarshal([]byte(`[\"bookshop\",\"amazon\",\"library\"]`), &res); err != nil {",
  5077  		`	for _, v := range res {`,
  5078  		`		classicsItemsAdditionalItemsItems2ValueEnum = append(classicsItemsAdditionalItemsItems2ValueEnum, v`,
  5079  		`func (m *ClassicsItemsAdditionalItemsItems2) validateClassicsItemsAdditionalItemsItems2ValueEnum(path, location string, value string) error {`,
  5080  		`	if err := validate.EnumCase(path, location, value, classicsItemsAdditionalItemsItems2ValueEnum, true); err != nil {`,
  5081  		`func (m *ClassicsItemsAdditionalItemsItems2) Validate(formats strfmt.Registry) error {`,
  5082  		`	if err := m.validateOrigin(formats); err != nil {`,
  5083  		`	for k := range m.ClassicsItemsAdditionalItemsItems2 {`,
  5084  		// removed undue IsZero()
  5085  		`		if err := m.validateClassicsItemsAdditionalItemsItems2ValueEnum(k, "body", m.ClassicsItemsAdditionalItemsItems2[k]); err != nil {`,
  5086  		`		return errors.CompositeValidationError(res...`,
  5087  		`var classicsItemsAdditionalItemsItems2TypeOriginPropEnum []interface{`,
  5088  		`	var res []string`,
  5089  		"	if err := json.Unmarshal([]byte(`[\"print\",\"e-book\",\"collection\",\"museum\"]`), &res); err != nil {",
  5090  		`	for _, v := range res {`,
  5091  		`		classicsItemsAdditionalItemsItems2TypeOriginPropEnum = append(classicsItemsAdditionalItemsItems2TypeOriginPropEnum, v`,
  5092  		`	ClassicsItemsAdditionalItemsItems2OriginPrint string = "print"`,
  5093  		`	ClassicsItemsAdditionalItemsItems2OriginEDashBook string = "e-book"`,
  5094  		`	ClassicsItemsAdditionalItemsItems2OriginCollection string = "collection"`,
  5095  		`	ClassicsItemsAdditionalItemsItems2OriginMuseum string = "museum"`,
  5096  		`func (m *ClassicsItemsAdditionalItemsItems2) validateOriginEnum(path, location string, value string) error {`,
  5097  		`	if err := validate.EnumCase(path, location, value, classicsItemsAdditionalItemsItems2TypeOriginPropEnum, true); err != nil {`,
  5098  		`func (m *ClassicsItemsAdditionalItemsItems2) validateOrigin(formats strfmt.Registry) error {`,
  5099  		`	if swag.IsZero(m.Origin) {`,
  5100  		`	if err := m.validateOriginEnum("origin", "body", m.Origin); err != nil {`,
  5101  	},
  5102  		// not expected
  5103  		todo,
  5104  		// output in log
  5105  		noLines,
  5106  		noLines)
  5107  
  5108  	// load expectations for model: comics.go
  5109  	flattenRun.AddExpectations("comics.go", []string{
  5110  		`type Comics struct {`,
  5111  		"	P0 *string `json:\"-\"`",
  5112  		"	P1 *ComicsItems1 `json:\"-\"`",
  5113  		"	P2 *ComicsItems2 `json:\"-\"`",
  5114  		"	P3 *ComicsItems3 `json:\"-\"`",
  5115  		"	P4 []strfmt.ISBN `json:\"-\"`",
  5116  		"	P5 *int64 `json:\"-\"`",
  5117  		`func (m *Comics) Validate(formats strfmt.Registry) error {`,
  5118  		`	if err := m.validateP0(formats); err != nil {`,
  5119  		`	if err := m.validateP1(formats); err != nil {`,
  5120  		`	if err := m.validateP2(formats); err != nil {`,
  5121  		`	if err := m.validateP3(formats); err != nil {`,
  5122  		`	if err := m.validateP4(formats); err != nil {`,
  5123  		`	if err := m.validateP5(formats); err != nil {`,
  5124  		`		return errors.CompositeValidationError(res...`,
  5125  		`func (m *Comics) validateP0(formats strfmt.Registry) error {`,
  5126  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  5127  		`func (m *Comics) validateP1(formats strfmt.Registry) error {`,
  5128  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  5129  		`	if m.P1 != nil {`,
  5130  		`		if err := m.P1.Validate(formats); err != nil {`,
  5131  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5132  		`				return ve.ValidateName("1"`,
  5133  		`func (m *Comics) validateP2(formats strfmt.Registry) error {`,
  5134  		`	if err := validate.Required("2", "body", m.P2); err != nil {`,
  5135  		`	if m.P2 != nil {`,
  5136  		`		if err := m.P2.Validate(formats); err != nil {`,
  5137  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5138  		`				return ve.ValidateName("2"`,
  5139  		`func (m *Comics) validateP3(formats strfmt.Registry) error {`,
  5140  		`	if err := validate.Required("3", "body", m.P3); err != nil {`,
  5141  		`	if m.P3 != nil {`,
  5142  		`		if err := m.P3.Validate(formats); err != nil {`,
  5143  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5144  		`				return ve.ValidateName("3"`,
  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  	},
  5152  		// not expected
  5153  		todo,
  5154  		// output in log
  5155  		noLines,
  5156  		noLines)
  5157  
  5158  	expandRun.AddExpectations("comics.go", []string{
  5159  		`type Comics struct {`,
  5160  		"	P0 *string `json:\"-\"`",
  5161  		"   P1 *ComicsItems1 `json:\"-\"`",
  5162  		"   P2 *ComicsItems2 `json:\"-\"`",
  5163  		"   P3 *ComicsItems3 `json:\"-\"`",
  5164  		"	P4 []strfmt.ISBN `json:\"-\"`",
  5165  		"	P5 *int64 `json:\"-\"`",
  5166  		`func (m *Comics) Validate(formats strfmt.Registry) error {`,
  5167  		`	if err := m.validateP0(formats); err != nil {`,
  5168  		`	if err := m.validateP1(formats); err != nil {`,
  5169  		`	if err := m.validateP2(formats); err != nil {`,
  5170  		`	if err := m.validateP3(formats); err != nil {`,
  5171  		`	if err := m.validateP4(formats); err != nil {`,
  5172  		`	if err := m.validateP5(formats); err != nil {`,
  5173  		`		return errors.CompositeValidationError(res...`,
  5174  		`func (m *Comics) validateP0(formats strfmt.Registry) error {`,
  5175  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  5176  		`func (m *Comics) validateP1(formats strfmt.Registry) error {`,
  5177  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  5178  		`func (m *Comics) validateP2(formats strfmt.Registry) error {`,
  5179  		`	if err := validate.Required("2", "body", m.P2); err != nil {`,
  5180  		`func (m *Comics) validateP3(formats strfmt.Registry) error {`,
  5181  		`	if err := validate.Required("3", "body", m.P3); err != nil {`,
  5182  		`func (m *Comics) validateP4(formats strfmt.Registry) error {`,
  5183  		`	if err := validate.Required("4", "body", m.P4); err != nil {`,
  5184  		`	for i := 0; i < len(m.P4); i++ {`,
  5185  		`		if err := validate.FormatOf("4"+"."+strconv.Itoa(i), "body", "isbn", m.P4[i].String(), formats); err != nil {`,
  5186  		`func (m *Comics) validateP5(formats strfmt.Registry) error {`,
  5187  		`	if err := validate.Required("5", "body", m.P5); err != nil {`,
  5188  		`type ComicsItems1 struct {`,
  5189  		`type ComicsItems2 struct {`,
  5190  		`type ComicsItems3 struct {`,
  5191  	},
  5192  		// not expected
  5193  		todo,
  5194  		// output in log
  5195  		noLines,
  5196  		noLines)
  5197  
  5198  	// load expectations for model: classics_items_additional_items_items0.go
  5199  	flattenRun.AddExpectations("classics_items_additional_items_items0.go", []string{
  5200  		`type ClassicsItemsAdditionalItemsItems0 struct {`,
  5201  		"	Period string `json:\"period,omitempty\"`",
  5202  		"	Title string `json:\"title,omitempty\"`",
  5203  		`func (m *ClassicsItemsAdditionalItemsItems0) Validate(formats strfmt.Registry) error {`,
  5204  		`	if err := m.validateTitle(formats); err != nil {`,
  5205  		`		return errors.CompositeValidationError(res...`,
  5206  		`var classicsItemsAdditionalItemsItems0TypeTitlePropEnum []interface{`,
  5207  		`	var res []string`,
  5208  		"	if err := json.Unmarshal([]byte(`[\"Les Misérables\",\"Bleak House\",\"Sherlock Holmes\",\"Siddhartha\"]`), &res); err != nil {",
  5209  		`	for _, v := range res {`,
  5210  		`		classicsItemsAdditionalItemsItems0TypeTitlePropEnum = append(classicsItemsAdditionalItemsItems0TypeTitlePropEnum, v`,
  5211  		`	ClassicsItemsAdditionalItemsItems0TitleLesMisérables string = "Les Misérables"`,
  5212  		`	ClassicsItemsAdditionalItemsItems0TitleBleakHouse string = "Bleak House"`,
  5213  		`	ClassicsItemsAdditionalItemsItems0TitleSherlockHolmes string = "Sherlock Holmes"`,
  5214  		`	ClassicsItemsAdditionalItemsItems0TitleSiddhartha string = "Siddhartha"`,
  5215  		`func (m *ClassicsItemsAdditionalItemsItems0) validateTitleEnum(path, location string, value string) error {`,
  5216  		`	if err := validate.EnumCase(path, location, value, classicsItemsAdditionalItemsItems0TypeTitlePropEnum, true); err != nil {`,
  5217  		`func (m *ClassicsItemsAdditionalItemsItems0) validateTitle(formats strfmt.Registry) error {`,
  5218  		`	if swag.IsZero(m.Title) {`,
  5219  		`	if err := m.validateTitleEnum("title", "body", m.Title); err != nil {`,
  5220  	},
  5221  		// not expected
  5222  		todo,
  5223  		// output in log
  5224  		noLines,
  5225  		noLines)
  5226  
  5227  	// load expectations for model: comics_items1.go
  5228  	flattenRun.AddExpectations("comics_items1.go", []string{
  5229  		`type ComicsItems1 struct {`,
  5230  		"	Narrative *string `json:\"narrative\"`",
  5231  		`func (m *ComicsItems1) Validate(formats strfmt.Registry) error {`,
  5232  		`	if err := m.validateNarrative(formats); err != nil {`,
  5233  		`		return errors.CompositeValidationError(res...`,
  5234  		`func (m *ComicsItems1) validateNarrative(formats strfmt.Registry) error {`,
  5235  		`	if err := validate.Required("narrative", "body", m.Narrative); err != nil {`,
  5236  	},
  5237  		// not expected
  5238  		todo,
  5239  		// output in log
  5240  		noLines,
  5241  		noLines)
  5242  
  5243  	// load expectations for model: comics_items3.go
  5244  	flattenRun.AddExpectations("comics_items3.go", []string{
  5245  		`type ComicsItems3 struct {`,
  5246  		"	Author string `json:\"author,omitempty\"`",
  5247  		"	Character string `json:\"character,omitempty\"`",
  5248  		`func (m *ComicsItems3) Validate(formats strfmt.Registry) error {`,
  5249  		`	if err := m.validateAuthor(formats); err != nil {`,
  5250  		`	if err := m.validateCharacter(formats); err != nil {`,
  5251  		`		return errors.CompositeValidationError(res...`,
  5252  		`func (m *ComicsItems3) validateAuthor(formats strfmt.Registry) error {`,
  5253  		`	if swag.IsZero(m.Author) {`,
  5254  		`	if err := validate.MinLength("author", "body", m.Author, 1); err != nil {`,
  5255  		`func (m *ComicsItems3) validateCharacter(formats strfmt.Registry) error {`,
  5256  		`	if swag.IsZero(m.Character) {`,
  5257  		"	if err := validate.Pattern(\"character\", \"body\", m.Character, `^[A-Z]+$`); err != nil {",
  5258  	},
  5259  		// not expected
  5260  		todo,
  5261  		// output in log
  5262  		noLines,
  5263  		noLines)
  5264  
  5265  	// load expectations for model: classics_tuple_additional_items.go
  5266  	flattenRun.AddExpectations("classics_tuple_additional_items.go", []string{
  5267  		`type ClassicsTupleAdditionalItems struct {`,
  5268  		"	P0 *ClassicsItemsAdditionalItemsItems0 `json:\"-\"`",
  5269  		"	P1 []strfmt.Date `json:\"-\"`",
  5270  		"	P2 *ClassicsItemsAdditionalItemsItems2 `json:\"-\"`",
  5271  		"	P3 Comics `json:\"-\"`",
  5272  		`func (m *ClassicsTupleAdditionalItems) Validate(formats strfmt.Registry) error {`,
  5273  		`	if err := m.validateP0(formats); err != nil {`,
  5274  		`	if err := m.validateP1(formats); err != nil {`,
  5275  		`	if err := m.validateP2(formats); err != nil {`,
  5276  		`	if err := m.validateP3(formats); err != nil {`,
  5277  		`		return errors.CompositeValidationError(res...`,
  5278  		`func (m *ClassicsTupleAdditionalItems) validateP0(formats strfmt.Registry) error {`,
  5279  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  5280  		`	if m.P0 != nil {`,
  5281  		`		if err := m.P0.Validate(formats); err != nil {`,
  5282  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5283  		`				return ve.ValidateName("0"`,
  5284  		`func (m *ClassicsTupleAdditionalItems) validateP1(formats strfmt.Registry) error {`,
  5285  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  5286  		`	for i := 0; i < len(m.P1); i++ {`,
  5287  		`		if err := validate.FormatOf("1"+"."+strconv.Itoa(i), "body", "date", m.P1[i].String(), formats); err != nil {`,
  5288  		`func (m *ClassicsTupleAdditionalItems) validateP2(formats strfmt.Registry) error {`,
  5289  		`	if err := validate.Required("2", "body", m.P2); err != nil {`,
  5290  		`	if m.P2 != nil {`,
  5291  		`		if err := m.P2.Validate(formats); err != nil {`,
  5292  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5293  		`				return ve.ValidateName("2"`,
  5294  		`func (m *ClassicsTupleAdditionalItems) validateP3(formats strfmt.Registry) error {`,
  5295  		`	if err := m.P3.Validate(formats); err != nil {`,
  5296  		`		if ve, ok := err.(*errors.Validation); ok {`,
  5297  		`			return ve.ValidateName("3"`,
  5298  	},
  5299  		// not expected
  5300  		todo,
  5301  		// output in log
  5302  		noLines,
  5303  		noLines)
  5304  }
  5305  
  5306  func initFixture1198() {
  5307  	// testing ../fixtures/bugs/1487/fixture-1198.yaml with expand (--skip-flatten)
  5308  
  5309  	f := newModelFixture("../fixtures/bugs/1198/fixture-1198.yaml", "string-body-api")
  5310  	flattenRun := f.AddRun(false)
  5311  
  5312  	// load expectations for model: pet.go
  5313  	flattenRun.AddExpectations("pet.go", []string{
  5314  		`type Pet struct {`,
  5315  		"	Date interface{} `json:\"date\"`",
  5316  		`func (m *Pet) Validate(formats strfmt.Registry) error {`,
  5317  		`	if err := m.validateDate(formats); err != nil {`,
  5318  		`		return errors.CompositeValidationError(res...`,
  5319  		`func (m *Pet) validateDate(formats strfmt.Registry) error {`,
  5320  	},
  5321  		// not expected
  5322  		todo,
  5323  		// output in log
  5324  		noLines,
  5325  		noLines)
  5326  }
  5327  
  5328  func initFixture1042() {
  5329  	// testing ../fixtures/bugs/1487/fixture-1042.yaml with expand (--skip-flatten)
  5330  
  5331  	/* when the specification incorrectly defines the allOf,
  5332  	generated unmarshalling is wrong.
  5333  	This fixture asserts that with correct spec, the generated models are correct.
  5334  
  5335  	*/
  5336  
  5337  	f := newModelFixture("../fixtures/bugs/1042/fixture-1042.yaml", "allOf marshalling")
  5338  	flattenRun := f.AddRun(false)
  5339  
  5340  	// load expectations for model: b.go
  5341  	flattenRun.AddExpectations("b.go", []string{
  5342  		`type B struct {`,
  5343  		`	A`,
  5344  		`	BAllOf1`,
  5345  		`func (m *B) UnmarshalJSON(raw []byte) error {`,
  5346  		`	var aO0 A`,
  5347  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  5348  		`	m.A = aO0`,
  5349  		`	var aO1 BAllOf1`,
  5350  		`	if err := swag.ReadJSON(raw, &aO1); err != nil {`,
  5351  		`	m.BAllOf1 = aO1`,
  5352  		`func (m B) MarshalJSON() ([]byte, error) {`,
  5353  		// slight optimization of allocations
  5354  		`	_parts := make([][]byte, 0, 2)`,
  5355  		`	aO0, err := swag.WriteJSON(m.A`,
  5356  		`	if err != nil {`,
  5357  		`		return nil, err`,
  5358  		`	_parts = append(_parts, aO0`,
  5359  		`	aO1, err := swag.WriteJSON(m.BAllOf1`,
  5360  		`	if err != nil {`,
  5361  		`		return nil, err`,
  5362  		`	_parts = append(_parts, aO1`,
  5363  		`	return swag.ConcatJSON(_parts...), nil`,
  5364  		`func (m *B) Validate(formats strfmt.Registry) error {`,
  5365  		`	if err := m.A.Validate(formats); err != nil {`,
  5366  		`	if err := m.BAllOf1.Validate(formats); err != nil {`,
  5367  		`		return errors.CompositeValidationError(res...`,
  5368  	},
  5369  		// not expected
  5370  		todo,
  5371  		// output in log
  5372  		noLines,
  5373  		noLines)
  5374  
  5375  	// load expectations for model: b_all_of1.go
  5376  	flattenRun.AddExpectations("b_all_of1.go", []string{
  5377  		`type BAllOf1 struct {`,
  5378  		"	F3 *string `json:\"f3\"`",
  5379  		"	F4 []string `json:\"f4\"`",
  5380  		`func (m *BAllOf1) Validate(formats strfmt.Registry) error {`,
  5381  		`	if err := m.validateF3(formats); err != nil {`,
  5382  		`	if err := m.validateF4(formats); err != nil {`,
  5383  		`		return errors.CompositeValidationError(res...`,
  5384  		`func (m *BAllOf1) validateF3(formats strfmt.Registry) error {`,
  5385  		`	if err := validate.Required("f3", "body", m.F3); err != nil {`,
  5386  		`func (m *BAllOf1) validateF4(formats strfmt.Registry) error {`,
  5387  		`	if err := validate.Required("f4", "body", m.F4); err != nil {`,
  5388  	},
  5389  		// not expected
  5390  		todo,
  5391  		// output in log
  5392  		noLines,
  5393  		noLines)
  5394  
  5395  	// load expectations for model: a.go
  5396  	flattenRun.AddExpectations("a.go", []string{
  5397  		`type A struct {`,
  5398  		"	F1 string `json:\"f1,omitempty\"`",
  5399  		"	F2 string `json:\"f2,omitempty\"`",
  5400  		// empty validation
  5401  		"func (m *A) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  5402  	},
  5403  		// not expected
  5404  		todo,
  5405  		// output in log
  5406  		noLines,
  5407  		noLines)
  5408  }
  5409  
  5410  func initFixture1042V2() {
  5411  	// testing ../fixtures/bugs/1487/fixture-1042-2.yaml with expand (--skip-flatten)
  5412  
  5413  	/* when the specification incorrectly defines the allOf,
  5414  	generated unmarshalling is wrong.
  5415  	This fixture asserts that with correct spec, the generated models are correct.
  5416  
  5417  	*/
  5418  
  5419  	f := newModelFixture("../fixtures/bugs/1042/fixture-1042-2.yaml", "allOf marshalling")
  5420  	flattenRun := f.AddRun(false)
  5421  
  5422  	// load expectations for model: error_model.go
  5423  	flattenRun.AddExpectations("error_model.go", []string{
  5424  		`type ErrorModel struct {`,
  5425  		"	Code *int64 `json:\"code\"`",
  5426  		"	Message *string `json:\"message\"`",
  5427  		`func (m *ErrorModel) Validate(formats strfmt.Registry) error {`,
  5428  		`	if err := m.validateCode(formats); err != nil {`,
  5429  		`	if err := m.validateMessage(formats); err != nil {`,
  5430  		`		return errors.CompositeValidationError(res...`,
  5431  		`func (m *ErrorModel) validateCode(formats strfmt.Registry) error {`,
  5432  		`	if err := validate.Required("code", "body", m.Code); err != nil {`,
  5433  		`	if err := validate.MinimumInt("code", "body", *m.Code, 100, false); err != nil {`,
  5434  		`	if err := validate.MaximumInt("code", "body", *m.Code, 600, false); err != nil {`,
  5435  		`func (m *ErrorModel) validateMessage(formats strfmt.Registry) error {`,
  5436  		`	if err := validate.Required("message", "body", m.Message); err != nil {`,
  5437  	},
  5438  		// not expected
  5439  		todo,
  5440  		// output in log
  5441  		noLines,
  5442  		noLines)
  5443  
  5444  	// load expectations for model: extended_error_model.go
  5445  	flattenRun.AddExpectations("extended_error_model.go", []string{
  5446  		`type ExtendedErrorModel struct {`,
  5447  		`	ErrorModel`,
  5448  		`	ExtendedErrorModelAllOf1`,
  5449  		`func (m *ExtendedErrorModel) UnmarshalJSON(raw []byte) error {`,
  5450  		`	var aO0 ErrorModel`,
  5451  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  5452  		`	m.ErrorModel = aO0`,
  5453  		`	var aO1 ExtendedErrorModelAllOf1`,
  5454  		`	if err := swag.ReadJSON(raw, &aO1); err != nil {`,
  5455  		`	m.ExtendedErrorModelAllOf1 = aO1`,
  5456  		`func (m ExtendedErrorModel) MarshalJSON() ([]byte, error) {`,
  5457  		// slight optimization of allocations
  5458  		`	_parts := make([][]byte, 0, 2)`,
  5459  		`	aO0, err := swag.WriteJSON(m.ErrorModel`,
  5460  		`	if err != nil {`,
  5461  		`		return nil, err`,
  5462  		`	_parts = append(_parts, aO0`,
  5463  		`	aO1, err := swag.WriteJSON(m.ExtendedErrorModelAllOf1`,
  5464  		`	if err != nil {`,
  5465  		`		return nil, err`,
  5466  		`	_parts = append(_parts, aO1`,
  5467  		`	return swag.ConcatJSON(_parts...), nil`,
  5468  		`func (m *ExtendedErrorModel) Validate(formats strfmt.Registry) error {`,
  5469  		`	if err := m.ErrorModel.Validate(formats); err != nil {`,
  5470  		`	if err := m.ExtendedErrorModelAllOf1.Validate(formats); err != nil {`,
  5471  		`		return errors.CompositeValidationError(res...`,
  5472  	},
  5473  		// not expected
  5474  		todo,
  5475  		// output in log
  5476  		noLines,
  5477  		noLines)
  5478  
  5479  	// load expectations for model: extended_error_model_all_of1.go
  5480  	flattenRun.AddExpectations("extended_error_model_all_of1.go", []string{
  5481  		`type ExtendedErrorModelAllOf1 struct {`,
  5482  		"	RootCause *string `json:\"rootCause\"`",
  5483  		`func (m *ExtendedErrorModelAllOf1) Validate(formats strfmt.Registry) error {`,
  5484  		`	if err := m.validateRootCause(formats); err != nil {`,
  5485  		`		return errors.CompositeValidationError(res...`,
  5486  		`func (m *ExtendedErrorModelAllOf1) validateRootCause(formats strfmt.Registry) error {`,
  5487  		`	if err := validate.Required("rootCause", "body", m.RootCause); err != nil {`,
  5488  	},
  5489  		// not expected
  5490  		todo,
  5491  		// output in log
  5492  		noLines,
  5493  		noLines)
  5494  }
  5495  
  5496  func initFixture979() {
  5497  	// testing ../fixtures/bugs/1487/fixture-979.yaml with expand (--skip-flatten)
  5498  
  5499  	/* checking that properties is enough to figure out an object schema
  5500  	 */
  5501  
  5502  	f := newModelFixture("../fixtures/bugs/979/fixture-979.yaml", "allOf without the explicit type object")
  5503  	flattenRun := f.AddRun(false)
  5504  
  5505  	// load expectations for model: cluster.go
  5506  	flattenRun.AddExpectations("cluster.go", []string{
  5507  		`type Cluster struct {`,
  5508  		`	NewCluster`,
  5509  		`	ClusterAllOf1`,
  5510  		`func (m *Cluster) UnmarshalJSON(raw []byte) error {`,
  5511  		`	var aO0 NewCluster`,
  5512  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  5513  		`	m.NewCluster = aO0`,
  5514  		`	var aO1 ClusterAllOf1`,
  5515  		`	if err := swag.ReadJSON(raw, &aO1); err != nil {`,
  5516  		`	m.ClusterAllOf1 = aO1`,
  5517  		`func (m Cluster) MarshalJSON() ([]byte, error) {`,
  5518  		// slight optimization of allocations
  5519  		`	_parts := make([][]byte, 0, 2)`,
  5520  		`	aO0, err := swag.WriteJSON(m.NewCluster`,
  5521  		`	if err != nil {`,
  5522  		`		return nil, err`,
  5523  		`	_parts = append(_parts, aO0`,
  5524  		`	aO1, err := swag.WriteJSON(m.ClusterAllOf1`,
  5525  		`	if err != nil {`,
  5526  		`		return nil, err`,
  5527  		`	_parts = append(_parts, aO1`,
  5528  		`	return swag.ConcatJSON(_parts...), nil`,
  5529  		`func (m *Cluster) Validate(formats strfmt.Registry) error {`,
  5530  		`	if err := m.NewCluster.Validate(formats); err != nil {`,
  5531  		`	if err := m.ClusterAllOf1.Validate(formats); err != nil {`,
  5532  		`		return errors.CompositeValidationError(res...`,
  5533  	},
  5534  		// not expected
  5535  		todo,
  5536  		// output in log
  5537  		noLines,
  5538  		noLines)
  5539  
  5540  	// load expectations for model: new_cluster.go
  5541  	flattenRun.AddExpectations("new_cluster.go", []string{
  5542  		`type NewCluster struct {`,
  5543  		"	DummyProp1 int64 `json:\"dummyProp1,omitempty\"`",
  5544  		// empty validation
  5545  		"func (m *NewCluster) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  5546  	},
  5547  		// not expected
  5548  		todo,
  5549  		// output in log
  5550  		noLines,
  5551  		noLines)
  5552  
  5553  	// load expectations for model: cluster_all_of1.go
  5554  	flattenRun.AddExpectations("cluster_all_of1.go", []string{
  5555  		`type ClusterAllOf1 struct {`,
  5556  		"	Result string `json:\"result,omitempty\"`",
  5557  		"	Status string `json:\"status,omitempty\"`",
  5558  		// empty validation
  5559  		"func (m *ClusterAllOf1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  5560  	},
  5561  		// not expected
  5562  		todo,
  5563  		// output in log
  5564  		noLines,
  5565  		noLines)
  5566  }
  5567  
  5568  func initFixture842() {
  5569  	// testing ../fixtures/bugs/1487/fixture-842.yaml with expand (--skip-flatten)
  5570  
  5571  	/* codegen fails to produce code that builds
  5572  	 */
  5573  
  5574  	f := newModelFixture("../fixtures/bugs/842/fixture-842.yaml", "polymorphic type containing an array of the base type")
  5575  	flattenRun := f.AddRun(false)
  5576  
  5577  	// load expectations for model: value_array_all_of1.go
  5578  	flattenRun.AddExpectations("value_array_all_of1.go", []string{
  5579  		`type ValueArrayAllOf1 struct {`,
  5580  		`	valuesField []Value`,
  5581  		`func (m *ValueArrayAllOf1) Values() []Value {`,
  5582  		`	return m.valuesField`,
  5583  		`func (m *ValueArrayAllOf1) SetValues(val []Value) {`,
  5584  		`	m.valuesField = val`,
  5585  		`func (m *ValueArrayAllOf1) Validate(formats strfmt.Registry) error {`,
  5586  		`	if err := m.validateValues(formats); err != nil {`,
  5587  		`		return errors.CompositeValidationError(res...`,
  5588  		`func (m *ValueArrayAllOf1) validateValues(formats strfmt.Registry) error {`,
  5589  		`	if err := validate.Required("Values", "body", m.Values()); err != nil {`,
  5590  		`	for i := 0; i < len(m.Values()); i++ {`,
  5591  		`		if err := m.valuesField[i].Validate(formats); err != nil {`,
  5592  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5593  		`				return ve.ValidateName("Values" + "." + strconv.Itoa(i)`,
  5594  	},
  5595  		// not expected
  5596  		todo,
  5597  		// output in log
  5598  		noLines,
  5599  		noLines)
  5600  
  5601  	// load expectations for model: value_array.go
  5602  	flattenRun.AddExpectations("value_array.go", []string{
  5603  		`type ValueArray struct {`,
  5604  		`	ValueArrayAllOf1`,
  5605  		`func (m *ValueArray) ValueType() string {`,
  5606  		`	return "ValueArray"`,
  5607  		`func (m *ValueArray) SetValueType(val string) {`,
  5608  		`func (m *ValueArray) Validate(formats strfmt.Registry) error {`,
  5609  		`	if err := m.ValueArrayAllOf1.Validate(formats); err != nil {`,
  5610  		`		return errors.CompositeValidationError(res...`,
  5611  	},
  5612  		// not expected
  5613  		todo,
  5614  		// output in log
  5615  		noLines,
  5616  		noLines)
  5617  
  5618  	// load expectations for model: value.go
  5619  	flattenRun.AddExpectations("value.go", []string{
  5620  		`type Value interface {`,
  5621  		`	runtime.Validatable`,
  5622  		`	ValueType() string`,
  5623  		`	SetValueType(string`,
  5624  		`type value struct {`,
  5625  		`	valueTypeField string`,
  5626  		`func (m *value) ValueType() string {`,
  5627  		`	return "Value"`,
  5628  		`func (m *value) SetValueType(val string) {`,
  5629  		`func UnmarshalValueSlice(reader io.Reader, consumer runtime.Consumer) ([]Value, error) {`,
  5630  		`	var elements []json.RawMessage`,
  5631  		`	if err := consumer.Consume(reader, &elements); err != nil {`,
  5632  		`		return nil, err`,
  5633  		`	var result []Value`,
  5634  		`	for _, element := range elements {`,
  5635  		`		obj, err := unmarshalValue(element, consumer`,
  5636  		`		if err != nil {`,
  5637  		`			return nil, err`,
  5638  		`		result = append(result, obj`,
  5639  		`	return result, nil`,
  5640  		`func UnmarshalValue(reader io.Reader, consumer runtime.Consumer) (Value, error) {`,
  5641  		`	data, err := io.ReadAll(reader`,
  5642  		`	if err != nil {`,
  5643  		`		return nil, err`,
  5644  		`	return unmarshalValue(data, consumer`,
  5645  		`func unmarshalValue(data []byte, consumer runtime.Consumer) (Value, error) {`,
  5646  		`	buf := bytes.NewBuffer(data`,
  5647  		`	buf2 := bytes.NewBuffer(data`,
  5648  		`	var getType struct {`,
  5649  		"		ValueType string `json:\"ValueType\"`",
  5650  		`	if err := consumer.Consume(buf, &getType); err != nil {`,
  5651  		`		return nil, err`,
  5652  		`	if err := validate.RequiredString("ValueType", "body", getType.ValueType); err != nil {`,
  5653  		`		return nil, err`,
  5654  		`	switch getType.ValueType {`,
  5655  		`	case "Value":`,
  5656  		`		var result value`,
  5657  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  5658  		`			return nil, err`,
  5659  		`		return &result, nil`,
  5660  		`	case "ValueArray":`,
  5661  		`		var result ValueArray`,
  5662  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  5663  		`			return nil, err`,
  5664  		`		return &result, nil`,
  5665  		`	return nil, errors.New(422, "invalid ValueType value: %q", getType.ValueType`,
  5666  		// empty validation
  5667  		"func (m *value) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  5668  	},
  5669  		// not expected
  5670  		todo,
  5671  		// output in log
  5672  		noLines,
  5673  		noLines)
  5674  }
  5675  
  5676  func initFixture607() {
  5677  	// testing ../fixtures/bugs/1487/fixture-607.yaml with expand (--skip-flatten)
  5678  
  5679  	/* broken code produced on polymorphic type
  5680  	 */
  5681  
  5682  	f := newModelFixture("../fixtures/bugs/607/fixture-607.yaml", "broken code when using array of polymorphic type")
  5683  	flattenRun := f.AddRun(false)
  5684  
  5685  	// load expectations for model: range_filter_all_of1.go
  5686  	flattenRun.AddExpectations("range_filter_all_of1.go", []string{
  5687  		`type RangeFilterAllOf1 struct {`,
  5688  		"	Config *RangeFilterAllOf1Config `json:\"config\"`",
  5689  		`func (m *RangeFilterAllOf1) Validate(formats strfmt.Registry) error {`,
  5690  		`	if err := m.validateConfig(formats); err != nil {`,
  5691  		`		return errors.CompositeValidationError(res...`,
  5692  		`func (m *RangeFilterAllOf1) validateConfig(formats strfmt.Registry) error {`,
  5693  		`	if err := validate.Required("config", "body", m.Config); err != nil {`,
  5694  		`	if m.Config != nil {`,
  5695  		`		if err := m.Config.Validate(formats); err != nil {`,
  5696  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5697  		`				return ve.ValidateName("config"`,
  5698  	},
  5699  		// not expected
  5700  		todo,
  5701  		// output in log
  5702  		noLines,
  5703  		noLines)
  5704  
  5705  	// load expectations for model: filter.go
  5706  	flattenRun.AddExpectations("filter.go", []string{
  5707  		`type Filter interface {`,
  5708  		`	runtime.Validatable`,
  5709  		`	Type() string`,
  5710  		`	SetType(string`,
  5711  		`type filter struct {`,
  5712  		`	typeField string`,
  5713  		`func (m *filter) Type() string {`,
  5714  		`	return "Filter"`,
  5715  		`func (m *filter) SetType(val string) {`,
  5716  		`func UnmarshalFilterSlice(reader io.Reader, consumer runtime.Consumer) ([]Filter, error) {`,
  5717  		`	var elements []json.RawMessage`,
  5718  		`	if err := consumer.Consume(reader, &elements); err != nil {`,
  5719  		`		return nil, err`,
  5720  		`	var result []Filter`,
  5721  		`	for _, element := range elements {`,
  5722  		`		obj, err := unmarshalFilter(element, consumer`,
  5723  		`		if err != nil {`,
  5724  		`			return nil, err`,
  5725  		`		result = append(result, obj`,
  5726  		`	return result, nil`,
  5727  		`func UnmarshalFilter(reader io.Reader, consumer runtime.Consumer) (Filter, error) {`,
  5728  		`	data, err := io.ReadAll(reader`,
  5729  		`	if err != nil {`,
  5730  		`		return nil, err`,
  5731  		`	return unmarshalFilter(data, consumer`,
  5732  		`func unmarshalFilter(data []byte, consumer runtime.Consumer) (Filter, error) {`,
  5733  		`	buf := bytes.NewBuffer(data`,
  5734  		`	buf2 := bytes.NewBuffer(data`,
  5735  		`	var getType struct {`,
  5736  		"		Type string `json:\"type\"`",
  5737  		`	if err := consumer.Consume(buf, &getType); err != nil {`,
  5738  		`		return nil, err`,
  5739  		`	if err := validate.RequiredString("type", "body", getType.Type); err != nil {`,
  5740  		`		return nil, err`,
  5741  		`	switch getType.Type {`,
  5742  		`	case "AndFilter":`,
  5743  		`		var result AndFilter`,
  5744  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  5745  		`			return nil, err`,
  5746  		`		return &result, nil`,
  5747  		`	case "Filter":`,
  5748  		`		var result filter`,
  5749  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  5750  		`			return nil, err`,
  5751  		`		return &result, nil`,
  5752  		`	case "RangeFilter":`,
  5753  		`		var result RangeFilter`,
  5754  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  5755  		`			return nil, err`,
  5756  		`		return &result, nil`,
  5757  		`	return nil, errors.New(422, "invalid type value: %q", getType.Type`,
  5758  		// empty validation
  5759  		"func (m *filter) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  5760  	},
  5761  		// not expected
  5762  		todo,
  5763  		// output in log
  5764  		noLines,
  5765  		noLines)
  5766  
  5767  	// load expectations for model: and_filter_all_of1.go
  5768  	flattenRun.AddExpectations("and_filter_all_of1.go", []string{
  5769  		`type AndFilterAllOf1 struct {`,
  5770  		`	configField []Filter`,
  5771  		`func (m *AndFilterAllOf1) Config() []Filter {`,
  5772  		`	return m.configField`,
  5773  		`func (m *AndFilterAllOf1) SetConfig(val []Filter) {`,
  5774  		`	m.configField = val`,
  5775  		`func (m *AndFilterAllOf1) UnmarshalJSON(raw []byte) error {`,
  5776  		`	var data struct {`,
  5777  		"		Config json.RawMessage `json:\"config\"`",
  5778  		`	buf := bytes.NewBuffer(raw`,
  5779  		`	dec := json.NewDecoder(buf`,
  5780  		`	dec.UseNumber(`,
  5781  		`	if err := dec.Decode(&data); err != nil {`,
  5782  		`	propConfig, err := UnmarshalFilterSlice(bytes.NewBuffer(data.Config), runtime.JSONConsumer()`,
  5783  		`	if err != nil && err != io.EOF {`,
  5784  		`	var result AndFilterAllOf1`,
  5785  		`	result.configField = propConfig`,
  5786  		`	*m = result`,
  5787  		`func (m AndFilterAllOf1) MarshalJSON() ([]byte, error) {`,
  5788  		`	var b1, b2, b3 []byte`,
  5789  		`	var err error`,
  5790  		`	b1, err = json.Marshal(struct {`,
  5791  		`	}{})`,
  5792  		`	if err != nil {`,
  5793  		`		return nil, err`,
  5794  		`	b2, err = json.Marshal(struct {`,
  5795  		"		Config []Filter `json:\"config\"`",
  5796  		`	}{`,
  5797  		`		Config: m.configField,`,
  5798  		`	})`,
  5799  		`	if err != nil {`,
  5800  		`		return nil, err`,
  5801  		`	return swag.ConcatJSON(b1, b2, b3), nil`,
  5802  		`func (m *AndFilterAllOf1) Validate(formats strfmt.Registry) error {`,
  5803  		`	if err := m.validateConfig(formats); err != nil {`,
  5804  		`		return errors.CompositeValidationError(res...`,
  5805  		`func (m *AndFilterAllOf1) validateConfig(formats strfmt.Registry) error {`,
  5806  		`	if err := validate.Required("config", "body", m.Config()); err != nil {`,
  5807  		`	for i := 0; i < len(m.Config()); i++ {`,
  5808  		`		if err := m.configField[i].Validate(formats); err != nil {`,
  5809  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5810  		`				return ve.ValidateName("config" + "." + strconv.Itoa(i)`,
  5811  	},
  5812  		// not expected
  5813  		todo,
  5814  		// output in log
  5815  		noLines,
  5816  		noLines)
  5817  
  5818  	// load expectations for model: and_filter.go
  5819  	flattenRun.AddExpectations("and_filter.go", []string{
  5820  		`type AndFilter struct {`,
  5821  		`	AndFilterAllOf1`,
  5822  		`func (m *AndFilter) Type() string {`,
  5823  		`	return "AndFilter"`,
  5824  		`func (m *AndFilter) SetType(val string) {`,
  5825  		`func (m *AndFilter) UnmarshalJSON(raw []byte) error {`,
  5826  		`	var data struct {`,
  5827  		`		AndFilterAllOf1`,
  5828  		`	buf := bytes.NewBuffer(raw`,
  5829  		`	dec := json.NewDecoder(buf`,
  5830  		`	dec.UseNumber(`,
  5831  		`	if err := dec.Decode(&data); err != nil {`,
  5832  		`	var base struct {`,
  5833  		"		Type string `json:\"type\"`",
  5834  		`	buf = bytes.NewBuffer(raw`,
  5835  		`	dec = json.NewDecoder(buf`,
  5836  		`	dec.UseNumber(`,
  5837  		`	if err := dec.Decode(&base); err != nil {`,
  5838  		`	var result AndFilter`,
  5839  		`	if base.Type != result.Type() {`,
  5840  		`		return errors.New(422, "invalid type value: %q", base.Type`,
  5841  		`	result.AndFilterAllOf1 = data.AndFilterAllOf1`,
  5842  		`	*m = result`,
  5843  		`func (m AndFilter) MarshalJSON() ([]byte, error) {`,
  5844  		`	var b1, b2, b3 []byte`,
  5845  		`	var err error`,
  5846  		`	b1, err = json.Marshal(struct {`,
  5847  		`		AndFilterAllOf1`,
  5848  		`	}{`,
  5849  		`		AndFilterAllOf1: m.AndFilterAllOf1,`,
  5850  		`	})`,
  5851  		`	if err != nil {`,
  5852  		`		return nil, err`,
  5853  		`	b2, err = json.Marshal(struct {`,
  5854  		"		Type string `json:\"type\"`",
  5855  		`	}{`,
  5856  		`		Type: m.Type(),`,
  5857  		`	})`,
  5858  		`	if err != nil {`,
  5859  		`		return nil, err`,
  5860  		`	return swag.ConcatJSON(b1, b2, b3), nil`,
  5861  		`func (m *AndFilter) Validate(formats strfmt.Registry) error {`,
  5862  		`	if err := m.AndFilterAllOf1.Validate(formats); err != nil {`,
  5863  		`		return errors.CompositeValidationError(res...`,
  5864  	},
  5865  		// not expected
  5866  		todo,
  5867  		// output in log
  5868  		noLines,
  5869  		noLines)
  5870  
  5871  	// load expectations for model: range_filter.go
  5872  	flattenRun.AddExpectations("range_filter.go", []string{
  5873  		`type RangeFilter struct {`,
  5874  		`	RangeFilterAllOf1`,
  5875  		`func (m *RangeFilter) Type() string {`,
  5876  		`	return "RangeFilter"`,
  5877  		`func (m *RangeFilter) SetType(val string) {`,
  5878  		`func (m *RangeFilter) UnmarshalJSON(raw []byte) error {`,
  5879  		`	var data struct {`,
  5880  		`		RangeFilterAllOf1`,
  5881  		`	buf := bytes.NewBuffer(raw`,
  5882  		`	dec := json.NewDecoder(buf`,
  5883  		`	dec.UseNumber(`,
  5884  		`	if err := dec.Decode(&data); err != nil {`,
  5885  		`	var base struct {`,
  5886  		"		Type string `json:\"type\"`",
  5887  		`	buf = bytes.NewBuffer(raw`,
  5888  		`	dec = json.NewDecoder(buf`,
  5889  		`	dec.UseNumber(`,
  5890  		`	if err := dec.Decode(&base); err != nil {`,
  5891  		`	var result RangeFilter`,
  5892  		`	if base.Type != result.Type() {`,
  5893  		`		return errors.New(422, "invalid type value: %q", base.Type`,
  5894  		`	result.RangeFilterAllOf1 = data.RangeFilterAllOf1`,
  5895  		`	*m = result`,
  5896  		`func (m RangeFilter) MarshalJSON() ([]byte, error) {`,
  5897  		`	var b1, b2, b3 []byte`,
  5898  		`	var err error`,
  5899  		`	b1, err = json.Marshal(struct {`,
  5900  		`		RangeFilterAllOf1`,
  5901  		`	}{`,
  5902  		`		RangeFilterAllOf1: m.RangeFilterAllOf1,`,
  5903  		`	})`,
  5904  		`	if err != nil {`,
  5905  		`		return nil, err`,
  5906  		`	b2, err = json.Marshal(struct {`,
  5907  		"		Type string `json:\"type\"`",
  5908  		`	}{`,
  5909  		`		Type: m.Type(),`,
  5910  		`	})`,
  5911  		`	if err != nil {`,
  5912  		`		return nil, err`,
  5913  		`	return swag.ConcatJSON(b1, b2, b3), nil`,
  5914  		`func (m *RangeFilter) Validate(formats strfmt.Registry) error {`,
  5915  		`	if err := m.RangeFilterAllOf1.Validate(formats); err != nil {`,
  5916  		`		return errors.CompositeValidationError(res...`,
  5917  	},
  5918  		// not expected
  5919  		todo,
  5920  		// output in log
  5921  		noLines,
  5922  		noLines)
  5923  
  5924  	// load expectations for model: range_filter_all_of1_config.go
  5925  	flattenRun.AddExpectations("range_filter_all_of1_config.go", []string{
  5926  		`type RangeFilterAllOf1Config struct {`,
  5927  		"	Gt float64 `json:\"gt,omitempty\"`",
  5928  		"	Gte float64 `json:\"gte,omitempty\"`",
  5929  		"	Lt float64 `json:\"lt,omitempty\"`",
  5930  		"	Lte float64 `json:\"lte,omitempty\"`",
  5931  		// empty validation
  5932  		"func (m *RangeFilterAllOf1Config) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  5933  	},
  5934  		// not expected
  5935  		todo,
  5936  		// output in log
  5937  		noLines,
  5938  		noLines)
  5939  }
  5940  
  5941  func initFixture1336() {
  5942  	// testing ../fixtures/bugs/1487/fixture-1336.yaml with expand (--skip-flatten)
  5943  
  5944  	/* broken code produced on polymorphic type
  5945  	 */
  5946  
  5947  	f := newModelFixture("../fixtures/bugs/1336/fixture-1336.yaml", "broken code when using array of polymorphic type")
  5948  	flattenRun := f.AddRun(false)
  5949  
  5950  	// load expectations for model: node.go
  5951  	flattenRun.AddExpectations("node.go", []string{
  5952  		`type Node interface {`,
  5953  		`	runtime.Validatable`,
  5954  		`	NodeType() string`,
  5955  		`	SetNodeType(string`,
  5956  		`type node struct {`,
  5957  		`	nodeTypeField string`,
  5958  		`func (m *node) NodeType() string {`,
  5959  		`	return "Node"`,
  5960  		`func (m *node) SetNodeType(val string) {`,
  5961  		`func UnmarshalNodeSlice(reader io.Reader, consumer runtime.Consumer) ([]Node, error) {`,
  5962  		`	var elements []json.RawMessage`,
  5963  		`	if err := consumer.Consume(reader, &elements); err != nil {`,
  5964  		`		return nil, err`,
  5965  		`	var result []Node`,
  5966  		`	for _, element := range elements {`,
  5967  		`		obj, err := unmarshalNode(element, consumer`,
  5968  		`		if err != nil {`,
  5969  		`			return nil, err`,
  5970  		`		result = append(result, obj`,
  5971  		`	return result, nil`,
  5972  		`func UnmarshalNode(reader io.Reader, consumer runtime.Consumer) (Node, error) {`,
  5973  		`	data, err := io.ReadAll(reader`,
  5974  		`	if err != nil {`,
  5975  		`		return nil, err`,
  5976  		`	return unmarshalNode(data, consumer`,
  5977  		`func unmarshalNode(data []byte, consumer runtime.Consumer) (Node, error) {`,
  5978  		`	buf := bytes.NewBuffer(data`,
  5979  		`	buf2 := bytes.NewBuffer(data`,
  5980  		`	var getType struct {`,
  5981  		"		NodeType string `json:\"NodeType\"`",
  5982  		`	if err := consumer.Consume(buf, &getType); err != nil {`,
  5983  		`		return nil, err`,
  5984  		`	if err := validate.RequiredString("NodeType", "body", getType.NodeType); err != nil {`,
  5985  		`		return nil, err`,
  5986  		`	switch getType.NodeType {`,
  5987  		`	case "CodeBlockNode":`,
  5988  		`		var result CodeBlockNode`,
  5989  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  5990  		`			return nil, err`,
  5991  		`		return &result, nil`,
  5992  		`	case "DocBlockNode":`,
  5993  		`		var result DocBlockNode`,
  5994  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  5995  		`			return nil, err`,
  5996  		`		return &result, nil`,
  5997  		`	case "Node":`,
  5998  		`		var result node`,
  5999  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  6000  		`			return nil, err`,
  6001  		`		return &result, nil`,
  6002  		`	return nil, errors.New(422, "invalid NodeType value: %q", getType.NodeType`,
  6003  		// empty validation
  6004  		"func (m *node) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  6005  	},
  6006  		// not expected
  6007  		todo,
  6008  		// output in log
  6009  		noLines,
  6010  		noLines)
  6011  
  6012  	// load expectations for model: code_block_node_all_of1.go
  6013  	flattenRun.AddExpectations("code_block_node_all_of1.go", []string{
  6014  		`type CodeBlockNodeAllOf1 struct {`,
  6015  		"	Code string `json:\"Code,omitempty\"`",
  6016  		// empty validation
  6017  		"func (m *CodeBlockNodeAllOf1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  6018  	},
  6019  		// not expected
  6020  		todo,
  6021  		// output in log
  6022  		noLines,
  6023  		noLines)
  6024  
  6025  	// load expectations for model: graph.go
  6026  	flattenRun.AddExpectations("graph.go", []string{
  6027  		`type Graph struct {`,
  6028  		`	nodesField []Node`,
  6029  		`func (m *Graph) Nodes() []Node {`,
  6030  		`	return m.nodesField`,
  6031  		`func (m *Graph) SetNodes(val []Node) {`,
  6032  		`	m.nodesField = val`,
  6033  		`func (m *Graph) UnmarshalJSON(raw []byte) error {`,
  6034  		`	var data struct {`,
  6035  		"		Nodes json.RawMessage `json:\"Nodes\"`",
  6036  		`	buf := bytes.NewBuffer(raw`,
  6037  		`	dec := json.NewDecoder(buf`,
  6038  		`	dec.UseNumber(`,
  6039  		`	if err := dec.Decode(&data); err != nil {`,
  6040  		`		nodes, err := UnmarshalNodeSlice(bytes.NewBuffer(data.Nodes), runtime.JSONConsumer()`,
  6041  		`	if err != nil && err != io.EOF {`,
  6042  		`	var result Graph`,
  6043  		`	result.nodesField = propNodes`,
  6044  		`	*m = result`,
  6045  		`func (m Graph) MarshalJSON() ([]byte, error) {`,
  6046  		`	var b1, b2, b3 []byte`,
  6047  		`	var err error`,
  6048  		`	b1, err = json.Marshal(struct {`,
  6049  		`	}{})`,
  6050  		`	if err != nil {`,
  6051  		`		return nil, err`,
  6052  		`	b2, err = json.Marshal(struct {`,
  6053  		"		Nodes []Node `json:\"Nodes\"`",
  6054  		`	}{`,
  6055  		`		Nodes: m.nodesField,`,
  6056  		`	})`,
  6057  		`	if err != nil {`,
  6058  		`		return nil, err`,
  6059  		`	return swag.ConcatJSON(b1, b2, b3), nil`,
  6060  		`func (m *Graph) Validate(formats strfmt.Registry) error {`,
  6061  		`		return errors.CompositeValidationError(res...`,
  6062  	},
  6063  		// not expected
  6064  		todo,
  6065  		// output in log
  6066  		noLines,
  6067  		noLines)
  6068  
  6069  	// load expectations for model: doc_block_node_all_of1.go
  6070  	flattenRun.AddExpectations("doc_block_node_all_of1.go", []string{
  6071  		`type DocBlockNodeAllOf1 struct {`,
  6072  		"	Doc string `json:\"Doc,omitempty\"`",
  6073  		// empty validation
  6074  		"func (m *DocBlockNodeAllOf1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  6075  	},
  6076  		// not expected
  6077  		todo,
  6078  		// output in log
  6079  		noLines,
  6080  		noLines)
  6081  
  6082  	// load expectations for model: doc_block_node.go
  6083  	flattenRun.AddExpectations("doc_block_node.go", []string{
  6084  		`type DocBlockNode struct {`,
  6085  		`	DocBlockNodeAllOf1`,
  6086  		`func (m *DocBlockNode) NodeType() string {`,
  6087  		`	return "DocBlockNode"`,
  6088  		`func (m *DocBlockNode) SetNodeType(val string) {`,
  6089  		`func (m *DocBlockNode) UnmarshalJSON(raw []byte) error {`,
  6090  		`	var data struct {`,
  6091  		`		DocBlockNodeAllOf1`,
  6092  		`	buf := bytes.NewBuffer(raw`,
  6093  		`	dec := json.NewDecoder(buf`,
  6094  		`	dec.UseNumber(`,
  6095  		`	if err := dec.Decode(&data); err != nil {`,
  6096  		`	var base struct {`,
  6097  		"		NodeType string `json:\"NodeType\"`",
  6098  		`	buf = bytes.NewBuffer(raw`,
  6099  		`	dec = json.NewDecoder(buf`,
  6100  		`	dec.UseNumber(`,
  6101  		`	if err := dec.Decode(&base); err != nil {`,
  6102  		`	var result DocBlockNode`,
  6103  		`	if base.NodeType != result.NodeType() {`,
  6104  		`		return errors.New(422, "invalid NodeType value: %q", base.NodeType`,
  6105  		`	result.DocBlockNodeAllOf1 = data.DocBlockNodeAllOf1`,
  6106  		`	*m = result`,
  6107  		`func (m DocBlockNode) MarshalJSON() ([]byte, error) {`,
  6108  		`	var b1, b2, b3 []byte`,
  6109  		`	var err error`,
  6110  		`	b1, err = json.Marshal(struct {`,
  6111  		`		DocBlockNodeAllOf1`,
  6112  		`	}{`,
  6113  		`		DocBlockNodeAllOf1: m.DocBlockNodeAllOf1,`,
  6114  		`	})`,
  6115  		`	if err != nil {`,
  6116  		`		return nil, err`,
  6117  		`	b2, err = json.Marshal(struct {`,
  6118  		"		NodeType string `json:\"NodeType\"`",
  6119  		`	}{`,
  6120  		`		NodeType: m.NodeType(),`,
  6121  		`	})`,
  6122  		`	if err != nil {`,
  6123  		`		return nil, err`,
  6124  		`	return swag.ConcatJSON(b1, b2, b3), nil`,
  6125  		`func (m *DocBlockNode) Validate(formats strfmt.Registry) error {`,
  6126  		`	if err := m.DocBlockNodeAllOf1.Validate(formats); err != nil {`,
  6127  		`		return errors.CompositeValidationError(res...`,
  6128  	},
  6129  		// not expected
  6130  		todo,
  6131  		// output in log
  6132  		noLines,
  6133  		noLines)
  6134  
  6135  	// load expectations for model: code_block_node.go
  6136  	flattenRun.AddExpectations("code_block_node.go", []string{
  6137  		`type CodeBlockNode struct {`,
  6138  		`	CodeBlockNodeAllOf1`,
  6139  		`func (m *CodeBlockNode) NodeType() string {`,
  6140  		`	return "CodeBlockNode"`,
  6141  		`func (m *CodeBlockNode) SetNodeType(val string) {`,
  6142  		`func (m *CodeBlockNode) UnmarshalJSON(raw []byte) error {`,
  6143  		`	var data struct {`,
  6144  		`		CodeBlockNodeAllOf1`,
  6145  		`	buf := bytes.NewBuffer(raw`,
  6146  		`	dec := json.NewDecoder(buf`,
  6147  		`	dec.UseNumber(`,
  6148  		`	if err := dec.Decode(&data); err != nil {`,
  6149  		`	var base struct {`,
  6150  		"		NodeType string `json:\"NodeType\"`",
  6151  		`	buf = bytes.NewBuffer(raw`,
  6152  		`	dec = json.NewDecoder(buf`,
  6153  		`	dec.UseNumber(`,
  6154  		`	if err := dec.Decode(&base); err != nil {`,
  6155  		`	var result CodeBlockNode`,
  6156  		`	if base.NodeType != result.NodeType() {`,
  6157  		`		return errors.New(422, "invalid NodeType value: %q", base.NodeType`,
  6158  		`	result.CodeBlockNodeAllOf1 = data.CodeBlockNodeAllOf1`,
  6159  		`	*m = result`,
  6160  		`func (m CodeBlockNode) MarshalJSON() ([]byte, error) {`,
  6161  		`	var b1, b2, b3 []byte`,
  6162  		`	var err error`,
  6163  		`	b1, err = json.Marshal(struct {`,
  6164  		`		CodeBlockNodeAllOf1`,
  6165  		`	}{`,
  6166  		`		CodeBlockNodeAllOf1: m.CodeBlockNodeAllOf1,`,
  6167  		`	})`,
  6168  		`	if err != nil {`,
  6169  		`		return nil, err`,
  6170  		`	b2, err = json.Marshal(struct {`,
  6171  		"		NodeType string `json:\"NodeType\"`",
  6172  		`	}{`,
  6173  		`		NodeType: m.NodeType(),`,
  6174  		`	})`,
  6175  		`	if err != nil {`,
  6176  		`		return nil, err`,
  6177  		`	return swag.ConcatJSON(b1, b2, b3), nil`,
  6178  		`func (m *CodeBlockNode) Validate(formats strfmt.Registry) error {`,
  6179  		`	if err := m.CodeBlockNodeAllOf1.Validate(formats); err != nil {`,
  6180  		`		return errors.CompositeValidationError(res...`,
  6181  	},
  6182  		// not expected
  6183  		todo,
  6184  		// output in log
  6185  		noLines,
  6186  		noLines)
  6187  }
  6188  
  6189  func initFixtureErrors() {
  6190  	// testing ../fixtures/bugs/1487/fixture-errors.yaml with expand (--skip-flatten)
  6191  
  6192  	/*
  6193  		invalid specs supported by go-swagger
  6194  	*/
  6195  
  6196  	f := newModelFixture("../fixtures/bugs/1487/fixture-errors.yaml", "broken spec to exercise error handling")
  6197  	flattenRun := f.AddRun(false)
  6198  	expandRun := f.AddRun(true)
  6199  
  6200  	// load expectations for model: node.go
  6201  	flattenRun.AddExpectations("array_without_items.go", []string{
  6202  		`type ArrayWithoutItems []interface{}`,
  6203  		// empty validation
  6204  		"func (m ArrayWithoutItems) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  6205  	},
  6206  		// not expected
  6207  		todo,
  6208  		// output in log
  6209  		// NOTE would expect warning for a non-swagger compliant, but nonetheless supposed construct (not implemented)
  6210  		noLines,
  6211  		noLines)
  6212  
  6213  	expandRun.AddExpectations("array_without_items.go", flattenRun.ExpectedFor("ArrayWithoutItems").ExpectedLines, todo, noLines, noLines)
  6214  
  6215  	flattenRun.AddExpectations("multiple_types.go", []string{
  6216  		`type MultipleTypes interface{`,
  6217  	},
  6218  		// not expected
  6219  		validatable,
  6220  		// output in log
  6221  		// expect warning
  6222  		// warning,
  6223  		noLines,
  6224  		noLines)
  6225  
  6226  	expandRun.AddExpectations("multiple_types.go", flattenRun.ExpectedFor("MultipleTypes").ExpectedLines, validatable, noLines, noLines)
  6227  }
  6228  
  6229  func initTodolistSchemavalidation() {
  6230  	// testing todolist.schemavalidation.yaml with flatten and expand (--skip-flatten)
  6231  
  6232  	/*
  6233  	   A very simple api description that makes a json only API to submit to do's.
  6234  
  6235  	*/
  6236  
  6237  	f := newModelFixture("../fixtures/codegen/todolist.schemavalidation.yml", "Private to-do list")
  6238  	flattenRun := f.AddRun(false)
  6239  	expandRun := f.AddRun(true)
  6240  
  6241  	// load expectations for model: all_of_validations_meta_all_of6.go
  6242  	flattenRun.AddExpectations("all_of_validations_meta_all_of6.go", []string{
  6243  		`type AllOfValidationsMetaAllOf6 struct {`,
  6244  		"	Coords *AllOfValidationsMetaAllOf6Coords `json:\"coords,omitempty\"`",
  6245  		`func (m *AllOfValidationsMetaAllOf6) Validate(formats strfmt.Registry) error {`,
  6246  		`	if err := m.validateCoords(formats); err != nil {`,
  6247  		`		return errors.CompositeValidationError(res...`,
  6248  		`func (m *AllOfValidationsMetaAllOf6) validateCoords(formats strfmt.Registry) error {`,
  6249  		`	if swag.IsZero(m.Coords) {`,
  6250  		`	if m.Coords != nil {`,
  6251  		`		if err := m.Coords.Validate(formats); err != nil {`,
  6252  		`			if ve, ok := err.(*errors.Validation); ok {`,
  6253  		`				return ve.ValidateName("coords"`,
  6254  	},
  6255  		// not expected
  6256  		todo,
  6257  		// output in log
  6258  		noLines,
  6259  		noLines)
  6260  
  6261  	// load expectations for model: nested_array_validations.go
  6262  	flattenRun.AddExpectations("nested_array_validations.go", []string{
  6263  		`type NestedArrayValidations struct {`,
  6264  		"	Tags [][][]string `json:\"tags\"`",
  6265  		`func (m *NestedArrayValidations) Validate(formats strfmt.Registry) error {`,
  6266  		`	if err := m.validateTags(formats); err != nil {`,
  6267  		`		return errors.CompositeValidationError(res...`,
  6268  		`func (m *NestedArrayValidations) validateTags(formats strfmt.Registry) error {`,
  6269  		`	if swag.IsZero(m.Tags) {`,
  6270  		`	iTagsSize := int64(len(m.Tags)`,
  6271  		`	if err := validate.MinItems("tags", "body", iTagsSize, 3); err != nil {`,
  6272  		`	if err := validate.MaxItems("tags", "body", iTagsSize, 10); err != nil {`,
  6273  		`	for i := 0; i < len(m.Tags); i++ {`,
  6274  		`		iiTagsSize := int64(len(m.Tags[i])`,
  6275  		`		if err := validate.MinItems("tags"+"."+strconv.Itoa(i), "body", iiTagsSize, 3); err != nil {`,
  6276  		`		if err := validate.MaxItems("tags"+"."+strconv.Itoa(i), "body", iiTagsSize, 10); err != nil {`,
  6277  		`		for ii := 0; ii < len(m.Tags[i]); ii++ {`,
  6278  		`			iiiTagsSize := int64(len(m.Tags[i][ii])`,
  6279  		`			if err := validate.MinItems("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiTagsSize, 3); err != nil {`,
  6280  		`			if err := validate.MaxItems("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiTagsSize, 10); err != nil {`,
  6281  		`			for iii := 0; iii < len(m.Tags[i][ii]); iii++ {`,
  6282  		`				if err := validate.MinLength("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Tags[i][ii][iii], 3); err != nil {`,
  6283  		`				if err := validate.MaxLength("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Tags[i][ii][iii], 10); err != nil {`,
  6284  		"				if err := validate.Pattern(\"tags\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", m.Tags[i][ii][iii], `\\w+`); err != nil {",
  6285  	},
  6286  		// not expected
  6287  		todo,
  6288  		// output in log
  6289  		noLines,
  6290  		noLines)
  6291  
  6292  	expandRun.AddExpectations("nested_array_validations.go", flattenRun.ExpectedFor("NestedArrayValidations").ExpectedLines, todo, noLines, noLines)
  6293  
  6294  	// load expectations for model: all_of_validations_meta_all_of4.go
  6295  	flattenRun.AddExpectations("all_of_validations_meta_all_of4.go", []string{
  6296  		`type AllOfValidationsMetaAllOf4 struct {`,
  6297  		"	Opts map[string]int32 `json:\"opts,omitempty\"`",
  6298  		`func (m *AllOfValidationsMetaAllOf4) Validate(formats strfmt.Registry) error {`,
  6299  		`	if err := m.validateOpts(formats); err != nil {`,
  6300  		`		return errors.CompositeValidationError(res...`,
  6301  		`func (m *AllOfValidationsMetaAllOf4) validateOpts(formats strfmt.Registry) error {`,
  6302  		`	if swag.IsZero(m.Opts) {`,
  6303  		`	for k := range m.Opts {`,
  6304  		`		if err := validate.MinimumInt("opts"+"."+k, "body", int64(m.Opts[k]), 2, false); err != nil {`,
  6305  		`		if err := validate.MaximumInt("opts"+"."+k, "body", int64(m.Opts[k]), 50, false); err != nil {`,
  6306  		`		if err := validate.MultipleOf("opts"+"."+k, "body", float64(m.Opts[k]), 1.5); err != nil {`,
  6307  	},
  6308  		// not expected
  6309  		todo,
  6310  		// output in log
  6311  		noLines,
  6312  		noLines)
  6313  
  6314  	// load expectations for model: simple_zero_allowed.go
  6315  	flattenRun.AddExpectations("simple_zero_allowed.go", []string{
  6316  		`type SimpleZeroAllowed struct {`,
  6317  		"	ID string `json:\"id,omitempty\"`",
  6318  		"	Name *string `json:\"name\"`",
  6319  		"	Urls []string `json:\"urls\"`",
  6320  		`func (m *SimpleZeroAllowed) Validate(formats strfmt.Registry) error {`,
  6321  		`	if err := m.validateID(formats); err != nil {`,
  6322  		`	if err := m.validateName(formats); err != nil {`,
  6323  		`	if err := m.validateUrls(formats); err != nil {`,
  6324  		`		return errors.CompositeValidationError(res...`,
  6325  		`func (m *SimpleZeroAllowed) validateID(formats strfmt.Registry) error {`,
  6326  		`	if swag.IsZero(m.ID) {`,
  6327  		`	if err := validate.MinLength("id", "body", m.ID, 2); err != nil {`,
  6328  		`	if err := validate.MaxLength("id", "body", m.ID, 50); err != nil {`,
  6329  		"	if err := validate.Pattern(\"id\", \"body\", m.ID, `[A-Za-z0-9][\\w- ]+`); err != nil {",
  6330  		`func (m *SimpleZeroAllowed) validateName(formats strfmt.Registry) error {`,
  6331  		`	if err := validate.Required("name", "body", m.Name); err != nil {`,
  6332  		`	if err := validate.MinLength("name", "body", *m.Name, 2); err != nil {`,
  6333  		`	if err := validate.MaxLength("name", "body", *m.Name, 50); err != nil {`,
  6334  		"	if err := validate.Pattern(\"name\", \"body\", *m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
  6335  		`func (m *SimpleZeroAllowed) validateUrls(formats strfmt.Registry) error {`,
  6336  		`	if err := validate.Required("urls", "body", m.Urls); err != nil {`,
  6337  	},
  6338  		// not expected
  6339  		todo,
  6340  		// output in log
  6341  		noLines,
  6342  		noLines)
  6343  
  6344  	expandRun.AddExpectations("simple_zero_allowed.go", flattenRun.ExpectedFor("SimpleZeroAllowed").ExpectedLines, todo, noLines, noLines)
  6345  
  6346  	// load expectations for model: named_all_of_all_of6_coords_all_of0.go
  6347  	flattenRun.AddExpectations("named_all_of_all_of6_coords_all_of0.go", []string{
  6348  		`type NamedAllOfAllOf6CoordsAllOf0 struct {`,
  6349  		"	Name string `json:\"name,omitempty\"`",
  6350  		`func (m *NamedAllOfAllOf6CoordsAllOf0) Validate(formats strfmt.Registry) error {`,
  6351  		`	if err := m.validateName(formats); err != nil {`,
  6352  		`		return errors.CompositeValidationError(res...`,
  6353  		`func (m *NamedAllOfAllOf6CoordsAllOf0) validateName(formats strfmt.Registry) error {`,
  6354  		`	if swag.IsZero(m.Name) {`,
  6355  		`	if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`,
  6356  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  6357  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
  6358  	},
  6359  		// not expected
  6360  		todo,
  6361  		// output in log
  6362  		noLines,
  6363  		noLines)
  6364  
  6365  	// load expectations for model: named_all_of_all_of6.go
  6366  	flattenRun.AddExpectations("named_all_of_all_of6.go", []string{
  6367  		`type NamedAllOfAllOf6 struct {`,
  6368  		"	Coords *NamedAllOfAllOf6Coords `json:\"coords,omitempty\"`",
  6369  		`func (m *NamedAllOfAllOf6) Validate(formats strfmt.Registry) error {`,
  6370  		`	if err := m.validateCoords(formats); err != nil {`,
  6371  		`		return errors.CompositeValidationError(res...`,
  6372  		`func (m *NamedAllOfAllOf6) validateCoords(formats strfmt.Registry) error {`,
  6373  		`	if swag.IsZero(m.Coords) {`,
  6374  		`	if m.Coords != nil {`,
  6375  		`		if err := m.Coords.Validate(formats); err != nil {`,
  6376  		`			if ve, ok := err.(*errors.Validation); ok {`,
  6377  		`				return ve.ValidateName("coords"`,
  6378  	},
  6379  		// not expected
  6380  		todo,
  6381  		// output in log
  6382  		noLines,
  6383  		noLines)
  6384  
  6385  	// load expectations for model: named_array_multi.go
  6386  	flattenRun.AddExpectations("named_array_multi.go", []string{
  6387  		`type NamedArrayMulti struct {`,
  6388  		"	P0 *string `json:\"-\"`",
  6389  		"	P1 *float64 `json:\"-\"`",
  6390  		`func (m *NamedArrayMulti) Validate(formats strfmt.Registry) error {`,
  6391  		`	if err := m.validateP0(formats); err != nil {`,
  6392  		`	if err := m.validateP1(formats); err != nil {`,
  6393  		`		return errors.CompositeValidationError(res...`,
  6394  		`func (m *NamedArrayMulti) validateP0(formats strfmt.Registry) error {`,
  6395  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  6396  		`	if err := validate.MinLength("0", "body", *m.P0, 3); err != nil {`,
  6397  		`	if err := validate.MaxLength("0", "body", *m.P0, 10); err != nil {`,
  6398  		"	if err := validate.Pattern(\"0\", \"body\", *m.P0, `\\w+`); err != nil {",
  6399  		`func (m *NamedArrayMulti) validateP1(formats strfmt.Registry) error {`,
  6400  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  6401  		`	if err := validate.Minimum("1", "body", *m.P1, 3, false); err != nil {`,
  6402  		`	if err := validate.Maximum("1", "body", *m.P1, 12, false); err != nil {`,
  6403  		`	if err := validate.MultipleOf("1", "body", *m.P1, 1.5); err != nil {`,
  6404  	},
  6405  		// not expected
  6406  		todo,
  6407  		// output in log
  6408  		noLines,
  6409  		noLines)
  6410  
  6411  	expandRun.AddExpectations("named_array_multi.go", flattenRun.ExpectedFor("NamedArrayMulti").ExpectedLines, todo, noLines, noLines)
  6412  
  6413  	// load expectations for model: named_array.go
  6414  	flattenRun.AddExpectations("named_array.go", []string{
  6415  		`type NamedArray []string`,
  6416  		`func (m NamedArray) Validate(formats strfmt.Registry) error {`,
  6417  		`	iNamedArraySize := int64(len(m)`,
  6418  		`	if err := validate.MinItems("", "body", iNamedArraySize, 3); err != nil {`,
  6419  		`	if err := validate.MaxItems("", "body", iNamedArraySize, 10); err != nil {`,
  6420  		`	for i := 0; i < len(m); i++ {`,
  6421  		`		if err := validate.MinLength(strconv.Itoa(i), "body", m[i], 3); err != nil {`,
  6422  		`		if err := validate.MaxLength(strconv.Itoa(i), "body", m[i], 10); err != nil {`,
  6423  		"		if err := validate.Pattern(strconv.Itoa(i), \"body\", m[i], `\\w+`); err != nil {",
  6424  		`		return errors.CompositeValidationError(res...`,
  6425  	},
  6426  		// not expected
  6427  		todo,
  6428  		// output in log
  6429  		noLines,
  6430  		noLines)
  6431  
  6432  	expandRun.AddExpectations("named_array.go", flattenRun.ExpectedFor("NamedArray").ExpectedLines, todo, noLines, noLines)
  6433  
  6434  	// load expectations for model: named_number.go
  6435  	flattenRun.AddExpectations("named_number.go", []string{
  6436  		`type NamedNumber int32`,
  6437  		`func (m NamedNumber) Validate(formats strfmt.Registry) error {`,
  6438  		`	if err := validate.MinimumInt("", "body", int64(m), 0, true); err != nil {`,
  6439  		`	if err := validate.MaximumInt("", "body", int64(m), 500, false); err != nil {`,
  6440  		`	if err := validate.MultipleOf("", "body", float64(m), 1.5); err != nil {`,
  6441  		`		return errors.CompositeValidationError(res...`,
  6442  	},
  6443  		// not expected
  6444  		todo,
  6445  		// output in log
  6446  		noLines,
  6447  		noLines)
  6448  
  6449  	expandRun.AddExpectations("named_number.go", flattenRun.ExpectedFor("NamedNumber").ExpectedLines, todo, noLines, noLines)
  6450  
  6451  	// load expectations for model: nested_map_validations.go
  6452  	flattenRun.AddExpectations("nested_map_validations.go", []string{
  6453  		`type NestedMapValidations struct {`,
  6454  		"	Meta map[string]map[string]map[string]int64 `json:\"meta,omitempty\"`",
  6455  		`func (m *NestedMapValidations) Validate(formats strfmt.Registry) error {`,
  6456  		`	if err := m.validateMeta(formats); err != nil {`,
  6457  		`		return errors.CompositeValidationError(res...`,
  6458  		`func (m *NestedMapValidations) validateMeta(formats strfmt.Registry) error {`,
  6459  		`	if swag.IsZero(m.Meta) {`,
  6460  		`	for k := range m.Meta {`,
  6461  		`		for kk := range m.Meta[k] {`,
  6462  		`			for kkk := range m.Meta[k][kk] {`,
  6463  		`				if err := validate.MinimumInt("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk], 3, false); err != nil {`,
  6464  		`				if err := validate.MaximumInt("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk], 6, false); err != nil {`,
  6465  		`				if err := validate.MultipleOfInt("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk], 1); err != nil {`,
  6466  	},
  6467  		// not expected
  6468  		todo,
  6469  		// output in log
  6470  		noLines,
  6471  		noLines)
  6472  
  6473  	expandRun.AddExpectations("nested_map_validations.go", flattenRun.ExpectedFor("NestedMapValidations").ExpectedLines, todo, noLines, noLines)
  6474  
  6475  	// load expectations for model: array_multi_validations_args.go
  6476  	flattenRun.AddExpectations("array_multi_validations_args.go", []string{
  6477  		`type ArrayMultiValidationsArgs struct {`,
  6478  		"	P0 *string `json:\"-\"`",
  6479  		"	P1 *float64 `json:\"-\"`",
  6480  		`func (m *ArrayMultiValidationsArgs) Validate(formats strfmt.Registry) error {`,
  6481  		`	if err := m.validateP0(formats); err != nil {`,
  6482  		`	if err := m.validateP1(formats); err != nil {`,
  6483  		`		return errors.CompositeValidationError(res...`,
  6484  		`func (m *ArrayMultiValidationsArgs) validateP0(formats strfmt.Registry) error {`,
  6485  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  6486  		`	if err := validate.MinLength("0", "body", *m.P0, 3); err != nil {`,
  6487  		`	if err := validate.MaxLength("0", "body", *m.P0, 10); err != nil {`,
  6488  		"	if err := validate.Pattern(\"0\", \"body\", *m.P0, `\\w+`); err != nil {",
  6489  		`func (m *ArrayMultiValidationsArgs) validateP1(formats strfmt.Registry) error {`,
  6490  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  6491  		`	if err := validate.Minimum("1", "body", *m.P1, 3, false); err != nil {`,
  6492  		`	if err := validate.Maximum("1", "body", *m.P1, 12, false); err != nil {`,
  6493  		`	if err := validate.MultipleOf("1", "body", *m.P1, 1.5); err != nil {`,
  6494  	},
  6495  		// not expected
  6496  		todo,
  6497  		// output in log
  6498  		noLines,
  6499  		noLines)
  6500  
  6501  	// load expectations for model: named_map_complex_additional_properties.go
  6502  	flattenRun.AddExpectations("named_map_complex_additional_properties.go", []string{
  6503  		`type NamedMapComplexAdditionalProperties struct {`,
  6504  		"	Age int32 `json:\"age,omitempty\"`",
  6505  		"	Name string `json:\"name,omitempty\"`",
  6506  		`func (m *NamedMapComplexAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  6507  		`	if err := m.validateAge(formats); err != nil {`,
  6508  		`	if err := m.validateName(formats); err != nil {`,
  6509  		`		return errors.CompositeValidationError(res...`,
  6510  		`func (m *NamedMapComplexAdditionalProperties) validateAge(formats strfmt.Registry) error {`,
  6511  		`	if swag.IsZero(m.Age) {`,
  6512  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  6513  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  6514  		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
  6515  		`func (m *NamedMapComplexAdditionalProperties) validateName(formats strfmt.Registry) error {`,
  6516  		`	if swag.IsZero(m.Name) {`,
  6517  		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
  6518  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  6519  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
  6520  	},
  6521  		// not expected
  6522  		todo,
  6523  		// output in log
  6524  		noLines,
  6525  		noLines)
  6526  
  6527  	// load expectations for model: named_nested_map_complex.go
  6528  	flattenRun.AddExpectations("named_nested_map_complex.go", []string{
  6529  		// maps are now simple types
  6530  		`type NamedNestedMapComplex map[string]map[string]map[string]NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties`,
  6531  		`func (m NamedNestedMapComplex) Validate(formats strfmt.Registry) error {`,
  6532  		`	for k := range m {`,
  6533  		`		for kk := range m[k] {`,
  6534  		`			for kkk := range m[k][kk] {`,
  6535  		`				if err := validate.Required(k+"."+kk+"."+kkk, "body", m[k][kk][kkk]); err != nil {`,
  6536  		`				if val, ok := m[k][kk][kkk]; ok {`,
  6537  		`					if err := val.Validate(formats); err != nil {`,
  6538  		`		return errors.CompositeValidationError(res...`,
  6539  	},
  6540  		// not expected
  6541  		todo,
  6542  		// output in log
  6543  		noLines,
  6544  		noLines)
  6545  
  6546  	expandRun.AddExpectations("named_nested_map_complex.go", []string{
  6547  		`type NamedNestedMapComplex map[string]map[string]map[string]NamedNestedMapComplexAnon`,
  6548  		`func (m NamedNestedMapComplex) Validate(formats strfmt.Registry) error {`,
  6549  		`	for k := range m {`,
  6550  		`		for kk := range m[k] {`,
  6551  		`			for kkk := range m[k][kk] {`,
  6552  		`				if val, ok := m[k][kk][kkk]; ok {`,
  6553  		`					if err := val.Validate(formats); err != nil {`,
  6554  		`		return errors.CompositeValidationError(res...`,
  6555  		`type NamedNestedMapComplexAnon struct {`,
  6556  		"	Age int32 `json:\"age,omitempty\"`",
  6557  		"	Name string `json:\"name,omitempty\"`",
  6558  		`func (m *NamedNestedMapComplexAnon) Validate(formats strfmt.Registry) error {`,
  6559  		`	if err := m.validateAge(formats); err != nil {`,
  6560  		`	if err := m.validateName(formats); err != nil {`,
  6561  		`		return errors.CompositeValidationError(res...`,
  6562  		`func (m *NamedNestedMapComplexAnon) validateAge(formats strfmt.Registry) error {`,
  6563  		`	if swag.IsZero(m.Age) {`,
  6564  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  6565  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  6566  		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
  6567  		`func (m *NamedNestedMapComplexAnon) validateName(formats strfmt.Registry) error {`,
  6568  		`	if swag.IsZero(m.Name) {`,
  6569  		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
  6570  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  6571  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
  6572  	},
  6573  		// not expected
  6574  		todo,
  6575  		// output in log
  6576  		noLines,
  6577  		noLines)
  6578  
  6579  	// load expectations for model: all_of_validations_meta_all_of1.go
  6580  	flattenRun.AddExpectations("all_of_validations_meta_all_of1.go", []string{
  6581  		`type AllOfValidationsMetaAllOf1 struct {`,
  6582  		"	Age int32 `json:\"age,omitempty\"`",
  6583  		`func (m *AllOfValidationsMetaAllOf1) Validate(formats strfmt.Registry) error {`,
  6584  		`	if err := m.validateAge(formats); err != nil {`,
  6585  		`		return errors.CompositeValidationError(res...`,
  6586  		`func (m *AllOfValidationsMetaAllOf1) validateAge(formats strfmt.Registry) error {`,
  6587  		`	if swag.IsZero(m.Age) {`,
  6588  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`,
  6589  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 50, false); err != nil {`,
  6590  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`,
  6591  	},
  6592  		// not expected
  6593  		todo,
  6594  		// output in log
  6595  		noLines,
  6596  		noLines)
  6597  
  6598  	// load expectations for model: nested_map_complex_validations_meta_additional_properties_additional_properties.go
  6599  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  6600  
  6601  	// load expectations for model: tag.go
  6602  	flattenRun.AddExpectations("tag.go", []string{
  6603  		`type Tag struct {`,
  6604  		"	ID int64 `json:\"id,omitempty\"`",
  6605  		"	Name string `json:\"name,omitempty\"`",
  6606  		// empty validation
  6607  		"func (m *Tag) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  6608  	},
  6609  		// not expected
  6610  		todo,
  6611  		// output in log
  6612  		noLines,
  6613  		noLines)
  6614  
  6615  	expandRun.AddExpectations("tag.go", flattenRun.ExpectedFor("Tag").ExpectedLines, todo, noLines, noLines)
  6616  
  6617  	// load expectations for model: nested_object_validations_args.go
  6618  	flattenRun.AddExpectations("nested_object_validations_args.go", []string{
  6619  		`type NestedObjectValidationsArgs struct {`,
  6620  		"	Meta *NestedObjectValidationsArgsMeta `json:\"meta,omitempty\"`",
  6621  		`func (m *NestedObjectValidationsArgs) Validate(formats strfmt.Registry) error {`,
  6622  		`	if err := m.validateMeta(formats); err != nil {`,
  6623  		`		return errors.CompositeValidationError(res...`,
  6624  		`func (m *NestedObjectValidationsArgs) validateMeta(formats strfmt.Registry) error {`,
  6625  		`	if swag.IsZero(m.Meta) {`,
  6626  		`	if m.Meta != nil {`,
  6627  		`		if err := m.Meta.Validate(formats); err != nil {`,
  6628  		`			if ve, ok := err.(*errors.Validation); ok {`,
  6629  		`				return ve.ValidateName("meta"`,
  6630  	},
  6631  		// not expected
  6632  		todo,
  6633  		// output in log
  6634  		noLines,
  6635  		noLines)
  6636  
  6637  	// load expectations for model: named_all_of_all_of6_coords_all_of1.go
  6638  	flattenRun.AddExpectations("named_all_of_all_of6_coords_all_of1.go", []string{
  6639  		`type NamedAllOfAllOf6CoordsAllOf1 struct {`,
  6640  		"	Age int32 `json:\"age,omitempty\"`",
  6641  		`func (m *NamedAllOfAllOf6CoordsAllOf1) Validate(formats strfmt.Registry) error {`,
  6642  		`	if err := m.validateAge(formats); err != nil {`,
  6643  		`		return errors.CompositeValidationError(res...`,
  6644  		`func (m *NamedAllOfAllOf6CoordsAllOf1) validateAge(formats strfmt.Registry) error {`,
  6645  		`	if swag.IsZero(m.Age) {`,
  6646  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`,
  6647  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 50, false); err != nil {`,
  6648  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`,
  6649  	},
  6650  		// not expected
  6651  		todo,
  6652  		// output in log
  6653  		noLines,
  6654  		noLines)
  6655  
  6656  	// load expectations for model: named_all_of_all_of6_coords.go
  6657  	flattenRun.AddExpectations("named_all_of_all_of6_coords.go", []string{
  6658  		`type NamedAllOfAllOf6Coords struct {`,
  6659  		`	NamedAllOfAllOf6CoordsAllOf0`,
  6660  		`	NamedAllOfAllOf6CoordsAllOf1`,
  6661  		`func (m *NamedAllOfAllOf6Coords) Validate(formats strfmt.Registry) error {`,
  6662  		`	if err := m.NamedAllOfAllOf6CoordsAllOf0.Validate(formats); err != nil {`,
  6663  		`	if err := m.NamedAllOfAllOf6CoordsAllOf1.Validate(formats); err != nil {`,
  6664  		`		return errors.CompositeValidationError(res...`,
  6665  	},
  6666  		// not expected
  6667  		todo,
  6668  		// output in log
  6669  		noLines,
  6670  		noLines)
  6671  
  6672  	// load expectations for model: array_multi_validations.go
  6673  	flattenRun.AddExpectations("array_multi_validations.go", []string{
  6674  		`type ArrayMultiValidations struct {`,
  6675  		"	Args ArrayMultiValidationsArgs `json:\"args,omitempty\"`",
  6676  		`func (m *ArrayMultiValidations) Validate(formats strfmt.Registry) error {`,
  6677  		`		return errors.CompositeValidationError(res...`,
  6678  	},
  6679  		// not expected
  6680  		todo,
  6681  		// output in log
  6682  		noLines,
  6683  		noLines)
  6684  
  6685  	expandRun.AddExpectations("array_multi_validations.go", []string{
  6686  		`type ArrayMultiValidations struct {`,
  6687  		"	Args *ArrayMultiValidationsArgsTuple0 `json:\"args,omitempty\"`",
  6688  		`func (m *ArrayMultiValidations) Validate(formats strfmt.Registry) error {`,
  6689  		`	if err := m.validateArgs(formats); err != nil {`,
  6690  		`		return errors.CompositeValidationError(res...`,
  6691  		`func (m *ArrayMultiValidations) validateArgs(formats strfmt.Registry) error {`,
  6692  		`	if swag.IsZero(m.Args) {`,
  6693  		`	if m.Args != nil {`,
  6694  		`		if err := m.Args.Validate(formats); err != nil {`,
  6695  		`			if ve, ok := err.(*errors.Validation); ok {`,
  6696  		`				return ve.ValidateName("args"`,
  6697  		`type ArrayMultiValidationsArgsTuple0 struct {`,
  6698  		"	P0 *string `json:\"-\"`",
  6699  		"	P1 *float64 `json:\"-\"`",
  6700  		`func (m *ArrayMultiValidationsArgsTuple0) Validate(formats strfmt.Registry) error {`,
  6701  		`	if err := m.validateP0(formats); err != nil {`,
  6702  		`	if err := m.validateP1(formats); err != nil {`,
  6703  		`		return errors.CompositeValidationError(res...`,
  6704  		`func (m *ArrayMultiValidationsArgsTuple0) validateP0(formats strfmt.Registry) error {`,
  6705  		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
  6706  		`	if err := validate.MinLength("P0", "body", *m.P0, 3); err != nil {`,
  6707  		`	if err := validate.MaxLength("P0", "body", *m.P0, 10); err != nil {`,
  6708  		"	if err := validate.Pattern(\"P0\", \"body\", *m.P0, `\\w+`); err != nil {",
  6709  		`func (m *ArrayMultiValidationsArgsTuple0) validateP1(formats strfmt.Registry) error {`,
  6710  		`	if err := validate.Required("P1", "body", m.P1); err != nil {`,
  6711  		`	if err := validate.Minimum("P1", "body", *m.P1, 3, false); err != nil {`,
  6712  		`	if err := validate.Maximum("P1", "body", *m.P1, 12, false); err != nil {`,
  6713  		`	if err := validate.MultipleOf("P1", "body", *m.P1, 1.5); err != nil {`,
  6714  	},
  6715  		// not expected
  6716  		todo,
  6717  		// output in log
  6718  		noLines,
  6719  		noLines)
  6720  
  6721  	// load expectations for model: string_validations.go
  6722  	flattenRun.AddExpectations("string_validations.go", []string{
  6723  		`type StringValidations struct {`,
  6724  		"	Name string `json:\"name,omitempty\"`",
  6725  		`func (m *StringValidations) Validate(formats strfmt.Registry) error {`,
  6726  		`	if err := m.validateName(formats); err != nil {`,
  6727  		`		return errors.CompositeValidationError(res...`,
  6728  		`func (m *StringValidations) validateName(formats strfmt.Registry) error {`,
  6729  		`	if swag.IsZero(m.Name) {`,
  6730  		`	if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`,
  6731  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  6732  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
  6733  	},
  6734  		// not expected
  6735  		todo,
  6736  		// output in log
  6737  		noLines,
  6738  		noLines)
  6739  
  6740  	expandRun.AddExpectations("string_validations.go", flattenRun.ExpectedFor("StringValidations").ExpectedLines, todo, noLines, noLines)
  6741  
  6742  	// load expectations for model: required_props.go
  6743  	flattenRun.AddExpectations("required_props.go", []string{
  6744  		`type RequiredProps struct {`,
  6745  		"	Age *int32 `json:\"age\"`",
  6746  		"	CreatedAt *strfmt.DateTime `json:\"createdAt\"`",
  6747  		"	ID *int64 `json:\"id\"`",
  6748  		"	Name *string `json:\"name\"`",
  6749  		"	Score *float32 `json:\"score\"`",
  6750  		"	Tags []string `json:\"tags\"`",
  6751  		`func (m *RequiredProps) Validate(formats strfmt.Registry) error {`,
  6752  		`	if err := m.validateAge(formats); err != nil {`,
  6753  		`	if err := m.validateCreatedAt(formats); err != nil {`,
  6754  		`	if err := m.validateID(formats); err != nil {`,
  6755  		`	if err := m.validateName(formats); err != nil {`,
  6756  		`	if err := m.validateScore(formats); err != nil {`,
  6757  		`	if err := m.validateTags(formats); err != nil {`,
  6758  		`		return errors.CompositeValidationError(res...`,
  6759  		`func (m *RequiredProps) validateAge(formats strfmt.Registry) error {`,
  6760  		`	if err := validate.Required("age", "body", m.Age); err != nil {`,
  6761  		`func (m *RequiredProps) validateCreatedAt(formats strfmt.Registry) error {`,
  6762  		`	if err := validate.Required("createdAt", "body", m.CreatedAt); err != nil {`,
  6763  		`	if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {`,
  6764  		`func (m *RequiredProps) validateID(formats strfmt.Registry) error {`,
  6765  		`	if err := validate.Required("id", "body", m.ID); err != nil {`,
  6766  		`func (m *RequiredProps) validateName(formats strfmt.Registry) error {`,
  6767  		`	if err := validate.Required("name", "body", m.Name); err != nil {`,
  6768  		`func (m *RequiredProps) validateScore(formats strfmt.Registry) error {`,
  6769  		`	if err := validate.Required("score", "body", m.Score); err != nil {`,
  6770  		`func (m *RequiredProps) validateTags(formats strfmt.Registry) error {`,
  6771  		`	if err := validate.Required("tags", "body", m.Tags); err != nil {`,
  6772  	},
  6773  		// not expected
  6774  		todo,
  6775  		// output in log
  6776  		noLines,
  6777  		noLines)
  6778  
  6779  	expandRun.AddExpectations("required_props.go", flattenRun.ExpectedFor("RequiredProps").ExpectedLines, todo, noLines, noLines)
  6780  
  6781  	// load expectations for model: named_all_of_all_of5.go
  6782  	flattenRun.AddExpectations("named_all_of_all_of5.go", []string{
  6783  		`type NamedAllOfAllOf5 struct {`,
  6784  		"	ExtOpts map[string]map[string]map[string]int32 `json:\"extOpts,omitempty\"`",
  6785  		`func (m *NamedAllOfAllOf5) Validate(formats strfmt.Registry) error {`,
  6786  		`	if err := m.validateExtOpts(formats); err != nil {`,
  6787  		`		return errors.CompositeValidationError(res...`,
  6788  		`func (m *NamedAllOfAllOf5) validateExtOpts(formats strfmt.Registry) error {`,
  6789  		`	if swag.IsZero(m.ExtOpts) {`,
  6790  		`	for k := range m.ExtOpts {`,
  6791  		`		for kk := range m.ExtOpts[k] {`,
  6792  		`			for kkk := range m.ExtOpts[k][kk] {`,
  6793  		`				if err := validate.MinimumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 2, false); err != nil {`,
  6794  		`				if err := validate.MaximumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 50, false); err != nil {`,
  6795  		`				if err := validate.MultipleOf("extOpts"+"."+k+"."+kk+"."+kkk, "body", float64(m.ExtOpts[k][kk][kkk]), 1.5); err != nil {`,
  6796  	},
  6797  		// not expected
  6798  		todo,
  6799  		// output in log
  6800  		noLines,
  6801  		noLines)
  6802  
  6803  	// load expectations for model: named_map.go
  6804  	flattenRun.AddExpectations("named_map.go", []string{
  6805  		`type NamedMap map[string]int64`,
  6806  		`func (m NamedMap) Validate(formats strfmt.Registry) error {`,
  6807  		`	for k := range m {`,
  6808  		`		if err := validate.MinimumInt(k, "body", m[k], 3, false); err != nil {`,
  6809  		`		if err := validate.MaximumInt(k, "body", m[k], 6, false); err != nil {`,
  6810  		`		if err := validate.MultipleOfInt(k, "body", m[k], 1); err != nil {`,
  6811  		`		return errors.CompositeValidationError(res...`,
  6812  	},
  6813  		// not expected
  6814  		todo,
  6815  		// output in log
  6816  		noLines,
  6817  		noLines)
  6818  
  6819  	expandRun.AddExpectations("named_map.go", flattenRun.ExpectedFor("NamedMap").ExpectedLines, todo, noLines, noLines)
  6820  
  6821  	// load expectations for model: named_string.go
  6822  	flattenRun.AddExpectations("named_string.go", []string{
  6823  		`type NamedString string`,
  6824  		`func (m NamedString) Validate(formats strfmt.Registry) error {`,
  6825  		`	if err := validate.MinLength("", "body", string(m), 2); err != nil {`,
  6826  		`	if err := validate.MaxLength("", "body", string(m), 50); err != nil {`,
  6827  		"	if err := validate.Pattern(\"\", \"body\", string(m), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  6828  		`		return errors.CompositeValidationError(res...`,
  6829  	},
  6830  		// not expected
  6831  		todo,
  6832  		// output in log
  6833  		noLines,
  6834  		noLines)
  6835  
  6836  	expandRun.AddExpectations("named_string.go", flattenRun.ExpectedFor("NamedString").ExpectedLines, todo, noLines, noLines)
  6837  
  6838  	// load expectations for model: named_all_of_all_of3.go
  6839  	flattenRun.AddExpectations("named_all_of_all_of3.go", []string{
  6840  		`type NamedAllOfAllOf3 struct {`,
  6841  		"	Assoc [][][]string `json:\"assoc\"`",
  6842  		`func (m *NamedAllOfAllOf3) Validate(formats strfmt.Registry) error {`,
  6843  		`	if err := m.validateAssoc(formats); err != nil {`,
  6844  		`		return errors.CompositeValidationError(res...`,
  6845  		`func (m *NamedAllOfAllOf3) validateAssoc(formats strfmt.Registry) error {`,
  6846  		`	if swag.IsZero(m.Assoc) {`,
  6847  		`	iAssocSize := int64(len(m.Assoc)`,
  6848  		`	if err := validate.MinItems("assoc", "body", iAssocSize, 5); err != nil {`,
  6849  		`	if err := validate.MaxItems("assoc", "body", iAssocSize, 20); err != nil {`,
  6850  		`	for i := 0; i < len(m.Assoc); i++ {`,
  6851  		`		iiAssocSize := int64(len(m.Assoc[i])`,
  6852  		`		if err := validate.MinItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 5); err != nil {`,
  6853  		`		if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 20); err != nil {`,
  6854  		`		for ii := 0; ii < len(m.Assoc[i]); ii++ {`,
  6855  		`			iiiAssocSize := int64(len(m.Assoc[i][ii])`,
  6856  		`			if err := validate.MinItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`,
  6857  		`			if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`,
  6858  		`			for iii := 0; iii < len(m.Assoc[i][ii]); iii++ {`,
  6859  		`				if err := validate.MinLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 2); err != nil {`,
  6860  		`				if err := validate.MaxLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 50); err != nil {`,
  6861  		"				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 {",
  6862  	},
  6863  		// not expected
  6864  		todo,
  6865  		// output in log
  6866  		noLines,
  6867  		noLines)
  6868  
  6869  	// load expectations for model: map_complex_validations.go
  6870  	flattenRun.AddExpectations("map_complex_validations.go", []string{
  6871  		`type MapComplexValidations struct {`,
  6872  		// maps are now simple types
  6873  		"Meta map[string]MapComplexValidationsMetaAdditionalProperties `json:\"meta,omitempty\"`",
  6874  		`func (m *MapComplexValidations) Validate(formats strfmt.Registry) error {`,
  6875  		`	if err := m.validateMeta(formats); err != nil {`,
  6876  		`		return errors.CompositeValidationError(res...`,
  6877  		`func (m *MapComplexValidations) validateMeta(formats strfmt.Registry) error {`,
  6878  		`	if swag.IsZero(m.Meta) {`,
  6879  		`            		for k := range m.Meta {`,
  6880  		`            			if val, ok := m.Meta[k]; ok {`,
  6881  		`            				if err := val.Validate(formats); err != nil {`,
  6882  	},
  6883  		// not expected
  6884  		todo,
  6885  		// output in log
  6886  		noLines,
  6887  		noLines)
  6888  
  6889  	expandRun.AddExpectations("map_complex_validations.go", []string{
  6890  		`type MapComplexValidations struct {`,
  6891  		"	Meta map[string]MapComplexValidationsMetaAnon `json:\"meta,omitempty\"`",
  6892  		`func (m *MapComplexValidations) Validate(formats strfmt.Registry) error {`,
  6893  		`	if err := m.validateMeta(formats); err != nil {`,
  6894  		`		return errors.CompositeValidationError(res...`,
  6895  		`func (m *MapComplexValidations) validateMeta(formats strfmt.Registry) error {`,
  6896  		`	if swag.IsZero(m.Meta) {`,
  6897  		`	for k := range m.Meta {`,
  6898  		`		if val, ok := m.Meta[k]; ok {`,
  6899  		`			if err := val.Validate(formats); err != nil {`,
  6900  		`type MapComplexValidationsMetaAnon struct {`,
  6901  		"	Age int32 `json:\"age,omitempty\"`",
  6902  		"	Name string `json:\"name,omitempty\"`",
  6903  		`func (m *MapComplexValidationsMetaAnon) Validate(formats strfmt.Registry) error {`,
  6904  		`	if err := m.validateAge(formats); err != nil {`,
  6905  		`	if err := m.validateName(formats); err != nil {`,
  6906  		`		return errors.CompositeValidationError(res...`,
  6907  		`func (m *MapComplexValidationsMetaAnon) validateAge(formats strfmt.Registry) error {`,
  6908  		`	if swag.IsZero(m.Age) {`,
  6909  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  6910  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  6911  		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
  6912  		`func (m *MapComplexValidationsMetaAnon) validateName(formats strfmt.Registry) error {`,
  6913  		`	if swag.IsZero(m.Name) {`,
  6914  		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
  6915  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  6916  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
  6917  	},
  6918  		// not expected
  6919  		todo,
  6920  		// output in log
  6921  		noLines,
  6922  		noLines)
  6923  
  6924  	// load expectations for model: named_nested_map_complex_additional_properties_additional_properties_additional_properties.go
  6925  	flattenRun.AddExpectations("named_nested_map_complex_additional_properties_additional_properties_additional_properties.go", []string{
  6926  		`type NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties struct {`,
  6927  		"	Age int32 `json:\"age,omitempty\"`",
  6928  		"	Name string `json:\"name,omitempty\"`",
  6929  		`func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  6930  		`	if err := m.validateAge(formats); err != nil {`,
  6931  		`	if err := m.validateName(formats); err != nil {`,
  6932  		`		return errors.CompositeValidationError(res...`,
  6933  		`func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateAge(formats strfmt.Registry) error {`,
  6934  		`	if swag.IsZero(m.Age) {`,
  6935  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  6936  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  6937  		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
  6938  		`func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`,
  6939  		`	if swag.IsZero(m.Name) {`,
  6940  		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
  6941  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  6942  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
  6943  	},
  6944  		// not expected
  6945  		todo,
  6946  		// output in log
  6947  		noLines,
  6948  		noLines)
  6949  
  6950  	// load expectations for model: all_of_validations_meta_all_of6_coords.go
  6951  	flattenRun.AddExpectations("all_of_validations_meta_all_of6_coords.go", []string{
  6952  		`type AllOfValidationsMetaAllOf6Coords struct {`,
  6953  		`	AllOfValidationsMetaAllOf6CoordsAllOf0`,
  6954  		`	AllOfValidationsMetaAllOf6CoordsAllOf1`,
  6955  		`func (m *AllOfValidationsMetaAllOf6Coords) Validate(formats strfmt.Registry) error {`,
  6956  		`	if err := m.AllOfValidationsMetaAllOf6CoordsAllOf0.Validate(formats); err != nil {`,
  6957  		`	if err := m.AllOfValidationsMetaAllOf6CoordsAllOf1.Validate(formats); err != nil {`,
  6958  		`		return errors.CompositeValidationError(res...`,
  6959  	},
  6960  		// not expected
  6961  		todo,
  6962  		// output in log
  6963  		noLines,
  6964  		noLines)
  6965  
  6966  	// load expectations for model: array_validations.go
  6967  	flattenRun.AddExpectations("array_validations.go", []string{
  6968  		`type ArrayValidations struct {`,
  6969  		"	Tags []string `json:\"tags\"`",
  6970  		`func (m *ArrayValidations) Validate(formats strfmt.Registry) error {`,
  6971  		`	if err := m.validateTags(formats); err != nil {`,
  6972  		`		return errors.CompositeValidationError(res...`,
  6973  		`func (m *ArrayValidations) validateTags(formats strfmt.Registry) error {`,
  6974  		`	if swag.IsZero(m.Tags) {`,
  6975  		`	iTagsSize := int64(len(m.Tags)`,
  6976  		`	if err := validate.MinItems("tags", "body", iTagsSize, 3); err != nil {`,
  6977  		`	if err := validate.MaxItems("tags", "body", iTagsSize, 10); err != nil {`,
  6978  		`	for i := 0; i < len(m.Tags); i++ {`,
  6979  		`		if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", m.Tags[i], 3); err != nil {`,
  6980  		`		if err := validate.MaxLength("tags"+"."+strconv.Itoa(i), "body", m.Tags[i], 10); err != nil {`,
  6981  		"		if err := validate.Pattern(\"tags\"+\".\"+strconv.Itoa(i), \"body\", m.Tags[i], `\\w+`); err != nil {",
  6982  	},
  6983  		// not expected
  6984  		todo,
  6985  		// output in log
  6986  		noLines,
  6987  		noLines)
  6988  
  6989  	expandRun.AddExpectations("array_validations.go", flattenRun.ExpectedFor("ArrayValidations").ExpectedLines, todo, noLines, noLines)
  6990  
  6991  	// load expectations for model: all_of_validations_meta.go
  6992  	flattenRun.AddExpectations("all_of_validations_meta.go", []string{
  6993  		`type AllOfValidationsMeta struct {`,
  6994  		`	AllOfValidationsMetaAllOf0`,
  6995  		`	AllOfValidationsMetaAllOf1`,
  6996  		`	AllOfValidationsMetaAllOf2`,
  6997  		`	AllOfValidationsMetaAllOf3`,
  6998  		`	AllOfValidationsMetaAllOf4`,
  6999  		`	AllOfValidationsMetaAllOf5`,
  7000  		`	AllOfValidationsMetaAllOf6`,
  7001  		`func (m *AllOfValidationsMeta) Validate(formats strfmt.Registry) error {`,
  7002  		`	if err := m.AllOfValidationsMetaAllOf0.Validate(formats); err != nil {`,
  7003  		`	if err := m.AllOfValidationsMetaAllOf1.Validate(formats); err != nil {`,
  7004  		`	if err := m.AllOfValidationsMetaAllOf2.Validate(formats); err != nil {`,
  7005  		`	if err := m.AllOfValidationsMetaAllOf3.Validate(formats); err != nil {`,
  7006  		`	if err := m.AllOfValidationsMetaAllOf4.Validate(formats); err != nil {`,
  7007  		`	if err := m.AllOfValidationsMetaAllOf5.Validate(formats); err != nil {`,
  7008  		`	if err := m.AllOfValidationsMetaAllOf6.Validate(formats); err != nil {`,
  7009  		`		return errors.CompositeValidationError(res...`,
  7010  	},
  7011  		// not expected
  7012  		todo,
  7013  		// output in log
  7014  		noLines,
  7015  		noLines)
  7016  
  7017  	// load expectations for model: map_complex_validations_meta_additional_properties.go
  7018  	flattenRun.AddExpectations("map_complex_validations_meta_additional_properties.go", []string{
  7019  		`type MapComplexValidationsMetaAdditionalProperties struct {`,
  7020  		"	Age int32 `json:\"age,omitempty\"`",
  7021  		"	Name string `json:\"name,omitempty\"`",
  7022  		`func (m *MapComplexValidationsMetaAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  7023  		`	if err := m.validateAge(formats); err != nil {`,
  7024  		`	if err := m.validateName(formats); err != nil {`,
  7025  		`		return errors.CompositeValidationError(res...`,
  7026  		`func (m *MapComplexValidationsMetaAdditionalProperties) validateAge(formats strfmt.Registry) error {`,
  7027  		`	if swag.IsZero(m.Age) {`,
  7028  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  7029  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  7030  		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
  7031  		`func (m *MapComplexValidationsMetaAdditionalProperties) validateName(formats strfmt.Registry) error {`,
  7032  		`	if swag.IsZero(m.Name) {`,
  7033  		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
  7034  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  7035  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
  7036  	},
  7037  		// not expected
  7038  		todo,
  7039  		// output in log
  7040  		noLines,
  7041  		noLines)
  7042  
  7043  	// load expectations for model: nested_map_complex_validations_meta_additional_properties.go
  7044  	// NOTE(fredbi): maps are simple types and this definition is no more generated
  7045  
  7046  	// load expectations for model: all_of_validations_meta_all_of6_coords_all_of1.go
  7047  	flattenRun.AddExpectations("all_of_validations_meta_all_of6_coords_all_of1.go", []string{
  7048  		`type AllOfValidationsMetaAllOf6CoordsAllOf1 struct {`,
  7049  		"	Age int32 `json:\"age,omitempty\"`",
  7050  		`func (m *AllOfValidationsMetaAllOf6CoordsAllOf1) Validate(formats strfmt.Registry) error {`,
  7051  		`	if err := m.validateAge(formats); err != nil {`,
  7052  		`		return errors.CompositeValidationError(res...`,
  7053  		`func (m *AllOfValidationsMetaAllOf6CoordsAllOf1) validateAge(formats strfmt.Registry) error {`,
  7054  		`	if swag.IsZero(m.Age) {`,
  7055  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`,
  7056  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 50, false); err != nil {`,
  7057  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`,
  7058  	},
  7059  		// not expected
  7060  		todo,
  7061  		// output in log
  7062  		noLines,
  7063  		noLines)
  7064  
  7065  	// load expectations for model: all_of_validations_meta_all_of3.go
  7066  	flattenRun.AddExpectations("all_of_validations_meta_all_of3.go", []string{
  7067  		`type AllOfValidationsMetaAllOf3 struct {`,
  7068  		"	Assoc [][][]string `json:\"assoc\"`",
  7069  		`func (m *AllOfValidationsMetaAllOf3) Validate(formats strfmt.Registry) error {`,
  7070  		`	if err := m.validateAssoc(formats); err != nil {`,
  7071  		`		return errors.CompositeValidationError(res...`,
  7072  		`func (m *AllOfValidationsMetaAllOf3) validateAssoc(formats strfmt.Registry) error {`,
  7073  		`	if swag.IsZero(m.Assoc) {`,
  7074  		`	iAssocSize := int64(len(m.Assoc)`,
  7075  		`	if err := validate.MinItems("assoc", "body", iAssocSize, 5); err != nil {`,
  7076  		`	if err := validate.MaxItems("assoc", "body", iAssocSize, 20); err != nil {`,
  7077  		`	for i := 0; i < len(m.Assoc); i++ {`,
  7078  		`		iiAssocSize := int64(len(m.Assoc[i])`,
  7079  		`		if err := validate.MinItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 5); err != nil {`,
  7080  		`		if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 20); err != nil {`,
  7081  		`		for ii := 0; ii < len(m.Assoc[i]); ii++ {`,
  7082  		`			iiiAssocSize := int64(len(m.Assoc[i][ii])`,
  7083  		`			if err := validate.MinItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`,
  7084  		`			if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`,
  7085  		`			for iii := 0; iii < len(m.Assoc[i][ii]); iii++ {`,
  7086  		`				if err := validate.MinLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 2); err != nil {`,
  7087  		`				if err := validate.MaxLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 50); err != nil {`,
  7088  		"				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 {",
  7089  	},
  7090  		// not expected
  7091  		todo,
  7092  		// output in log
  7093  		noLines,
  7094  		noLines)
  7095  
  7096  	// load expectations for model: nested_object_validations.go
  7097  	flattenRun.AddExpectations("nested_object_validations.go", []string{
  7098  		`type NestedObjectValidations struct {`,
  7099  		"	Args *NestedObjectValidationsArgs `json:\"args,omitempty\"`",
  7100  		`func (m *NestedObjectValidations) Validate(formats strfmt.Registry) error {`,
  7101  		`	if err := m.validateArgs(formats); err != nil {`,
  7102  		`		return errors.CompositeValidationError(res...`,
  7103  		`func (m *NestedObjectValidations) validateArgs(formats strfmt.Registry) error {`,
  7104  		`	if swag.IsZero(m.Args) {`,
  7105  		`	if m.Args != nil {`,
  7106  		`		if err := m.Args.Validate(formats); err != nil {`,
  7107  		`			if ve, ok := err.(*errors.Validation); ok {`,
  7108  		`				return ve.ValidateName("args"`,
  7109  	},
  7110  		// not expected
  7111  		todo,
  7112  		// output in log
  7113  		noLines,
  7114  		noLines)
  7115  
  7116  	expandRun.AddExpectations("nested_object_validations.go", []string{
  7117  		`type NestedObjectValidations struct {`,
  7118  		"	Args *NestedObjectValidationsArgs `json:\"args,omitempty\"`",
  7119  		`func (m *NestedObjectValidations) Validate(formats strfmt.Registry) error {`,
  7120  		`	if err := m.validateArgs(formats); err != nil {`,
  7121  		`		return errors.CompositeValidationError(res...`,
  7122  		`func (m *NestedObjectValidations) validateArgs(formats strfmt.Registry) error {`,
  7123  		`	if swag.IsZero(m.Args) {`,
  7124  		`	if m.Args != nil {`,
  7125  		`		if err := m.Args.Validate(formats); err != nil {`,
  7126  		`			if ve, ok := err.(*errors.Validation); ok {`,
  7127  		`				return ve.ValidateName("args"`,
  7128  		`type NestedObjectValidationsArgs struct {`,
  7129  		"	Meta *NestedObjectValidationsArgsMeta `json:\"meta,omitempty\"`",
  7130  		`func (m *NestedObjectValidationsArgs) Validate(formats strfmt.Registry) error {`,
  7131  		`	if err := m.validateMeta(formats); err != nil {`,
  7132  		`		return errors.CompositeValidationError(res...`,
  7133  		`func (m *NestedObjectValidationsArgs) validateMeta(formats strfmt.Registry) error {`,
  7134  		`	if swag.IsZero(m.Meta) {`,
  7135  		`	if m.Meta != nil {`,
  7136  		`		if err := m.Meta.Validate(formats); err != nil {`,
  7137  		`			if ve, ok := err.(*errors.Validation); ok {`,
  7138  		`				return ve.ValidateName("args" + "." + "meta"`,
  7139  		`type NestedObjectValidationsArgsMeta struct {`,
  7140  		"	First string `json:\"first,omitempty\"`",
  7141  		"	Fourth [][][]float32 `json:\"fourth\"`",
  7142  		"	Second float64 `json:\"second,omitempty\"`",
  7143  		"	Third []float32 `json:\"third\"`",
  7144  		`func (m *NestedObjectValidationsArgsMeta) Validate(formats strfmt.Registry) error {`,
  7145  		`	if err := m.validateFirst(formats); err != nil {`,
  7146  		`	if err := m.validateFourth(formats); err != nil {`,
  7147  		`	if err := m.validateSecond(formats); err != nil {`,
  7148  		`	if err := m.validateThird(formats); err != nil {`,
  7149  		`		return errors.CompositeValidationError(res...`,
  7150  		`func (m *NestedObjectValidationsArgsMeta) validateFirst(formats strfmt.Registry) error {`,
  7151  		`	if swag.IsZero(m.First) {`,
  7152  		`	if err := validate.MinLength("args"+"."+"meta"+"."+"first", "body", m.First, 2); err != nil {`,
  7153  		`	if err := validate.MaxLength("args"+"."+"meta"+"."+"first", "body", m.First, 50); err != nil {`,
  7154  		"	if err := validate.Pattern(\"args\"+\".\"+\"meta\"+\".\"+\"first\", \"body\", m.First, `^\\w+`); err != nil {",
  7155  		`func (m *NestedObjectValidationsArgsMeta) validateFourth(formats strfmt.Registry) error {`,
  7156  		`	if swag.IsZero(m.Fourth) {`,
  7157  		`	iFourthSize := int64(len(m.Fourth)`,
  7158  		`	if err := validate.MinItems("args"+"."+"meta"+"."+"fourth", "body", iFourthSize, 5); err != nil {`,
  7159  		`	if err := validate.MaxItems("args"+"."+"meta"+"."+"fourth", "body", iFourthSize, 93); err != nil {`,
  7160  		`	for i := 0; i < len(m.Fourth); i++ {`,
  7161  		`		iiFourthSize := int64(len(m.Fourth[i])`,
  7162  		`		if err := validate.MinItems("args"+"."+"meta"+"."+"fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 5); err != nil {`,
  7163  		`		if err := validate.MaxItems("args"+"."+"meta"+"."+"fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 93); err != nil {`,
  7164  		`		for ii := 0; ii < len(m.Fourth[i]); ii++ {`,
  7165  		`			iiiFourthSize := int64(len(m.Fourth[i][ii])`,
  7166  		`			if err := validate.MinItems("args"+"."+"meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 5); err != nil {`,
  7167  		`			if err := validate.MaxItems("args"+"."+"meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 93); err != nil {`,
  7168  		`			for iii := 0; iii < len(m.Fourth[i][ii]); iii++ {`,
  7169  		`				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 {`,
  7170  		`				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 {`,
  7171  		`				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 {`,
  7172  		`func (m *NestedObjectValidationsArgsMeta) validateSecond(formats strfmt.Registry) error {`,
  7173  		`	if swag.IsZero(m.Second) {`,
  7174  		`	if err := validate.Minimum("args"+"."+"meta"+"."+"second", "body", m.Second, 3, false); err != nil {`,
  7175  		`	if err := validate.Maximum("args"+"."+"meta"+"."+"second", "body", m.Second, 51, false); err != nil {`,
  7176  		`	if err := validate.MultipleOf("args"+"."+"meta"+"."+"second", "body", m.Second, 1.5); err != nil {`,
  7177  		`func (m *NestedObjectValidationsArgsMeta) validateThird(formats strfmt.Registry) error {`,
  7178  		`	if swag.IsZero(m.Third) {`,
  7179  		`	iThirdSize := int64(len(m.Third)`,
  7180  		`	if err := validate.MinItems("args"+"."+"meta"+"."+"third", "body", iThirdSize, 5); err != nil {`,
  7181  		`	if err := validate.MaxItems("args"+"."+"meta"+"."+"third", "body", iThirdSize, 93); err != nil {`,
  7182  		`	for i := 0; i < len(m.Third); i++ {`,
  7183  		`		if err := validate.Minimum("args"+"."+"meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 3, false); err != nil {`,
  7184  		`		if err := validate.Maximum("args"+"."+"meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 6, false); err != nil {`,
  7185  		`		if err := validate.MultipleOf("args"+"."+"meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 0.5); err != nil {`,
  7186  	},
  7187  		// not expected
  7188  		todo,
  7189  		// output in log
  7190  		noLines,
  7191  		noLines)
  7192  
  7193  	// load expectations for model: named_array_additional.go
  7194  	flattenRun.AddExpectations("named_array_additional.go", []string{
  7195  		`type NamedArrayAdditional struct {`,
  7196  		"	P0 *string `json:\"-\"`",
  7197  		"	P1 *float64 `json:\"-\"`",
  7198  		"	NamedArrayAdditionalItems []int64 `json:\"-\"`",
  7199  		`func (m *NamedArrayAdditional) Validate(formats strfmt.Registry) error {`,
  7200  		`	if err := m.validateP0(formats); err != nil {`,
  7201  		`	if err := m.validateP1(formats); err != nil {`,
  7202  		`	if err := m.validateNamedArrayAdditionalItems(formats); err != nil {`,
  7203  		`		return errors.CompositeValidationError(res...`,
  7204  		`func (m *NamedArrayAdditional) validateP0(formats strfmt.Registry) error {`,
  7205  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  7206  		`	if err := validate.MinLength("0", "body", *m.P0, 3); err != nil {`,
  7207  		`	if err := validate.MaxLength("0", "body", *m.P0, 10); err != nil {`,
  7208  		"	if err := validate.Pattern(\"0\", \"body\", *m.P0, `\\w+`); err != nil {",
  7209  		`func (m *NamedArrayAdditional) validateP1(formats strfmt.Registry) error {`,
  7210  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  7211  		`	if err := validate.Minimum("1", "body", *m.P1, 3, false); err != nil {`,
  7212  		`	if err := validate.Maximum("1", "body", *m.P1, 12, false); err != nil {`,
  7213  		`	if err := validate.MultipleOf("1", "body", *m.P1, 1.5); err != nil {`,
  7214  		`func (m *NamedArrayAdditional) validateNamedArrayAdditionalItems(formats strfmt.Registry) error {`,
  7215  		`	for i := range m.NamedArrayAdditionalItems {`,
  7216  		`		if err := validate.MinimumInt(strconv.Itoa(i+2), "body", m.NamedArrayAdditionalItems[i], 3, false); err != nil {`,
  7217  		`		if err := validate.MaximumInt(strconv.Itoa(i+2), "body", m.NamedArrayAdditionalItems[i], 6, false); err != nil {`,
  7218  		`		if err := validate.MultipleOfInt(strconv.Itoa(i+2), "body", m.NamedArrayAdditionalItems[i], 1); err != nil {`,
  7219  	},
  7220  		// not expected
  7221  		todo,
  7222  		// output in log
  7223  		noLines,
  7224  		noLines)
  7225  
  7226  	expandRun.AddExpectations("named_array_additional.go", flattenRun.ExpectedFor("NamedArrayAdditional").ExpectedLines, todo, noLines, noLines)
  7227  
  7228  	// load expectations for model: pet.go
  7229  	flattenRun.AddExpectations("pet.go", []string{
  7230  		`type Pet struct {`,
  7231  		"	Category *Category `json:\"category,omitempty\"`",
  7232  		"	ID int64 `json:\"id,omitempty\"`",
  7233  		"	Name *string `json:\"name\"`",
  7234  		"	PhotoUrls []string `json:\"photoUrls\" xml:\"photoUrl\"`",
  7235  		"	Status string `json:\"status,omitempty\"`",
  7236  		"	Tags []*Tag `json:\"tags\" xml:\"tag\"`",
  7237  		`func (m *Pet) Validate(formats strfmt.Registry) error {`,
  7238  		`	if err := m.validateCategory(formats); err != nil {`,
  7239  		`	if err := m.validateName(formats); err != nil {`,
  7240  		`	if err := m.validatePhotoUrls(formats); err != nil {`,
  7241  		`	if err := m.validateStatus(formats); err != nil {`,
  7242  		`	if err := m.validateTags(formats); err != nil {`,
  7243  		`		return errors.CompositeValidationError(res...`,
  7244  		`func (m *Pet) validateCategory(formats strfmt.Registry) error {`,
  7245  		`	if swag.IsZero(m.Category) {`,
  7246  		`	if m.Category != nil {`,
  7247  		`		if err := m.Category.Validate(formats); err != nil {`,
  7248  		`			if ve, ok := err.(*errors.Validation); ok {`,
  7249  		`				return ve.ValidateName("category"`,
  7250  		`func (m *Pet) validateName(formats strfmt.Registry) error {`,
  7251  		`	if err := validate.Required("name", "body", m.Name); err != nil {`,
  7252  		`func (m *Pet) validatePhotoUrls(formats strfmt.Registry) error {`,
  7253  		`	if err := validate.Required("photoUrls", "body", m.PhotoUrls); err != nil {`,
  7254  		`var petTypeStatusPropEnum []interface{`,
  7255  		`	var res []string`,
  7256  		"	if err := json.Unmarshal([]byte(`[\"available\",\"pending\",\"sold\"]`), &res); err != nil {",
  7257  		`	for _, v := range res {`,
  7258  		`		petTypeStatusPropEnum = append(petTypeStatusPropEnum, v`,
  7259  		`	PetStatusAvailable string = "available"`,
  7260  		`	PetStatusPending string = "pending"`,
  7261  		`	PetStatusSold string = "sold"`,
  7262  		`func (m *Pet) validateStatusEnum(path, location string, value string) error {`,
  7263  		`	if err := validate.EnumCase(path, location, value, petTypeStatusPropEnum, true); err != nil {`,
  7264  		`func (m *Pet) validateStatus(formats strfmt.Registry) error {`,
  7265  		`	if swag.IsZero(m.Status) {`,
  7266  		`	if err := m.validateStatusEnum("status", "body", m.Status); err != nil {`,
  7267  		`func (m *Pet) validateTags(formats strfmt.Registry) error {`,
  7268  		`	if swag.IsZero(m.Tags) {`,
  7269  		`	for i := 0; i < len(m.Tags); i++ {`,
  7270  		// do we need Required when item is nullable?
  7271  		// nullable not required:
  7272  		`		if swag.IsZero(m.Tags[i]) {`,
  7273  		// nullable required:
  7274  		`		if m.Tags[i] != nil {`,
  7275  		`			if err := m.Tags[i].Validate(formats); err != nil {`,
  7276  		`				if ve, ok := err.(*errors.Validation); ok {`,
  7277  		`					return ve.ValidateName("tags" + "." + strconv.Itoa(i)`,
  7278  	},
  7279  		// not expected
  7280  		todo,
  7281  		// output in log
  7282  		noLines,
  7283  		noLines)
  7284  
  7285  	expandRun.AddExpectations("pet.go", []string{
  7286  		`type Pet struct {`,
  7287  		"	Category *PetCategory `json:\"category,omitempty\"`",
  7288  		"	ID int64 `json:\"id,omitempty\"`",
  7289  		"	Name *string `json:\"name\"`",
  7290  		"	PhotoUrls []string `json:\"photoUrls\" xml:\"photoUrl\"`",
  7291  		"	Status string `json:\"status,omitempty\"`",
  7292  		"	Tags []*PetTagsItems0 `json:\"tags\" xml:\"tag\"`",
  7293  		`func (m *Pet) Validate(formats strfmt.Registry) error {`,
  7294  		`	if err := m.validateCategory(formats); err != nil {`,
  7295  		`	if err := m.validateName(formats); err != nil {`,
  7296  		`	if err := m.validatePhotoUrls(formats); err != nil {`,
  7297  		`	if err := m.validateStatus(formats); err != nil {`,
  7298  		`	if err := m.validateTags(formats); err != nil {`,
  7299  		`		return errors.CompositeValidationError(res...`,
  7300  		`func (m *Pet) validateCategory(formats strfmt.Registry) error {`,
  7301  		`	if swag.IsZero(m.Category) {`,
  7302  		`	if m.Category != nil {`,
  7303  		`		if err := m.Category.Validate(formats); err != nil {`,
  7304  		`			if ve, ok := err.(*errors.Validation); ok {`,
  7305  		`				return ve.ValidateName("category"`,
  7306  		`func (m *Pet) validateName(formats strfmt.Registry) error {`,
  7307  		`	if err := validate.Required("name", "body", m.Name); err != nil {`,
  7308  		`func (m *Pet) validatePhotoUrls(formats strfmt.Registry) error {`,
  7309  		`	if err := validate.Required("photoUrls", "body", m.PhotoUrls); err != nil {`,
  7310  		`var petTypeStatusPropEnum []interface{`,
  7311  		`	var res []string`,
  7312  		"	if err := json.Unmarshal([]byte(`[\"available\",\"pending\",\"sold\"]`), &res); err != nil {",
  7313  		`	for _, v := range res {`,
  7314  		`		petTypeStatusPropEnum = append(petTypeStatusPropEnum, v`,
  7315  		`	PetStatusAvailable string = "available"`,
  7316  		`	PetStatusPending string = "pending"`,
  7317  		`	PetStatusSold string = "sold"`,
  7318  		`func (m *Pet) validateStatusEnum(path, location string, value string) error {`,
  7319  		`	if err := validate.EnumCase(path, location, value, petTypeStatusPropEnum, true); err != nil {`,
  7320  		`func (m *Pet) validateStatus(formats strfmt.Registry) error {`,
  7321  		`	if swag.IsZero(m.Status) {`,
  7322  		`	if err := m.validateStatusEnum("status", "body", m.Status); err != nil {`,
  7323  		`func (m *Pet) validateTags(formats strfmt.Registry) error {`,
  7324  		`	if swag.IsZero(m.Tags) {`,
  7325  		`	for i := 0; i < len(m.Tags); i++ {`,
  7326  		// do we need Required when item is nullable?
  7327  		// nullable not required:
  7328  		`		if swag.IsZero(m.Tags[i]) {`,
  7329  		// nullable required:
  7330  		`		if m.Tags[i] != nil {`,
  7331  		`			if err := m.Tags[i].Validate(formats); err != nil {`,
  7332  		`				if ve, ok := err.(*errors.Validation); ok {`,
  7333  		`					return ve.ValidateName("tags" + "." + strconv.Itoa(i)`,
  7334  		`type PetCategory struct {`,
  7335  		"	ID int64 `json:\"id,omitempty\"`",
  7336  		"	Name string `json:\"name,omitempty\"`",
  7337  		// empty validation
  7338  		"func (m *PetCategory) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  7339  		`type PetTagsItems0 struct {`,
  7340  		"	ID int64 `json:\"id,omitempty\"`",
  7341  		"	Name string `json:\"name,omitempty\"`",
  7342  		// empty validation
  7343  		"func (m *PetTagsItems0) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  7344  	},
  7345  		// not expected
  7346  		todo,
  7347  		// output in log
  7348  		noLines,
  7349  		noLines)
  7350  
  7351  	// load expectations for model: map_complex_validations_meta.go
  7352  	// NOTE(fredbi): maps are simple types and this definition is no more generated
  7353  
  7354  	// load expectations for model: array_additional_validations_args.go
  7355  	flattenRun.AddExpectations("array_additional_validations_args.go", []string{
  7356  		`type ArrayAdditionalValidationsArgs struct {`,
  7357  		"	P0 *string `json:\"-\"`",
  7358  		"	P1 *float64 `json:\"-\"`",
  7359  		"	ArrayAdditionalValidationsArgsItems []int64 `json:\"-\"`",
  7360  		`func (m *ArrayAdditionalValidationsArgs) Validate(formats strfmt.Registry) error {`,
  7361  		`	if err := m.validateP0(formats); err != nil {`,
  7362  		`	if err := m.validateP1(formats); err != nil {`,
  7363  		`	if err := m.validateArrayAdditionalValidationsArgsItems(formats); err != nil {`,
  7364  		`		return errors.CompositeValidationError(res...`,
  7365  		`func (m *ArrayAdditionalValidationsArgs) validateP0(formats strfmt.Registry) error {`,
  7366  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  7367  		`	if err := validate.MinLength("0", "body", *m.P0, 3); err != nil {`,
  7368  		`	if err := validate.MaxLength("0", "body", *m.P0, 10); err != nil {`,
  7369  		"	if err := validate.Pattern(\"0\", \"body\", *m.P0, `\\w+`); err != nil {",
  7370  		`func (m *ArrayAdditionalValidationsArgs) validateP1(formats strfmt.Registry) error {`,
  7371  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  7372  		`	if err := validate.Minimum("1", "body", *m.P1, 3, false); err != nil {`,
  7373  		`	if err := validate.Maximum("1", "body", *m.P1, 12, false); err != nil {`,
  7374  		`	if err := validate.MultipleOf("1", "body", *m.P1, 1.5); err != nil {`,
  7375  		`func (m *ArrayAdditionalValidationsArgs) validateArrayAdditionalValidationsArgsItems(formats strfmt.Registry) error {`,
  7376  		`	for i := range m.ArrayAdditionalValidationsArgsItems {`,
  7377  		`		if err := validate.MinimumInt(strconv.Itoa(i+2), "body", m.ArrayAdditionalValidationsArgsItems[i], 3, false); err != nil {`,
  7378  		`		if err := validate.MaximumInt(strconv.Itoa(i+2), "body", m.ArrayAdditionalValidationsArgsItems[i], 6, false); err != nil {`,
  7379  		`		if err := validate.MultipleOfInt(strconv.Itoa(i+2), "body", m.ArrayAdditionalValidationsArgsItems[i], 1); err != nil {`,
  7380  	},
  7381  		// not expected
  7382  		todo,
  7383  		// output in log
  7384  		noLines,
  7385  		noLines)
  7386  
  7387  	// load expectations for model: all_of_validations_meta_all_of2.go
  7388  	flattenRun.AddExpectations("all_of_validations_meta_all_of2.go", []string{
  7389  		`type AllOfValidationsMetaAllOf2 struct {`,
  7390  		"	Args []string `json:\"args\"`",
  7391  		`func (m *AllOfValidationsMetaAllOf2) Validate(formats strfmt.Registry) error {`,
  7392  		`	if err := m.validateArgs(formats); err != nil {`,
  7393  		`		return errors.CompositeValidationError(res...`,
  7394  		`func (m *AllOfValidationsMetaAllOf2) validateArgs(formats strfmt.Registry) error {`,
  7395  		`	if swag.IsZero(m.Args) {`,
  7396  		`	iArgsSize := int64(len(m.Args)`,
  7397  		`	if err := validate.MinItems("args", "body", iArgsSize, 5); err != nil {`,
  7398  		`	if err := validate.MaxItems("args", "body", iArgsSize, 20); err != nil {`,
  7399  		`	for i := 0; i < len(m.Args); i++ {`,
  7400  		`		if err := validate.MinLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 2); err != nil {`,
  7401  		`		if err := validate.MaxLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 50); err != nil {`,
  7402  		"		if err := validate.Pattern(\"args\"+\".\"+strconv.Itoa(i), \"body\", m.Args[i], `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7403  	},
  7404  		// not expected
  7405  		todo,
  7406  		// output in log
  7407  		noLines,
  7408  		noLines)
  7409  
  7410  	// load expectations for model: all_of_validations_meta_all_of0.go
  7411  	flattenRun.AddExpectations("all_of_validations_meta_all_of0.go", []string{
  7412  		`type AllOfValidationsMetaAllOf0 struct {`,
  7413  		"	Name string `json:\"name,omitempty\"`",
  7414  		`func (m *AllOfValidationsMetaAllOf0) Validate(formats strfmt.Registry) error {`,
  7415  		`	if err := m.validateName(formats); err != nil {`,
  7416  		`		return errors.CompositeValidationError(res...`,
  7417  		`func (m *AllOfValidationsMetaAllOf0) validateName(formats strfmt.Registry) error {`,
  7418  		`	if swag.IsZero(m.Name) {`,
  7419  		`	if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`,
  7420  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  7421  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7422  	},
  7423  		// not expected
  7424  		todo,
  7425  		// output in log
  7426  		noLines,
  7427  		noLines)
  7428  
  7429  	// load expectations for model: named_all_of_all_of4.go
  7430  	flattenRun.AddExpectations("named_all_of_all_of4.go", []string{
  7431  		`type NamedAllOfAllOf4 struct {`,
  7432  		"	Opts map[string]float64 `json:\"opts,omitempty\"`",
  7433  		`func (m *NamedAllOfAllOf4) Validate(formats strfmt.Registry) error {`,
  7434  		`	if err := m.validateOpts(formats); err != nil {`,
  7435  		`		return errors.CompositeValidationError(res...`,
  7436  		`func (m *NamedAllOfAllOf4) validateOpts(formats strfmt.Registry) error {`,
  7437  		`	if swag.IsZero(m.Opts) {`,
  7438  		`	for k := range m.Opts {`,
  7439  		`		if err := validate.Minimum("opts"+"."+k, "body", m.Opts[k], 2, false); err != nil {`,
  7440  		`		if err := validate.Maximum("opts"+"."+k, "body", m.Opts[k], 50, false); err != nil {`,
  7441  		`		if err := validate.MultipleOf("opts"+"."+k, "body", m.Opts[k], 1.5); err != nil {`,
  7442  	},
  7443  		// not expected
  7444  		todo,
  7445  		// output in log
  7446  		noLines,
  7447  		noLines)
  7448  
  7449  	// load expectations for model: named_all_of_all_of0.go
  7450  	flattenRun.AddExpectations("named_all_of_all_of0.go", []string{
  7451  		`type NamedAllOfAllOf0 struct {`,
  7452  		"	Name string `json:\"name,omitempty\"`",
  7453  		`func (m *NamedAllOfAllOf0) Validate(formats strfmt.Registry) error {`,
  7454  		`	if err := m.validateName(formats); err != nil {`,
  7455  		`		return errors.CompositeValidationError(res...`,
  7456  		`func (m *NamedAllOfAllOf0) validateName(formats strfmt.Registry) error {`,
  7457  		`	if swag.IsZero(m.Name) {`,
  7458  		`	if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`,
  7459  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  7460  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7461  	},
  7462  		// not expected
  7463  		todo,
  7464  		// output in log
  7465  		noLines,
  7466  		noLines)
  7467  
  7468  	// load expectations for model: nested_map_complex_validations_meta_additional_properties_additional_properties_additional_properties.go
  7469  	flattenRun.AddExpectations("nested_map_complex_validations_meta_additional_properties_additional_properties_additional_properties.go", []string{
  7470  		`type NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties struct {`,
  7471  		"	Age int32 `json:\"age,omitempty\"`",
  7472  		"	Name string `json:\"name,omitempty\"`",
  7473  		`func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  7474  		`	if err := m.validateAge(formats); err != nil {`,
  7475  		`	if err := m.validateName(formats); err != nil {`,
  7476  		`		return errors.CompositeValidationError(res...`,
  7477  		`func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateAge(formats strfmt.Registry) error {`,
  7478  		`	if swag.IsZero(m.Age) {`,
  7479  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  7480  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  7481  		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
  7482  		`func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`,
  7483  		`	if swag.IsZero(m.Name) {`,
  7484  		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
  7485  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  7486  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
  7487  	},
  7488  		// not expected
  7489  		todo,
  7490  		// output in log
  7491  		noLines,
  7492  		noLines)
  7493  
  7494  	// load expectations for model: refed_all_of_validations.go
  7495  	flattenRun.AddExpectations("refed_all_of_validations.go", []string{
  7496  		`type RefedAllOfValidations struct {`,
  7497  		`	NamedString`,
  7498  		`	NamedNumber`,
  7499  		`func (m *RefedAllOfValidations) Validate(formats strfmt.Registry) error {`,
  7500  		`	if err := m.NamedString.Validate(formats); err != nil {`,
  7501  		`	if err := m.NamedNumber.Validate(formats); err != nil {`,
  7502  		`		return errors.CompositeValidationError(res...`,
  7503  	},
  7504  		// not expected
  7505  		todo,
  7506  		// output in log
  7507  		noLines,
  7508  		noLines)
  7509  
  7510  	expandRun.AddExpectations("refed_all_of_validations.go", []string{
  7511  		`type RefedAllOfValidations struct {`,
  7512  		`	RefedAllOfValidationsAllOf0`,
  7513  		`	RefedAllOfValidationsAllOf1`,
  7514  		`func (m *RefedAllOfValidations) Validate(formats strfmt.Registry) error {`,
  7515  		`	if err := m.RefedAllOfValidationsAllOf0.Validate(formats); err != nil {`,
  7516  		`	if err := m.RefedAllOfValidationsAllOf1.Validate(formats); err != nil {`,
  7517  		`		return errors.CompositeValidationError(res...`,
  7518  		`type RefedAllOfValidationsAllOf0 string`,
  7519  		`func (m RefedAllOfValidationsAllOf0) Validate(formats strfmt.Registry) error {`,
  7520  		`	if err := validate.MinLength("", "body", string(m), 2); err != nil {`,
  7521  		`	if err := validate.MaxLength("", "body", string(m), 50); err != nil {`,
  7522  		"	if err := validate.Pattern(\"\", \"body\", string(m), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7523  		`		return errors.CompositeValidationError(res...`,
  7524  		`type RefedAllOfValidationsAllOf1 int32`,
  7525  		`func (m RefedAllOfValidationsAllOf1) Validate(formats strfmt.Registry) error {`,
  7526  		`	if err := validate.MinimumInt("", "body", int64(m), 0, true); err != nil {`,
  7527  		`	if err := validate.MaximumInt("", "body", int64(m), 500, false); err != nil {`,
  7528  		`	if err := validate.MultipleOf("", "body", float64(m), 1.5); err != nil {`,
  7529  		`		return errors.CompositeValidationError(res...`,
  7530  	},
  7531  		// not expected
  7532  		todo,
  7533  		// output in log
  7534  		noLines,
  7535  		noLines)
  7536  
  7537  	// load expectations for model: update_org.go
  7538  	flattenRun.AddExpectations("update_org.go", []string{
  7539  		`type UpdateOrg struct {`,
  7540  		"	Email string `json:\"email,omitempty\"`",
  7541  		"	InvoiceEmail bool `json:\"invoice_email,omitempty\"`",
  7542  		"	TagExpiration *int64 `json:\"tag_expiration,omitempty\"`",
  7543  		`func (m *UpdateOrg) Validate(formats strfmt.Registry) error {`,
  7544  		`	if err := m.validateTagExpiration(formats); err != nil {`,
  7545  		`		return errors.CompositeValidationError(res...`,
  7546  		`func (m *UpdateOrg) validateTagExpiration(formats strfmt.Registry) error {`,
  7547  		`	if swag.IsZero(m.TagExpiration) {`,
  7548  		`	if err := validate.MinimumInt("tag_expiration", "body", *m.TagExpiration, 0, false); err != nil {`,
  7549  		`	if err := validate.MaximumInt("tag_expiration", "body", *m.TagExpiration, 2.592e+06, false); err != nil {`,
  7550  	},
  7551  		// not expected
  7552  		todo,
  7553  		// output in log
  7554  		noLines,
  7555  		noLines)
  7556  
  7557  	expandRun.AddExpectations("update_org.go", flattenRun.ExpectedFor("UpdateOrg").ExpectedLines, todo, noLines, noLines)
  7558  
  7559  	// load expectations for model: number_validations.go
  7560  	flattenRun.AddExpectations("number_validations.go", []string{
  7561  		`type NumberValidations struct {`,
  7562  		"	Age int32 `json:\"age,omitempty\"`",
  7563  		`func (m *NumberValidations) Validate(formats strfmt.Registry) error {`,
  7564  		`	if err := m.validateAge(formats); err != nil {`,
  7565  		`		return errors.CompositeValidationError(res...`,
  7566  		`func (m *NumberValidations) validateAge(formats strfmt.Registry) error {`,
  7567  		`	if swag.IsZero(m.Age) {`,
  7568  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 0, true); err != nil {`,
  7569  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 500, false); err != nil {`,
  7570  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`,
  7571  	},
  7572  		// not expected
  7573  		todo,
  7574  		// output in log
  7575  		noLines,
  7576  		noLines)
  7577  
  7578  	expandRun.AddExpectations("number_validations.go", flattenRun.ExpectedFor("NumberValidations").ExpectedLines, todo, noLines, noLines)
  7579  
  7580  	// load expectations for model: nested_map_complex_validations.go
  7581  	flattenRun.AddExpectations("nested_map_complex_validations.go", []string{
  7582  		`type NestedMapComplexValidations struct {`,
  7583  		// maps are now simple types
  7584  		"	Meta map[string]map[string]map[string]NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties `json:\"meta,omitempty\"`",
  7585  		`func (m *NestedMapComplexValidations) Validate(formats strfmt.Registry) error {`,
  7586  		`	if err := m.validateMeta(formats); err != nil {`,
  7587  		`		return errors.CompositeValidationError(res...`,
  7588  		`func (m *NestedMapComplexValidations) validateMeta(formats strfmt.Registry) error {`,
  7589  		`	if swag.IsZero(m.Meta) {`,
  7590  		`            		for k := range m.Meta {`,
  7591  		`            			for kk := range m.Meta[k] {`,
  7592  		`            				for kkk := range m.Meta[k][kk] {`,
  7593  		`	            				if err := validate.Required("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk]); err != nil {`,
  7594  		`            					if val, ok := m.Meta[k][kk][kkk]; ok {`,
  7595  		`            						if err := val.Validate(formats); err != nil {`,
  7596  	},
  7597  		// not expected
  7598  		todo,
  7599  		// output in log
  7600  		noLines,
  7601  		noLines)
  7602  
  7603  	expandRun.AddExpectations("nested_map_complex_validations.go", []string{
  7604  		`type NestedMapComplexValidations struct {`,
  7605  		"	Meta map[string]map[string]map[string]NestedMapComplexValidationsMetaAnon `json:\"meta,omitempty\"`",
  7606  		`func (m *NestedMapComplexValidations) Validate(formats strfmt.Registry) error {`,
  7607  		`	if err := m.validateMeta(formats); err != nil {`,
  7608  		`		return errors.CompositeValidationError(res...`,
  7609  		`func (m *NestedMapComplexValidations) validateMeta(formats strfmt.Registry) error {`,
  7610  		`	if swag.IsZero(m.Meta) {`,
  7611  		`	for k := range m.Meta {`,
  7612  		`		for kk := range m.Meta[k] {`,
  7613  		`			for kkk := range m.Meta[k][kk] {`,
  7614  		`				if val, ok := m.Meta[k][kk][kkk]; ok {`,
  7615  		`					if err := val.Validate(formats); err != nil {`,
  7616  		`type NestedMapComplexValidationsMetaAnon struct {`,
  7617  		"	Age int32 `json:\"age,omitempty\"`",
  7618  		"	Name string `json:\"name,omitempty\"`",
  7619  		`func (m *NestedMapComplexValidationsMetaAnon) Validate(formats strfmt.Registry) error {`,
  7620  		`	if err := m.validateAge(formats); err != nil {`,
  7621  		`	if err := m.validateName(formats); err != nil {`,
  7622  		`		return errors.CompositeValidationError(res...`,
  7623  		`func (m *NestedMapComplexValidationsMetaAnon) validateAge(formats strfmt.Registry) error {`,
  7624  		`	if swag.IsZero(m.Age) {`,
  7625  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  7626  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  7627  		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
  7628  		`func (m *NestedMapComplexValidationsMetaAnon) validateName(formats strfmt.Registry) error {`,
  7629  		`	if swag.IsZero(m.Name) {`,
  7630  		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
  7631  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  7632  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
  7633  	},
  7634  		// not expected
  7635  		todo,
  7636  		// output in log
  7637  		noLines,
  7638  		noLines)
  7639  
  7640  	// load expectations for model: category.go
  7641  	flattenRun.AddExpectations("category.go", []string{
  7642  		`type Category struct {`,
  7643  		"	ID int64 `json:\"id,omitempty\"`",
  7644  		"	Name string `json:\"name,omitempty\"`",
  7645  		// empty validation
  7646  		"func (m *Category) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  7647  	},
  7648  		// not expected
  7649  		todo,
  7650  		// output in log
  7651  		noLines,
  7652  		noLines)
  7653  
  7654  	expandRun.AddExpectations("category.go", flattenRun.ExpectedFor("Category").ExpectedLines, todo, noLines, noLines)
  7655  
  7656  	// load expectations for model: named_all_of_all_of2.go
  7657  	flattenRun.AddExpectations("named_all_of_all_of2.go", []string{
  7658  		`type NamedAllOfAllOf2 struct {`,
  7659  		"	Args []string `json:\"args\"`",
  7660  		`func (m *NamedAllOfAllOf2) Validate(formats strfmt.Registry) error {`,
  7661  		`	if err := m.validateArgs(formats); err != nil {`,
  7662  		`		return errors.CompositeValidationError(res...`,
  7663  		`func (m *NamedAllOfAllOf2) validateArgs(formats strfmt.Registry) error {`,
  7664  		`	if swag.IsZero(m.Args) {`,
  7665  		`	iArgsSize := int64(len(m.Args)`,
  7666  		`	if err := validate.MinItems("args", "body", iArgsSize, 5); err != nil {`,
  7667  		`	if err := validate.MaxItems("args", "body", iArgsSize, 20); err != nil {`,
  7668  		`	for i := 0; i < len(m.Args); i++ {`,
  7669  		`		if err := validate.MinLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 2); err != nil {`,
  7670  		`		if err := validate.MaxLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 50); err != nil {`,
  7671  		"		if err := validate.Pattern(\"args\"+\".\"+strconv.Itoa(i), \"body\", m.Args[i], `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7672  	},
  7673  		// not expected
  7674  		todo,
  7675  		// output in log
  7676  		noLines,
  7677  		noLines)
  7678  
  7679  	// load expectations for model: named_nested_map_complex_additional_properties_additional_properties.go
  7680  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  7681  
  7682  	// load expectations for model: named_nested_map_complex_additional_properties.go
  7683  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  7684  
  7685  	// load expectations for model: named_nested_array.go
  7686  	flattenRun.AddExpectations("named_nested_array.go", []string{
  7687  		`type NamedNestedArray [][][]string`,
  7688  		`func (m NamedNestedArray) Validate(formats strfmt.Registry) error {`,
  7689  		`	iNamedNestedArraySize := int64(len(m)`,
  7690  		`	if err := validate.MinItems("", "body", iNamedNestedArraySize, 3); err != nil {`,
  7691  		`	if err := validate.MaxItems("", "body", iNamedNestedArraySize, 10); err != nil {`,
  7692  		`	for i := 0; i < len(m); i++ {`,
  7693  		`		iiNamedNestedArraySize := int64(len(m[i])`,
  7694  		`		if err := validate.MinItems(strconv.Itoa(i), "body", iiNamedNestedArraySize, 3); err != nil {`,
  7695  		`		if err := validate.MaxItems(strconv.Itoa(i), "body", iiNamedNestedArraySize, 10); err != nil {`,
  7696  		`		for ii := 0; ii < len(m[i]); ii++ {`,
  7697  		`			iiiNamedNestedArraySize := int64(len(m[i][ii])`,
  7698  		`			if err := validate.MinItems(strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiNamedNestedArraySize, 3); err != nil {`,
  7699  		`			if err := validate.MaxItems(strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiNamedNestedArraySize, 10); err != nil {`,
  7700  		`			for iii := 0; iii < len(m[i][ii]); iii++ {`,
  7701  		`				if err := validate.MinLength(strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m[i][ii][iii], 3); err != nil {`,
  7702  		`				if err := validate.MaxLength(strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m[i][ii][iii], 10); err != nil {`,
  7703  		"				if err := validate.Pattern(strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", m[i][ii][iii], `\\w+`); err != nil {",
  7704  		`		return errors.CompositeValidationError(res...`,
  7705  	},
  7706  		// not expected
  7707  		todo,
  7708  		// output in log
  7709  		noLines,
  7710  		noLines)
  7711  
  7712  	expandRun.AddExpectations("named_nested_array.go", flattenRun.ExpectedFor("NamedNestedArray").ExpectedLines, todo, noLines, noLines)
  7713  
  7714  	// load expectations for model: named_all_of.go
  7715  	flattenRun.AddExpectations("named_all_of.go", []string{
  7716  		`type NamedAllOf struct {`,
  7717  		`	NamedAllOfAllOf0`,
  7718  		`	NamedAllOfAllOf1`,
  7719  		`	NamedAllOfAllOf2`,
  7720  		`	NamedAllOfAllOf3`,
  7721  		`	NamedAllOfAllOf4`,
  7722  		`	NamedAllOfAllOf5`,
  7723  		`	NamedAllOfAllOf6`,
  7724  		`func (m *NamedAllOf) Validate(formats strfmt.Registry) error {`,
  7725  		`	if err := m.NamedAllOfAllOf0.Validate(formats); err != nil {`,
  7726  		`	if err := m.NamedAllOfAllOf1.Validate(formats); err != nil {`,
  7727  		`	if err := m.NamedAllOfAllOf2.Validate(formats); err != nil {`,
  7728  		`	if err := m.NamedAllOfAllOf3.Validate(formats); err != nil {`,
  7729  		`	if err := m.NamedAllOfAllOf4.Validate(formats); err != nil {`,
  7730  		`	if err := m.NamedAllOfAllOf5.Validate(formats); err != nil {`,
  7731  		`	if err := m.NamedAllOfAllOf6.Validate(formats); err != nil {`,
  7732  		`		return errors.CompositeValidationError(res...`,
  7733  	},
  7734  		// not expected
  7735  		todo,
  7736  		// output in log
  7737  		noLines,
  7738  		noLines)
  7739  
  7740  	expandRun.AddExpectations("named_all_of.go", []string{
  7741  		`type NamedAllOf struct {`,
  7742  		"	Name string `json:\"name,omitempty\"`",
  7743  		"	Age int32 `json:\"age,omitempty\"`",
  7744  		"	Args []string `json:\"args\"`",
  7745  		"	Assoc [][][]string `json:\"assoc\"`",
  7746  		"	Opts map[string]float64 `json:\"opts,omitempty\"`",
  7747  		"	ExtOpts map[string]map[string]map[string]int32 `json:\"extOpts,omitempty\"`",
  7748  		`	Coords struct {`,
  7749  		"		Name string `json:\"name,omitempty\"`",
  7750  		"		Age int32 `json:\"age,omitempty\"`",
  7751  		"	} `json:\"coords,omitempty\"`",
  7752  		`func (m *NamedAllOf) Validate(formats strfmt.Registry) error {`,
  7753  		`	if err := m.validateName(formats); err != nil {`,
  7754  		`	if err := m.validateAge(formats); err != nil {`,
  7755  		`	if err := m.validateArgs(formats); err != nil {`,
  7756  		`	if err := m.validateAssoc(formats); err != nil {`,
  7757  		`	if err := m.validateOpts(formats); err != nil {`,
  7758  		`	if err := m.validateExtOpts(formats); err != nil {`,
  7759  		`	if err := m.validateCoords(formats); err != nil {`,
  7760  		`		return errors.CompositeValidationError(res...`,
  7761  		`func (m *NamedAllOf) validateName(formats strfmt.Registry) error {`,
  7762  		`	if swag.IsZero(m.Name) {`,
  7763  		`	if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`,
  7764  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  7765  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7766  		`func (m *NamedAllOf) validateAge(formats strfmt.Registry) error {`,
  7767  		`	if swag.IsZero(m.Age) {`,
  7768  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`,
  7769  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 50, false); err != nil {`,
  7770  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`,
  7771  		`func (m *NamedAllOf) validateArgs(formats strfmt.Registry) error {`,
  7772  		`	if swag.IsZero(m.Args) {`,
  7773  		`	iArgsSize := int64(len(m.Args)`,
  7774  		`	if err := validate.MinItems("args", "body", iArgsSize, 5); err != nil {`,
  7775  		`	if err := validate.MaxItems("args", "body", iArgsSize, 20); err != nil {`,
  7776  		`	for i := 0; i < len(m.Args); i++ {`,
  7777  		`		if err := validate.MinLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 2); err != nil {`,
  7778  		`		if err := validate.MaxLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 50); err != nil {`,
  7779  		"		if err := validate.Pattern(\"args\"+\".\"+strconv.Itoa(i), \"body\", m.Args[i], `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7780  		`func (m *NamedAllOf) validateAssoc(formats strfmt.Registry) error {`,
  7781  		`	if swag.IsZero(m.Assoc) {`,
  7782  		`	iAssocSize := int64(len(m.Assoc)`,
  7783  		`	if err := validate.MinItems("assoc", "body", iAssocSize, 5); err != nil {`,
  7784  		`	if err := validate.MaxItems("assoc", "body", iAssocSize, 20); err != nil {`,
  7785  		`	for i := 0; i < len(m.Assoc); i++ {`,
  7786  		`		iiAssocSize := int64(len(m.Assoc[i])`,
  7787  		`		if err := validate.MinItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 5); err != nil {`,
  7788  		`		if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 20); err != nil {`,
  7789  		`		for ii := 0; ii < len(m.Assoc[i]); ii++ {`,
  7790  		`			iiiAssocSize := int64(len(m.Assoc[i][ii])`,
  7791  		`			if err := validate.MinItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`,
  7792  		`			if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`,
  7793  		`			for iii := 0; iii < len(m.Assoc[i][ii]); iii++ {`,
  7794  		`				if err := validate.MinLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 2); err != nil {`,
  7795  		`				if err := validate.MaxLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 50); err != nil {`,
  7796  		"				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 {",
  7797  		`func (m *NamedAllOf) validateOpts(formats strfmt.Registry) error {`,
  7798  		`	if swag.IsZero(m.Opts) {`,
  7799  		`	for k := range m.Opts {`,
  7800  		`		if err := validate.Minimum("opts"+"."+k, "body", m.Opts[k], 2, false); err != nil {`,
  7801  		`		if err := validate.Maximum("opts"+"."+k, "body", m.Opts[k], 50, false); err != nil {`,
  7802  		`		if err := validate.MultipleOf("opts"+"."+k, "body", m.Opts[k], 1.5); err != nil {`,
  7803  		`func (m *NamedAllOf) validateExtOpts(formats strfmt.Registry) error {`,
  7804  		`	if swag.IsZero(m.ExtOpts) {`,
  7805  		`	for k := range m.ExtOpts {`,
  7806  		`		for kk := range m.ExtOpts[k] {`,
  7807  		`			for kkk := range m.ExtOpts[k][kk] {`,
  7808  		`				if err := validate.MinimumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 2, false); err != nil {`,
  7809  		`				if err := validate.MaximumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 50, false); err != nil {`,
  7810  		`				if err := validate.MultipleOf("extOpts"+"."+k+"."+kk+"."+kkk, "body", float64(m.ExtOpts[k][kk][kkk]), 1.5); err != nil {`,
  7811  		`func (m *NamedAllOf) validateCoords(formats strfmt.Registry) error {`,
  7812  		`	if swag.IsZero(m.Coords) {`,
  7813  		`	if err := validate.MinLength("coords"+"."+"name", "body", m.Coords.Name, 2); err != nil {`,
  7814  		`	if err := validate.MaxLength("coords"+"."+"name", "body", m.Coords.Name, 50); err != nil {`,
  7815  		"	if err := validate.Pattern(\"coords\"+\".\"+\"name\", \"body\", m.Coords.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7816  		`	if err := validate.MinimumInt("coords"+"."+"age", "body", int64(m.Coords.Age), 2, false); err != nil {`,
  7817  		`	if err := validate.MaximumInt("coords"+"."+"age", "body", int64(m.Coords.Age), 50, false); err != nil {`,
  7818  		`	if err := validate.MultipleOf("coords"+"."+"age", "body", float64(m.Coords.Age), 1.5); err != nil {`,
  7819  	},
  7820  		// not expected
  7821  		todo,
  7822  		// output in log
  7823  		noLines,
  7824  		noLines)
  7825  
  7826  	// load expectations for model: named_map_complex.go
  7827  	flattenRun.AddExpectations("named_map_complex.go", []string{
  7828  		`type NamedMapComplex map[string]NamedMapComplexAdditionalProperties`,
  7829  		`func (m NamedMapComplex) Validate(formats strfmt.Registry) error {`,
  7830  		`	for k := range m {`,
  7831  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  7832  		`		if val, ok := m[k]; ok {`,
  7833  		`			if err := val.Validate(formats); err != nil {`,
  7834  		`		return errors.CompositeValidationError(res...`,
  7835  	},
  7836  		// not expected
  7837  		todo,
  7838  		// output in log
  7839  		noLines,
  7840  		noLines)
  7841  
  7842  	expandRun.AddExpectations("named_map_complex.go", []string{
  7843  		`type NamedMapComplex map[string]NamedMapComplexAnon`,
  7844  		`func (m NamedMapComplex) Validate(formats strfmt.Registry) error {`,
  7845  		`	for k := range m {`,
  7846  		`		if val, ok := m[k]; ok {`,
  7847  		`			if err := val.Validate(formats); err != nil {`,
  7848  		`		return errors.CompositeValidationError(res...`,
  7849  		`type NamedMapComplexAnon struct {`,
  7850  		"	Age int32 `json:\"age,omitempty\"`",
  7851  		"	Name string `json:\"name,omitempty\"`",
  7852  		`func (m *NamedMapComplexAnon) Validate(formats strfmt.Registry) error {`,
  7853  		`	if err := m.validateAge(formats); err != nil {`,
  7854  		`	if err := m.validateName(formats); err != nil {`,
  7855  		`		return errors.CompositeValidationError(res...`,
  7856  		`func (m *NamedMapComplexAnon) validateAge(formats strfmt.Registry) error {`,
  7857  		`	if swag.IsZero(m.Age) {`,
  7858  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  7859  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  7860  		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
  7861  		`func (m *NamedMapComplexAnon) validateName(formats strfmt.Registry) error {`,
  7862  		`	if swag.IsZero(m.Name) {`,
  7863  		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
  7864  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  7865  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
  7866  	},
  7867  		// not expected
  7868  		todo,
  7869  		// output in log
  7870  		noLines,
  7871  		noLines)
  7872  
  7873  	// load expectations for model: nested_map_complex_validations_meta.go
  7874  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  7875  
  7876  	// load expectations for model: array_additional_validations.go
  7877  	flattenRun.AddExpectations("array_additional_validations.go", []string{
  7878  		`type ArrayAdditionalValidations struct {`,
  7879  		"	Args ArrayAdditionalValidationsArgs `json:\"args,omitempty\"`",
  7880  		`func (m *ArrayAdditionalValidations) Validate(formats strfmt.Registry) error {`,
  7881  		`	if err := m.validateArgs(formats); err != nil {`,
  7882  		`		return errors.CompositeValidationError(res...`,
  7883  		`func (m *ArrayAdditionalValidations) validateArgs(formats strfmt.Registry) error {`,
  7884  		`	if swag.IsZero(m.Args) {`,
  7885  		`	if err := m.Args.Validate(formats); err != nil {`,
  7886  		`		if ve, ok := err.(*errors.Validation); ok {`,
  7887  		`			return ve.ValidateName("args"`,
  7888  	},
  7889  		// not expected
  7890  		todo,
  7891  		// output in log
  7892  		noLines,
  7893  		noLines)
  7894  
  7895  	expandRun.AddExpectations("array_additional_validations.go", []string{
  7896  		`type ArrayAdditionalValidations struct {`,
  7897  		"	Args *ArrayAdditionalValidationsArgsTuple0 `json:\"args,omitempty\"`",
  7898  		`func (m *ArrayAdditionalValidations) Validate(formats strfmt.Registry) error {`,
  7899  		`	if err := m.validateArgs(formats); err != nil {`,
  7900  		`		return errors.CompositeValidationError(res...`,
  7901  		`func (m *ArrayAdditionalValidations) validateArgs(formats strfmt.Registry) error {`,
  7902  		`	if swag.IsZero(m.Args) {`,
  7903  		`	if m.Args != nil {`,
  7904  		`		if err := m.Args.Validate(formats); err != nil {`,
  7905  		`			if ve, ok := err.(*errors.Validation); ok {`,
  7906  		`				return ve.ValidateName("args"`,
  7907  		`type ArrayAdditionalValidationsArgsTuple0 struct {`,
  7908  		"	P0 *string `json:\"-\"`",
  7909  		"	P1 *float64 `json:\"-\"`",
  7910  		"	ArrayAdditionalValidationsArgsTuple0Items []int64 `json:\"-\"`",
  7911  		`func (m *ArrayAdditionalValidationsArgsTuple0) Validate(formats strfmt.Registry) error {`,
  7912  		`	if err := m.validateP0(formats); err != nil {`,
  7913  		`	if err := m.validateP1(formats); err != nil {`,
  7914  		`	if err := m.validateArrayAdditionalValidationsArgsTuple0Items(formats); err != nil {`,
  7915  		`		return errors.CompositeValidationError(res...`,
  7916  		`func (m *ArrayAdditionalValidationsArgsTuple0) validateP0(formats strfmt.Registry) error {`,
  7917  		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
  7918  		`	if err := validate.MinLength("P0", "body", *m.P0, 3); err != nil {`,
  7919  		`	if err := validate.MaxLength("P0", "body", *m.P0, 10); err != nil {`,
  7920  		"	if err := validate.Pattern(\"P0\", \"body\", *m.P0, `\\w+`); err != nil {",
  7921  		`func (m *ArrayAdditionalValidationsArgsTuple0) validateP1(formats strfmt.Registry) error {`,
  7922  		`	if err := validate.Required("P1", "body", m.P1); err != nil {`,
  7923  		`	if err := validate.Minimum("P1", "body", *m.P1, 3, false); err != nil {`,
  7924  		`	if err := validate.Maximum("P1", "body", *m.P1, 12, false); err != nil {`,
  7925  		`	if err := validate.MultipleOf("P1", "body", *m.P1, 1.5); err != nil {`,
  7926  		`func (m *ArrayAdditionalValidationsArgsTuple0) validateArrayAdditionalValidationsArgsTuple0Items(formats strfmt.Registry) error {`,
  7927  		`	for i := range m.ArrayAdditionalValidationsArgsTuple0Items {`,
  7928  		`		if err := validate.MinimumInt(strconv.Itoa(i), "body", m.ArrayAdditionalValidationsArgsTuple0Items[i], 3, false); err != nil {`,
  7929  		`		if err := validate.MaximumInt(strconv.Itoa(i), "body", m.ArrayAdditionalValidationsArgsTuple0Items[i], 6, false); err != nil {`,
  7930  		`		if err := validate.MultipleOfInt(strconv.Itoa(i), "body", m.ArrayAdditionalValidationsArgsTuple0Items[i], 1); err != nil {`,
  7931  	},
  7932  		// not expected
  7933  		todo,
  7934  		// output in log
  7935  		noLines,
  7936  		noLines)
  7937  
  7938  	// load expectations for model: nested_object_validations_args_meta.go
  7939  	flattenRun.AddExpectations("nested_object_validations_args_meta.go", []string{
  7940  		`type NestedObjectValidationsArgsMeta struct {`,
  7941  		"	First string `json:\"first,omitempty\"`",
  7942  		"	Fourth [][][]float32 `json:\"fourth\"`",
  7943  		"	Second float64 `json:\"second,omitempty\"`",
  7944  		"	Third []float32 `json:\"third\"`",
  7945  		`func (m *NestedObjectValidationsArgsMeta) Validate(formats strfmt.Registry) error {`,
  7946  		`	if err := m.validateFirst(formats); err != nil {`,
  7947  		`	if err := m.validateFourth(formats); err != nil {`,
  7948  		`	if err := m.validateSecond(formats); err != nil {`,
  7949  		`	if err := m.validateThird(formats); err != nil {`,
  7950  		`		return errors.CompositeValidationError(res...`,
  7951  		`func (m *NestedObjectValidationsArgsMeta) validateFirst(formats strfmt.Registry) error {`,
  7952  		`	if swag.IsZero(m.First) {`,
  7953  		`	if err := validate.MinLength("first", "body", m.First, 2); err != nil {`,
  7954  		`	if err := validate.MaxLength("first", "body", m.First, 50); err != nil {`,
  7955  		"	if err := validate.Pattern(\"first\", \"body\", m.First, `^\\w+`); err != nil {",
  7956  		`func (m *NestedObjectValidationsArgsMeta) validateFourth(formats strfmt.Registry) error {`,
  7957  		`	if swag.IsZero(m.Fourth) {`,
  7958  		`	iFourthSize := int64(len(m.Fourth)`,
  7959  		`	if err := validate.MinItems("fourth", "body", iFourthSize, 5); err != nil {`,
  7960  		`	if err := validate.MaxItems("fourth", "body", iFourthSize, 93); err != nil {`,
  7961  		`	for i := 0; i < len(m.Fourth); i++ {`,
  7962  		`		iiFourthSize := int64(len(m.Fourth[i])`,
  7963  		`		if err := validate.MinItems("fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 5); err != nil {`,
  7964  		`		if err := validate.MaxItems("fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 93); err != nil {`,
  7965  		`		for ii := 0; ii < len(m.Fourth[i]); ii++ {`,
  7966  		`			iiiFourthSize := int64(len(m.Fourth[i][ii])`,
  7967  		`			if err := validate.MinItems("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 5); err != nil {`,
  7968  		`			if err := validate.MaxItems("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 93); err != nil {`,
  7969  		`			for iii := 0; iii < len(m.Fourth[i][ii]); iii++ {`,
  7970  		`				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 {`,
  7971  		`				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 {`,
  7972  		`				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 {`,
  7973  		`func (m *NestedObjectValidationsArgsMeta) validateSecond(formats strfmt.Registry) error {`,
  7974  		`	if swag.IsZero(m.Second) {`,
  7975  		`	if err := validate.Minimum("second", "body", m.Second, 3, false); err != nil {`,
  7976  		`	if err := validate.Maximum("second", "body", m.Second, 51, false); err != nil {`,
  7977  		`	if err := validate.MultipleOf("second", "body", m.Second, 1.5); err != nil {`,
  7978  		`func (m *NestedObjectValidationsArgsMeta) validateThird(formats strfmt.Registry) error {`,
  7979  		`	if swag.IsZero(m.Third) {`,
  7980  		`	iThirdSize := int64(len(m.Third)`,
  7981  		`	if err := validate.MinItems("third", "body", iThirdSize, 5); err != nil {`,
  7982  		`	if err := validate.MaxItems("third", "body", iThirdSize, 93); err != nil {`,
  7983  		`	for i := 0; i < len(m.Third); i++ {`,
  7984  		`		if err := validate.Minimum("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 3, false); err != nil {`,
  7985  		`		if err := validate.Maximum("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 6, false); err != nil {`,
  7986  		`		if err := validate.MultipleOf("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 0.5); err != nil {`,
  7987  	},
  7988  		// not expected
  7989  		todo,
  7990  		// output in log
  7991  		noLines,
  7992  		noLines)
  7993  
  7994  	// load expectations for model: map_validations.go
  7995  	flattenRun.AddExpectations("map_validations.go", []string{
  7996  		`type MapValidations struct {`,
  7997  		"	Meta map[string]int64 `json:\"meta,omitempty\"`",
  7998  		`func (m *MapValidations) Validate(formats strfmt.Registry) error {`,
  7999  		`	if err := m.validateMeta(formats); err != nil {`,
  8000  		`		return errors.CompositeValidationError(res...`,
  8001  		`func (m *MapValidations) validateMeta(formats strfmt.Registry) error {`,
  8002  		`	if swag.IsZero(m.Meta) {`,
  8003  		`	for k := range m.Meta {`,
  8004  		`		if err := validate.MinimumInt("meta"+"."+k, "body", m.Meta[k], 3, false); err != nil {`,
  8005  		`		if err := validate.MaximumInt("meta"+"."+k, "body", m.Meta[k], 6, false); err != nil {`,
  8006  		`		if err := validate.MultipleOfInt("meta"+"."+k, "body", m.Meta[k], 1); err != nil {`,
  8007  	},
  8008  		// not expected
  8009  		todo,
  8010  		// output in log
  8011  		noLines,
  8012  		noLines)
  8013  
  8014  	expandRun.AddExpectations("map_validations.go", flattenRun.ExpectedFor("MapValidations").ExpectedLines, todo, noLines, noLines)
  8015  
  8016  	// load expectations for model: named_all_of_all_of1.go
  8017  	flattenRun.AddExpectations("named_all_of_all_of1.go", []string{
  8018  		`type NamedAllOfAllOf1 struct {`,
  8019  		"	Age int32 `json:\"age,omitempty\"`",
  8020  		`func (m *NamedAllOfAllOf1) Validate(formats strfmt.Registry) error {`,
  8021  		`	if err := m.validateAge(formats); err != nil {`,
  8022  		`		return errors.CompositeValidationError(res...`,
  8023  		`func (m *NamedAllOfAllOf1) validateAge(formats strfmt.Registry) error {`,
  8024  		`	if swag.IsZero(m.Age) {`,
  8025  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`,
  8026  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 50, false); err != nil {`,
  8027  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`,
  8028  	},
  8029  		// not expected
  8030  		todo,
  8031  		// output in log
  8032  		noLines,
  8033  		noLines)
  8034  
  8035  	// load expectations for model: all_of_validations_meta_all_of5.go
  8036  	flattenRun.AddExpectations("all_of_validations_meta_all_of5.go", []string{
  8037  		`type AllOfValidationsMetaAllOf5 struct {`,
  8038  		"	ExtOpts map[string]map[string]map[string]int32 `json:\"extOpts,omitempty\"`",
  8039  		`func (m *AllOfValidationsMetaAllOf5) Validate(formats strfmt.Registry) error {`,
  8040  		`	if err := m.validateExtOpts(formats); err != nil {`,
  8041  		`		return errors.CompositeValidationError(res...`,
  8042  		`func (m *AllOfValidationsMetaAllOf5) validateExtOpts(formats strfmt.Registry) error {`,
  8043  		`	if swag.IsZero(m.ExtOpts) {`,
  8044  		`	for k := range m.ExtOpts {`,
  8045  		`		for kk := range m.ExtOpts[k] {`,
  8046  		`			for kkk := range m.ExtOpts[k][kk] {`,
  8047  		`				if err := validate.MinimumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 2, false); err != nil {`,
  8048  		`				if err := validate.MaximumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 50, false); err != nil {`,
  8049  		`				if err := validate.MultipleOf("extOpts"+"."+k+"."+kk+"."+kkk, "body", float64(m.ExtOpts[k][kk][kkk]), 1.5); err != nil {`,
  8050  	},
  8051  		// not expected
  8052  		todo,
  8053  		// output in log
  8054  		noLines,
  8055  		noLines)
  8056  
  8057  	// load expectations for model: all_of_validations.go
  8058  	flattenRun.AddExpectations("all_of_validations.go", []string{
  8059  		`type AllOfValidations struct {`,
  8060  		"	Meta *AllOfValidationsMeta `json:\"meta,omitempty\"`",
  8061  		`func (m *AllOfValidations) Validate(formats strfmt.Registry) error {`,
  8062  		`	if err := m.validateMeta(formats); err != nil {`,
  8063  		`		return errors.CompositeValidationError(res...`,
  8064  		`func (m *AllOfValidations) validateMeta(formats strfmt.Registry) error {`,
  8065  		`	if swag.IsZero(m.Meta) {`,
  8066  		`	if m.Meta != nil {`,
  8067  		`		if err := m.Meta.Validate(formats); err != nil {`,
  8068  		`			if ve, ok := err.(*errors.Validation); ok {`,
  8069  		`				return ve.ValidateName("meta"`,
  8070  	},
  8071  		// not expected
  8072  		todo,
  8073  		// output in log
  8074  		noLines,
  8075  		noLines)
  8076  
  8077  	expandRun.AddExpectations("all_of_validations.go", []string{
  8078  		`type AllOfValidations struct {`,
  8079  		`	Meta struct {`,
  8080  		"		Name string `json:\"name,omitempty\"`",
  8081  		"		Age int32 `json:\"age,omitempty\"`",
  8082  		"		Args []string `json:\"args\"`",
  8083  		"		Assoc [][][]string `json:\"assoc\"`",
  8084  		"		Opts map[string]int32 `json:\"opts,omitempty\"`",
  8085  		"		ExtOpts map[string]map[string]map[string]int32 `json:\"extOpts,omitempty\"`",
  8086  		`		Coords struct {`,
  8087  		"			Name string `json:\"name,omitempty\"`",
  8088  		"			Age int32 `json:\"age,omitempty\"`",
  8089  		"		} `json:\"coords,omitempty\"`",
  8090  		"	} `json:\"meta,omitempty\"`",
  8091  		`func (m *AllOfValidations) Validate(formats strfmt.Registry) error {`,
  8092  		`	if err := m.validateMeta(formats); err != nil {`,
  8093  		`		return errors.CompositeValidationError(res...`,
  8094  		`func (m *AllOfValidations) validateMeta(formats strfmt.Registry) error {`,
  8095  		`	if swag.IsZero(m.Meta) {`,
  8096  		`	if err := validate.MinLength("meta"+"."+"name", "body", m.Meta.Name, 2); err != nil {`,
  8097  		`	if err := validate.MaxLength("meta"+"."+"name", "body", m.Meta.Name, 50); err != nil {`,
  8098  		"	if err := validate.Pattern(\"meta\"+\".\"+\"name\", \"body\", m.Meta.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
  8099  		`	if err := validate.MinimumInt("meta"+"."+"age", "body", int64(m.Meta.Age), 2, false); err != nil {`,
  8100  		`	if err := validate.MaximumInt("meta"+"."+"age", "body", int64(m.Meta.Age), 50, false); err != nil {`,
  8101  		`	if err := validate.MultipleOf("meta"+"."+"age", "body", float64(m.Meta.Age), 1.5); err != nil {`,
  8102  		`	iArgsSize := int64(len(m.Meta.Args)`,
  8103  		`	if err := validate.MinItems("meta"+"."+"args", "body", iArgsSize, 5); err != nil {`,
  8104  		`	if err := validate.MaxItems("meta"+"."+"args", "body", iArgsSize, 20); err != nil {`,
  8105  		`	for i := 0; i < len(m.Meta.Args); i++ {`,
  8106  		`		if err := validate.MinLength("meta"+"."+"args"+"."+strconv.Itoa(i), "body", m.Meta.Args[i], 2); err != nil {`,
  8107  		`		if err := validate.MaxLength("meta"+"."+"args"+"."+strconv.Itoa(i), "body", m.Meta.Args[i], 50); err != nil {`,
  8108  		"		if err := validate.Pattern(\"meta\"+\".\"+\"args\"+\".\"+strconv.Itoa(i), \"body\", m.Meta.Args[i], `[A-Za-z0-9][\\w- ]+`); err != nil {",
  8109  		`	iAssocSize := int64(len(m.Meta.Assoc)`,
  8110  		`	if err := validate.MinItems("meta"+"."+"assoc", "body", iAssocSize, 5); err != nil {`,
  8111  		`	if err := validate.MaxItems("meta"+"."+"assoc", "body", iAssocSize, 20); err != nil {`,
  8112  		`	for i := 0; i < len(m.Meta.Assoc); i++ {`,
  8113  		`		iiAssocSize := int64(len(m.Meta.Assoc[i])`,
  8114  		`		if err := validate.MinItems("meta"+"."+"assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 5); err != nil {`,
  8115  		`		if err := validate.MaxItems("meta"+"."+"assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 20); err != nil {`,
  8116  		`		for ii := 0; ii < len(m.Meta.Assoc[i]); ii++ {`,
  8117  		`			iiiAssocSize := int64(len(m.Meta.Assoc[i][ii])`,
  8118  		`			if err := validate.MinItems("meta"+"."+"assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`,
  8119  		`			if err := validate.MaxItems("meta"+"."+"assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`,
  8120  		`			for iii := 0; iii < len(m.Meta.Assoc[i][ii]); iii++ {`,
  8121  		`				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 {`,
  8122  		`				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 {`,
  8123  		"				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 {",
  8124  		`	for k := range m.Meta.Opts {`,
  8125  		`		if err := validate.MinimumInt("meta"+"."+"opts"+"."+k, "body", int64(m.Meta.Opts[k]), 2, false); err != nil {`,
  8126  		`		if err := validate.MaximumInt("meta"+"."+"opts"+"."+k, "body", int64(m.Meta.Opts[k]), 50, false); err != nil {`,
  8127  		`		if err := validate.MultipleOf("meta"+"."+"opts"+"."+k, "body", float64(m.Meta.Opts[k]), 1.5); err != nil {`,
  8128  		`	for k := range m.Meta.ExtOpts {`,
  8129  		`		for kk := range m.Meta.ExtOpts[k] {`,
  8130  		`			for kkk := range m.Meta.ExtOpts[k][kk] {`,
  8131  		`				if err := validate.MinimumInt("meta"+"."+"extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.Meta.ExtOpts[k][kk][kkk]), 2, false); err != nil {`,
  8132  		`				if err := validate.MaximumInt("meta"+"."+"extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.Meta.ExtOpts[k][kk][kkk]), 50, false); err != nil {`,
  8133  		`				if err := validate.MultipleOf("meta"+"."+"extOpts"+"."+k+"."+kk+"."+kkk, "body", float64(m.Meta.ExtOpts[k][kk][kkk]), 1.5); err != nil {`,
  8134  		`	if err := validate.MinLength("meta"+"."+"coords"+"."+"name", "body", m.Meta.Coords.Name, 2); err != nil {`,
  8135  		`	if err := validate.MaxLength("meta"+"."+"coords"+"."+"name", "body", m.Meta.Coords.Name, 50); err != nil {`,
  8136  		"	if err := validate.Pattern(\"meta\"+\".\"+\"coords\"+\".\"+\"name\", \"body\", m.Meta.Coords.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
  8137  		`	if err := validate.MinimumInt("meta"+"."+"coords"+"."+"age", "body", int64(m.Meta.Coords.Age), 2, false); err != nil {`,
  8138  		`	if err := validate.MaximumInt("meta"+"."+"coords"+"."+"age", "body", int64(m.Meta.Coords.Age), 50, false); err != nil {`,
  8139  		`	if err := validate.MultipleOf("meta"+"."+"coords"+"."+"age", "body", float64(m.Meta.Coords.Age), 1.5); err != nil {`,
  8140  	},
  8141  		// not expected
  8142  		todo,
  8143  		// output in log
  8144  		noLines,
  8145  		noLines)
  8146  
  8147  	// load expectations for model: named_nested_object_meta.go
  8148  	flattenRun.AddExpectations("named_nested_object_meta.go", []string{
  8149  		`type NamedNestedObjectMeta struct {`,
  8150  		"	First string `json:\"first,omitempty\"`",
  8151  		"	Fourth [][][]float32 `json:\"fourth\"`",
  8152  		"	Second float64 `json:\"second,omitempty\"`",
  8153  		"	Third []float32 `json:\"third\"`",
  8154  		`func (m *NamedNestedObjectMeta) Validate(formats strfmt.Registry) error {`,
  8155  		`	if err := m.validateFirst(formats); err != nil {`,
  8156  		`	if err := m.validateFourth(formats); err != nil {`,
  8157  		`	if err := m.validateSecond(formats); err != nil {`,
  8158  		`	if err := m.validateThird(formats); err != nil {`,
  8159  		`		return errors.CompositeValidationError(res...`,
  8160  		`func (m *NamedNestedObjectMeta) validateFirst(formats strfmt.Registry) error {`,
  8161  		`	if swag.IsZero(m.First) {`,
  8162  		`	if err := validate.MinLength("first", "body", m.First, 2); err != nil {`,
  8163  		`	if err := validate.MaxLength("first", "body", m.First, 50); err != nil {`,
  8164  		"	if err := validate.Pattern(\"first\", \"body\", m.First, `^\\w+`); err != nil {",
  8165  		`func (m *NamedNestedObjectMeta) validateFourth(formats strfmt.Registry) error {`,
  8166  		`	if swag.IsZero(m.Fourth) {`,
  8167  		`	iFourthSize := int64(len(m.Fourth)`,
  8168  		`	if err := validate.MinItems("fourth", "body", iFourthSize, 5); err != nil {`,
  8169  		`	if err := validate.MaxItems("fourth", "body", iFourthSize, 93); err != nil {`,
  8170  		`	for i := 0; i < len(m.Fourth); i++ {`,
  8171  		`		iiFourthSize := int64(len(m.Fourth[i])`,
  8172  		`		if err := validate.MinItems("fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 5); err != nil {`,
  8173  		`		if err := validate.MaxItems("fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 93); err != nil {`,
  8174  		`		for ii := 0; ii < len(m.Fourth[i]); ii++ {`,
  8175  		`			iiiFourthSize := int64(len(m.Fourth[i][ii])`,
  8176  		`			if err := validate.MinItems("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 5); err != nil {`,
  8177  		`			if err := validate.MaxItems("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 93); err != nil {`,
  8178  		`			for iii := 0; iii < len(m.Fourth[i][ii]); iii++ {`,
  8179  		`				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 {`,
  8180  		`				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 {`,
  8181  		`				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 {`,
  8182  		`func (m *NamedNestedObjectMeta) validateSecond(formats strfmt.Registry) error {`,
  8183  		`	if swag.IsZero(m.Second) {`,
  8184  		`	if err := validate.Minimum("second", "body", m.Second, 3, false); err != nil {`,
  8185  		`	if err := validate.Maximum("second", "body", m.Second, 51, false); err != nil {`,
  8186  		`	if err := validate.MultipleOf("second", "body", m.Second, 1.5); err != nil {`,
  8187  		`func (m *NamedNestedObjectMeta) validateThird(formats strfmt.Registry) error {`,
  8188  		`	if swag.IsZero(m.Third) {`,
  8189  		`	iThirdSize := int64(len(m.Third)`,
  8190  		`	if err := validate.MinItems("third", "body", iThirdSize, 5); err != nil {`,
  8191  		`	if err := validate.MaxItems("third", "body", iThirdSize, 93); err != nil {`,
  8192  		`	for i := 0; i < len(m.Third); i++ {`,
  8193  		`		if err := validate.Minimum("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 3, false); err != nil {`,
  8194  		`		if err := validate.Maximum("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 6, false); err != nil {`,
  8195  		`		if err := validate.MultipleOf("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 0.5); err != nil {`,
  8196  	},
  8197  		// not expected
  8198  		todo,
  8199  		// output in log
  8200  		noLines,
  8201  		noLines)
  8202  
  8203  	// load expectations for model: named_nested_object.go
  8204  	flattenRun.AddExpectations("named_nested_object.go", []string{
  8205  		`type NamedNestedObject struct {`,
  8206  		"	Meta *NamedNestedObjectMeta `json:\"meta,omitempty\"`",
  8207  		`func (m *NamedNestedObject) Validate(formats strfmt.Registry) error {`,
  8208  		`	if err := m.validateMeta(formats); err != nil {`,
  8209  		`		return errors.CompositeValidationError(res...`,
  8210  		`func (m *NamedNestedObject) validateMeta(formats strfmt.Registry) error {`,
  8211  		`	if swag.IsZero(m.Meta) {`,
  8212  		`	if m.Meta != nil {`,
  8213  		`		if err := m.Meta.Validate(formats); err != nil {`,
  8214  		`			if ve, ok := err.(*errors.Validation); ok {`,
  8215  		`				return ve.ValidateName("meta"`,
  8216  	},
  8217  		// not expected
  8218  		todo,
  8219  		// output in log
  8220  		noLines,
  8221  		noLines)
  8222  
  8223  	expandRun.AddExpectations("named_nested_object.go", []string{
  8224  		`type NamedNestedObject struct {`,
  8225  		"	Meta *NamedNestedObjectMeta `json:\"meta,omitempty\"`",
  8226  		`func (m *NamedNestedObject) Validate(formats strfmt.Registry) error {`,
  8227  		`	if err := m.validateMeta(formats); err != nil {`,
  8228  		`		return errors.CompositeValidationError(res...`,
  8229  		`func (m *NamedNestedObject) validateMeta(formats strfmt.Registry) error {`,
  8230  		`	if swag.IsZero(m.Meta) {`,
  8231  		`	if m.Meta != nil {`,
  8232  		`		if err := m.Meta.Validate(formats); err != nil {`,
  8233  		`			if ve, ok := err.(*errors.Validation); ok {`,
  8234  		`				return ve.ValidateName("meta"`,
  8235  		`type NamedNestedObjectMeta struct {`,
  8236  		"	First string `json:\"first,omitempty\"`",
  8237  		"	Fourth [][][]float32 `json:\"fourth\"`",
  8238  		"	Second float64 `json:\"second,omitempty\"`",
  8239  		"	Third []float32 `json:\"third\"`",
  8240  		`func (m *NamedNestedObjectMeta) Validate(formats strfmt.Registry) error {`,
  8241  		`	if err := m.validateFirst(formats); err != nil {`,
  8242  		`	if err := m.validateFourth(formats); err != nil {`,
  8243  		`	if err := m.validateSecond(formats); err != nil {`,
  8244  		`	if err := m.validateThird(formats); err != nil {`,
  8245  		`		return errors.CompositeValidationError(res...`,
  8246  		`func (m *NamedNestedObjectMeta) validateFirst(formats strfmt.Registry) error {`,
  8247  		`	if swag.IsZero(m.First) {`,
  8248  		`	if err := validate.MinLength("meta"+"."+"first", "body", m.First, 2); err != nil {`,
  8249  		`	if err := validate.MaxLength("meta"+"."+"first", "body", m.First, 50); err != nil {`,
  8250  		"	if err := validate.Pattern(\"meta\"+\".\"+\"first\", \"body\", m.First, `^\\w+`); err != nil {",
  8251  		`func (m *NamedNestedObjectMeta) validateFourth(formats strfmt.Registry) error {`,
  8252  		`	if swag.IsZero(m.Fourth) {`,
  8253  		`	iFourthSize := int64(len(m.Fourth)`,
  8254  		`	if err := validate.MinItems("meta"+"."+"fourth", "body", iFourthSize, 5); err != nil {`,
  8255  		`	if err := validate.MaxItems("meta"+"."+"fourth", "body", iFourthSize, 93); err != nil {`,
  8256  		`	for i := 0; i < len(m.Fourth); i++ {`,
  8257  		`		iiFourthSize := int64(len(m.Fourth[i])`,
  8258  		`		if err := validate.MinItems("meta"+"."+"fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 5); err != nil {`,
  8259  		`		if err := validate.MaxItems("meta"+"."+"fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 93); err != nil {`,
  8260  		`		for ii := 0; ii < len(m.Fourth[i]); ii++ {`,
  8261  		`			iiiFourthSize := int64(len(m.Fourth[i][ii])`,
  8262  		`			if err := validate.MinItems("meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 5); err != nil {`,
  8263  		`			if err := validate.MaxItems("meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 93); err != nil {`,
  8264  		`			for iii := 0; iii < len(m.Fourth[i][ii]); iii++ {`,
  8265  		`				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 {`,
  8266  		`				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 {`,
  8267  		`				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 {`,
  8268  		`func (m *NamedNestedObjectMeta) validateSecond(formats strfmt.Registry) error {`,
  8269  		`	if swag.IsZero(m.Second) {`,
  8270  		`	if err := validate.Minimum("meta"+"."+"second", "body", m.Second, 3, false); err != nil {`,
  8271  		`	if err := validate.Maximum("meta"+"."+"second", "body", m.Second, 51, false); err != nil {`,
  8272  		`	if err := validate.MultipleOf("meta"+"."+"second", "body", m.Second, 1.5); err != nil {`,
  8273  		`func (m *NamedNestedObjectMeta) validateThird(formats strfmt.Registry) error {`,
  8274  		`	if swag.IsZero(m.Third) {`,
  8275  		`	iThirdSize := int64(len(m.Third)`,
  8276  		`	if err := validate.MinItems("meta"+"."+"third", "body", iThirdSize, 5); err != nil {`,
  8277  		`	if err := validate.MaxItems("meta"+"."+"third", "body", iThirdSize, 93); err != nil {`,
  8278  		`	for i := 0; i < len(m.Third); i++ {`,
  8279  		`		if err := validate.Minimum("meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 3, false); err != nil {`,
  8280  		`		if err := validate.Maximum("meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 6, false); err != nil {`,
  8281  		`		if err := validate.MultipleOf("meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 0.5); err != nil {`,
  8282  	},
  8283  		// not expected
  8284  		todo,
  8285  		// output in log
  8286  		noLines,
  8287  		noLines)
  8288  
  8289  	// load expectations for model: all_of_validations_meta_all_of6_coords_all_of0.go
  8290  	flattenRun.AddExpectations("all_of_validations_meta_all_of6_coords_all_of0.go", []string{
  8291  		`type AllOfValidationsMetaAllOf6CoordsAllOf0 struct {`,
  8292  		"	Name string `json:\"name,omitempty\"`",
  8293  		`func (m *AllOfValidationsMetaAllOf6CoordsAllOf0) Validate(formats strfmt.Registry) error {`,
  8294  		`	if err := m.validateName(formats); err != nil {`,
  8295  		`		return errors.CompositeValidationError(res...`,
  8296  		`func (m *AllOfValidationsMetaAllOf6CoordsAllOf0) validateName(formats strfmt.Registry) error {`,
  8297  		`	if swag.IsZero(m.Name) {`,
  8298  		`	if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`,
  8299  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  8300  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
  8301  	},
  8302  		// not expected
  8303  		todo,
  8304  		// output in log
  8305  		noLines,
  8306  		noLines)
  8307  
  8308  	// load expectations for model: named_nested_map.go
  8309  	flattenRun.AddExpectations("named_nested_map.go", []string{
  8310  		`type NamedNestedMap map[string]map[string]map[string]int64`,
  8311  		`func (m NamedNestedMap) Validate(formats strfmt.Registry) error {`,
  8312  		`	for k := range m {`,
  8313  		`		for kk := range m[k] {`,
  8314  		`			for kkk := range m[k][kk] {`,
  8315  		`				if err := validate.MinimumInt(k+"."+kk+"."+kkk, "body", m[k][kk][kkk], 3, false); err != nil {`,
  8316  		`				if err := validate.MaximumInt(k+"."+kk+"."+kkk, "body", m[k][kk][kkk], 6, false); err != nil {`,
  8317  		`				if err := validate.MultipleOfInt(k+"."+kk+"."+kkk, "body", m[k][kk][kkk], 1); err != nil {`,
  8318  		`		return errors.CompositeValidationError(res...`,
  8319  	},
  8320  		// not expected
  8321  		todo,
  8322  		// output in log
  8323  		noLines,
  8324  		noLines)
  8325  
  8326  	expandRun.AddExpectations("named_nested_map.go", flattenRun.ExpectedFor("NamedNestedMap").ExpectedLines, todo, noLines, noLines)
  8327  }
  8328  
  8329  func initFixtureNestedMaps() {
  8330  	// testing fixture-nested-maps.yaml with flatten and expand (--skip-flatten)
  8331  
  8332  	/*
  8333  	   Test specifically focused on nested maps (e.g.nested additionalProperties)
  8334  
  8335  	*/
  8336  
  8337  	f := newModelFixture("../fixtures/bugs/1487/fixture-nested-maps.yaml", "Nested maps")
  8338  	flattenRun := f.AddRun(false)
  8339  	expandRun := f.AddRun(true)
  8340  
  8341  	// load expectations for model: alias_interface.go
  8342  	flattenRun.AddExpectations("alias_interface.go", []string{
  8343  		`type AliasInterface interface{`,
  8344  	},
  8345  		// not expected
  8346  		validatable,
  8347  		// output in log
  8348  		noLines,
  8349  		noLines)
  8350  
  8351  	expandRun.AddExpectations("alias_interface.go", flattenRun.ExpectedFor("AliasInterface").ExpectedLines, validatable, noLines, noLines)
  8352  
  8353  	// load expectations for model: test_nested_aliased_interface.go
  8354  	flattenRun.AddExpectations("test_nested_aliased_interface.go", []string{
  8355  		`type TestNestedAliasedInterface struct {`,
  8356  		"	Meta map[string]map[string]map[string]AliasInterface `json:\"meta,omitempty\"`",
  8357  		// empty validation
  8358  		"func (m *TestNestedAliasedInterface) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8359  	},
  8360  		// not expected
  8361  		todo,
  8362  		// output in log
  8363  		noLines,
  8364  		noLines)
  8365  
  8366  	expandRun.AddExpectations("test_nested_aliased_interface.go", []string{
  8367  		`type TestNestedAliasedInterface struct {`,
  8368  		"	Meta map[string]map[string]map[string]interface{} `json:\"meta,omitempty\"`",
  8369  		// empty validation
  8370  		"func (m *TestNestedAliasedInterface) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8371  	},
  8372  		// not expected
  8373  		todo,
  8374  		// output in log
  8375  		noLines,
  8376  		noLines)
  8377  
  8378  	// load expectations for model: nested_map_validations.go
  8379  	flattenRun.AddExpectations("nested_map_validations.go", []string{
  8380  		`type NestedMapValidations struct {`,
  8381  		"	Meta map[string]map[string]map[string]int64 `json:\"meta,omitempty\"`",
  8382  		`func (m *NestedMapValidations) Validate(formats strfmt.Registry) error {`,
  8383  		`	if err := m.validateMeta(formats); err != nil {`,
  8384  		`		return errors.CompositeValidationError(res...`,
  8385  		`func (m *NestedMapValidations) validateMeta(formats strfmt.Registry) error {`,
  8386  		`	if swag.IsZero(m.Meta) {`,
  8387  		`	for k := range m.Meta {`,
  8388  		`		for kk := range m.Meta[k] {`,
  8389  		`			for kkk := range m.Meta[k][kk] {`,
  8390  		`				if err := validate.MinimumInt("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk], 3, false); err != nil {`,
  8391  		`				if err := validate.MaximumInt("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk], 6, false); err != nil {`,
  8392  		`				if err := validate.MultipleOfInt("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk], 1); err != nil {`,
  8393  	},
  8394  		// not expected
  8395  		todo,
  8396  		// output in log
  8397  		noLines,
  8398  		noLines)
  8399  
  8400  	expandRun.AddExpectations("nested_map_validations.go", flattenRun.ExpectedFor("NestedMapValidations").ExpectedLines, todo, noLines, noLines)
  8401  
  8402  	// load expectations for model: named_nested_map_complex.go
  8403  	flattenRun.AddExpectations("named_nested_map_complex.go", []string{
  8404  		`type NamedNestedMapComplex map[string]map[string]map[string]NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties`,
  8405  		`func (m NamedNestedMapComplex) Validate(formats strfmt.Registry) error {`,
  8406  		`	for k := range m {`,
  8407  		`		for kk := range m[k] {`,
  8408  		`			for kkk := range m[k][kk] {`,
  8409  		`				if err := validate.Required(k+"."+kk+"."+kkk, "body", m[k][kk][kkk]); err != nil {`,
  8410  		`				if val, ok := m[k][kk][kkk]; ok {`,
  8411  		`					if err := val.Validate(formats); err != nil {`,
  8412  		`		return errors.CompositeValidationError(res...`,
  8413  	},
  8414  		// not expected
  8415  		todo,
  8416  		// output in log
  8417  		noLines,
  8418  		noLines)
  8419  
  8420  	expandRun.AddExpectations("named_nested_map_complex.go", []string{
  8421  		`type NamedNestedMapComplex map[string]map[string]map[string]NamedNestedMapComplexAnon`,
  8422  		`func (m NamedNestedMapComplex) Validate(formats strfmt.Registry) error {`,
  8423  		`	for k := range m {`,
  8424  		`		for kk := range m[k] {`,
  8425  		`			for kkk := range m[k][kk] {`,
  8426  		`				if val, ok := m[k][kk][kkk]; ok {`,
  8427  		`					if err := val.Validate(formats); err != nil {`,
  8428  		`		return errors.CompositeValidationError(res...`,
  8429  		`type NamedNestedMapComplexAnon struct {`,
  8430  		"	Age int32 `json:\"age,omitempty\"`",
  8431  		"	Name string `json:\"name,omitempty\"`",
  8432  		`func (m *NamedNestedMapComplexAnon) Validate(formats strfmt.Registry) error {`,
  8433  		`	if err := m.validateAge(formats); err != nil {`,
  8434  		`	if err := m.validateName(formats); err != nil {`,
  8435  		`		return errors.CompositeValidationError(res...`,
  8436  		`func (m *NamedNestedMapComplexAnon) validateAge(formats strfmt.Registry) error {`,
  8437  		`	if swag.IsZero(m.Age) {`,
  8438  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  8439  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  8440  		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
  8441  		`func (m *NamedNestedMapComplexAnon) validateName(formats strfmt.Registry) error {`,
  8442  		`	if swag.IsZero(m.Name) {`,
  8443  		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
  8444  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  8445  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
  8446  	},
  8447  		// not expected
  8448  		todo,
  8449  		// output in log
  8450  		noLines,
  8451  		noLines)
  8452  
  8453  	// load expectations for model: nested_map_complex_validations_meta_additional_properties_additional_properties.go
  8454  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  8455  
  8456  	// load expectations for model: nested_map_no_validations_additional_properties_additional_properties.go
  8457  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  8458  
  8459  	// load expectations for model: test_nested_interface.go
  8460  	flattenRun.AddExpectations("test_nested_interface.go", []string{
  8461  		`type TestNestedInterface struct {`,
  8462  		"	Meta map[string]map[string]map[string]interface{} `json:\"meta,omitempty\"`",
  8463  		// empty validation
  8464  		"func (m *TestNestedInterface) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8465  	},
  8466  		// not expected
  8467  		todo,
  8468  		// output in log
  8469  		noLines,
  8470  		noLines)
  8471  
  8472  	expandRun.AddExpectations("test_nested_interface.go", flattenRun.ExpectedFor("TestNestedInterface").ExpectedLines, todo, noLines, noLines)
  8473  
  8474  	// load expectations for model: named_nested_map_complex_additional_properties_additional_properties_additional_properties.go
  8475  	flattenRun.AddExpectations("named_nested_map_complex_additional_properties_additional_properties_additional_properties.go", []string{
  8476  		`type NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties struct {`,
  8477  		"	Age int32 `json:\"age,omitempty\"`",
  8478  		"	Name string `json:\"name,omitempty\"`",
  8479  		`func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  8480  		`	if err := m.validateAge(formats); err != nil {`,
  8481  		`	if err := m.validateName(formats); err != nil {`,
  8482  		`		return errors.CompositeValidationError(res...`,
  8483  		`func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateAge(formats strfmt.Registry) error {`,
  8484  		`	if swag.IsZero(m.Age) {`,
  8485  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  8486  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  8487  		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
  8488  		`func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`,
  8489  		`	if swag.IsZero(m.Name) {`,
  8490  		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
  8491  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  8492  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
  8493  	},
  8494  		// not expected
  8495  		todo,
  8496  		// output in log
  8497  		noLines,
  8498  		noLines)
  8499  
  8500  	// load expectations for model: nested_map_no_validations_additional_properties.go
  8501  	// NOTE(fredbi): maps are simple types and this definition is no more generated
  8502  
  8503  	expandRun.AddExpectations("nested_map_no_validations.go", []string{
  8504  		`type NestedMapNoValidations map[string]map[string]map[string]NestedMapNoValidationsAnon`,
  8505  		`func (m NestedMapNoValidations) Validate(formats strfmt.Registry) error {`,
  8506  		`	for k := range m {`,
  8507  		`		for kk := range m[k] {`,
  8508  		`			for kkk := range m[k][kk] {`,
  8509  		`				if val, ok := m[k][kk][kkk]; ok {`,
  8510  		`					if err := val.Validate(formats); err != nil {`,
  8511  		`		return errors.CompositeValidationError(res...`,
  8512  		`type NestedMapNoValidationsAnon struct {`,
  8513  		"	Age int64 `json:\"age,omitempty\"`",
  8514  		"	Name string `json:\"name,omitempty\"`",
  8515  		// empty validation
  8516  		"func (m *NestedMapNoValidationsAnon) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8517  	},
  8518  		// not expected
  8519  		todo,
  8520  		// output in log
  8521  		noLines,
  8522  		noLines)
  8523  
  8524  	// load expectations for model: nested_map_complex_validations_meta_additional_properties.go
  8525  	// NOTE(fredbi): maps are simple types and this definition is no more generated
  8526  
  8527  	// load expectations for model: nested_map_no_validations_additional_properties_additional_properties_additional_properties.go
  8528  	// NOTE: maps are now simple types - this definition is no more generated
  8529  
  8530  	// load expectations for model: nested_map_no_validations.go
  8531  	flattenRun.AddExpectations("nested_map_no_validations.go", []string{
  8532  		`type NestedMapNoValidations map[string]map[string]map[string]NestedMapNoValidationsAdditionalPropertiesAdditionalPropertiesAdditionalProperties`,
  8533  		`func (m NestedMapNoValidations) Validate(formats strfmt.Registry) error {`,
  8534  		`	for k := range m {`,
  8535  		`       	for kk := range m[k] {`,
  8536  		`            		for kkk := range m[k][kk] {`,
  8537  		`            			if val, ok := m[k][kk][kkk]; ok {`,
  8538  		`            			if err := validate.Required(k+"."+kk+"."+kkk, "body", m[k][kk][kkk]); err != nil {`,
  8539  		`            				if err := val.Validate(formats); err != nil {`,
  8540  		`		return errors.CompositeValidationError(res...`,
  8541  	},
  8542  		// not expected
  8543  		todo,
  8544  		// output in log
  8545  		noLines,
  8546  		noLines)
  8547  
  8548  	// load expectations for model: nested_map_complex_validations_meta_additional_properties_additional_properties_additional_properties.go
  8549  	flattenRun.AddExpectations("nested_map_complex_validations_meta_additional_properties_additional_properties_additional_properties.go", []string{
  8550  		`type NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties struct {`,
  8551  		"	Age int32 `json:\"age,omitempty\"`",
  8552  		"	Name string `json:\"name,omitempty\"`",
  8553  		`func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  8554  		`	if err := m.validateAge(formats); err != nil {`,
  8555  		`	if err := m.validateName(formats); err != nil {`,
  8556  		`		return errors.CompositeValidationError(res...`,
  8557  		`func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateAge(formats strfmt.Registry) error {`,
  8558  		`	if swag.IsZero(m.Age) {`,
  8559  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  8560  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  8561  		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
  8562  		`func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`,
  8563  		`	if swag.IsZero(m.Name) {`,
  8564  		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
  8565  		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
  8566  		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
  8567  	},
  8568  		// not expected
  8569  		todo,
  8570  		// output in log
  8571  		noLines,
  8572  		noLines)
  8573  
  8574  	// load expectations for model: nested_map_complex_validations.go
  8575  	flattenRun.AddExpectations("nested_map_complex_validations.go", []string{
  8576  		`type NestedMapComplexValidations struct {`,
  8577  		// maps are now simple types
  8578  		"	Meta map[string]map[string]map[string]NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties `json:\"meta,omitempty\"`",
  8579  		`func (m *NestedMapComplexValidations) Validate(formats strfmt.Registry) error {`,
  8580  		`	if err := m.validateMeta(formats); err != nil {`,
  8581  		`		return errors.CompositeValidationError(res...`,
  8582  		`func (m *NestedMapComplexValidations) validateMeta(formats strfmt.Registry) error {`,
  8583  		`	if swag.IsZero(m.Meta) {`,
  8584  		`          		for k := range m.Meta {`,
  8585  		`          			for kk := range m.Meta[k] {`,
  8586  		`          				for kkk := range m.Meta[k][kk] {`,
  8587  		`          				if err := validate.Required("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk]); err != nil {`,
  8588  		`          					if val, ok := m.Meta[k][kk][kkk]; ok {`,
  8589  		`          						if err := val.Validate(formats); err != nil {`,
  8590  	},
  8591  		// not expected
  8592  		todo,
  8593  		// output in log
  8594  		noLines,
  8595  		noLines)
  8596  
  8597  	// load expectations for model: named_nested_map_complex_additional_properties_additional_properties.go
  8598  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  8599  
  8600  	// load expectations for model: named_nested_map_complex_additional_properties.go
  8601  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  8602  
  8603  	// load expectations for model: nested_map_complex_validations_meta.go
  8604  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  8605  }
  8606  
  8607  func initFixture844Variations() {
  8608  	// testing fixture-844-variations.yaml with flatten and expand (--skip-flatten)
  8609  
  8610  	/*
  8611  	   repro
  8612  	*/
  8613  
  8614  	f := newModelFixture("../fixtures/bugs/1487/fixture-844-variations.yaml", "allOf bugs with empty objects")
  8615  	flattenRun := f.AddRun(false)
  8616  	expandRun := f.AddRun(true)
  8617  
  8618  	// load expectations for model: foo.go
  8619  	flattenRun.AddExpectations("foo.go", []string{
  8620  		`type Foo interface{`,
  8621  	},
  8622  		// not expected
  8623  		validatable,
  8624  		// output in log
  8625  		noLines,
  8626  		noLines)
  8627  
  8628  	expandRun.AddExpectations("foo.go", flattenRun.ExpectedFor("Foo").ExpectedLines, validatable, noLines, noLines)
  8629  
  8630  	// load expectations for model: variation2.go
  8631  	flattenRun.AddExpectations("variation2.go", []string{
  8632  		`type Variation2 struct {`,
  8633  		"	Prop1 EmptyEnum `json:\"prop1,omitempty\"`",
  8634  		// empty validation
  8635  		"func (m *Variation2) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8636  	},
  8637  		// not expected
  8638  		todo,
  8639  		// output in log
  8640  		noLines,
  8641  		noLines)
  8642  
  8643  	expandRun.AddExpectations("variation2.go", []string{
  8644  		`type Variation2 struct {`,
  8645  		"	Prop1 interface{} `json:\"prop1,omitempty\"`",
  8646  		// empty validation
  8647  		"func (m *Variation2) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8648  	},
  8649  		// not expected
  8650  		todo,
  8651  		// output in log
  8652  		noLines,
  8653  		noLines)
  8654  
  8655  	// load expectations for model: bar.go
  8656  	flattenRun.AddExpectations("bar.go", []string{
  8657  		`type Bar interface{`,
  8658  	},
  8659  		// not expected
  8660  		validatable,
  8661  		// output in log
  8662  		noLines,
  8663  		noLines)
  8664  
  8665  	expandRun.AddExpectations("bar.go", flattenRun.ExpectedFor("Bar").ExpectedLines, validatable, noLines, noLines)
  8666  
  8667  	// load expectations for model: variation3.go
  8668  	flattenRun.AddExpectations("variation3.go", []string{
  8669  		`type Variation3 struct {`,
  8670  		"	Prop1 []EmptyEnum `json:\"prop1\"`",
  8671  		`func (m *Variation3) Validate(formats strfmt.Registry) error {`,
  8672  		`	if err := m.validateProp1(formats); err != nil {`,
  8673  		`		return errors.CompositeValidationError(res...`,
  8674  		`func (m *Variation3) validateProp1(formats strfmt.Registry) error {`,
  8675  		`	if swag.IsZero(m.Prop1) {`,
  8676  		`	iProp1Size := int64(len(m.Prop1)`,
  8677  		`	if err := validate.MinItems("prop1", "body", iProp1Size, 10); err != nil {`,
  8678  	},
  8679  		// not expected
  8680  		todo,
  8681  		// output in log
  8682  		noLines,
  8683  		noLines)
  8684  
  8685  	expandRun.AddExpectations("variation3.go", []string{
  8686  		`type Variation3 struct {`,
  8687  		"	Prop1 []interface{} `json:\"prop1\"`",
  8688  		`func (m *Variation3) Validate(formats strfmt.Registry) error {`,
  8689  		`	if err := m.validateProp1(formats); err != nil {`,
  8690  		`		return errors.CompositeValidationError(res...`,
  8691  		`var variation3Prop1ItemsEnum []interface{`,
  8692  		`	var res []interface{`,
  8693  		"	if err := json.Unmarshal([]byte(`[\"abc\",\"def\"]`), &res); err != nil {",
  8694  		`	for _, v := range res {`,
  8695  		`		variation3Prop1ItemsEnum = append(variation3Prop1ItemsEnum, v`,
  8696  		`func (m *Variation3) validateProp1ItemsEnum(path, location string, value interface{}) error {`,
  8697  		`	if err := validate.EnumCase(path, location, value, variation3Prop1ItemsEnum, true); err != nil {`,
  8698  		`func (m *Variation3) validateProp1(formats strfmt.Registry) error {`,
  8699  		`	if swag.IsZero(m.Prop1) {`,
  8700  		`	iProp1Size := int64(len(m.Prop1)`,
  8701  		`	if err := validate.MinItems("prop1", "body", iProp1Size, 10); err != nil {`,
  8702  	},
  8703  		// not expected
  8704  		todo,
  8705  		// output in log
  8706  		noLines,
  8707  		noLines)
  8708  
  8709  	// load expectations for model: tuple_variation.go
  8710  	flattenRun.AddExpectations("tuple_variation.go", []string{
  8711  		`type TupleVariation struct {`,
  8712  		"	P0 *int64 `json:\"-\"`",
  8713  		"	P1 Bar `json:\"-\"`",
  8714  		"	P2 NonInterface `json:\"-\"`",
  8715  		"	P3 []Bar `json:\"-\"`",
  8716  		"	TupleVariationItems []interface{} `json:\"-\"`",
  8717  		`func (m *TupleVariation) Validate(formats strfmt.Registry) error {`,
  8718  		`	if err := m.validateP0(formats); err != nil {`,
  8719  		`	if err := m.validateP1(formats); err != nil {`,
  8720  		`	if err := m.validateP2(formats); err != nil {`,
  8721  		`	if err := m.validateP3(formats); err != nil {`,
  8722  		`	if err := m.validateTupleVariationItems(formats); err != nil {`,
  8723  		`		return errors.CompositeValidationError(res...`,
  8724  		`func (m *TupleVariation) validateP0(formats strfmt.Registry) error {`,
  8725  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  8726  		`	if err := validate.MaximumInt("0", "body", *m.P0, 10, false); err != nil {`,
  8727  		`func (m *TupleVariation) validateP1(formats strfmt.Registry) error {`,
  8728  		`if m.P1 == nil {`, // now required interface{} checked against nil
  8729  		`return errors.Required("1", "body", m.P1)`,
  8730  		`func (m *TupleVariation) validateP2(formats strfmt.Registry) error {`,
  8731  		`	if err := m.P2.Validate(formats); err != nil {`,
  8732  		`		if ve, ok := err.(*errors.Validation); ok {`,
  8733  		`			return ve.ValidateName("2"`,
  8734  		`func (m *TupleVariation) validateP3(formats strfmt.Registry) error {`,
  8735  		`	if err := validate.Required("3", "body", m.P3); err != nil {`,
  8736  		`	iP3Size := int64(len(m.P3)`,
  8737  		`	if err := validate.MaxItems("3", "body", iP3Size, 10); err != nil {`,
  8738  		// empty validation
  8739  		"func (m *TupleVariation) validateTupleVariationItems(formats strfmt.Registry) error {\n\n	return nil\n}",
  8740  	},
  8741  		// not expected
  8742  		append(todo,
  8743  			`	if err := validate.Required("1", "body", m.P1)`, // check we don't have redundant validations
  8744  			`	if err := validate.Required("1", "body", Bar(m.P1))`,
  8745  		),
  8746  		// output in log
  8747  		noLines,
  8748  		noLines)
  8749  
  8750  	expandRun.AddExpectations("tuple_variation.go", []string{
  8751  		`type TupleVariation struct {`,
  8752  		"	P0 *int64 `json:\"-\"`",
  8753  		"	P1 interface{} `json:\"-\"`",
  8754  		"	P2 map[string]strfmt.Date `json:\"-\"`",
  8755  		"	P3 []interface{} `json:\"-\"`",
  8756  		"	TupleVariationItems []interface{} `json:\"-\"`",
  8757  		`func (m *TupleVariation) Validate(formats strfmt.Registry) error {`,
  8758  		`	if err := m.validateP0(formats); err != nil {`,
  8759  		`	if err := m.validateP1(formats); err != nil {`,
  8760  		`	if err := m.validateP2(formats); err != nil {`,
  8761  		`	if err := m.validateP3(formats); err != nil {`,
  8762  		`	if err := m.validateTupleVariationItems(formats); err != nil {`,
  8763  		`		return errors.CompositeValidationError(res...`,
  8764  		`func (m *TupleVariation) validateP0(formats strfmt.Registry) error {`,
  8765  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  8766  		`	if err := validate.MaximumInt("0", "body", *m.P0, 10, false); err != nil {`,
  8767  		`func (m *TupleVariation) validateP1(formats strfmt.Registry) error {`,
  8768  		`if m.P1 == nil {`, // now required interface{} checked against nil
  8769  		`return errors.Required("1", "body", m.P1)`,
  8770  		`func (m *TupleVariation) validateP2(formats strfmt.Registry) error {`,
  8771  		`	for k := range m.P2 {`,
  8772  		`		if err := validate.FormatOf("2"+"."+k, "body", "date", m.P2[k].String(), formats); err != nil {`,
  8773  		`func (m *TupleVariation) validateP3(formats strfmt.Registry) error {`,
  8774  		`	if err := validate.Required("3", "body", m.P3); err != nil {`,
  8775  		`	iP3Size := int64(len(m.P3)`,
  8776  		`	if err := validate.MaxItems("3", "body", iP3Size, 10); err != nil {`,
  8777  		// empty validation
  8778  		"func (m *TupleVariation) validateTupleVariationItems(formats strfmt.Registry) error {\n\n	return nil\n}",
  8779  	},
  8780  		// not expected
  8781  		todo,
  8782  		// output in log
  8783  		noLines,
  8784  		noLines)
  8785  
  8786  	// load expectations for model: add_items_variation.go
  8787  	flattenRun.AddExpectations("add_items_variation.go", []string{
  8788  		`type AddItemsVariation struct {`,
  8789  		"	P0 *int64 `json:\"-\"`",
  8790  		"	P1 Bar `json:\"-\"`",
  8791  		"	AddItemsVariationItems [][]Foo `json:\"-\"`",
  8792  		`func (m *AddItemsVariation) Validate(formats strfmt.Registry) error {`,
  8793  		`	if err := m.validateP0(formats); err != nil {`,
  8794  		`	if err := m.validateP1(formats); err != nil {`,
  8795  		`	if err := m.validateAddItemsVariationItems(formats); err != nil {`,
  8796  		`		return errors.CompositeValidationError(res...`,
  8797  		`func (m *AddItemsVariation) validateP0(formats strfmt.Registry) error {`,
  8798  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  8799  		`	if err := validate.MaximumInt("0", "body", *m.P0, 10, false); err != nil {`,
  8800  		`func (m *AddItemsVariation) validateP1(formats strfmt.Registry) error {`,
  8801  		`if m.P1 == nil {`, // now required interface{} checked against nil
  8802  		`return errors.Required("1", "body", m.P1)`,
  8803  		`func (m *AddItemsVariation) validateAddItemsVariationItems(formats strfmt.Registry) error {`,
  8804  		`	for i := range m.AddItemsVariationItems {`,
  8805  		`		if err := validate.UniqueItems(strconv.Itoa(i+2), "body", m.AddItemsVariationItems[i]); err != nil {`,
  8806  	},
  8807  		// not expected
  8808  		todo,
  8809  		// output in log
  8810  		noLines,
  8811  		noLines)
  8812  
  8813  	expandRun.AddExpectations("add_items_variation.go", []string{
  8814  		`type AddItemsVariation struct {`,
  8815  		"	P0 *int64 `json:\"-\"`",
  8816  		"	P1 interface{} `json:\"-\"`",
  8817  		"	AddItemsVariationItems [][]interface{} `json:\"-\"`",
  8818  		`func (m *AddItemsVariation) Validate(formats strfmt.Registry) error {`,
  8819  		`	if err := m.validateP0(formats); err != nil {`,
  8820  		`	if err := m.validateP1(formats); err != nil {`,
  8821  		`	if err := m.validateAddItemsVariationItems(formats); err != nil {`,
  8822  		`		return errors.CompositeValidationError(res...`,
  8823  		`func (m *AddItemsVariation) validateP0(formats strfmt.Registry) error {`,
  8824  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  8825  		`	if err := validate.MaximumInt("0", "body", *m.P0, 10, false); err != nil {`,
  8826  		`func (m *AddItemsVariation) validateP1(formats strfmt.Registry) error {`,
  8827  		`if m.P1 == nil {`, // now required interface{} checked against nil
  8828  		`return errors.Required("1", "body", m.P1)`,
  8829  		`func (m *AddItemsVariation) validateAddItemsVariationItems(formats strfmt.Registry) error {`,
  8830  		`	for i := range m.AddItemsVariationItems {`,
  8831  		`		if err := validate.UniqueItems(strconv.Itoa(i+2), "body", m.AddItemsVariationItems[i]); err != nil {`,
  8832  	},
  8833  		// not expected
  8834  		todo,
  8835  		// output in log
  8836  		noLines,
  8837  		noLines)
  8838  
  8839  	// load expectations for model: non_interface.go
  8840  	flattenRun.AddExpectations("non_interface.go", []string{
  8841  		`type NonInterface map[string]strfmt.Date`,
  8842  		`func (m NonInterface) Validate(formats strfmt.Registry) error {`,
  8843  		`	for k := range m {`,
  8844  		`		if err := validate.FormatOf(k, "body", "date", m[k].String(), formats); err != nil {`,
  8845  		`		return errors.CompositeValidationError(res...`,
  8846  	},
  8847  		// not expected
  8848  		todo,
  8849  		// output in log
  8850  		noLines,
  8851  		noLines)
  8852  
  8853  	expandRun.AddExpectations("non_interface.go", flattenRun.ExpectedFor("NonInterface").ExpectedLines, todo, noLines, noLines)
  8854  
  8855  	// load expectations for model: variation0.go
  8856  	flattenRun.AddExpectations("variation0.go", []string{
  8857  		`type Variation0 struct {`,
  8858  		`	Foo`,
  8859  		`	Bar`,
  8860  		// empty validation
  8861  		"func (m *Variation0) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8862  	},
  8863  		// not expected
  8864  		todo,
  8865  		// output in log
  8866  		noLines,
  8867  		noLines)
  8868  
  8869  	expandRun.AddExpectations("variation0.go", []string{
  8870  		`type Variation0 struct {`,
  8871  		`	Variation0AllOf0`,
  8872  		`	Variation0AllOf1`,
  8873  		`type Variation0AllOf0 interface{}`,
  8874  		`type Variation0AllOf1 interface{}`,
  8875  		// empty validation
  8876  		"func (m *Variation0) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8877  	},
  8878  		// not expected
  8879  		todo,
  8880  		// output in log
  8881  		noLines,
  8882  		noLines)
  8883  
  8884  	// load expectations for model: variation1.go
  8885  	flattenRun.AddExpectations("variation1.go", []string{
  8886  		`type Variation1 struct {`,
  8887  		`	Foo`,
  8888  		`	NonInterface`,
  8889  		`func (m *Variation1) Validate(formats strfmt.Registry) error {`,
  8890  		`	if err := m.NonInterface.Validate(formats); err != nil {`,
  8891  		`		return errors.CompositeValidationError(res...`,
  8892  	},
  8893  		// not expected
  8894  		todo,
  8895  		// output in log
  8896  		noLines,
  8897  		noLines)
  8898  
  8899  	expandRun.AddExpectations("variation1.go", []string{
  8900  		`type Variation1 struct {`,
  8901  		`	Variation1AllOf0`,
  8902  		"	AO1 map[string]strfmt.Date `json:\"-\"`",
  8903  		`func (m *Variation1) Validate(formats strfmt.Registry) error {`,
  8904  		`	for k := range m.AO1 {`,
  8905  		`		if err := validate.FormatOf(k, "body", "date", m.AO1[k].String(), formats); err != nil {`,
  8906  		`		return errors.CompositeValidationError(res...`,
  8907  		`type Variation1AllOf0 interface{}`,
  8908  	},
  8909  		// not expected
  8910  		todo,
  8911  		// output in log
  8912  		noLines,
  8913  		noLines)
  8914  
  8915  	// load expectations for model: empty_enum.go
  8916  	flattenRun.AddExpectations("empty_enum.go", []string{
  8917  		`type EmptyEnum interface{}`,
  8918  	},
  8919  		// not expected
  8920  		validatable,
  8921  		// output in log
  8922  		noLines,
  8923  		noLines)
  8924  
  8925  	expandRun.AddExpectations("empty_enum.go", flattenRun.ExpectedFor("EmptyEnum").ExpectedLines, validatable, noLines, noLines)
  8926  
  8927  	// load expectations for model: get_o_k_body.go
  8928  	flattenRun.AddExpectations("get_o_k_body.go", []string{
  8929  		`type GetOKBody struct {`,
  8930  		`	Foo`,
  8931  		`	Bar`,
  8932  		// empty validation
  8933  		"func (m *GetOKBody) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8934  	},
  8935  		// not expected
  8936  		todo,
  8937  		// output in log
  8938  		noLines,
  8939  		noLines)
  8940  }
  8941  
  8942  func initFixtureMoreAddProps() {
  8943  	// testing fixture-moreAddProps.yaml with flatten and expand (--skip-flatten)
  8944  
  8945  	/*
  8946  	   various patterns of additionalProperties
  8947  	*/
  8948  
  8949  	f := newModelFixture("../fixtures/bugs/1487/fixture-moreAddProps.yaml", "fixture for additionalProperties")
  8950  	flattenRun := f.AddRun(false)
  8951  	expandRun := f.AddRun(true)
  8952  
  8953  	// load expectations for model: trial.go
  8954  	flattenRun.AddExpectations("trial.go", []string{
  8955  		`type Trial struct {`,
  8956  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  8957  		"	AdditionalProperties *TrialAdditionalProperties `json:\"additionalProperties,omitempty\"`",
  8958  		`func (m *Trial) Validate(formats strfmt.Registry) error {`,
  8959  		`	if err := m.validateA1(formats); err != nil {`,
  8960  		`	if err := m.validateAdditionalProperties(formats); err != nil {`,
  8961  		`		return errors.CompositeValidationError(res...`,
  8962  		`func (m *Trial) validateA1(formats strfmt.Registry) error {`,
  8963  		`	if swag.IsZero(m.A1) {`,
  8964  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  8965  		`func (m *Trial) validateAdditionalProperties(formats strfmt.Registry) error {`,
  8966  		`	if swag.IsZero(m.AdditionalProperties) {`,
  8967  		`	if m.AdditionalProperties != nil {`,
  8968  		`		if err := m.AdditionalProperties.Validate(formats); err != nil {`,
  8969  		`			if ve, ok := err.(*errors.Validation); ok {`,
  8970  		`				return ve.ValidateName("additionalProperties"`,
  8971  	},
  8972  		// not expected
  8973  		todo,
  8974  		// output in log
  8975  		noLines,
  8976  		noLines)
  8977  
  8978  	// load expectations for model: trial_additional_properties.go
  8979  	flattenRun.AddExpectations("trial_additional_properties.go", []string{
  8980  		`type TrialAdditionalProperties struct {`,
  8981  		"	Discourse string `json:\"discourse,omitempty\"`",
  8982  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  8983  		"	TrialAdditionalPropertiesAdditionalProperties map[string]interface{} `json:\"-\"`",
  8984  		// empty validation
  8985  		"func (m *TrialAdditionalProperties) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8986  	},
  8987  		// not expected
  8988  		todo,
  8989  		// output in log
  8990  		noLines,
  8991  		noLines)
  8992  
  8993  	// load expectations for model: additional_transitive_refed_object_thing_additional_properties.go
  8994  	flattenRun.AddExpectations("additional_transitive_refed_object_thing_additional_properties.go", []string{
  8995  		`type AdditionalTransitiveRefedObjectThingAdditionalProperties struct {`,
  8996  		"	Prop1 *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1 `json:\"prop1,omitempty\"`",
  8997  		"	AdditionalTransitiveRefedObjectThingAdditionalProperties map[string]*AdditionalTransitiveRefedObjectThingAdditionalPropertiesAdditionalProperties `json:\"-\"`",
  8998  		`func (m *AdditionalTransitiveRefedObjectThingAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  8999  		`	if err := m.validateProp1(formats); err != nil {`,
  9000  		`	for k := range m.AdditionalTransitiveRefedObjectThingAdditionalProperties {`,
  9001  		`		if val, ok := m.AdditionalTransitiveRefedObjectThingAdditionalProperties[k]; ok {`,
  9002  		`			if val != nil {`,
  9003  		`				if err := val.Validate(formats); err != nil {`,
  9004  		`		return errors.CompositeValidationError(res...`,
  9005  		`func (m *AdditionalTransitiveRefedObjectThingAdditionalProperties) validateProp1(formats strfmt.Registry) error {`,
  9006  		`	if swag.IsZero(m.Prop1) {`,
  9007  		`	if m.Prop1 != nil {`,
  9008  		`		if err := m.Prop1.Validate(formats); err != nil {`,
  9009  		`			if ve, ok := err.(*errors.Validation); ok {`,
  9010  		`				return ve.ValidateName("prop1"`,
  9011  	},
  9012  		// not expected
  9013  		todo,
  9014  		// output in log
  9015  		noLines,
  9016  		noLines)
  9017  
  9018  	// load expectations for model: additional_transitive_refed_object_thing_additional_properties_prop1.go
  9019  	flattenRun.AddExpectations("additional_transitive_refed_object_thing_additional_properties_prop1.go", []string{
  9020  		`type AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1 struct {`,
  9021  		"	ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`",
  9022  		"	AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1 map[string]*AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalProperties `json:\"-\"`",
  9023  		`func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1) Validate(formats strfmt.Registry) error {`,
  9024  		`	if err := m.validateThisOneNotRequiredEither(formats); err != nil {`,
  9025  		`	for k := range m.AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1 {`,
  9026  		`		if val, ok := m.AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1[k]; ok {`,
  9027  		`			if val != nil {`,
  9028  		`				if err := val.Validate(formats); err != nil {`,
  9029  		`		return errors.CompositeValidationError(res...`,
  9030  		`func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`,
  9031  		`	if swag.IsZero(m.ThisOneNotRequiredEither) {`,
  9032  		`	if err := validate.MaximumInt("thisOneNotRequiredEither", "body", m.ThisOneNotRequiredEither, 20, false); err != nil {`,
  9033  	},
  9034  		// not expected
  9035  		todo,
  9036  		// output in log
  9037  		noLines,
  9038  		noLines)
  9039  
  9040  	// load expectations for model: additional_transitive_refed_thing.go
  9041  	flattenRun.AddExpectations("additional_transitive_refed_thing.go", []string{
  9042  		`type AdditionalTransitiveRefedThing struct {`,
  9043  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  9044  		"	AdditionalTransitiveRefedThing map[string][]*AdditionalTransitiveRefedThingAdditionalPropertiesItems `json:\"-\"`",
  9045  		`func (m *AdditionalTransitiveRefedThing) Validate(formats strfmt.Registry) error {`,
  9046  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  9047  		`	for k := range m.AdditionalTransitiveRefedThing {`,
  9048  		`		if err := validate.Required(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  9049  		`		if err := validate.UniqueItems(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  9050  		`		for i := 0; i < len(m.AdditionalTransitiveRefedThing[k]); i++ {`,
  9051  		// do we need Required when item is nullable?
  9052  		// nullable not required:
  9053  		`			if swag.IsZero(m.AdditionalTransitiveRefedThing[k][i]) {`,
  9054  		// nullable not required:
  9055  		`			if m.AdditionalTransitiveRefedThing[k][i] != nil {`,
  9056  		`				if err := m.AdditionalTransitiveRefedThing[k][i].Validate(formats); err != nil {`,
  9057  		`					if ve, ok := err.(*errors.Validation); ok {`,
  9058  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  9059  		`		return errors.CompositeValidationError(res...`,
  9060  		`func (m *AdditionalTransitiveRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  9061  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  9062  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`,
  9063  	},
  9064  		// not expected
  9065  		todo,
  9066  		// output in log
  9067  		noLines,
  9068  		noLines)
  9069  
  9070  	// load expectations for model: additional_transitive_refed_thing_additional_properties_items_additional_properties_additional_properties.go
  9071  	flattenRun.AddExpectations("additional_transitive_refed_thing_additional_properties_items_additional_properties_additional_properties.go", []string{
  9072  		`type AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalPropertiesAdditionalProperties struct {`,
  9073  		"	Discourse string `json:\"discourse,omitempty\"`",
  9074  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  9075  		"	AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalPropertiesAdditionalPropertiesAdditionalProperties map[string]interface{} `json:\"-\"`",
  9076  		// empty validation
  9077  		"func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  9078  	},
  9079  		// not expected
  9080  		todo,
  9081  		// output in log
  9082  		noLines,
  9083  		noLines)
  9084  
  9085  	// load expectations for model: additional_transitive_refed_object_thing.go
  9086  	flattenRun.AddExpectations("additional_transitive_refed_object_thing.go", []string{
  9087  		`type AdditionalTransitiveRefedObjectThing struct {`,
  9088  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  9089  		"	AdditionalTransitiveRefedObjectThing map[string]*AdditionalTransitiveRefedObjectThingAdditionalProperties `json:\"-\"`",
  9090  		`func (m *AdditionalTransitiveRefedObjectThing) Validate(formats strfmt.Registry) error {`,
  9091  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  9092  		`	for k := range m.AdditionalTransitiveRefedObjectThing {`,
  9093  		`		if val, ok := m.AdditionalTransitiveRefedObjectThing[k]; ok {`,
  9094  		`			if val != nil {`,
  9095  		`				if err := val.Validate(formats); err != nil {`,
  9096  		`		return errors.CompositeValidationError(res...`,
  9097  		`func (m *AdditionalTransitiveRefedObjectThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  9098  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  9099  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`,
  9100  	},
  9101  		// not expected
  9102  		todo,
  9103  		// output in log
  9104  		noLines,
  9105  		noLines)
  9106  
  9107  	// load expectations for model: additional_transitive_refed_object_thing_additional_properties_additional_properties.go
  9108  	flattenRun.AddExpectations("additional_transitive_refed_object_thing_additional_properties_additional_properties.go", []string{
  9109  		`type AdditionalTransitiveRefedObjectThingAdditionalPropertiesAdditionalProperties struct {`,
  9110  		"	Discourse string `json:\"discourse,omitempty\"`",
  9111  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  9112  		"	AdditionalTransitiveRefedObjectThingAdditionalPropertiesAdditionalPropertiesAdditionalProperties map[string]interface{} `json:\"-\"`",
  9113  		// empty validation
  9114  		"func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  9115  	},
  9116  		// not expected
  9117  		todo,
  9118  		// output in log
  9119  		noLines,
  9120  		noLines)
  9121  
  9122  	// load expectations for model: additional_transitive_refed_object_thing_additional_properties_prop1_additional_properties.go
  9123  	flattenRun.AddExpectations("additional_transitive_refed_object_thing_additional_properties_prop1_additional_properties.go", []string{
  9124  		`type AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalProperties struct {`,
  9125  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  9126  		"	B1 strfmt.Date `json:\"b1,omitempty\"`",
  9127  		"	AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalPropertiesAdditionalProperties map[string]interface{} `json:\"-\"`",
  9128  		`func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalProperties) Validate(formats strfmt.Registry) error {`,
  9129  		`	if err := m.validateA1(formats); err != nil {`,
  9130  		`	if err := m.validateB1(formats); err != nil {`,
  9131  		`		return errors.CompositeValidationError(res...`,
  9132  		`func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalProperties) validateA1(formats strfmt.Registry) error {`,
  9133  		`	if swag.IsZero(m.A1) {`,
  9134  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  9135  		`func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalProperties) validateB1(formats strfmt.Registry) error {`,
  9136  		`	if swag.IsZero(m.B1) {`,
  9137  		`	if err := validate.FormatOf("b1", "body", "date", m.B1.String(), formats); err != nil {`,
  9138  	},
  9139  		// not expected
  9140  		todo,
  9141  		// output in log
  9142  		noLines,
  9143  		noLines)
  9144  
  9145  	// load expectations for model: additional_transitive_refed_thing_additional_properties_items.go
  9146  	flattenRun.AddExpectations("additional_transitive_refed_thing_additional_properties_items.go", []string{
  9147  		`type AdditionalTransitiveRefedThingAdditionalPropertiesItems struct {`,
  9148  		"	ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`",
  9149  		"	AdditionalTransitiveRefedThingAdditionalPropertiesItems map[string]*AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties `json:\"-\"`",
  9150  		`func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItems) Validate(formats strfmt.Registry) error {`,
  9151  		`	if err := m.validateThisOneNotRequiredEither(formats); err != nil {`,
  9152  		`	for k := range m.AdditionalTransitiveRefedThingAdditionalPropertiesItems {`,
  9153  		`		if val, ok := m.AdditionalTransitiveRefedThingAdditionalPropertiesItems[k]; ok {`,
  9154  		`			if val != nil {`,
  9155  		`				if err := val.Validate(formats); err != nil {`,
  9156  		`		return errors.CompositeValidationError(res...`,
  9157  		`func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItems) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`,
  9158  		`	if swag.IsZero(m.ThisOneNotRequiredEither) {`,
  9159  		`	if err := validate.MaximumInt("thisOneNotRequiredEither", "body", m.ThisOneNotRequiredEither, 20, false); err != nil {`,
  9160  	},
  9161  		// not expected
  9162  		todo,
  9163  		// output in log
  9164  		noLines,
  9165  		noLines)
  9166  
  9167  	// load expectations for model: additional_transitive_refed_thing_additional_properties_items_additional_properties.go
  9168  	flattenRun.AddExpectations("additional_transitive_refed_thing_additional_properties_items_additional_properties.go", []string{
  9169  		`type AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties struct {`,
  9170  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  9171  		"	B1 strfmt.DateTime `json:\"b1,omitempty\"`",
  9172  		"	AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties map[string]*AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalPropertiesAdditionalProperties `json:\"-\"`",
  9173  		`func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  9174  		`	if err := m.validateA1(formats); err != nil {`,
  9175  		`	if err := m.validateB1(formats); err != nil {`,
  9176  		`	for k := range m.AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties {`,
  9177  		`		if val, ok := m.AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties[k]; ok {`,
  9178  		`			if val != nil {`,
  9179  		`				if err := val.Validate(formats); err != nil {`,
  9180  		`		return errors.CompositeValidationError(res...`,
  9181  		`func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties) validateA1(formats strfmt.Registry) error {`,
  9182  		`	if swag.IsZero(m.A1) {`,
  9183  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  9184  		`func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties) validateB1(formats strfmt.Registry) error {`,
  9185  		`	if swag.IsZero(m.B1) {`,
  9186  		`	if err := validate.FormatOf("b1", "body", "date-time", m.B1.String(), formats); err != nil {`,
  9187  	},
  9188  		// not expected
  9189  		todo,
  9190  		// output in log
  9191  		noLines,
  9192  		noLines)
  9193  
  9194  	// load expectations for model: trial.go
  9195  	expandRun.AddExpectations("trial.go", []string{
  9196  		`type Trial struct {`,
  9197  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  9198  		"	AdditionalProperties *TrialAdditionalProperties `json:\"additionalProperties,omitempty\"`",
  9199  		`func (m *Trial) Validate(formats strfmt.Registry) error {`,
  9200  		`	if err := m.validateA1(formats); err != nil {`,
  9201  		`	if err := m.validateAdditionalProperties(formats); err != nil {`,
  9202  		`		return errors.CompositeValidationError(res...`,
  9203  		`func (m *Trial) validateA1(formats strfmt.Registry) error {`,
  9204  		`	if swag.IsZero(m.A1) {`,
  9205  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  9206  		`func (m *Trial) validateAdditionalProperties(formats strfmt.Registry) error {`,
  9207  		`	if swag.IsZero(m.AdditionalProperties) {`,
  9208  		`	if m.AdditionalProperties != nil {`,
  9209  		`		if err := m.AdditionalProperties.Validate(formats); err != nil {`,
  9210  		`			if ve, ok := err.(*errors.Validation); ok {`,
  9211  		`				return ve.ValidateName("additionalProperties"`,
  9212  		`type TrialAdditionalProperties struct {`,
  9213  		"	Discourse string `json:\"discourse,omitempty\"`",
  9214  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  9215  		"	TrialAdditionalPropertiesAdditionalProperties map[string]interface{} `json:\"-\"`",
  9216  		// empty validation
  9217  		"func (m *TrialAdditionalProperties) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  9218  	},
  9219  		// not expected
  9220  		todo,
  9221  		// output in log
  9222  		noLines,
  9223  		noLines)
  9224  
  9225  	// load expectations for model: additional_transitive_refed_thing.go
  9226  	expandRun.AddExpectations("additional_transitive_refed_thing.go", []string{
  9227  		`type AdditionalTransitiveRefedThing struct {`,
  9228  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  9229  		"	AdditionalTransitiveRefedThing map[string][]*AdditionalTransitiveRefedThingItems0 `json:\"-\"`",
  9230  		`func (m *AdditionalTransitiveRefedThing) Validate(formats strfmt.Registry) error {`,
  9231  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  9232  		`	for k := range m.AdditionalTransitiveRefedThing {`,
  9233  		`		if err := validate.Required(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  9234  		`		if err := validate.UniqueItems(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  9235  		`		for i := 0; i < len(m.AdditionalTransitiveRefedThing[k]); i++ {`,
  9236  		// do we need Required when item is nullable?
  9237  		// nullable not required:
  9238  		`			if swag.IsZero(m.AdditionalTransitiveRefedThing[k][i]) {`,
  9239  		// nullable required:
  9240  		`			if m.AdditionalTransitiveRefedThing[k][i] != nil {`,
  9241  		`				if err := m.AdditionalTransitiveRefedThing[k][i].Validate(formats); err != nil {`,
  9242  		`					if ve, ok := err.(*errors.Validation); ok {`,
  9243  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  9244  		`		return errors.CompositeValidationError(res...`,
  9245  		`func (m *AdditionalTransitiveRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  9246  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  9247  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`,
  9248  		`type AdditionalTransitiveRefedThingItems0 struct {`,
  9249  		"	ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`",
  9250  		"	AdditionalTransitiveRefedThingItems0 map[string]*AdditionalTransitiveRefedThingItems0Anon `json:\"-\"`",
  9251  		`func (m *AdditionalTransitiveRefedThingItems0) Validate(formats strfmt.Registry) error {`,
  9252  		`	if err := m.validateThisOneNotRequiredEither(formats); err != nil {`,
  9253  		`	for k := range m.AdditionalTransitiveRefedThingItems0 {`,
  9254  		`		if val, ok := m.AdditionalTransitiveRefedThingItems0[k]; ok {`,
  9255  		`			if val != nil {`,
  9256  		`				if err := val.Validate(formats); err != nil {`,
  9257  		`		return errors.CompositeValidationError(res...`,
  9258  		`func (m *AdditionalTransitiveRefedThingItems0) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`,
  9259  		`	if swag.IsZero(m.ThisOneNotRequiredEither) {`,
  9260  		`	if err := validate.MaximumInt("thisOneNotRequiredEither", "body", m.ThisOneNotRequiredEither, 20, false); err != nil {`,
  9261  		`type AdditionalTransitiveRefedThingItems0Anon struct {`,
  9262  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  9263  		"	B1 strfmt.DateTime `json:\"b1,omitempty\"`",
  9264  		"	AdditionalTransitiveRefedThingItems0Anon map[string]*AdditionalTransitiveRefedThingItems0AnonAnon `json:\"-\"`",
  9265  		`func (m *AdditionalTransitiveRefedThingItems0Anon) Validate(formats strfmt.Registry) error {`,
  9266  		`	if err := m.validateA1(formats); err != nil {`,
  9267  		`	if err := m.validateB1(formats); err != nil {`,
  9268  		`	for k := range m.AdditionalTransitiveRefedThingItems0Anon {`,
  9269  		`		if val, ok := m.AdditionalTransitiveRefedThingItems0Anon[k]; ok {`,
  9270  		`			if val != nil {`,
  9271  		`				if err := val.Validate(formats); err != nil {`,
  9272  		`		return errors.CompositeValidationError(res...`,
  9273  		`func (m *AdditionalTransitiveRefedThingItems0Anon) validateA1(formats strfmt.Registry) error {`,
  9274  		`	if swag.IsZero(m.A1) {`,
  9275  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  9276  		`func (m *AdditionalTransitiveRefedThingItems0Anon) validateB1(formats strfmt.Registry) error {`,
  9277  		`	if swag.IsZero(m.B1) {`,
  9278  		`	if err := validate.FormatOf("b1", "body", "date-time", m.B1.String(), formats); err != nil {`,
  9279  		`type AdditionalTransitiveRefedThingItems0AnonAnon struct {`,
  9280  		"	Discourse string `json:\"discourse,omitempty\"`",
  9281  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  9282  		"	AdditionalTransitiveRefedThingItems0AnonAnonAdditionalProperties map[string]interface{} `json:\"-\"`",
  9283  		// empty validation
  9284  		"func (m *AdditionalTransitiveRefedThingItems0AnonAnon) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  9285  	},
  9286  		// not expected
  9287  		todo,
  9288  		// output in log
  9289  		noLines,
  9290  		noLines)
  9291  
  9292  	// load expectations for model: additional_transitive_refed_object_thing.go
  9293  	expandRun.AddExpectations("additional_transitive_refed_object_thing.go", []string{
  9294  		`type AdditionalTransitiveRefedObjectThing struct {`,
  9295  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  9296  		"	AdditionalTransitiveRefedObjectThing map[string]*AdditionalTransitiveRefedObjectThingAnon `json:\"-\"`",
  9297  		`func (m *AdditionalTransitiveRefedObjectThing) Validate(formats strfmt.Registry) error {`,
  9298  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  9299  		`	for k := range m.AdditionalTransitiveRefedObjectThing {`,
  9300  		`		if val, ok := m.AdditionalTransitiveRefedObjectThing[k]; ok {`,
  9301  		`			if val != nil {`,
  9302  		`				if err := val.Validate(formats); err != nil {`,
  9303  		`		return errors.CompositeValidationError(res...`,
  9304  		`func (m *AdditionalTransitiveRefedObjectThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  9305  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  9306  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", m.ThisOneNotRequired, 10, false); err != nil {`,
  9307  		`type AdditionalTransitiveRefedObjectThingAnon struct {`,
  9308  		"	Prop1 *AdditionalTransitiveRefedObjectThingAnonProp1 `json:\"prop1,omitempty\"`",
  9309  		"	AdditionalTransitiveRefedObjectThingAnon map[string]*AdditionalTransitiveRefedObjectThingAnonAnon `json:\"-\"`",
  9310  		`func (m *AdditionalTransitiveRefedObjectThingAnon) Validate(formats strfmt.Registry) error {`,
  9311  		`	if err := m.validateProp1(formats); err != nil {`,
  9312  		`	for k := range m.AdditionalTransitiveRefedObjectThingAnon {`,
  9313  		`		if val, ok := m.AdditionalTransitiveRefedObjectThingAnon[k]; ok {`,
  9314  		`			if val != nil {`,
  9315  		`				if err := val.Validate(formats); err != nil {`,
  9316  		`		return errors.CompositeValidationError(res...`,
  9317  		`func (m *AdditionalTransitiveRefedObjectThingAnon) validateProp1(formats strfmt.Registry) error {`,
  9318  		`	if swag.IsZero(m.Prop1) {`,
  9319  		`	if m.Prop1 != nil {`,
  9320  		`		if err := m.Prop1.Validate(formats); err != nil {`,
  9321  		`			if ve, ok := err.(*errors.Validation); ok {`,
  9322  		`				return ve.ValidateName("prop1"`,
  9323  		`type AdditionalTransitiveRefedObjectThingAnonAnon struct {`,
  9324  		"	Discourse string `json:\"discourse,omitempty\"`",
  9325  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  9326  		"	AdditionalTransitiveRefedObjectThingAnonAnonAdditionalProperties map[string]interface{} `json:\"-\"`",
  9327  		`type AdditionalTransitiveRefedObjectThingAnonProp1 struct {`,
  9328  		"	ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`",
  9329  		"	AdditionalTransitiveRefedObjectThingAnonProp1 map[string]*AdditionalTransitiveRefedObjectThingAnonProp1Anon `json:\"-\"`",
  9330  		`func (m *AdditionalTransitiveRefedObjectThingAnonProp1) Validate(formats strfmt.Registry) error {`,
  9331  		`	if err := m.validateThisOneNotRequiredEither(formats); err != nil {`,
  9332  		`	for k := range m.AdditionalTransitiveRefedObjectThingAnonProp1 {`,
  9333  		`		if val, ok := m.AdditionalTransitiveRefedObjectThingAnonProp1[k]; ok {`,
  9334  		`			if val != nil {`,
  9335  		`				if err := val.Validate(formats); err != nil {`,
  9336  		`		return errors.CompositeValidationError(res...`,
  9337  		`func (m *AdditionalTransitiveRefedObjectThingAnonProp1) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`,
  9338  		`	if swag.IsZero(m.ThisOneNotRequiredEither) {`,
  9339  		`	if err := validate.MaximumInt("prop1"+"."+"thisOneNotRequiredEither", "body", m.ThisOneNotRequiredEither, 20, false); err != nil {`,
  9340  		`type AdditionalTransitiveRefedObjectThingAnonProp1Anon struct {`,
  9341  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  9342  		"	B1 strfmt.Date `json:\"b1,omitempty\"`",
  9343  		"	AdditionalTransitiveRefedObjectThingAnonProp1AnonAdditionalProperties map[string]interface{} `json:\"-\"`",
  9344  		`func (m *AdditionalTransitiveRefedObjectThingAnonProp1Anon) Validate(formats strfmt.Registry) error {`,
  9345  		`	if err := m.validateA1(formats); err != nil {`,
  9346  		`	if err := m.validateB1(formats); err != nil {`,
  9347  		`		return errors.CompositeValidationError(res...`,
  9348  		`func (m *AdditionalTransitiveRefedObjectThingAnonProp1Anon) validateA1(formats strfmt.Registry) error {`,
  9349  		`	if swag.IsZero(m.A1) {`,
  9350  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  9351  		`func (m *AdditionalTransitiveRefedObjectThingAnonProp1Anon) validateB1(formats strfmt.Registry) error {`,
  9352  		`	if swag.IsZero(m.B1) {`,
  9353  		`	if err := validate.FormatOf("b1", "body", "date", m.B1.String(), formats); err != nil {`,
  9354  		// empty validation
  9355  		"func (m *AdditionalTransitiveRefedObjectThingAnonAnon) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  9356  	},
  9357  		// not expected
  9358  		todo,
  9359  		// output in log
  9360  		noLines,
  9361  		noLines)
  9362  }
  9363  
  9364  func initFixture1537() {
  9365  	// testing fixture-1537.yaml with flatten and expand (--skip-flatten)
  9366  	// TODO: expand
  9367  
  9368  	/*
  9369  	   repro issue 1537
  9370  	*/
  9371  
  9372  	f := newModelFixture("../fixtures/bugs/1537/fixture-1537.yaml", "param body required with array of objects")
  9373  	thisRun := f.AddRun(false)
  9374  
  9375  	// load expectations for model: profile_array.go
  9376  	thisRun.AddExpectations("profile_array.go", []string{
  9377  		`type ProfileArray struct {`,
  9378  		"	ProfileCfg []*ProfileCfg `json:\"profileCfg\"`",
  9379  		`func (m *ProfileArray) Validate(formats strfmt.Registry) error {`,
  9380  		`	if err := m.validateProfileCfg(formats); err != nil {`,
  9381  		`		return errors.CompositeValidationError(res...`,
  9382  		`func (m *ProfileArray) validateProfileCfg(formats strfmt.Registry) error {`,
  9383  		`	if err := validate.Required("profileCfg", "body", m.ProfileCfg); err != nil {`,
  9384  		`	for i := 0; i < len(m.ProfileCfg); i++ {`,
  9385  		// do we need Required when item is nullable?
  9386  		// nullable not required:
  9387  		`		if swag.IsZero(m.ProfileCfg[i]) {`,
  9388  		// nullable required:
  9389  		`		if m.ProfileCfg[i] != nil {`,
  9390  		`			if err := m.ProfileCfg[i].Validate(formats); err != nil {`,
  9391  		`				if ve, ok := err.(*errors.Validation); ok {`,
  9392  		`					return ve.ValidateName("profileCfg" + "." + strconv.Itoa(i)`,
  9393  	},
  9394  		// not expected
  9395  		todo,
  9396  		// output in log
  9397  		noLines,
  9398  		noLines)
  9399  
  9400  	// load expectations for model: profile.go
  9401  	thisRun.AddExpectations("profile.go", []string{
  9402  		`type Profile struct {`,
  9403  		"	ProfileCfg ProfileCfgs `json:\"profileCfg,omitempty\"`",
  9404  		`func (m *Profile) Validate(formats strfmt.Registry) error {`,
  9405  		`	if err := m.validateProfileCfg(formats); err != nil {`,
  9406  		`		return errors.CompositeValidationError(res...`,
  9407  		`func (m *Profile) validateProfileCfg(formats strfmt.Registry) error {`,
  9408  		`	if swag.IsZero(m.ProfileCfg) {`,
  9409  		`	if err := m.ProfileCfg.Validate(formats); err != nil {`,
  9410  		`		if ve, ok := err.(*errors.Validation); ok {`,
  9411  		`			return ve.ValidateName("profileCfg"`,
  9412  	},
  9413  		// not expected
  9414  		todo,
  9415  		// output in log
  9416  		noLines,
  9417  		noLines)
  9418  
  9419  	// load expectations for model: profile_cfgs.go
  9420  	thisRun.AddExpectations("profile_cfgs.go", []string{
  9421  		`type ProfileCfgs []*ProfileCfg`,
  9422  		`func (m ProfileCfgs) Validate(formats strfmt.Registry) error {`,
  9423  		`	for i := 0; i < len(m); i++ {`,
  9424  		// do we need Required when item is nullable?
  9425  		// nullable not required:
  9426  		`		if swag.IsZero(m[i]) {`,
  9427  		// nullable required:
  9428  		`		if m[i] != nil {`,
  9429  		`			if err := m[i].Validate(formats); err != nil {`,
  9430  		`				if ve, ok := err.(*errors.Validation); ok {`,
  9431  		`					return ve.ValidateName(strconv.Itoa(i)`,
  9432  		`		return errors.CompositeValidationError(res...`,
  9433  	},
  9434  		// not expected
  9435  		todo,
  9436  		// output in log
  9437  		noLines,
  9438  		noLines)
  9439  
  9440  	// load expectations for model: profile_cfg.go
  9441  	thisRun.AddExpectations("profile_cfg.go", []string{
  9442  		`type ProfileCfg struct {`,
  9443  		"	Value1 int32 `json:\"value1,omitempty\"`",
  9444  		"	Value2 int32 `json:\"value2,omitempty\"`",
  9445  		// empty validation
  9446  		"func (m *ProfileCfg) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  9447  	},
  9448  		// not expected
  9449  		todo,
  9450  		// output in log
  9451  		noLines,
  9452  		noLines)
  9453  
  9454  	// load expectations for model: profile_required.go
  9455  	thisRun.AddExpectations("profile_required.go", []string{
  9456  		`type ProfileRequired struct {`,
  9457  		"	ProfileCfg ProfileCfgs `json:\"profileCfg\"`",
  9458  		`func (m *ProfileRequired) Validate(formats strfmt.Registry) error {`,
  9459  		`	if err := m.validateProfileCfg(formats); err != nil {`,
  9460  		`		return errors.CompositeValidationError(res...`,
  9461  		`func (m *ProfileRequired) validateProfileCfg(formats strfmt.Registry) error {`,
  9462  		`	if err := validate.Required("profileCfg", "body", m.ProfileCfg); err != nil {`,
  9463  		`	if err := m.ProfileCfg.Validate(formats); err != nil {`,
  9464  		`		if ve, ok := err.(*errors.Validation); ok {`,
  9465  		`			return ve.ValidateName("profileCfg"`,
  9466  	},
  9467  		// not expected
  9468  		todo,
  9469  		// output in log
  9470  		noLines,
  9471  		noLines)
  9472  }
  9473  
  9474  func initFixture1537v2() {
  9475  	// testing fixture-1537-2.yaml with flatten and expand (--skip-flatten)
  9476  	// TODO: expand
  9477  
  9478  	/*
  9479  	   repro issue 1537, with aliased items
  9480  	*/
  9481  
  9482  	f := newModelFixture("../fixtures/bugs/1537/fixture-1537-2.yaml", "param body required with array of aliased items")
  9483  	thisRun := f.AddRun(false)
  9484  
  9485  	// load expectations for model: profiles.go
  9486  	thisRun.AddExpectations("profiles.go", []string{
  9487  		`type Profiles []ProfileCfgs`,
  9488  		`func (m Profiles) Validate(formats strfmt.Registry) error {`,
  9489  		`	for i := 0; i < len(m); i++ {`,
  9490  		`		if err := m[i].Validate(formats); err != nil {`,
  9491  		`			if ve, ok := err.(*errors.Validation); ok {`,
  9492  		`				return ve.ValidateName(strconv.Itoa(i)`,
  9493  		`		return errors.CompositeValidationError(res...`,
  9494  	},
  9495  		// not expected
  9496  		todo,
  9497  		// output in log
  9498  		noLines,
  9499  		noLines)
  9500  
  9501  	// load expectations for model: profile_cfgs_no_validation.go
  9502  	thisRun.AddExpectations("profile_cfgs_no_validation.go", []string{
  9503  		`type ProfileCfgsNoValidation []*ProfileCfg`,
  9504  		`func (m ProfileCfgsNoValidation) Validate(formats strfmt.Registry) error {`,
  9505  		`	for i := 0; i < len(m); i++ {`,
  9506  		// do we need Required when item is nullable?
  9507  		// nullable not required:
  9508  		`		if swag.IsZero(m[i]) {`,
  9509  		// nullable required:
  9510  		`		if m[i] != nil {`,
  9511  		`			if err := m[i].Validate(formats); err != nil {`,
  9512  		`				if ve, ok := err.(*errors.Validation); ok {`,
  9513  		`					return ve.ValidateName(strconv.Itoa(i)`,
  9514  		`		return errors.CompositeValidationError(res...`,
  9515  	},
  9516  		// not expected
  9517  		todo,
  9518  		// output in log
  9519  		noLines,
  9520  		noLines)
  9521  
  9522  	// load expectations for model: profile_cfgs.go
  9523  	thisRun.AddExpectations("profile_cfgs.go", []string{
  9524  		`type ProfileCfgs []*ProfileCfg`,
  9525  		`func (m ProfileCfgs) Validate(formats strfmt.Registry) error {`,
  9526  		`	iProfileCfgsSize := int64(len(m)`,
  9527  		`	if err := validate.MaxItems("", "body", iProfileCfgsSize, 10); err != nil {`,
  9528  		`	for i := 0; i < len(m); i++ {`,
  9529  		// do we need Required when item is nullable?
  9530  		// nullable not required:
  9531  		`		if swag.IsZero(m[i]) {`,
  9532  		// nullable required:
  9533  		`		if m[i] != nil {`,
  9534  		`			if err := m[i].Validate(formats); err != nil {`,
  9535  		`				if ve, ok := err.(*errors.Validation); ok {`,
  9536  		`					return ve.ValidateName(strconv.Itoa(i)`,
  9537  		`		return errors.CompositeValidationError(res...`,
  9538  	},
  9539  		// not expected
  9540  		todo,
  9541  		// output in log
  9542  		noLines,
  9543  		noLines)
  9544  
  9545  	// load expectations for model: profile_cfg.go
  9546  	thisRun.AddExpectations("profile_cfg.go", []string{
  9547  		`type ProfileCfg struct {`,
  9548  		"	Value1 int32 `json:\"value1,omitempty\"`",
  9549  		"	Value2 int32 `json:\"value2,omitempty\"`",
  9550  		// empty validation
  9551  		"func (m *ProfileCfg) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  9552  	},
  9553  		// not expected
  9554  		todo,
  9555  		// output in log
  9556  		noLines,
  9557  		noLines)
  9558  
  9559  	// load expectations for model: profiles_no_validation.go
  9560  	thisRun.AddExpectations("profiles_no_validation.go", []string{
  9561  		`type ProfilesNoValidation []ProfileCfgsNoValidation`,
  9562  		`func (m ProfilesNoValidation) Validate(formats strfmt.Registry) error {`,
  9563  		`	for i := 0; i < len(m); i++ {`,
  9564  		`		if err := m[i].Validate(formats); err != nil {`,
  9565  		`			if ve, ok := err.(*errors.Validation); ok {`,
  9566  		`				return ve.ValidateName(strconv.Itoa(i)`,
  9567  		`		return errors.CompositeValidationError(res...`,
  9568  	},
  9569  		// not expected
  9570  		todo,
  9571  		// output in log
  9572  		noLines,
  9573  		noLines)
  9574  }
  9575  
  9576  func initFixture15365() {
  9577  	// testing fixture-1536-5.yaml with flatten but NOT expand (--skip-flatten)
  9578  
  9579  	f := newModelFixture("../fixtures/bugs/1536/fixture-1536-5.yaml", "param body with maps")
  9580  	thisRun := f.AddRun(false)
  9581  
  9582  	// load expectations for model: model_array_of_nullable.go
  9583  	thisRun.AddExpectations("model_array_of_nullable.go", []string{
  9584  		`type ModelArrayOfNullable []*int64`,
  9585  		`func (m ModelArrayOfNullable) Validate(formats strfmt.Registry) error {`,
  9586  		`	for i := 0; i < len(m); i++ {`,
  9587  		// do we need Required when item is nullable?
  9588  		// nullable not required:
  9589  		`		if swag.IsZero(m[i]) {`,
  9590  		// nullable required:
  9591  		`		if err := validate.MinimumInt(strconv.Itoa(i), "body", *m[i], 0, false); err != nil {`,
  9592  		`		return errors.CompositeValidationError(res...`,
  9593  	},
  9594  		// not expected
  9595  		todo,
  9596  		// output in log
  9597  		noLines,
  9598  		noLines)
  9599  
  9600  	// load expectations for model: model_map_of_nullable_primitive.go
  9601  	thisRun.AddExpectations("model_map_of_nullable_primitive.go", []string{
  9602  		`type ModelMapOfNullablePrimitive map[string]*int64`,
  9603  		`func (m ModelMapOfNullablePrimitive) Validate(formats strfmt.Registry) error {`,
  9604  		`	for k := range m {`,
  9605  		// do we need Required when element is nullable?
  9606  		// nullable not required:
  9607  		`		if swag.IsZero(m[k]) {`,
  9608  		`		if err := validate.MinimumInt(k, "body", *m[k], 0, false); err != nil {`,
  9609  		`		return errors.CompositeValidationError(res...`,
  9610  	},
  9611  		// not expected
  9612  		todo,
  9613  		// output in log
  9614  		noLines,
  9615  		noLines)
  9616  
  9617  	// load expectations for model: model_array_with_max.go
  9618  	thisRun.AddExpectations("model_array_with_max.go", []string{
  9619  		`type ModelArrayWithMax []interface{`,
  9620  		`func (m ModelArrayWithMax) Validate(formats strfmt.Registry) error {`,
  9621  		`	iModelArrayWithMaxSize := int64(len(m)`,
  9622  		`	if err := validate.MaxItems("", "body", iModelArrayWithMaxSize, 10); err != nil {`,
  9623  		`		return errors.CompositeValidationError(res...`,
  9624  	},
  9625  		// not expected
  9626  		todo,
  9627  		// output in log
  9628  		noLines,
  9629  		noLines)
  9630  
  9631  	// load expectations for model: model_array_of_x_nullable.go
  9632  	thisRun.AddExpectations("model_array_of_x_nullable.go", []string{
  9633  		`type ModelArrayOfXNullable []*int64`,
  9634  		// do we need Required when item is nullable?
  9635  		// nullable not required:
  9636  		"func (m ModelArrayOfXNullable) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  9637  		// nullable required:
  9638  	},
  9639  		// not expected
  9640  		todo,
  9641  		// output in log
  9642  		noLines,
  9643  		noLines)
  9644  
  9645  	// load expectations for model: model_array_of_nullable_format.go
  9646  	thisRun.AddExpectations("model_array_of_nullable_format.go", []string{
  9647  		`type ModelArrayOfNullableFormat []*strfmt.UUID`,
  9648  		`func (m ModelArrayOfNullableFormat) Validate(formats strfmt.Registry) error {`,
  9649  		`	for i := 0; i < len(m); i++ {`,
  9650  		// do we need Required when item is nullable?
  9651  		// nullable not required:
  9652  		`		if swag.IsZero(m[i]) {`,
  9653  		// nullable required:
  9654  		`		if err := validate.FormatOf(strconv.Itoa(i), "body", "uuid", m[i].String(), formats); err != nil {`,
  9655  		`		return errors.CompositeValidationError(res...`,
  9656  	},
  9657  		// not expected
  9658  		todo,
  9659  		// output in log
  9660  		noLines,
  9661  		noLines)
  9662  
  9663  	// load expectations for model: model_map_of_of_slice_of_nullable_primitive.go
  9664  	thisRun.AddExpectations("model_map_of_of_slice_of_nullable_primitive.go", []string{
  9665  		`type ModelMapOfOfSliceOfNullablePrimitive map[string][]*int64`,
  9666  		`func (m ModelMapOfOfSliceOfNullablePrimitive) Validate(formats strfmt.Registry) error {`,
  9667  		`	for k := range m {`,
  9668  		// do we need Required when element is nullable?
  9669  		// nullable not required:
  9670  		`		for i := 0; i < len(m[k]); i++ {`,
  9671  		// do we need Required when item is nullable?
  9672  		// nullable not required:
  9673  		`			if err := validate.MinimumInt(k+"."+strconv.Itoa(i), "body", *m[k][i], 0, false); err != nil {`,
  9674  		`		return errors.CompositeValidationError(res...`,
  9675  	},
  9676  		// not expected
  9677  		todo,
  9678  		// output in log
  9679  		noLines,
  9680  		noLines)
  9681  
  9682  	// load expectations for model: model_map_of_ref.go
  9683  	thisRun.AddExpectations("model_map_of_ref.go", []string{
  9684  		`type ModelMapOfRef map[string]ModelArrayWithMax`,
  9685  		`func (m ModelMapOfRef) Validate(formats strfmt.Registry) error {`,
  9686  		`	for k := range m {`,
  9687  		`		if err := m[k].Validate(formats); err != nil {`,
  9688  		`			if ve, ok := err.(*errors.Validation); ok {`,
  9689  		`				return ve.ValidateName(k`,
  9690  		`		return errors.CompositeValidationError(res...`,
  9691  	},
  9692  		// not expected
  9693  		todo,
  9694  		// output in log
  9695  		noLines,
  9696  		noLines)
  9697  
  9698  	// load expectations for model: model_array_of_format.go
  9699  	thisRun.AddExpectations("model_array_of_format.go", []string{
  9700  		`type ModelArrayOfFormat []strfmt.UUID`,
  9701  		`func (m ModelArrayOfFormat) Validate(formats strfmt.Registry) error {`,
  9702  		`	for i := 0; i < len(m); i++ {`,
  9703  		`		if err := validate.FormatOf(strconv.Itoa(i), "body", "uuid", m[i].String(), formats); err != nil {`,
  9704  		`		return errors.CompositeValidationError(res...`,
  9705  	},
  9706  		// not expected
  9707  		todo,
  9708  		// output in log
  9709  		noLines,
  9710  		noLines)
  9711  
  9712  	// load expectations for model: model_array_of_ref_no_validations.go
  9713  	thisRun.AddExpectations("model_array_of_ref_no_validations.go", []string{
  9714  		`type ModelArrayOfRefNoValidations []ModelInterface`,
  9715  		// empty validation
  9716  		"func (m ModelArrayOfRefNoValidations) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  9717  	},
  9718  		// not expected
  9719  		todo,
  9720  		// output in log
  9721  		noLines,
  9722  		noLines)
  9723  
  9724  	// load expectations for model: model_array_of_not_nullable.go
  9725  	thisRun.AddExpectations("model_array_of_not_nullable.go", []string{
  9726  		`type ModelArrayOfNotNullable []int64`,
  9727  		`func (m ModelArrayOfNotNullable) Validate(formats strfmt.Registry) error {`,
  9728  		`	for i := 0; i < len(m); i++ {`,
  9729  		`		if err := validate.MinimumInt(strconv.Itoa(i), "body", m[i], 10, false); err != nil {`,
  9730  		`		return errors.CompositeValidationError(res...`,
  9731  	},
  9732  		// not expected
  9733  		todo,
  9734  		// output in log
  9735  		noLines,
  9736  		noLines)
  9737  
  9738  	// load expectations for model: model_array_of_nullable_string.go
  9739  	thisRun.AddExpectations("model_array_of_nullable_string.go", []string{
  9740  		`type ModelArrayOfNullableString []*string`,
  9741  		// do we need Required when item is nullable?
  9742  		// nullable not required:
  9743  		// empty validation
  9744  		"func (m ModelArrayOfNullableString) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  9745  		// nullable required:
  9746  	},
  9747  		// not expected
  9748  		todo,
  9749  		// output in log
  9750  		noLines,
  9751  		noLines)
  9752  
  9753  	// load expectations for model: model_map_of_x_nullable_primitive.go
  9754  	thisRun.AddExpectations("model_map_of_x_nullable_primitive.go", []string{
  9755  		`type ModelMapOfXNullablePrimitive map[string]*int64`,
  9756  		`func (m ModelMapOfXNullablePrimitive) Validate(formats strfmt.Registry) error {`,
  9757  		`	for k := range m {`,
  9758  		// do we need...?
  9759  		`		if swag.IsZero(m[k]) {`,
  9760  		`		if err := validate.MinimumInt(k, "body", *m[k], 100, false); err != nil {`,
  9761  		`		return errors.CompositeValidationError(res...`,
  9762  	},
  9763  		// not expected
  9764  		todo,
  9765  		// output in log
  9766  		noLines,
  9767  		noLines)
  9768  
  9769  	// load expectations for model: model_array_of_not_nullable_string.go
  9770  	thisRun.AddExpectations("model_array_of_not_nullable_string.go", []string{
  9771  		`type ModelArrayOfNotNullableString []string`,
  9772  		// empty validation
  9773  		"func (m ModelArrayOfNotNullableString) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  9774  	},
  9775  		// not expected
  9776  		todo,
  9777  		// output in log
  9778  		noLines,
  9779  		noLines)
  9780  
  9781  	// load expectations for model: model_array_of_ref_slice_validations.go
  9782  	thisRun.AddExpectations("model_array_of_ref_slice_validations.go", []string{
  9783  		`type ModelArrayOfRefSliceValidations []ModelInterface`,
  9784  		`func (m ModelArrayOfRefSliceValidations) Validate(formats strfmt.Registry) error {`,
  9785  		`	iModelArrayOfRefSliceValidationsSize := int64(len(m)`,
  9786  		`	if err := validate.MaxItems("", "body", iModelArrayOfRefSliceValidationsSize, 10); err != nil {`,
  9787  		`		return errors.CompositeValidationError(res...`,
  9788  	},
  9789  		// not expected
  9790  		todo,
  9791  		// output in log
  9792  		noLines,
  9793  		noLines)
  9794  
  9795  	// load expectations for model: model_interface.go
  9796  	thisRun.AddExpectations("model_interface.go", []string{
  9797  		`type ModelInterface interface{`,
  9798  	},
  9799  		// not expected
  9800  		todo,
  9801  		// output in log
  9802  		noLines,
  9803  		noLines)
  9804  
  9805  	// load expectations for model: model_array_of_ref.go
  9806  	thisRun.AddExpectations("model_array_of_ref.go", []string{
  9807  		`type ModelArrayOfRef []ModelArrayOfXNullable`,
  9808  		`func (m ModelArrayOfRef) Validate(formats strfmt.Registry) error {`,
  9809  		`	for i := 0; i < len(m); i++ {`,
  9810  		`		if err := m[i].Validate(formats); err != nil {`,
  9811  		`			if ve, ok := err.(*errors.Validation); ok {`,
  9812  		`				return ve.ValidateName(strconv.Itoa(i)`,
  9813  		`		return errors.CompositeValidationError(res...`,
  9814  	},
  9815  		// not expected
  9816  		todo,
  9817  		// output in log
  9818  		noLines,
  9819  		noLines)
  9820  }
  9821  
  9822  func initFixture1548() {
  9823  	// testing fixture-1548.yaml with flatten
  9824  
  9825  	/*
  9826  		My App API: check that there is no format validation on Base64 types
  9827  	*/
  9828  
  9829  	f := newModelFixture("../fixtures/bugs/1548/fixture-1548.yaml", "My App API")
  9830  	thisRun := f.AddRun(false)
  9831  
  9832  	// load expectations for model: base64_alias.go
  9833  	thisRun.AddExpectations("base64_alias.go", []string{
  9834  		`type Base64Alias strfmt.Base64`,
  9835  		`func (m *Base64Alias) UnmarshalJSON(b []byte) error {`,
  9836  		`	return ((*strfmt.Base64)(m)).UnmarshalJSON(b`,
  9837  		`func (m Base64Alias) MarshalJSON() ([]byte, error) {`,
  9838  		`	return (strfmt.Base64(m)).MarshalJSON(`,
  9839  		`func (m Base64Alias) Validate(formats strfmt.Registry) error {`,
  9840  	},
  9841  		// not expected
  9842  		[]string{
  9843  			"TODO",
  9844  			"validate.FormatOf(",
  9845  			`return errors.CompositeValidationError(res...`,
  9846  		},
  9847  		// output in log
  9848  		noLines,
  9849  		noLines)
  9850  
  9851  	// load expectations for model: base64_map.go
  9852  	thisRun.AddExpectations("base64_map.go", []string{
  9853  		`type Base64Map map[string]strfmt.Base64`,
  9854  		`func (m Base64Map) Validate(formats strfmt.Registry) error {`,
  9855  		`	for k := range m {`,
  9856  		`		if err := validate.MaxLength(k, "body", m[k].String(), 100); err != nil {`,
  9857  		`		return errors.CompositeValidationError(res...`,
  9858  	},
  9859  		// not expected
  9860  		[]string{"TODO", "validate.FormatOf("},
  9861  		// output in log
  9862  		noLines,
  9863  		noLines)
  9864  
  9865  	// load expectations for model: base64_array.go
  9866  	thisRun.AddExpectations("base64_array.go", []string{
  9867  		`type Base64Array []strfmt.Base64`,
  9868  		`func (m Base64Array) Validate(formats strfmt.Registry) error {`,
  9869  	},
  9870  		// not expected
  9871  		[]string{
  9872  			"TODO",
  9873  			"validate.FormatOf(",
  9874  			`	for i := 0; i < len(m); i++ {`,
  9875  			`		return errors.CompositeValidationError(res...`,
  9876  		},
  9877  		// output in log
  9878  		noLines,
  9879  		noLines)
  9880  
  9881  	// load expectations for model: base64_model.go
  9882  	thisRun.AddExpectations("base64_model.go", []string{
  9883  		`type Base64Model struct {`,
  9884  		"	Prop1 strfmt.Base64 `json:\"prop1,omitempty\"`",
  9885  		`func (m *Base64Model) Validate(formats strfmt.Registry) error {`,
  9886  	},
  9887  		// not expected
  9888  		[]string{
  9889  			"TODO",
  9890  			"validate.FormatOf(",
  9891  			`	if err := m.validateProp1(formats); err != nil {`,
  9892  			`func (m *Base64Model) validateProp1(formats strfmt.Registry) error {`,
  9893  		},
  9894  		// output in log
  9895  		noLines,
  9896  		noLines)
  9897  }
  9898  
  9899  func initFixtureSimpleTuple() {
  9900  	// testing fixture-simple-tuple.yaml with flatten
  9901  
  9902  	/*
  9903  	   A basic test of for serialization generation for tuples and additionalItems.
  9904  
  9905  	*/
  9906  	f := newModelFixture("../fixtures/bugs/1571/fixture-simple-tuple.yaml", "fixture for serializing tuples")
  9907  	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
  9908  	expandRun := f.AddRun(true)
  9909  
  9910  	// load expectations for model: tuple_thing_with_map_element.go
  9911  	flattenRun.AddExpectations("tuple_thing_with_map_element.go", []string{
  9912  		`type TupleThingWithMapElement struct {`,
  9913  		"	P0 map[string]string `json:\"-\"`",
  9914  		"	P1 map[string]int64 `json:\"-\"`",
  9915  		"	TupleThingWithMapElementItems []map[string]strfmt.Date `json:\"-\"`",
  9916  		`func (m *TupleThingWithMapElement) UnmarshalJSON(raw []byte) error {`,
  9917  		`	var stage1 []json.RawMessage`,
  9918  		`	buf := bytes.NewBuffer(raw`,
  9919  		`	dec := json.NewDecoder(buf`,
  9920  		`	dec.UseNumber(`,
  9921  		`	if err := dec.Decode(&stage1); err != nil {`,
  9922  		`	var lastIndex int`,
  9923  		`	if len(stage1) > 0 {`,
  9924  		`		var dataP0 map[string]string`,
  9925  		`		buf = bytes.NewBuffer(stage1[0]`,
  9926  		`		dec := json.NewDecoder(buf`,
  9927  		`		dec.UseNumber(`,
  9928  		`		if err := dec.Decode(&dataP0); err != nil {`,
  9929  		`		m.P0 = dataP0`,
  9930  		`		lastIndex = 0`,
  9931  		`	if len(stage1) > 1 {`,
  9932  		`		var dataP1 map[string]int64`,
  9933  		`		buf = bytes.NewBuffer(stage1[1]`,
  9934  		`		dec := json.NewDecoder(buf`,
  9935  		`		dec.UseNumber(`,
  9936  		`		if err := dec.Decode(&dataP1); err != nil {`,
  9937  		`		m.P1 = dataP1`,
  9938  		`		lastIndex = 1`,
  9939  		`	if len(stage1) > lastIndex+1 {`,
  9940  		`		for _, val := range stage1[lastIndex+1:] {`,
  9941  		`			var toadd map[string]strfmt.Date`,
  9942  		`			buf = bytes.NewBuffer(val`,
  9943  		`			dec := json.NewDecoder(buf`,
  9944  		`			dec.UseNumber(`,
  9945  		`			if err := dec.Decode(&toadd); err != nil {`,
  9946  		`			m.TupleThingWithMapElementItems = append(m.TupleThingWithMapElementItems, toadd`,
  9947  		`func (m TupleThingWithMapElement) MarshalJSON() ([]byte, error) {`,
  9948  		`	data := []interface{}{`,
  9949  		`		m.P0,`,
  9950  		`		m.P1,`,
  9951  		`	for _, v := range m.TupleThingWithMapElementItems {`,
  9952  		`		data = append(data, v`,
  9953  		`	return json.Marshal(data`,
  9954  		`func (m *TupleThingWithMapElement) Validate(formats strfmt.Registry) error {`,
  9955  		`	if err := m.validateP0(formats); err != nil {`,
  9956  		`	if err := m.validateP1(formats); err != nil {`,
  9957  		`	if err := m.validateTupleThingWithMapElementItems(formats); err != nil {`,
  9958  		`		return errors.CompositeValidationError(res...`,
  9959  		`func (m *TupleThingWithMapElement) validateP0(formats strfmt.Registry) error {`,
  9960  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  9961  		`	for k := range m.P0 {`,
  9962  		`		if err := validate.MaxLength("0"+"."+k, "body", m.P0[k], 10); err != nil {`,
  9963  		`func (m *TupleThingWithMapElement) validateP1(formats strfmt.Registry) error {`,
  9964  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  9965  		`	for k := range m.P1 {`,
  9966  		`		if err := validate.MinimumInt("1"+"."+k, "body", m.P1[k], 10, false); err != nil {`,
  9967  		`func (m *TupleThingWithMapElement) validateTupleThingWithMapElementItems(formats strfmt.Registry) error {`,
  9968  		`	for i := range m.TupleThingWithMapElementItems {`,
  9969  		`		for k := range m.TupleThingWithMapElementItems[i] {`,
  9970  		`			if err := validate.FormatOf(strconv.Itoa(i+2)+"."+k, "body", "date", ` +
  9971  			`m.TupleThingWithMapElementItems[i][k].String(), formats); err != nil {`,
  9972  	},
  9973  		// not expected
  9974  		todo,
  9975  		// output in log
  9976  		noLines,
  9977  		noLines)
  9978  
  9979  	expandRun.AddExpectations("tuple_thing_with_map_element.go",
  9980  		flattenRun.ExpectedFor("TupleThingWithMapElement").ExpectedLines, todo, noLines, noLines)
  9981  
  9982  	// load expectations for model: true_tuple_thing.go
  9983  	flattenRun.AddExpectations("true_tuple_thing.go", []string{
  9984  		`type TrueTupleThing struct {`,
  9985  		"	P0 *float64 `json:\"-\"`",
  9986  		"	P1 *string `json:\"-\"`",
  9987  		"	TrueTupleThingItems []interface{} `json:\"-\"`",
  9988  		`func (m *TrueTupleThing) UnmarshalJSON(raw []byte) error {`,
  9989  		`	var stage1 []json.RawMessage`,
  9990  		`	buf := bytes.NewBuffer(raw`,
  9991  		`	dec := json.NewDecoder(buf`,
  9992  		`	dec.UseNumber(`,
  9993  		`	if err := dec.Decode(&stage1); err != nil {`,
  9994  		`	var lastIndex int`,
  9995  		`	if len(stage1) > 0 {`,
  9996  		`		var dataP0 float64`,
  9997  		`		buf = bytes.NewBuffer(stage1[0]`,
  9998  		`		dec := json.NewDecoder(buf`,
  9999  		`		dec.UseNumber(`,
 10000  		`		if err := dec.Decode(&dataP0); err != nil {`,
 10001  		`		m.P0 = &dataP0`,
 10002  		`		lastIndex = 0`,
 10003  		`	if len(stage1) > 1 {`,
 10004  		`		var dataP1 string`,
 10005  		`		buf = bytes.NewBuffer(stage1[1]`,
 10006  		`		dec := json.NewDecoder(buf`,
 10007  		`		dec.UseNumber(`,
 10008  		`		if err := dec.Decode(&dataP1); err != nil {`,
 10009  		`		m.P1 = &dataP1`,
 10010  		`		lastIndex = 1`,
 10011  		`	if len(stage1) > lastIndex+1 {`,
 10012  		`		for _, val := range stage1[lastIndex+1:] {`,
 10013  		`			var toadd interface{`,
 10014  		`			buf = bytes.NewBuffer(val`,
 10015  		`			dec := json.NewDecoder(buf`,
 10016  		`			dec.UseNumber(`,
 10017  		`			if err := dec.Decode(&toadd); err != nil {`,
 10018  		`			m.TrueTupleThingItems = append(m.TrueTupleThingItems, toadd`,
 10019  		`func (m TrueTupleThing) MarshalJSON() ([]byte, error) {`,
 10020  		`	data := []interface{}{`,
 10021  		`		m.P0,`,
 10022  		`		m.P1,`,
 10023  		`	for _, v := range m.TrueTupleThingItems {`,
 10024  		`		data = append(data, v`,
 10025  		`	return json.Marshal(data`,
 10026  		`func (m *TrueTupleThing) Validate(formats strfmt.Registry) error {`,
 10027  		`	if err := m.validateP0(formats); err != nil {`,
 10028  		`	if err := m.validateP1(formats); err != nil {`,
 10029  		`	if err := m.validateTrueTupleThingItems(formats); err != nil {`,
 10030  		`		return errors.CompositeValidationError(res...`,
 10031  		`func (m *TrueTupleThing) validateP0(formats strfmt.Registry) error {`,
 10032  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 10033  		`func (m *TrueTupleThing) validateP1(formats strfmt.Registry) error {`,
 10034  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
 10035  		`func (m *TrueTupleThing) validateTrueTupleThingItems(formats strfmt.Registry) error {`,
 10036  	},
 10037  		// not expected
 10038  		todo,
 10039  		// output in log
 10040  		noLines,
 10041  		noLines)
 10042  
 10043  	expandRun.AddExpectations("true_tuple_thing.go",
 10044  		flattenRun.ExpectedFor("TrueTupleThing").ExpectedLines, todo, noLines, noLines)
 10045  
 10046  	// load expectations for model: false_tuple_thing.go
 10047  	flattenRun.AddExpectations("false_tuple_thing.go", []string{
 10048  		`type FalseTupleThing struct {`,
 10049  		"	P0 *float64 `json:\"-\"`",
 10050  		"	P1 *string `json:\"-\"`",
 10051  		`func (m *FalseTupleThing) UnmarshalJSON(raw []byte) error {`,
 10052  		`	var stage1 []json.RawMessage`,
 10053  		`	buf := bytes.NewBuffer(raw`,
 10054  		`	dec := json.NewDecoder(buf`,
 10055  		`	dec.UseNumber(`,
 10056  		`	if err := dec.Decode(&stage1); err != nil {`,
 10057  		`	if len(stage1) > 0 {`,
 10058  		`		var dataP0 float64`,
 10059  		`		buf = bytes.NewBuffer(stage1[0]`,
 10060  		`		dec := json.NewDecoder(buf`,
 10061  		`		dec.UseNumber(`,
 10062  		`		if err := dec.Decode(&dataP0); err != nil {`,
 10063  		`		m.P0 = &dataP0`,
 10064  		`	if len(stage1) > 1 {`,
 10065  		`		var dataP1 string`,
 10066  		`		buf = bytes.NewBuffer(stage1[1]`,
 10067  		`		dec := json.NewDecoder(buf`,
 10068  		`		dec.UseNumber(`,
 10069  		`		if err := dec.Decode(&dataP1); err != nil {`,
 10070  		`		m.P1 = &dataP1`,
 10071  		`func (m FalseTupleThing) MarshalJSON() ([]byte, error) {`,
 10072  		`	data := []interface{}{`,
 10073  		`		m.P0,`,
 10074  		`		m.P1,`,
 10075  		`	return json.Marshal(data`,
 10076  		`func (m *FalseTupleThing) Validate(formats strfmt.Registry) error {`,
 10077  		`	if err := m.validateP0(formats); err != nil {`,
 10078  		`	if err := m.validateP1(formats); err != nil {`,
 10079  		`		return errors.CompositeValidationError(res...`,
 10080  		`func (m *FalseTupleThing) validateP0(formats strfmt.Registry) error {`,
 10081  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 10082  		`func (m *FalseTupleThing) validateP1(formats strfmt.Registry) error {`,
 10083  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
 10084  	},
 10085  		// not expected
 10086  		todo,
 10087  		// output in log
 10088  		noLines,
 10089  		noLines)
 10090  
 10091  	expandRun.AddExpectations("false_tuple_thing.go",
 10092  		flattenRun.ExpectedFor("FalseTupleThing").ExpectedLines, todo, noLines, noLines)
 10093  
 10094  	// load expectations for model: tuple_thing_with_not_nullable.go
 10095  	flattenRun.AddExpectations("tuple_thing_with_not_nullable.go", []string{
 10096  		`type TupleThingWithNotNullable struct {`,
 10097  		"	P0 string `json:\"-\"`",
 10098  		"	P1 *int64 `json:\"-\"`",
 10099  		"	TupleThingWithNotNullableItems []interface{} `json:\"-\"`",
 10100  		`func (m *TupleThingWithNotNullable) UnmarshalJSON(raw []byte) error {`,
 10101  		`	var stage1 []json.RawMessage`,
 10102  		`	buf := bytes.NewBuffer(raw`,
 10103  		`	dec := json.NewDecoder(buf`,
 10104  		`	dec.UseNumber(`,
 10105  		`	if err := dec.Decode(&stage1); err != nil {`,
 10106  		`	var lastIndex int`,
 10107  		`	if len(stage1) > 0 {`,
 10108  		`		var dataP0 string`,
 10109  		`		buf = bytes.NewBuffer(stage1[0]`,
 10110  		`		dec := json.NewDecoder(buf`,
 10111  		`		dec.UseNumber(`,
 10112  		`		if err := dec.Decode(&dataP0); err != nil {`,
 10113  		`		m.P0 = dataP0`,
 10114  		`		lastIndex = 0`,
 10115  		`	if len(stage1) > 1 {`,
 10116  		`		var dataP1 int64`,
 10117  		`		buf = bytes.NewBuffer(stage1[1]`,
 10118  		`		dec := json.NewDecoder(buf`,
 10119  		`		dec.UseNumber(`,
 10120  		`		if err := dec.Decode(&dataP1); err != nil {`,
 10121  		`		m.P1 = &dataP1`,
 10122  		`		lastIndex = 1`,
 10123  		`	if len(stage1) > lastIndex+1 {`,
 10124  		`		for _, val := range stage1[lastIndex+1:] {`,
 10125  		`			var toadd interface{`,
 10126  		`			buf = bytes.NewBuffer(val`,
 10127  		`			dec := json.NewDecoder(buf`,
 10128  		`			dec.UseNumber(`,
 10129  		`			if err := dec.Decode(&toadd); err != nil {`,
 10130  		`			m.TupleThingWithNotNullableItems = append(m.TupleThingWithNotNullableItems, toadd`,
 10131  		`func (m TupleThingWithNotNullable) MarshalJSON() ([]byte, error) {`,
 10132  		`	data := []interface{}{`,
 10133  		`		m.P0,`,
 10134  		`		m.P1,`,
 10135  		`	for _, v := range m.TupleThingWithNotNullableItems {`,
 10136  		`		data = append(data, v`,
 10137  		`	return json.Marshal(data`,
 10138  		`func (m *TupleThingWithNotNullable) Validate(formats strfmt.Registry) error {`,
 10139  		`	if err := m.validateP0(formats); err != nil {`,
 10140  		`	if err := m.validateP1(formats); err != nil {`,
 10141  		`	if err := m.validateTupleThingWithNotNullableItems(formats); err != nil {`,
 10142  		`		return errors.CompositeValidationError(res...`,
 10143  		`func (m *TupleThingWithNotNullable) validateP0(formats strfmt.Registry) error {`,
 10144  		`	if err := validate.RequiredString("0", "body", m.P0); err != nil {`,
 10145  		`	if err := validate.MaxLength("0", "body", m.P0, 10); err != nil {`,
 10146  		`func (m *TupleThingWithNotNullable) validateP1(formats strfmt.Registry) error {`,
 10147  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
 10148  		`	if err := validate.MaximumInt("1", "body", *m.P1, 10, false); err != nil {`,
 10149  		`func (m *TupleThingWithNotNullable) validateTupleThingWithNotNullableItems(formats strfmt.Registry) error {`,
 10150  	},
 10151  		// not expected
 10152  		todo,
 10153  		// output in log
 10154  		noLines,
 10155  		noLines)
 10156  
 10157  	expandRun.AddExpectations("tuple_thing_with_not_nullable.go",
 10158  		flattenRun.ExpectedFor("TupleThingWithNotNullable").ExpectedLines, todo, noLines, noLines)
 10159  
 10160  	// load expectations for model: tuple_thing.go
 10161  	flattenRun.AddExpectations("tuple_thing.go", []string{
 10162  		`type TupleThing struct {`,
 10163  		"	P0 *string `json:\"-\"`",
 10164  		"	P1 *string `json:\"-\"`",
 10165  		`func (m *TupleThing) UnmarshalJSON(raw []byte) error {`,
 10166  		`	var stage1 []json.RawMessage`,
 10167  		`	buf := bytes.NewBuffer(raw`,
 10168  		`	dec := json.NewDecoder(buf`,
 10169  		`	dec.UseNumber(`,
 10170  		`	if err := dec.Decode(&stage1); err != nil {`,
 10171  		`	if len(stage1) > 0 {`,
 10172  		`		var dataP0 string`,
 10173  		`		buf = bytes.NewBuffer(stage1[0]`,
 10174  		`		dec := json.NewDecoder(buf`,
 10175  		`		dec.UseNumber(`,
 10176  		`		if err := dec.Decode(&dataP0); err != nil {`,
 10177  		`		m.P0 = &dataP0`,
 10178  		`	if len(stage1) > 1 {`,
 10179  		`		var dataP1 string`,
 10180  		`		buf = bytes.NewBuffer(stage1[1]`,
 10181  		`		dec := json.NewDecoder(buf`,
 10182  		`		dec.UseNumber(`,
 10183  		`		if err := dec.Decode(&dataP1); err != nil {`,
 10184  		`		m.P1 = &dataP1`,
 10185  		`func (m TupleThing) MarshalJSON() ([]byte, error) {`,
 10186  		`	data := []interface{}{`,
 10187  		`		m.P0,`,
 10188  		`		m.P1,`,
 10189  		`	return json.Marshal(data`,
 10190  		`func (m *TupleThing) Validate(formats strfmt.Registry) error {`,
 10191  		`	if err := m.validateP0(formats); err != nil {`,
 10192  		`	if err := m.validateP1(formats); err != nil {`,
 10193  		`		return errors.CompositeValidationError(res...`,
 10194  		`var tupleThingTypeP0PropEnum []interface{`,
 10195  		`	var res []string`,
 10196  		"	if err := json.Unmarshal([]byte(`[\"CONST1\",\"CONST2\"]`), &res); err != nil {",
 10197  		`	for _, v := range res {`,
 10198  		`		tupleThingTypeP0PropEnum = append(tupleThingTypeP0PropEnum, v`,
 10199  		`	TupleThingP0CONST1 string = "CONST1"`,
 10200  		`	TupleThingP0CONST2 string = "CONST2"`,
 10201  		`func (m *TupleThing) validateP0Enum(path, location string, value string) error {`,
 10202  		`	if err := validate.EnumCase(path, location, value, tupleThingTypeP0PropEnum, true); err != nil {`,
 10203  		`func (m *TupleThing) validateP0(formats strfmt.Registry) error {`,
 10204  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 10205  		`	if err := m.validateP0Enum("0", "body", *m.P0); err != nil {`,
 10206  		`var tupleThingTypeP1PropEnum []interface{`,
 10207  		`	var res []string`,
 10208  		"	if err := json.Unmarshal([]byte(`[\"CONST3\",\"CONST4\"]`), &res); err != nil {",
 10209  		`	for _, v := range res {`,
 10210  		`		tupleThingTypeP1PropEnum = append(tupleThingTypeP1PropEnum, v`,
 10211  		`	TupleThingP1CONST3 string = "CONST3"`,
 10212  		`	TupleThingP1CONST4 string = "CONST4"`,
 10213  		`func (m *TupleThing) validateP1Enum(path, location string, value string) error {`,
 10214  		`	if err := validate.EnumCase(path, location, value, tupleThingTypeP1PropEnum, true); err != nil {`,
 10215  		`func (m *TupleThing) validateP1(formats strfmt.Registry) error {`,
 10216  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
 10217  		`	if err := m.validateP1Enum("1", "body", *m.P1); err != nil {`,
 10218  	},
 10219  		// not expected
 10220  		todo,
 10221  		// output in log
 10222  		noLines,
 10223  		noLines)
 10224  
 10225  	expandRun.AddExpectations("tuple_thing.go",
 10226  		flattenRun.ExpectedFor("TupleThing").ExpectedLines, todo, noLines, noLines)
 10227  
 10228  	// load expectations for model: tuple_thing_with_additional_items.go
 10229  	flattenRun.AddExpectations("tuple_thing_with_additional_items.go", []string{
 10230  		`type TupleThingWithAdditionalItems struct {`,
 10231  		"	P0 *string `json:\"-\"`",
 10232  		"	P1 *int64 `json:\"-\"`",
 10233  		"	TupleThingWithAdditionalItemsItems []int64 `json:\"-\"`",
 10234  		`func (m *TupleThingWithAdditionalItems) UnmarshalJSON(raw []byte) error {`,
 10235  		`	var stage1 []json.RawMessage`,
 10236  		`	buf := bytes.NewBuffer(raw`,
 10237  		`	dec := json.NewDecoder(buf`,
 10238  		`	dec.UseNumber(`,
 10239  		`	if err := dec.Decode(&stage1); err != nil {`,
 10240  		`	var lastIndex int`,
 10241  		`	if len(stage1) > 0 {`,
 10242  		`		var dataP0 string`,
 10243  		`		buf = bytes.NewBuffer(stage1[0]`,
 10244  		`		dec := json.NewDecoder(buf`,
 10245  		`		dec.UseNumber(`,
 10246  		`		if err := dec.Decode(&dataP0); err != nil {`,
 10247  		`		m.P0 = &dataP0`,
 10248  		`		lastIndex = 0`,
 10249  		`	if len(stage1) > 1 {`,
 10250  		`		var dataP1 int64`,
 10251  		`		buf = bytes.NewBuffer(stage1[1]`,
 10252  		`		dec := json.NewDecoder(buf`,
 10253  		`		dec.UseNumber(`,
 10254  		`		if err := dec.Decode(&dataP1); err != nil {`,
 10255  		`		m.P1 = &dataP1`,
 10256  		`		lastIndex = 1`,
 10257  		`	if len(stage1) > lastIndex+1 {`,
 10258  		`		for _, val := range stage1[lastIndex+1:] {`,
 10259  		`			var toadd int64`,
 10260  		`			buf = bytes.NewBuffer(val`,
 10261  		`			dec := json.NewDecoder(buf`,
 10262  		`			dec.UseNumber(`,
 10263  		`			if err := dec.Decode(&toadd); err != nil {`,
 10264  		`			m.TupleThingWithAdditionalItemsItems = append(m.TupleThingWithAdditionalItemsItems, toadd`,
 10265  		`func (m TupleThingWithAdditionalItems) MarshalJSON() ([]byte, error) {`,
 10266  		`	data := []interface{}{`,
 10267  		`		m.P0,`,
 10268  		`		m.P1,`,
 10269  		`	for _, v := range m.TupleThingWithAdditionalItemsItems {`,
 10270  		`		data = append(data, v`,
 10271  		`	return json.Marshal(data`,
 10272  		`func (m *TupleThingWithAdditionalItems) Validate(formats strfmt.Registry) error {`,
 10273  		`	if err := m.validateP0(formats); err != nil {`,
 10274  		`	if err := m.validateP1(formats); err != nil {`,
 10275  		`	if err := m.validateTupleThingWithAdditionalItemsItems(formats); err != nil {`,
 10276  		`		return errors.CompositeValidationError(res...`,
 10277  		`func (m *TupleThingWithAdditionalItems) validateP0(formats strfmt.Registry) error {`,
 10278  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 10279  		`func (m *TupleThingWithAdditionalItems) validateP1(formats strfmt.Registry) error {`,
 10280  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
 10281  		`	if err := validate.MaximumInt("1", "body", *m.P1, 10, false); err != nil {`,
 10282  		`var tupleThingWithAdditionalItemsItemsEnum []interface{`,
 10283  		`	var res []int64`,
 10284  		"	if err := json.Unmarshal([]byte(`[1,2]`), &res); err != nil {",
 10285  		`	for _, v := range res {`,
 10286  		`		tupleThingWithAdditionalItemsItemsEnum = append(tupleThingWithAdditionalItemsItemsEnum, v`,
 10287  		`func (m *TupleThingWithAdditionalItems) validateTupleThingWithAdditionalItemsItemsEnum(path,` +
 10288  			` location string, value int64) error {`,
 10289  		`	if err := validate.EnumCase(path, location, value, tupleThingWithAdditionalItemsItemsEnum, true); err != nil {`,
 10290  		`func (m *TupleThingWithAdditionalItems) validateTupleThingWithAdditionalItemsItems(formats strfmt.Registry)` +
 10291  			` error {`,
 10292  		`	for i := range m.TupleThingWithAdditionalItemsItems {`,
 10293  		`		if err := m.validateTupleThingWithAdditionalItemsItemsEnum(strconv.Itoa(i+2), "body", ` +
 10294  			`m.TupleThingWithAdditionalItemsItems[i]); err != nil {`,
 10295  	},
 10296  		// not expected
 10297  		todo,
 10298  		// output in log
 10299  		noLines,
 10300  		noLines)
 10301  
 10302  	expandRun.AddExpectations("tuple_thing_with_additional_items.go",
 10303  		flattenRun.ExpectedFor("TupleThingWithAdditionalItems").ExpectedLines, todo, noLines, noLines)
 10304  
 10305  	// load expectations for model: tuple_thing_with_array_element.go
 10306  	flattenRun.AddExpectations("tuple_thing_with_array_element.go", []string{
 10307  		`type TupleThingWithArrayElement struct {`,
 10308  		"	P0 []string `json:\"-\"`",
 10309  		"	P1 []int64 `json:\"-\"`",
 10310  		"	TupleThingWithArrayElementItems [][]strfmt.Date `json:\"-\"`",
 10311  		`func (m *TupleThingWithArrayElement) UnmarshalJSON(raw []byte) error {`,
 10312  		`	var stage1 []json.RawMessage`,
 10313  		`	buf := bytes.NewBuffer(raw`,
 10314  		`	dec := json.NewDecoder(buf`,
 10315  		`	dec.UseNumber(`,
 10316  		`	if err := dec.Decode(&stage1); err != nil {`,
 10317  		`	var lastIndex int`,
 10318  		`	if len(stage1) > 0 {`,
 10319  		`		var dataP0 []string`,
 10320  		`		buf = bytes.NewBuffer(stage1[0]`,
 10321  		`		dec := json.NewDecoder(buf`,
 10322  		`		dec.UseNumber(`,
 10323  		`		if err := dec.Decode(&dataP0); err != nil {`,
 10324  		`		m.P0 = dataP0`,
 10325  		`		lastIndex = 0`,
 10326  		`	if len(stage1) > 1 {`,
 10327  		`		var dataP1 []int64`,
 10328  		`		buf = bytes.NewBuffer(stage1[1]`,
 10329  		`		dec := json.NewDecoder(buf`,
 10330  		`		dec.UseNumber(`,
 10331  		`		if err := dec.Decode(&dataP1); err != nil {`,
 10332  		`		m.P1 = dataP1`,
 10333  		`		lastIndex = 1`,
 10334  		`	if len(stage1) > lastIndex+1 {`,
 10335  		`		for _, val := range stage1[lastIndex+1:] {`,
 10336  		`			var toadd []strfmt.Date`,
 10337  		`			buf = bytes.NewBuffer(val`,
 10338  		`			dec := json.NewDecoder(buf`,
 10339  		`			dec.UseNumber(`,
 10340  		`			if err := dec.Decode(&toadd); err != nil {`,
 10341  		`			m.TupleThingWithArrayElementItems = append(m.TupleThingWithArrayElementItems, toadd`,
 10342  		`func (m TupleThingWithArrayElement) MarshalJSON() ([]byte, error) {`,
 10343  		`	data := []interface{}{`,
 10344  		`		m.P0,`,
 10345  		`		m.P1,`,
 10346  		`	for _, v := range m.TupleThingWithArrayElementItems {`,
 10347  		`		data = append(data, v`,
 10348  		`	return json.Marshal(data`,
 10349  		`func (m *TupleThingWithArrayElement) Validate(formats strfmt.Registry) error {`,
 10350  		`	if err := m.validateP0(formats); err != nil {`,
 10351  		`	if err := m.validateP1(formats); err != nil {`,
 10352  		`	if err := m.validateTupleThingWithArrayElementItems(formats); err != nil {`,
 10353  		`		return errors.CompositeValidationError(res...`,
 10354  		`func (m *TupleThingWithArrayElement) validateP0(formats strfmt.Registry) error {`,
 10355  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 10356  		`	iP0Size := int64(len(m.P0)`,
 10357  		`	if err := validate.MaxItems("0", "body", iP0Size, 10); err != nil {`,
 10358  		`	for i := 0; i < len(m.P0); i++ {`,
 10359  		`		if err := validate.MaxLength("0"+"."+strconv.Itoa(i), "body", m.P0[i], 10); err != nil {`,
 10360  		`func (m *TupleThingWithArrayElement) validateP1(formats strfmt.Registry) error {`,
 10361  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 10362  		`	iP1Size := int64(len(m.P1)`,
 10363  		`	if err := validate.MinItems("1", "body", iP1Size, 20); err != nil {`,
 10364  		`	for i := 0; i < len(m.P1); i++ {`,
 10365  		`		if err := validate.MinimumInt("1"+"."+strconv.Itoa(i), "body", m.P1[i], 10, false); err != nil {`,
 10366  		`func (m *TupleThingWithArrayElement) validateTupleThingWithArrayElementItems(formats strfmt.Registry) error {`,
 10367  		`	for i := range m.TupleThingWithArrayElementItems {`,
 10368  		`		for ii := 0; ii < len(m.TupleThingWithArrayElementItems[i]); ii++ {`,
 10369  		`			if err := validate.FormatOf(strconv.Itoa(i+2)+"."+strconv.Itoa(ii), "body", ` +
 10370  			`"date", m.TupleThingWithArrayElementItems[i][ii].String(), formats); err != nil {`,
 10371  	},
 10372  		// not expected
 10373  		todo,
 10374  		// output in log
 10375  		noLines,
 10376  		noLines)
 10377  
 10378  	expandRun.AddExpectations("tuple_thing_with_array_element.go",
 10379  		flattenRun.ExpectedFor("TupleThingWithArrayElement").ExpectedLines, todo, noLines, noLines)
 10380  
 10381  	// load expectations for model: array_of_tuples.go
 10382  	flattenRun.AddExpectations("array_of_tuples.go", []string{
 10383  		`type ArrayOfTuples []ArrayOfTuplesTuple0`,
 10384  		`func (m ArrayOfTuples) Validate(formats strfmt.Registry) error {`,
 10385  		`	iArrayOfTuplesSize := int64(len(m)`,
 10386  		`	if err := validate.MinItems("", "body", iArrayOfTuplesSize, 1); err != nil {`,
 10387  		`	for i := 0; i < len(m); i++ {`,
 10388  		`		if err := m[i].Validate(formats); err != nil {`,
 10389  		`			if ve, ok := err.(*errors.Validation); ok {`,
 10390  		`				return ve.ValidateName(strconv.Itoa(i)`,
 10391  		`		return errors.CompositeValidationError(res...`,
 10392  		`type ArrayOfTuplesTuple0 struct {`,
 10393  		"	P0 []string `json:\"-\"`",
 10394  		"	P1 []int64 `json:\"-\"`",
 10395  		"	ArrayOfTuplesTuple0Items [][]strfmt.Date `json:\"-\"`",
 10396  		`func (m *ArrayOfTuplesTuple0) UnmarshalJSON(raw []byte) error {`,
 10397  		`	var stage1 []json.RawMessage`,
 10398  		`	buf := bytes.NewBuffer(raw`,
 10399  		`	dec := json.NewDecoder(buf`,
 10400  		`	dec.UseNumber(`,
 10401  		`	if err := dec.Decode(&stage1); err != nil {`,
 10402  		`	var lastIndex int`,
 10403  		`	if len(stage1) > 0 {`,
 10404  		`		var dataP0 []string`,
 10405  		`		buf = bytes.NewBuffer(stage1[0]`,
 10406  		`		dec := json.NewDecoder(buf`,
 10407  		`		dec.UseNumber(`,
 10408  		`		if err := dec.Decode(&dataP0); err != nil {`,
 10409  		`		m.P0 = dataP0`,
 10410  		`		lastIndex = 0`,
 10411  		`	if len(stage1) > 1 {`,
 10412  		`		var dataP1 []int64`,
 10413  		`		buf = bytes.NewBuffer(stage1[1]`,
 10414  		`		dec := json.NewDecoder(buf`,
 10415  		`		dec.UseNumber(`,
 10416  		`		if err := dec.Decode(&dataP1); err != nil {`,
 10417  		`		m.P1 = dataP1`,
 10418  		`		lastIndex = 1`,
 10419  		`	if len(stage1) > lastIndex+1 {`,
 10420  		`		for _, val := range stage1[lastIndex+1:] {`,
 10421  		`			var toadd []strfmt.Date`,
 10422  		`			buf = bytes.NewBuffer(val`,
 10423  		`			dec := json.NewDecoder(buf`,
 10424  		`			dec.UseNumber(`,
 10425  		`			if err := dec.Decode(&toadd); err != nil {`,
 10426  		`			m.ArrayOfTuplesTuple0Items = append(m.ArrayOfTuplesTuple0Items, toadd`,
 10427  		`func (m ArrayOfTuplesTuple0) MarshalJSON() ([]byte, error) {`,
 10428  		`	data := []interface{}{`,
 10429  		`		m.P0,`,
 10430  		`		m.P1,`,
 10431  		`	for _, v := range m.ArrayOfTuplesTuple0Items {`,
 10432  		`		data = append(data, v`,
 10433  		`	return json.Marshal(data`,
 10434  		`func (m *ArrayOfTuplesTuple0) Validate(formats strfmt.Registry) error {`,
 10435  		`	if err := m.validateP0(formats); err != nil {`,
 10436  		`	if err := m.validateP1(formats); err != nil {`,
 10437  		`	if err := m.validateArrayOfTuplesTuple0Items(formats); err != nil {`,
 10438  		`		return errors.CompositeValidationError(res...`,
 10439  		`func (m *ArrayOfTuplesTuple0) validateP0(formats strfmt.Registry) error {`,
 10440  		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
 10441  		`	iP0Size := int64(len(m.P0)`,
 10442  		`	if err := validate.MaxItems("P0", "body", iP0Size, 10); err != nil {`,
 10443  		`	for i := 0; i < len(m.P0); i++ {`,
 10444  		`		if err := validate.MaxLength("P0"+"."+strconv.Itoa(i), "body", m.P0[i], 10); err != nil {`,
 10445  		`func (m *ArrayOfTuplesTuple0) validateP1(formats strfmt.Registry) error {`,
 10446  		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
 10447  		`	iP1Size := int64(len(m.P1)`,
 10448  		`	if err := validate.MinItems("P1", "body", iP1Size, 20); err != nil {`,
 10449  		`	for i := 0; i < len(m.P1); i++ {`,
 10450  		`		if err := validate.MinimumInt("P1"+"."+strconv.Itoa(i), ` +
 10451  			`"body", m.P1[i], 10, false); err != nil {`,
 10452  		`func (m *ArrayOfTuplesTuple0) validateArrayOfTuplesTuple0Items(formats strfmt.Registry) error {`,
 10453  		`	for i := range m.ArrayOfTuplesTuple0Items {`,
 10454  		`		for ii := 0; ii < len(m.ArrayOfTuplesTuple0Items[i]); ii++ {`,
 10455  		`			if err := validate.FormatOf(strconv.Itoa(i)+"."+strconv.Itoa(ii), ` +
 10456  			`"body", "date", m.ArrayOfTuplesTuple0Items[i][ii].String(), formats); err != nil {`,
 10457  	},
 10458  		// not expected
 10459  		todo,
 10460  		// output in log
 10461  		noLines,
 10462  		noLines)
 10463  
 10464  	expandRun.AddExpectations("array_of_tuples.go",
 10465  		flattenRun.ExpectedFor("ArrayOfTuples").ExpectedLines, todo, noLines, noLines)
 10466  
 10467  	// load expectations for model: tuple_thing_with_object_element.go
 10468  	flattenRun.AddExpectations("tuple_thing_with_object_element.go", []string{
 10469  		`type TupleThingWithObjectElement struct {`,
 10470  		"	P0 *TupleThingWithObjectElementItems0 `json:\"-\"`",
 10471  		"	P1 map[string]int64 `json:\"-\"`",
 10472  		"	TupleThingWithObjectElementItems []map[string]strfmt.Date `json:\"-\"`",
 10473  		`func (m *TupleThingWithObjectElement) UnmarshalJSON(raw []byte) error {`,
 10474  		`	var stage1 []json.RawMessage`,
 10475  		`	buf := bytes.NewBuffer(raw`,
 10476  		`	dec := json.NewDecoder(buf`,
 10477  		`	dec.UseNumber(`,
 10478  		`	if err := dec.Decode(&stage1); err != nil {`,
 10479  		`	var lastIndex int`,
 10480  		`	if len(stage1) > 0 {`,
 10481  		`		var dataP0 TupleThingWithObjectElementItems0`,
 10482  		`		buf = bytes.NewBuffer(stage1[0]`,
 10483  		`		dec := json.NewDecoder(buf`,
 10484  		`		dec.UseNumber(`,
 10485  		`		if err := dec.Decode(&dataP0); err != nil {`,
 10486  		`		m.P0 = &dataP0`,
 10487  		`		lastIndex = 0`,
 10488  		`	if len(stage1) > 1 {`,
 10489  		`		var dataP1 map[string]int64`,
 10490  		`		buf = bytes.NewBuffer(stage1[1]`,
 10491  		`		dec := json.NewDecoder(buf`,
 10492  		`		dec.UseNumber(`,
 10493  		`		if err := dec.Decode(&dataP1); err != nil {`,
 10494  		`		m.P1 = dataP1`,
 10495  		`		lastIndex = 1`,
 10496  		`	if len(stage1) > lastIndex+1 {`,
 10497  		`		for _, val := range stage1[lastIndex+1:] {`,
 10498  		`			var toadd map[string]strfmt.Date`,
 10499  		`			buf = bytes.NewBuffer(val`,
 10500  		`			dec := json.NewDecoder(buf`,
 10501  		`			dec.UseNumber(`,
 10502  		`			if err := dec.Decode(&toadd); err != nil {`,
 10503  		`			m.TupleThingWithObjectElementItems = append(m.TupleThingWithObjectElementItems, toadd`,
 10504  		`func (m TupleThingWithObjectElement) MarshalJSON() ([]byte, error) {`,
 10505  		`	data := []interface{}{`,
 10506  		`		m.P0,`,
 10507  		`		m.P1,`,
 10508  		`	for _, v := range m.TupleThingWithObjectElementItems {`,
 10509  		`		data = append(data, v`,
 10510  		`	return json.Marshal(data`,
 10511  		`func (m *TupleThingWithObjectElement) Validate(formats strfmt.Registry) error {`,
 10512  		`	if err := m.validateP0(formats); err != nil {`,
 10513  		`	if err := m.validateP1(formats); err != nil {`,
 10514  		`	if err := m.validateTupleThingWithObjectElementItems(formats); err != nil {`,
 10515  		`		return errors.CompositeValidationError(res...`,
 10516  		`func (m *TupleThingWithObjectElement) validateP0(formats strfmt.Registry) error {`,
 10517  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 10518  		`	if m.P0 != nil {`,
 10519  		`		if err := m.P0.Validate(formats); err != nil {`,
 10520  		`			if ve, ok := err.(*errors.Validation); ok {`,
 10521  		`				return ve.ValidateName("0"`,
 10522  		`func (m *TupleThingWithObjectElement) validateP1(formats strfmt.Registry) error {`,
 10523  		`if err := validate.Required("1", "body", m.P1); err != nil {`,
 10524  		`	for k := range m.P1 {`,
 10525  		`		if err := validate.MinimumInt("1"+"."+k, "body", m.P1[k], 10, false); err != nil {`,
 10526  		`func (m *TupleThingWithObjectElement) validateTupleThingWithObjectElementItems(formats strfmt.Registry)` +
 10527  			` error {`,
 10528  		`	for i := range m.TupleThingWithObjectElementItems {`,
 10529  		`		for k := range m.TupleThingWithObjectElementItems[i] {`,
 10530  		`			if err := validate.FormatOf(strconv.Itoa(i+2)+"."+k, "body", "date", ` +
 10531  			`m.TupleThingWithObjectElementItems[i][k].String(), formats); err != nil {`,
 10532  		`type TupleThingWithObjectElementItems0 struct {`,
 10533  		"	Prop1 string `json:\"prop1,omitempty\"`",
 10534  		`func (m *TupleThingWithObjectElementItems0) Validate(formats strfmt.Registry) error {`,
 10535  		`	if err := m.validateProp1(formats); err != nil {`,
 10536  		`		return errors.CompositeValidationError(res...`,
 10537  		`func (m *TupleThingWithObjectElementItems0) validateProp1(formats strfmt.Registry) error {`,
 10538  		`	if swag.IsZero(m.Prop1) {`,
 10539  		`	if err := validate.MaxLength("prop1", "body", m.Prop1, 10); err != nil {`,
 10540  	},
 10541  		// not expected
 10542  		todo,
 10543  		// output in log
 10544  		noLines,
 10545  		noLines)
 10546  
 10547  	expandRun.AddExpectations("tuple_thing_with_object_element.go",
 10548  		flattenRun.ExpectedFor("TupleThingWithObjectElement").ExpectedLines, todo, noLines, noLines)
 10549  
 10550  	// load expectations for model: tuple_thing_with_no_additional_items.go
 10551  	flattenRun.AddExpectations("tuple_thing_with_no_additional_items.go", []string{
 10552  		`type TupleThingWithNoAdditionalItems struct {`,
 10553  		"	P0 *string `json:\"-\"`",
 10554  		"	P1 *int64 `json:\"-\"`",
 10555  		`func (m *TupleThingWithNoAdditionalItems) UnmarshalJSON(raw []byte) error {`,
 10556  		`	var stage1 []json.RawMessage`,
 10557  		`	buf := bytes.NewBuffer(raw`,
 10558  		`	dec := json.NewDecoder(buf`,
 10559  		`	dec.UseNumber(`,
 10560  		`	if err := dec.Decode(&stage1); err != nil {`,
 10561  		`	if len(stage1) > 0 {`,
 10562  		`		var dataP0 string`,
 10563  		`		buf = bytes.NewBuffer(stage1[0]`,
 10564  		`		dec := json.NewDecoder(buf`,
 10565  		`		dec.UseNumber(`,
 10566  		`		if err := dec.Decode(&dataP0); err != nil {`,
 10567  		`		m.P0 = &dataP0`,
 10568  		`	if len(stage1) > 1 {`,
 10569  		`		var dataP1 int64`,
 10570  		`		buf = bytes.NewBuffer(stage1[1]`,
 10571  		`		dec := json.NewDecoder(buf`,
 10572  		`		dec.UseNumber(`,
 10573  		`		if err := dec.Decode(&dataP1); err != nil {`,
 10574  		`		m.P1 = &dataP1`,
 10575  		`func (m TupleThingWithNoAdditionalItems) MarshalJSON() ([]byte, error) {`,
 10576  		`	data := []interface{}{`,
 10577  		`		m.P0,`,
 10578  		`		m.P1,`,
 10579  		`	return json.Marshal(data`,
 10580  		`func (m *TupleThingWithNoAdditionalItems) Validate(formats strfmt.Registry) error {`,
 10581  		`	if err := m.validateP0(formats); err != nil {`,
 10582  		`	if err := m.validateP1(formats); err != nil {`,
 10583  		`		return errors.CompositeValidationError(res...`,
 10584  		`func (m *TupleThingWithNoAdditionalItems) validateP0(formats strfmt.Registry) error {`,
 10585  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 10586  		`func (m *TupleThingWithNoAdditionalItems) validateP1(formats strfmt.Registry) error {`,
 10587  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 10588  		`	if err := validate.MaximumInt("1", "body", *m.P1, 10, false); err != nil {`,
 10589  	},
 10590  		// not expected
 10591  		todo,
 10592  		// output in log
 10593  		noLines,
 10594  		noLines)
 10595  
 10596  	expandRun.AddExpectations("tuple_thing_with_no_additional_items.go",
 10597  		flattenRun.ExpectedFor("TupleThingWithNoAdditionalItems").ExpectedLines, todo, noLines, noLines)
 10598  
 10599  	// load expectations for model: tuple_thing_with_any_additional_items.go
 10600  	flattenRun.AddExpectations("tuple_thing_with_any_additional_items.go", []string{
 10601  		`type TupleThingWithAnyAdditionalItems struct {`,
 10602  		"	P0 *string `json:\"-\"`",
 10603  		"	P1 *int64 `json:\"-\"`",
 10604  		"	TupleThingWithAnyAdditionalItemsItems []interface{} `json:\"-\"`",
 10605  		`func (m *TupleThingWithAnyAdditionalItems) UnmarshalJSON(raw []byte) error {`,
 10606  		`	var stage1 []json.RawMessage`,
 10607  		`	buf := bytes.NewBuffer(raw`,
 10608  		`	dec := json.NewDecoder(buf`,
 10609  		`	dec.UseNumber(`,
 10610  		`	if err := dec.Decode(&stage1); err != nil {`,
 10611  		`	var lastIndex int`,
 10612  		`	if len(stage1) > 0 {`,
 10613  		`		var dataP0 string`,
 10614  		`		buf = bytes.NewBuffer(stage1[0]`,
 10615  		`		dec := json.NewDecoder(buf`,
 10616  		`		dec.UseNumber(`,
 10617  		`		if err := dec.Decode(&dataP0); err != nil {`,
 10618  		`		m.P0 = &dataP0`,
 10619  		`		lastIndex = 0`,
 10620  		`	if len(stage1) > 1 {`,
 10621  		`		var dataP1 int64`,
 10622  		`		buf = bytes.NewBuffer(stage1[1]`,
 10623  		`		dec := json.NewDecoder(buf`,
 10624  		`		dec.UseNumber(`,
 10625  		`		if err := dec.Decode(&dataP1); err != nil {`,
 10626  		`		m.P1 = &dataP1`,
 10627  		`		lastIndex = 1`,
 10628  		`	if len(stage1) > lastIndex+1 {`,
 10629  		`		for _, val := range stage1[lastIndex+1:] {`,
 10630  		`			var toadd interface{`,
 10631  		`			buf = bytes.NewBuffer(val`,
 10632  		`			dec := json.NewDecoder(buf`,
 10633  		`			dec.UseNumber(`,
 10634  		`			if err := dec.Decode(&toadd); err != nil {`,
 10635  		`			m.TupleThingWithAnyAdditionalItemsItems = append(m.TupleThingWithAnyAdditionalItemsItems, toadd`,
 10636  		`func (m TupleThingWithAnyAdditionalItems) MarshalJSON() ([]byte, error) {`,
 10637  		`	data := []interface{}{`,
 10638  		`		m.P0,`,
 10639  		`		m.P1,`,
 10640  		`	for _, v := range m.TupleThingWithAnyAdditionalItemsItems {`,
 10641  		`		data = append(data, v`,
 10642  		`	return json.Marshal(data`,
 10643  		`func (m *TupleThingWithAnyAdditionalItems) Validate(formats strfmt.Registry) error {`,
 10644  		`	if err := m.validateP0(formats); err != nil {`,
 10645  		`	if err := m.validateP1(formats); err != nil {`,
 10646  		`	if err := m.validateTupleThingWithAnyAdditionalItemsItems(formats); err != nil {`,
 10647  		`		return errors.CompositeValidationError(res...`,
 10648  		`func (m *TupleThingWithAnyAdditionalItems) validateP0(formats strfmt.Registry) error {`,
 10649  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 10650  		`	if err := validate.MaxLength("0", "body", *m.P0, 10); err != nil {`,
 10651  		`func (m *TupleThingWithAnyAdditionalItems) validateP1(formats strfmt.Registry) error {`,
 10652  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 10653  		`	if err := validate.MaximumInt("1", "body", *m.P1, 10, false); err != nil {`,
 10654  		`func (m *TupleThingWithAnyAdditionalItems) ` +
 10655  			`validateTupleThingWithAnyAdditionalItemsItems(formats strfmt.Registry) error {`,
 10656  	},
 10657  		// not expected
 10658  		todo,
 10659  		// output in log
 10660  		noLines,
 10661  		noLines)
 10662  
 10663  	expandRun.AddExpectations("tuple_thing_with_any_additional_items.go",
 10664  		flattenRun.ExpectedFor("TupleThingWithAnyAdditionalItems").ExpectedLines, todo, noLines, noLines)
 10665  }
 10666  
 10667  func initFixtureDeepMaps() {
 10668  	// testing fixture-deepMaps.yaml with minimal flatten
 10669  
 10670  	f := newModelFixture("../fixtures/enhancements/1572/fixture-deepMaps.yaml", "issue 1572 - deep maps")
 10671  	thisRun := f.AddRun(false).WithMinimalFlatten(true)
 10672  
 10673  	// load expectations for model: model_object_vanilla.go
 10674  	thisRun.AddExpectations("model_object_vanilla.go", []string{
 10675  		`type ModelObjectVanilla struct {`,
 10676  		"	Prop0 *ModelSanity `json:\"prop0,omitempty\"`",
 10677  		"	Prop1 *ModelSanity `json:\"prop1\"`",
 10678  		"	Prop2 []*ModelSanity `json:\"prop2\"`",
 10679  		"	Prop3 *ModelSanity `json:\"prop3,omitempty\"`",
 10680  		"	Prop4 map[string]ModelSanity `json:\"prop4,omitempty\"`",
 10681  		"	Prop5 int64 `json:\"prop5,omitempty\"`",
 10682  		"	ModelObjectVanilla map[string]map[string]map[string]ModelSanity `json:\"-\"`",
 10683  		`func (m *ModelObjectVanilla) Validate(formats strfmt.Registry) error {`,
 10684  		`	if err := m.validateProp0(formats); err != nil {`,
 10685  		`	if err := m.validateProp1(formats); err != nil {`,
 10686  		`	if err := m.validateProp2(formats); err != nil {`,
 10687  		`	if err := m.validateProp3(formats); err != nil {`,
 10688  		`	if err := m.validateProp4(formats); err != nil {`,
 10689  		`	for k := range m.ModelObjectVanilla {`,
 10690  		`		for kk := range m.ModelObjectVanilla[k] {`,
 10691  		`			for kkk := range m.ModelObjectVanilla[k][kk] {`,
 10692  		`				if err := validate.Required(k+"."+kk+"."+kkk, "body",` +
 10693  			` m.ModelObjectVanilla[k][kk][kkk]); err != nil {`,
 10694  		`				if val, ok := m.ModelObjectVanilla[k][kk][kkk]; ok {`,
 10695  		`					if err := val.Validate(formats); err != nil {`,
 10696  		`		return errors.CompositeValidationError(res...`,
 10697  		`func (m *ModelObjectVanilla) validateProp0(formats strfmt.Registry) error {`,
 10698  		`	if swag.IsZero(m.Prop0) {`,
 10699  		`	if m.Prop0 != nil {`,
 10700  		`		if err := m.Prop0.Validate(formats); err != nil {`,
 10701  		`			if ve, ok := err.(*errors.Validation); ok {`,
 10702  		`				return ve.ValidateName("prop0"`,
 10703  		`func (m *ModelObjectVanilla) validateProp1(formats strfmt.Registry) error {`,
 10704  		`	if err := validate.Required("prop1", "body", m.Prop1); err != nil {`,
 10705  		`	if m.Prop1 != nil {`,
 10706  		`		if err := m.Prop1.Validate(formats); err != nil {`,
 10707  		`			if ve, ok := err.(*errors.Validation); ok {`,
 10708  		`				return ve.ValidateName("prop1"`,
 10709  		`func (m *ModelObjectVanilla) validateProp2(formats strfmt.Registry) error {`,
 10710  		`	if swag.IsZero(m.Prop2) {`,
 10711  		`	for i := 0; i < len(m.Prop2); i++ {`,
 10712  		`		if swag.IsZero(m.Prop2[i]) {`,
 10713  		`		if m.Prop2[i] != nil {`,
 10714  		`			if err := m.Prop2[i].Validate(formats); err != nil {`,
 10715  		`				if ve, ok := err.(*errors.Validation); ok {`,
 10716  		`					return ve.ValidateName("prop2" + "." + strconv.Itoa(i)`,
 10717  		`func (m *ModelObjectVanilla) validateProp3(formats strfmt.Registry) error {`,
 10718  		`	if swag.IsZero(m.Prop3) {`,
 10719  		`	if m.Prop3 != nil {`,
 10720  		`		if err := m.Prop3.Validate(formats); err != nil {`,
 10721  		`			if ve, ok := err.(*errors.Validation); ok {`,
 10722  		`				return ve.ValidateName("prop3"`,
 10723  		`func (m *ModelObjectVanilla) validateProp4(formats strfmt.Registry) error {`,
 10724  		`	if swag.IsZero(m.Prop4) {`,
 10725  		`	for k := range m.Prop4 {`,
 10726  		`		if err := validate.Required("prop4"+"."+k, "body", m.Prop4[k]); err != nil {`,
 10727  		`		if val, ok := m.Prop4[k]; ok {`,
 10728  		`			if err := val.Validate(formats); err != nil {`,
 10729  	},
 10730  		// not expected
 10731  		todo,
 10732  		// output in log
 10733  		noLines,
 10734  		noLines)
 10735  
 10736  	// load expectations for model: model_sanity.go
 10737  	thisRun.AddExpectations("model_sanity.go", []string{
 10738  		`type ModelSanity struct {`,
 10739  		"	PropA string `json:\"propA,omitempty\"`",
 10740  		"	PropB *string `json:\"propB\"`",
 10741  		`func (m *ModelSanity) Validate(formats strfmt.Registry) error {`,
 10742  		`	if err := m.validatePropB(formats); err != nil {`,
 10743  		`		return errors.CompositeValidationError(res...`,
 10744  		`func (m *ModelSanity) validatePropB(formats strfmt.Registry) error {`,
 10745  		`	if err := validate.Required("propB", "body", m.PropB); err != nil {`,
 10746  	},
 10747  		// not expected
 10748  		todo,
 10749  		// output in log
 10750  		noLines,
 10751  		noLines)
 10752  }
 10753  
 10754  func initFixture1617() {
 10755  	// testing fixture-1617.yaml with flatten and expand (--skip-flatten)
 10756  
 10757  	f := newModelFixture("../fixtures/bugs/1617/fixture-1617.yaml", "aaa")
 10758  	thisRun := f.AddRun(false).WithMinimalFlatten(true)
 10759  
 10760  	// load expectations for model: artifact_info.go
 10761  	thisRun.AddExpectations("artifact_info.go", []string{
 10762  		`type ArtifactInfo struct {`,
 10763  		`	ArtifactDescription`,
 10764  		"	Path ArtifactPath `json:\"Path,omitempty\"`",
 10765  		"	Status ArtifactStatus `json:\"Status,omitempty\"`",
 10766  		"	Timestamp strfmt.DateTime `json:\"Timestamp,omitempty\"`",
 10767  		`func (m *ArtifactInfo) UnmarshalJSON(raw []byte) error {`,
 10768  		`	var aO0 ArtifactDescription`,
 10769  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
 10770  		`	m.ArtifactDescription = aO0`,
 10771  		`	var propsArtifactInfo struct {`,
 10772  		"		Path ArtifactPath `json:\"Path,omitempty\"`",
 10773  		"		Status ArtifactStatus `json:\"Status,omitempty\"`",
 10774  		"		Timestamp strfmt.DateTime `json:\"Timestamp,omitempty\"`",
 10775  		`	if err := swag.ReadJSON(raw, &propsArtifactInfo); err != nil {`,
 10776  		`	m.Path = propsArtifactInfo.Path`,
 10777  		`	m.Status = propsArtifactInfo.Status`,
 10778  		`	m.Timestamp = propsArtifactInfo.Timestamp`,
 10779  		`func (m ArtifactInfo) MarshalJSON() ([]byte, error) {`,
 10780  		`	_parts := make([][]byte, 0, 1`,
 10781  		`	aO0, err := swag.WriteJSON(m.ArtifactDescription`,
 10782  		`	if err != nil {`,
 10783  		`		return nil, err`,
 10784  		`	_parts = append(_parts, aO0`,
 10785  		`	var propsArtifactInfo struct {`,
 10786  		"		Path ArtifactPath `json:\"Path,omitempty\"`",
 10787  		"		Status ArtifactStatus `json:\"Status,omitempty\"`",
 10788  		"		Timestamp strfmt.DateTime `json:\"Timestamp,omitempty\"`",
 10789  		`	propsArtifactInfo.Path = m.Path`,
 10790  		`	propsArtifactInfo.Status = m.Status`,
 10791  		`	propsArtifactInfo.Timestamp = m.Timestamp`,
 10792  		`	jsonDataPropsArtifactInfo, errArtifactInfo := swag.WriteJSON(propsArtifactInfo`,
 10793  		`	if errArtifactInfo != nil {`,
 10794  		`		return nil, errArtifactInfo`,
 10795  		`	_parts = append(_parts, jsonDataPropsArtifactInfo`,
 10796  		`	return swag.ConcatJSON(_parts...), nil`,
 10797  		`func (m *ArtifactInfo) Validate(formats strfmt.Registry) error {`,
 10798  		`	if err := m.ArtifactDescription.Validate(formats); err != nil {`,
 10799  		`	if err := m.validatePath(formats); err != nil {`,
 10800  		`	if err := m.validateStatus(formats); err != nil {`,
 10801  		`	if err := m.validateTimestamp(formats); err != nil {`,
 10802  		`		return errors.CompositeValidationError(res...`,
 10803  		`func (m *ArtifactInfo) validatePath(formats strfmt.Registry) error {`,
 10804  		`	if swag.IsZero(m.Path) {`,
 10805  		`	if err := m.Path.Validate(formats); err != nil {`,
 10806  		`		if ve, ok := err.(*errors.Validation); ok {`,
 10807  		`			return ve.ValidateName("Path"`,
 10808  		`func (m *ArtifactInfo) validateStatus(formats strfmt.Registry) error {`,
 10809  		`	if swag.IsZero(m.Status) {`,
 10810  		`	if err := m.Status.Validate(formats); err != nil {`,
 10811  		`		if ve, ok := err.(*errors.Validation); ok {`,
 10812  		`			return ve.ValidateName("Status"`,
 10813  		`func (m *ArtifactInfo) validateTimestamp(formats strfmt.Registry) error {`,
 10814  		`	if swag.IsZero(m.Timestamp) {`,
 10815  		`	if err := validate.FormatOf("Timestamp", "body", "date-time", m.Timestamp.String(), formats); err != nil {`,
 10816  		`func (m *ArtifactInfo) MarshalBinary() ([]byte, error) {`,
 10817  		`	if m == nil {`,
 10818  		`		return nil, nil`,
 10819  		`	return swag.WriteJSON(m`,
 10820  		`func (m *ArtifactInfo) UnmarshalBinary(b []byte) error {`,
 10821  		`	var res ArtifactInfo`,
 10822  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
 10823  		`	*m = res`,
 10824  	},
 10825  		// not expected
 10826  		todo,
 10827  		// output in log
 10828  		noLines,
 10829  		noLines)
 10830  }
 10831  
 10832  func initFixtureRealiasedTypes() {
 10833  	/*
 10834  	   realiased types
 10835  	*/
 10836  
 10837  	f := newModelFixture("../fixtures/bugs/1260/fixture-realiased-types.yaml", "test type realiasing")
 10838  	thisRun := f.AddRun(false).WithMinimalFlatten(true)
 10839  
 10840  	// load expectations for model: g1.go
 10841  	thisRun.AddExpectations("g1.go", []string{
 10842  		`type G1 struct {`,
 10843  		"	Prop1 int64 `json:\"prop1,omitempty\"`",
 10844  		// empty validation
 10845  		"func (m *G1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
 10846  	},
 10847  		// not expected
 10848  		todo,
 10849  		// output in log
 10850  		noLines,
 10851  		noLines)
 10852  
 10853  	// load expectations for model: e2v.go
 10854  	thisRun.AddExpectations("e2v.go", []string{
 10855  		`type E2v = E0v`,
 10856  	},
 10857  		// not expected
 10858  		todo,
 10859  		// output in log
 10860  		noLines,
 10861  		noLines)
 10862  
 10863  	// load expectations for model: a1v.go
 10864  	thisRun.AddExpectations("a1v.go", []string{
 10865  		`type A1v []int64`,
 10866  		`func (m A1v) Validate(formats strfmt.Registry) error {`,
 10867  		`	iA1vSize := int64(len(m)`,
 10868  		`	if err := validate.MaxItems("", "body", iA1vSize, 100); err != nil {`,
 10869  		`	for i := 0; i < len(m); i++ {`,
 10870  		`		if err := validate.MaximumInt(strconv.Itoa(i), "body", m[i], 100, false); err != nil {`,
 10871  		`		return errors.CompositeValidationError(res...`,
 10872  	},
 10873  		// not expected
 10874  		todo,
 10875  		// output in log
 10876  		noLines,
 10877  		noLines)
 10878  
 10879  	// load expectations for model: f2v.go
 10880  	thisRun.AddExpectations("f2v.go", []string{
 10881  		`type F2v = F0v`,
 10882  	},
 10883  		// not expected
 10884  		todo,
 10885  		// output in log
 10886  		noLines,
 10887  		noLines)
 10888  
 10889  	// load expectations for model: hsubtype1.go
 10890  	thisRun.AddExpectations("hsubtype1.go", []string{
 10891  		`type Hsubtype1 struct {`,
 10892  		`	h1p1Field string`,
 10893  		`	h1p2Field strfmt.Date`,
 10894  		"	Hsp1 uint32 `json:\"hsp1,omitempty\"`",
 10895  		`func (m *Hsubtype1) H1p1() string {`,
 10896  		`	return m.h1p1Field`,
 10897  		`func (m *Hsubtype1) SetH1p1(val string) {`,
 10898  		`	m.h1p1Field = val`,
 10899  		`func (m *Hsubtype1) H1p2() strfmt.Date {`,
 10900  		`	return m.h1p2Field`,
 10901  		`func (m *Hsubtype1) SetH1p2(val strfmt.Date) {`,
 10902  		`	m.h1p2Field = val`,
 10903  		`func (m *Hsubtype1) Validate(formats strfmt.Registry) error {`,
 10904  		`	if err := m.validateH1p2(formats); err != nil {`,
 10905  		`		return errors.CompositeValidationError(res...`,
 10906  		`func (m *Hsubtype1) validateH1p2(formats strfmt.Registry) error {`,
 10907  		`	if swag.IsZero(m.H1p2()) {`,
 10908  		`	if err := validate.FormatOf("h1p2", "body", "date", m.H1p2().String(), formats); err != nil {`,
 10909  	},
 10910  		// not expected
 10911  		todo,
 10912  		// output in log
 10913  		noLines,
 10914  		noLines)
 10915  
 10916  	// load expectations for model: f2.go
 10917  	thisRun.AddExpectations("f2.go", []string{
 10918  		`type F2 = F0`,
 10919  	},
 10920  		// not expected
 10921  		todo,
 10922  		// output in log
 10923  		noLines,
 10924  		noLines)
 10925  
 10926  	// load expectations for model: h0.go
 10927  	thisRun.AddExpectations("h0.go", []string{
 10928  		`type H0 = H1`,
 10929  		`func UnmarshalH0(reader io.Reader, consumer runtime.Consumer) (H0, error) {`,
 10930  		`	return UnmarshalH1(reader, consumer`,
 10931  		`func UnmarshalH0Slice(reader io.Reader, consumer runtime.Consumer) ([]H0, error) {`,
 10932  		`	return UnmarshalH1Slice(reader, consumer`,
 10933  	},
 10934  		// not expected
 10935  		todo,
 10936  		// output in log
 10937  		noLines,
 10938  		noLines)
 10939  
 10940  	// load expectations for model: c1v.go
 10941  	thisRun.AddExpectations("c1v.go", []string{
 10942  		`type C1v interface{`,
 10943  	},
 10944  		// not expected
 10945  		todo,
 10946  		// output in log
 10947  		noLines,
 10948  		noLines)
 10949  
 10950  	// load expectations for model: d0v.go
 10951  	thisRun.AddExpectations("d0v.go", []string{
 10952  		`type D0v = D1v`,
 10953  	},
 10954  		// not expected
 10955  		todo,
 10956  		// output in log
 10957  		noLines,
 10958  		noLines)
 10959  
 10960  	// load expectations for model: e2.go
 10961  	thisRun.AddExpectations("e2.go", []string{
 10962  		`type E2 = E0`,
 10963  	},
 10964  		// not expected
 10965  		todo,
 10966  		// output in log
 10967  		noLines,
 10968  		noLines)
 10969  
 10970  	// load expectations for model: d2v.go
 10971  	thisRun.AddExpectations("d2v.go", []string{
 10972  		`type D2v = D0v`,
 10973  	},
 10974  		// not expected
 10975  		todo,
 10976  		// output in log
 10977  		noLines,
 10978  		noLines)
 10979  
 10980  	// load expectations for model: b2v.go
 10981  	thisRun.AddExpectations("b2v.go", []string{
 10982  		`type B2v = B0v`,
 10983  	},
 10984  		// not expected
 10985  		todo,
 10986  		// output in log
 10987  		noLines,
 10988  		noLines)
 10989  
 10990  	// load expectations for model: a1.go
 10991  	thisRun.AddExpectations("a1.go", []string{
 10992  		`type A1 []int64`,
 10993  		// empty validation
 10994  		"func (m A1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
 10995  	},
 10996  		// not expected
 10997  		todo,
 10998  		// output in log
 10999  		noLines,
 11000  		noLines)
 11001  
 11002  	// load expectations for model: hsubtype2.go
 11003  	thisRun.AddExpectations("hsubtype2.go", []string{
 11004  		`type Hsubtype2 struct {`,
 11005  		`	h1p1Field string`,
 11006  		`	h1p2Field strfmt.Date`,
 11007  		"	Hsp2 strfmt.DateTime `json:\"hsp2,omitempty\"`",
 11008  		`func (m *Hsubtype2) H1p1() string {`,
 11009  		`	return m.h1p1Field`,
 11010  		`func (m *Hsubtype2) SetH1p1(val string) {`,
 11011  		`	m.h1p1Field = val`,
 11012  		`func (m *Hsubtype2) H1p2() strfmt.Date {`,
 11013  		`	return m.h1p2Field`,
 11014  		`func (m *Hsubtype2) SetH1p2(val strfmt.Date) {`,
 11015  		`	m.h1p2Field = val`,
 11016  		`func (m *Hsubtype2) Validate(formats strfmt.Registry) error {`,
 11017  		`	if err := m.validateH1p2(formats); err != nil {`,
 11018  		`	if err := m.validateHsp2(formats); err != nil {`,
 11019  		`		return errors.CompositeValidationError(res...`,
 11020  		`func (m *Hsubtype2) validateH1p2(formats strfmt.Registry) error {`,
 11021  		`	if swag.IsZero(m.H1p2()) {`,
 11022  		`	if err := validate.FormatOf("h1p2", "body", "date", m.H1p2().String(), formats); err != nil {`,
 11023  		`func (m *Hsubtype2) validateHsp2(formats strfmt.Registry) error {`,
 11024  		`	if swag.IsZero(m.Hsp2) {`,
 11025  		`	if err := validate.FormatOf("hsp2", "body", "date-time", m.Hsp2.String(), formats); err != nil {`,
 11026  	},
 11027  		// not expected
 11028  		todo,
 11029  		// output in log
 11030  		noLines,
 11031  		noLines)
 11032  
 11033  	// load expectations for model: b2.go
 11034  	thisRun.AddExpectations("b2.go", []string{
 11035  		`type B2 = B0`,
 11036  	},
 11037  		// not expected
 11038  		todo,
 11039  		// output in log
 11040  		noLines,
 11041  		noLines)
 11042  
 11043  	// load expectations for model: b1.go
 11044  	thisRun.AddExpectations("b1.go", []string{
 11045  		`type B1 map[string]int64`,
 11046  		// empty validation
 11047  		"func (m B1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
 11048  	},
 11049  		// not expected
 11050  		todo,
 11051  		// output in log
 11052  		noLines,
 11053  		noLines)
 11054  
 11055  	// load expectations for model: d0.go
 11056  	thisRun.AddExpectations("d0.go", []string{
 11057  		`type D0 = D1`,
 11058  	},
 11059  		// not expected
 11060  		todo,
 11061  		// output in log
 11062  		noLines,
 11063  		noLines)
 11064  
 11065  	// load expectations for model: g1v.go
 11066  	thisRun.AddExpectations("g1v.go", []string{
 11067  		`type G1v struct {`,
 11068  		"	Prop1v int64 `json:\"prop1v,omitempty\"`",
 11069  		"	Prop2v *int64 `json:\"prop2v\"`",
 11070  		`func (m *G1v) Validate(formats strfmt.Registry) error {`,
 11071  		`	if err := m.validateProp1v(formats); err != nil {`,
 11072  		`	if err := m.validateProp2v(formats); err != nil {`,
 11073  		`		return errors.CompositeValidationError(res...`,
 11074  		`func (m *G1v) validateProp1v(formats strfmt.Registry) error {`,
 11075  		`	if swag.IsZero(m.Prop1v) {`,
 11076  		`	if err := validate.MaximumInt("prop1v", "body", m.Prop1v, 100, false); err != nil {`,
 11077  		`func (m *G1v) validateProp2v(formats strfmt.Registry) error {`,
 11078  		`	if err := validate.Required("prop2v", "body", m.Prop2v); err != nil {`,
 11079  	},
 11080  		// not expected
 11081  		todo,
 11082  		// output in log
 11083  		noLines,
 11084  		noLines)
 11085  
 11086  	// load expectations for model: e0.go
 11087  	thisRun.AddExpectations("e0.go", []string{
 11088  		`type E0 = E1`,
 11089  	},
 11090  		// not expected
 11091  		todo,
 11092  		// output in log
 11093  		noLines,
 11094  		noLines)
 11095  
 11096  	// load expectations for model: f0v.go
 11097  	thisRun.AddExpectations("f0v.go", []string{
 11098  		`type F0v = F1v`,
 11099  	},
 11100  		// not expected
 11101  		todo,
 11102  		// output in log
 11103  		noLines,
 11104  		noLines)
 11105  
 11106  	// load expectations for model: h2.go
 11107  	thisRun.AddExpectations("h2.go", []string{
 11108  		`type H2 = H0`,
 11109  		`func UnmarshalH2(reader io.Reader, consumer runtime.Consumer) (H2, error) {`,
 11110  		`	return UnmarshalH0(reader, consumer`,
 11111  		`func UnmarshalH2Slice(reader io.Reader, consumer runtime.Consumer) ([]H2, error) {`,
 11112  		`	return UnmarshalH0Slice(reader, consumer`,
 11113  	},
 11114  		// not expected
 11115  		todo,
 11116  		// output in log
 11117  		noLines,
 11118  		noLines)
 11119  
 11120  	// load expectations for model: b1v.go
 11121  	thisRun.AddExpectations("b1v.go", []string{
 11122  		`type B1v map[string]int64`,
 11123  		`func (m B1v) Validate(formats strfmt.Registry) error {`,
 11124  		`	for k := range m {`,
 11125  		`		if err := validate.MaximumInt(k, "body", m[k], 100, false); err != nil {`,
 11126  		`		return errors.CompositeValidationError(res...`,
 11127  	},
 11128  		// not expected
 11129  		todo,
 11130  		// output in log
 11131  		noLines,
 11132  		noLines)
 11133  
 11134  	// load expectations for model: f0.go
 11135  	thisRun.AddExpectations("f0.go", []string{
 11136  		`type F0 = F1`,
 11137  	},
 11138  		// not expected
 11139  		todo,
 11140  		// output in log
 11141  		noLines,
 11142  		noLines)
 11143  
 11144  	// load expectations for model: a2v.go
 11145  	thisRun.AddExpectations("a2v.go", []string{
 11146  		`type A2v = A0v`,
 11147  	},
 11148  		// not expected
 11149  		todo,
 11150  		// output in log
 11151  		noLines,
 11152  		noLines)
 11153  
 11154  	// load expectations for model: hs2.go
 11155  	thisRun.AddExpectations("hs2.go", []string{
 11156  		`type Hs2 struct {`,
 11157  		`	Hs0`,
 11158  		// NOT empty validation
 11159  		"func (m *Hs2) Validate(formats strfmt.Registry) error {",
 11160  		"if err := m.Hs0.Validate(formats); err != nil {",
 11161  	},
 11162  		// not expected
 11163  		[]string{"TODO", "func (m *Hs2) Validate(formats strfmt.Registry) error {\n	return nil\n}"},
 11164  		// output in log
 11165  		noLines,
 11166  		noLines)
 11167  
 11168  	// load expectations for model: d1v.go
 11169  	thisRun.AddExpectations("d1v.go", []string{
 11170  		`type D1v int64`,
 11171  		`func (m D1v) Validate(formats strfmt.Registry) error {`,
 11172  		`	if err := validate.MaximumInt("", "body", int64(m), 100, false); err != nil {`,
 11173  		`		return errors.CompositeValidationError(res...`,
 11174  	},
 11175  		// not expected
 11176  		todo,
 11177  		// output in log
 11178  		noLines,
 11179  		noLines)
 11180  
 11181  	// load expectations for model: c1.go
 11182  	thisRun.AddExpectations("c1.go", []string{
 11183  		`type C1 interface{`,
 11184  	},
 11185  		// not expected
 11186  		todo,
 11187  		// output in log
 11188  		noLines,
 11189  		noLines)
 11190  
 11191  	// load expectations for model: c2.go
 11192  	thisRun.AddExpectations("c2.go", []string{
 11193  		`type C2 = C0`,
 11194  	},
 11195  		// not expected
 11196  		todo,
 11197  		// output in log
 11198  		noLines,
 11199  		noLines)
 11200  
 11201  	// load expectations for model: e0v.go
 11202  	thisRun.AddExpectations("e0v.go", []string{
 11203  		`type E0v = E1v`,
 11204  	},
 11205  		// not expected
 11206  		todo,
 11207  		// output in log
 11208  		noLines,
 11209  		noLines)
 11210  
 11211  	// load expectations for model: d1.go
 11212  	thisRun.AddExpectations("d1.go", []string{
 11213  		`type D1 int64`,
 11214  		// empty validation
 11215  		"func (m D1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
 11216  	},
 11217  		// not expected
 11218  		todo,
 11219  		// output in log
 11220  		noLines,
 11221  		noLines)
 11222  
 11223  	// load expectations for model: g2.go
 11224  	thisRun.AddExpectations("g2.go", []string{
 11225  		`type G2 struct {`,
 11226  		`	G0`,
 11227  		// NOT empty validation
 11228  		"func (m *G2) Validate(formats strfmt.Registry) error {",
 11229  		"if err := m.G0.Validate(formats); err != nil {",
 11230  	},
 11231  		// not expected
 11232  		[]string{"TODO", "func (m *G2) Validate(formats strfmt.Registry) error {\n	return nil\n}"},
 11233  		// output in log
 11234  		noLines,
 11235  		noLines)
 11236  
 11237  	// load expectations for model: d2.go
 11238  	thisRun.AddExpectations("d2.go", []string{
 11239  		`type D2 = D0`,
 11240  	},
 11241  		// not expected
 11242  		todo,
 11243  		// output in log
 11244  		noLines,
 11245  		noLines)
 11246  
 11247  	// load expectations for model: b0.go
 11248  	thisRun.AddExpectations("b0.go", []string{
 11249  		`type B0 = B1`,
 11250  	},
 11251  		// not expected
 11252  		todo,
 11253  		// output in log
 11254  		noLines,
 11255  		noLines)
 11256  
 11257  	// load expectations for model: c2v.go
 11258  	thisRun.AddExpectations("c2v.go", []string{
 11259  		`type C2v = C0v`,
 11260  	},
 11261  		// not expected
 11262  		todo,
 11263  		// output in log
 11264  		noLines,
 11265  		noLines)
 11266  
 11267  	// load expectations for model: g0.go
 11268  	thisRun.AddExpectations("g0.go", []string{
 11269  		`type G0 struct {`,
 11270  		`	G1`,
 11271  		// NOT empty validation
 11272  		"func (m *G0) Validate(formats strfmt.Registry) error {",
 11273  		"if err := m.G1.Validate(formats); err != nil {",
 11274  	},
 11275  		// not expected
 11276  		[]string{"TODO", "func (m *G0) Validate(formats strfmt.Registry) error {\n	return nil\n}"},
 11277  		// output in log
 11278  		noLines,
 11279  		noLines)
 11280  
 11281  	// load expectations for model: a0.go
 11282  	thisRun.AddExpectations("a0.go", []string{
 11283  		`type A0 = A1`,
 11284  	},
 11285  		// not expected
 11286  		todo,
 11287  		// output in log
 11288  		noLines,
 11289  		noLines)
 11290  
 11291  	// load expectations for model: a2.go
 11292  	thisRun.AddExpectations("a2.go", []string{
 11293  		`type A2 = A0`,
 11294  	},
 11295  		// not expected
 11296  		todo,
 11297  		// output in log
 11298  		noLines,
 11299  		noLines)
 11300  
 11301  	// load expectations for model: h1.go
 11302  	thisRun.AddExpectations("h1.go", []string{
 11303  		`type H1 interface {`,
 11304  		`	runtime.Validatable`,
 11305  		`	H1p1() string`,
 11306  		`	SetH1p1(string`,
 11307  		`	H1p2() strfmt.Date`,
 11308  		`	SetH1p2(strfmt.Date`,
 11309  		`type h1 struct {`,
 11310  		`	h1p1Field string`,
 11311  		`	h1p2Field strfmt.Date`,
 11312  		`func (m *h1) H1p1() string {`,
 11313  		`	return m.h1p1Field`,
 11314  		`func (m *h1) SetH1p1(val string) {`,
 11315  		`	m.h1p1Field = val`,
 11316  		`func (m *h1) H1p2() strfmt.Date {`,
 11317  		`	return m.h1p2Field`,
 11318  		`func (m *h1) SetH1p2(val strfmt.Date) {`,
 11319  		`	m.h1p2Field = val`,
 11320  		`func UnmarshalH1Slice(reader io.Reader, consumer runtime.Consumer) ([]H1, error) {`,
 11321  		`	var elements []json.RawMessage`,
 11322  		`	if err := consumer.Consume(reader, &elements); err != nil {`,
 11323  		`		return nil, err`,
 11324  		`	var result []H1`,
 11325  		`	for _, element := range elements {`,
 11326  		`		obj, err := unmarshalH1(element, consumer`,
 11327  		`		if err != nil {`,
 11328  		`			return nil, err`,
 11329  		`		result = append(result, obj`,
 11330  		`	return result, nil`,
 11331  		`func UnmarshalH1(reader io.Reader, consumer runtime.Consumer) (H1, error) {`,
 11332  		`	data, err := io.ReadAll(reader`,
 11333  		`	if err != nil {`,
 11334  		`		return nil, err`,
 11335  		`	return unmarshalH1(data, consumer`,
 11336  		`func unmarshalH1(data []byte, consumer runtime.Consumer) (H1, error) {`,
 11337  		`	buf := bytes.NewBuffer(data`,
 11338  		`	buf2 := bytes.NewBuffer(data`,
 11339  		`	var getType struct {`,
 11340  		"		Htype string `json:\"htype\"`",
 11341  		`	if err := consumer.Consume(buf, &getType); err != nil {`,
 11342  		`		return nil, err`,
 11343  		`	if err := validate.RequiredString("htype", "body", getType.Htype); err != nil {`,
 11344  		`		return nil, err`,
 11345  		`	switch getType.Htype {`,
 11346  		`	case "h1":`,
 11347  		`		var result h1`,
 11348  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
 11349  		`			return nil, err`,
 11350  		`		return &result, nil`,
 11351  		`	case "hsubtype1":`,
 11352  		`		var result Hsubtype1`,
 11353  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
 11354  		`			return nil, err`,
 11355  		`		return &result, nil`,
 11356  		`	case "hsubtype2":`,
 11357  		`		var result Hsubtype2`,
 11358  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
 11359  		`			return nil, err`,
 11360  		`		return &result, nil`,
 11361  		`	return nil, errors.New(422, "invalid htype value: %q", getType.Htype`,
 11362  		`func (m *h1) Validate(formats strfmt.Registry) error {`,
 11363  		`	if err := m.validateH1p2(formats); err != nil {`,
 11364  		`		return errors.CompositeValidationError(res...`,
 11365  		`func (m *h1) validateH1p2(formats strfmt.Registry) error {`,
 11366  		`	if swag.IsZero(m.H1p2()) {`,
 11367  		`	if err := validate.FormatOf("h1p2", "body", "date", m.H1p2().String(), formats); err != nil {`,
 11368  	},
 11369  		// not expected
 11370  		todo,
 11371  		// output in log
 11372  		noLines,
 11373  		noLines)
 11374  
 11375  	// load expectations for model: c0v.go
 11376  	thisRun.AddExpectations("c0v.go", []string{
 11377  		`type C0v = C1v`,
 11378  	},
 11379  		// not expected
 11380  		todo,
 11381  		// output in log
 11382  		noLines,
 11383  		noLines)
 11384  
 11385  	// load expectations for model: g2v.go
 11386  	thisRun.AddExpectations("g2v.go", []string{
 11387  		`type G2v struct {`,
 11388  		`	G0v`,
 11389  		// NOT empty validation
 11390  		"func (m *G2v) Validate(formats strfmt.Registry) error {",
 11391  		"if err := m.G0v.Validate(formats); err != nil",
 11392  	},
 11393  		// not expected
 11394  		[]string{"TODO", "func (m *G2v) Validate(formats strfmt.Registry) error {\n      return nil\n}"},
 11395  		// output in log
 11396  		noLines,
 11397  		noLines)
 11398  
 11399  	// load expectations for model: f1.go
 11400  	thisRun.AddExpectations("f1.go", []string{
 11401  		`type F1 strfmt.UUID`,
 11402  		`func (m F1) Validate(formats strfmt.Registry) error {`,
 11403  		`	if err := validate.FormatOf("", "body", "uuid", strfmt.UUID(m).String(), formats); err != nil {`,
 11404  		`		return errors.CompositeValidationError(res...`,
 11405  	},
 11406  		// not expected
 11407  		todo,
 11408  		// output in log
 11409  		noLines,
 11410  		noLines)
 11411  
 11412  	// load expectations for model: e1.go
 11413  	thisRun.AddExpectations("e1.go", []string{
 11414  		`type E1 strfmt.Date`,
 11415  		`func (m E1) Validate(formats strfmt.Registry) error {`,
 11416  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
 11417  		`		return errors.CompositeValidationError(res...`,
 11418  	},
 11419  		// not expected
 11420  		todo,
 11421  		// output in log
 11422  		noLines,
 11423  		noLines)
 11424  
 11425  	// load expectations for model: a0v.go
 11426  	thisRun.AddExpectations("a0v.go", []string{
 11427  		`type A0v = A1v`,
 11428  	},
 11429  		// not expected
 11430  		todo,
 11431  		// output in log
 11432  		noLines,
 11433  		noLines)
 11434  
 11435  	// load expectations for model: c0.go
 11436  	thisRun.AddExpectations("c0.go", []string{
 11437  		`type C0 = C1`,
 11438  	},
 11439  		// not expected
 11440  		todo,
 11441  		// output in log
 11442  		noLines,
 11443  		noLines)
 11444  
 11445  	// load expectations for model: f1v.go
 11446  	thisRun.AddExpectations("f1v.go", []string{
 11447  		`type F1v strfmt.UUID`,
 11448  		`func (m F1v) Validate(formats strfmt.Registry) error {`,
 11449  		`	if err := validate.FormatOf("", "body", "uuid", strfmt.UUID(m).String(), formats); err != nil {`,
 11450  		`		return errors.CompositeValidationError(res...`,
 11451  	},
 11452  		// not expected
 11453  		todo,
 11454  		// output in log
 11455  		noLines,
 11456  		noLines)
 11457  
 11458  	// load expectations for model: e1v.go
 11459  	thisRun.AddExpectations("e1v.go", []string{
 11460  		`type E1v strfmt.Date`,
 11461  		`func (m E1v) Validate(formats strfmt.Registry) error {`,
 11462  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
 11463  		`		return errors.CompositeValidationError(res...`,
 11464  	},
 11465  		// not expected
 11466  		todo,
 11467  		// output in log
 11468  		noLines,
 11469  		noLines)
 11470  
 11471  	// load expectations for model: b0v.go
 11472  	thisRun.AddExpectations("b0v.go", []string{
 11473  		`type B0v = B1v`,
 11474  	},
 11475  		// not expected
 11476  		todo,
 11477  		// output in log
 11478  		noLines,
 11479  		noLines)
 11480  
 11481  	// load expectations for model: g0v.go
 11482  	thisRun.AddExpectations("g0v.go", []string{
 11483  		`type G0v struct {`,
 11484  		`	G1v`,
 11485  		// NOT empty validation
 11486  		"func (m *G0v) Validate(formats strfmt.Registry) error {",
 11487  		"if err := m.G1v.Validate(formats); err != nil {",
 11488  	},
 11489  		// not expected
 11490  		[]string{"TODO", "func (m *G0v) Validate(formats strfmt.Registry) error {\n	return nil\n}"},
 11491  		// output in log
 11492  		noLines,
 11493  		noLines)
 11494  
 11495  	// load expectations for model: hs0.go
 11496  	thisRun.AddExpectations("hs0.go", []string{
 11497  		`type Hs0 struct {`,
 11498  		`	Hsubtype1`,
 11499  		// NOT empty validation
 11500  		"func (m *Hs0) Validate(formats strfmt.Registry) error {",
 11501  		"if err := m.Hsubtype1.Validate(formats); err != nil {",
 11502  	},
 11503  		// not expected
 11504  		[]string{"TODO", "func (m *Hs0) Validate(formats strfmt.Registry) error {\n	return nil\n}"},
 11505  		// output in log
 11506  		noLines,
 11507  		noLines)
 11508  }
 11509  
 11510  func initFixture1993() {
 11511  	/*
 11512  	   required / non required base type
 11513  	*/
 11514  
 11515  	f := newModelFixture("../fixtures/bugs/1993/fixture-1993.yaml", "test required/non required base type")
 11516  	thisRun := f.AddRun(false).WithMinimalFlatten(true)
 11517  
 11518  	// load expectations for model: house.go
 11519  	thisRun.AddExpectations("house.go", []string{
 11520  		`if err := validate.Required("pet", "body", m.Pet()); err != nil {`,
 11521  	},
 11522  		// not expected
 11523  		todo,
 11524  		// output in log
 11525  		noLines,
 11526  		noLines)
 11527  
 11528  	// load expectations for model: empty_house.go
 11529  	thisRun.AddExpectations("empty_house.go", []string{
 11530  		`if swag.IsZero(m.Pet())`,
 11531  	},
 11532  		// not expected
 11533  		todo,
 11534  		// output in log
 11535  		noLines,
 11536  		noLines)
 11537  }
 11538  
 11539  func initFixture2604() {
 11540  	f := newModelFixture("../fixtures/bugs/2604/2604.yaml", "additional cases for embedded structs")
 11541  	thisRun := f.AddRun(false).WithMinimalFlatten(true)
 11542  
 11543  	thisRun.AddExpectations("composed.go", []string{
 11544  		`type Composed struct {`,
 11545  		`	NoValidations`,
 11546  		`func (m *Composed) Validate(formats strfmt.Registry) error {`,
 11547  		`if err := m.NoValidations.Validate(formats); err != nil {`,
 11548  	},
 11549  		// not expected
 11550  		todo,
 11551  		// output in log
 11552  		noLines,
 11553  		noLines)
 11554  
 11555  	thisRun.AddExpectations("composed_iface.go", []string{
 11556  		`type ComposedIface = Interface`,
 11557  	},
 11558  		// not expected
 11559  		todo,
 11560  		// output in log
 11561  		noLines,
 11562  		noLines)
 11563  
 11564  	thisRun.AddExpectations("interface.go", []string{
 11565  		`type Interface interface{}`,
 11566  	},
 11567  		// not expected
 11568  		todo,
 11569  		// output in log
 11570  		noLines,
 11571  		noLines)
 11572  
 11573  	thisRun.AddExpectations("no_validations.go", []string{
 11574  		`type NoValidations struct {`,
 11575  		// empty validation
 11576  		"func (m *NoValidations) Validate(formats strfmt.Registry) error {\n	return nil\n}",
 11577  	},
 11578  		// not expected
 11579  		todo,
 11580  		// output in log
 11581  		noLines,
 11582  		noLines)
 11583  
 11584  	thisRun.AddExpectations("post_fields.go", []string{
 11585  		`type PostFields struct {`,
 11586  		`func (m *PostFields) Validate(formats strfmt.Registry) error {`,
 11587  		`if err := m.validateA(formats); err != nil {`,
 11588  		`if err := m.validateB(formats); err != nil {`,
 11589  	},
 11590  		// not expected
 11591  		todo,
 11592  		// output in log
 11593  		noLines,
 11594  		noLines)
 11595  
 11596  	thisRun.AddExpectations("post_request.go", []string{
 11597  		`type PostRequest struct {`,
 11598  		`PostFields`,
 11599  		`func (m *PostRequest) Validate(formats strfmt.Registry) error {`,
 11600  		`if err := m.PostFields.Validate(formats); err != nil {`,
 11601  	},
 11602  		// not expected
 11603  		todo,
 11604  		// output in log
 11605  		noLines,
 11606  		noLines)
 11607  }
 11608  
 11609  func initFixture2364() {
 11610  	f := newModelFixture("../fixtures/bugs/2364/fixture-2364.yaml", "test non-nullable allOf")
 11611  	thisRun := f.AddRun(false).WithMinimalFlatten(true)
 11612  
 11613  	thisRun.AddExpectations("bundle_attributes_response.go", []string{
 11614  		`type BundleAttributesResponse struct {`,
 11615  		`Items []BundleItemResponse`,
 11616  		`Sections []ItemBundleSectionResponse`,
 11617  		`NullableSections []*NullableItemBundleSectionResponse`,
 11618  		`OtherSections []*OtherItemBundleSectionResponse`,
 11619  		`Type BundleType`,
 11620  	},
 11621  		// not expected
 11622  		todo,
 11623  		// output in log
 11624  		noLines,
 11625  		noLines)
 11626  }
 11627  
 11628  func initFixture2163() {
 11629  	f := newModelFixture("../fixtures/enhancements/2163/fixture-2163.yaml", "ambiguous validations")
 11630  	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
 11631  
 11632  	flattenRun.AddExpectations("obj.go", []string{
 11633  		`E map[string]interface{}`,
 11634  		`Ebis map[string]interface{}`,
 11635  		`I []map[string]interface{}`,
 11636  		`J []map[string][]map[string]interface{}`,
 11637  		//
 11638  		`func (m *Obj) validateEEnum(path, location string, value map[string]interface{}) error {`,
 11639  		`if swag.IsZero(m.E) {`,
 11640  		`nprops := len(m.E)`,
 11641  		`if nprops < 12 {`,
 11642  		`return errors.TooFewProperties("e", "body", 12)`,
 11643  		`if err := m.validateEEnum("e", "body", m.E); err != nil {`,
 11644  		//
 11645  		`func (m *Obj) validateEbisEnum(path, location string, value map[string]interface{}) error {`,
 11646  		`if swag.IsZero(m.Ebis) {`,
 11647  		`nprops := len(m.Ebis)`,
 11648  		`if nprops < 1 {`,
 11649  		`return errors.TooFewProperties("ebis", "body", 1)`,
 11650  		`if err := m.validateEbisEnum("ebis", "body", m.Ebis); err != nil {`,
 11651  		//
 11652  		`func (m *Obj) validateF(formats strfmt.Registry) error {`,
 11653  		`if swag.IsZero(m.F) {`,
 11654  		`if err := validate.UniqueItems("f", "body", m.F); err != nil {`,
 11655  		`for i := 0; i < len(m.F); i++ {`,
 11656  		`nprops := len(m.F[i])`,
 11657  		`if nprops < 13 {`,
 11658  		`return errors.TooFewProperties("f"+"."+strconv.Itoa(i), "body", 13)`,
 11659  		//
 11660  		`func (m *Obj) validateI(formats strfmt.Registry) error {`,
 11661  		`if swag.IsZero(m.I) {`,
 11662  		`if err := validate.MinItems("i", "body", iISize, 4); err != nil {`,
 11663  		`if err := validate.UniqueItems("i", "body", m.I); err != nil {`,
 11664  		`for i := 0; i < len(m.I); i++ {`,
 11665  		`nprops := len(m.I[i])`,
 11666  		`if nprops > 5 {`,
 11667  		`return errors.TooManyProperties("i"+"."+strconv.Itoa(i), "body", 5`,
 11668  		//
 11669  		`func (m *Obj) validateJ(formats strfmt.Registry) error {`,
 11670  		`if swag.IsZero(m.J) {`,
 11671  		`iJSize := int64(len(m.J))`,
 11672  		`if err := validate.MinItems("j", "body", iJSize, 4); err != nil {`,
 11673  		`if err := validate.UniqueItems("j", "body", m.J); err != nil {`,
 11674  		`for i := 0; i < len(m.J); i++ {`,
 11675  		`nprops := len(m.J[i])`,
 11676  		`if nprops > 5 {`,
 11677  		`return errors.TooManyProperties("j"+"."+strconv.Itoa(i), "body", 5)`,
 11678  		`for k := range m.J[i] {`,
 11679  		`iiJSize := int64(len(m.J[i][k]))`,
 11680  		`if err := validate.MaxItems("j"+"."+strconv.Itoa(i)+"."+k, "body", iiJSize, 12); err != nil {`,
 11681  		`for ii := 0; ii < len(m.J[i][k]); ii++ {`,
 11682  		`nprops := len(m.J[i][k][ii])`,
 11683  		`if nprops < 1 {`,
 11684  		`return errors.TooFewProperties("j"+"."+strconv.Itoa(i)+"."+k+"."+strconv.Itoa(ii), "body", 1)`,
 11685  	}, todo, noLines, noLines)
 11686  }
 11687  
 11688  func initFixture2587() {
 11689  	f := newModelFixture("../fixtures/bugs/2587/2587.yaml", "min/max properties")
 11690  	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
 11691  
 11692  	flattenRun.AddExpectations("basic_thing.go", []string{
 11693  		`type BasicThing struct {`,
 11694  		`Data interface{} `,
 11695  		`func (m *BasicThing) Validate(formats strfmt.Registry) error {`,
 11696  		`props := make(map[string]json.RawMessage, 1+10)`,
 11697  		`j, err := swag.WriteJSON(m)`,
 11698  		`nprops := len(props)`,
 11699  		`if nprops > 20 {`,
 11700  		`return errors.TooManyProperties("", "body", 20)`,
 11701  	}, todo, noLines, noLines)
 11702  
 11703  	flattenRun.AddExpectations("nested_thing.go", []string{
 11704  		`type NestedThing struct {`,
 11705  		`Data map[string]interface{} `,
 11706  		`NestedThingAdditionalProperties map[string]interface{}`,
 11707  		`func (m *NestedThing) Validate(formats strfmt.Registry) error {`,
 11708  		`// short circuits minProperties > 0`,
 11709  		`if m == nil {`,
 11710  		`props := make(map[string]json.RawMessage, 1+10)`,
 11711  		`nprops := len(props)`,
 11712  		`if nprops < 5 {`,
 11713  		`return errors.TooFewProperties("", "body", 5)`,
 11714  		`if nprops > 10`,
 11715  		`return errors.TooManyProperties("", "body", 10)`,
 11716  		`if err := m.validateData(formats); err != nil {`,
 11717  		`func (m *NestedThing) validateData(formats strfmt.Registry) error {`,
 11718  		`if swag.IsZero(m.Data) {`,
 11719  		`nprops := len(m.Data)`,
 11720  		`if nprops < 15 {`,
 11721  		`return errors.TooFewProperties("data", "body", 15)`,
 11722  		`if nprops > 20 {`,
 11723  		`return errors.TooManyProperties("data", "body", 20)`,
 11724  	}, todo, noLines, noLines)
 11725  
 11726  	flattenRun.AddExpectations("some_thing.go", []string{
 11727  		`type SomeThing struct {`,
 11728  		`Data map[string]interface{}`,
 11729  		`func (m *SomeThing) Validate(formats strfmt.Registry) error {`,
 11730  		`if err := m.validateData(formats); err != nil {`,
 11731  		`func (m *SomeThing) validateData(formats strfmt.Registry) error {`,
 11732  		`if swag.IsZero(m.Data) {`,
 11733  		`nprops := len(m.Data)`,
 11734  		`if nprops > 20 {`,
 11735  		`return errors.TooManyProperties("data", "body", 20)`,
 11736  	}, todo, noLines, noLines)
 11737  
 11738  	flattenRun.AddExpectations("some_typed_thing.go", []string{
 11739  		`type SomeTypedThing struct {`,
 11740  		`Data map[string]string`,
 11741  		`func (m *SomeTypedThing) Validate(formats strfmt.Registry) error {`,
 11742  		`func (m *SomeTypedThing) Validate(formats strfmt.Registry) error {`,
 11743  		`func (m *SomeTypedThing) validateData(formats strfmt.Registry) error {`,
 11744  		`if swag.IsZero(m.Data) {`,
 11745  		`nprops := len(m.Data)`,
 11746  		`if nprops > 20 {`,
 11747  		`return errors.TooManyProperties("data", "body", 20)`,
 11748  	}, todo, noLines, noLines)
 11749  }