github.com/hsdp/go-swagger@v0.19.0/generator/moreschemavalidation_fixtures_test.go (about)

     1  package generator
     2  
     3  func initFixture1479Part() {
     4  	// testing ../fixtures/bugs/1479/fixture-1479-part.yaml with flatten and expand (--skip-flatten)
     5  
     6  	/*
     7  		The breakage with allOf occurs when a schema with an allOf has itself a
     8  		property which is an allOf construct
     9  	*/
    10  
    11  	f := newModelFixture("../fixtures/bugs/1479/fixture-1479-part.yaml", "check nested AllOf validations (from Pouch Engine API)")
    12  	flattenRun := f.AddRun(false)
    13  	expandRun := f.AddRun(true)
    14  
    15  	// load expectations for model: container_create_config_all_of1.go
    16  	flattenRun.AddExpectations("container_create_config_all_of1.go", []string{
    17  		`type ContainerCreateConfigAllOf1 struct {`,
    18  		"	HostConfig *HostConfig `json:\"HostConfig,omitempty\"`",
    19  		"	NetworkingConfig *NetworkingConfig `json:\"NetworkingConfig,omitempty\"`",
    20  		`func (m *ContainerCreateConfigAllOf1) Validate(formats strfmt.Registry) error {`,
    21  		`	if err := m.validateHostConfig(formats); err != nil {`,
    22  		`	if err := m.validateNetworkingConfig(formats); err != nil {`,
    23  		`		return errors.CompositeValidationError(res...`,
    24  		`func (m *ContainerCreateConfigAllOf1) validateHostConfig(formats strfmt.Registry) error {`,
    25  		`	if swag.IsZero(m.HostConfig) {`,
    26  		`	if m.HostConfig != nil {`,
    27  		`		if err := m.HostConfig.Validate(formats); err != nil {`,
    28  		`			if ve, ok := err.(*errors.Validation); ok {`,
    29  		`				return ve.ValidateName("HostConfig"`,
    30  		`func (m *ContainerCreateConfigAllOf1) validateNetworkingConfig(formats strfmt.Registry) error {`,
    31  		`	if swag.IsZero(m.NetworkingConfig) {`,
    32  		`	if m.NetworkingConfig != nil {`,
    33  		`		if err := m.NetworkingConfig.Validate(formats); err != nil {`,
    34  		`			if ve, ok := err.(*errors.Validation); ok {`,
    35  		`				return ve.ValidateName("NetworkingConfig"`,
    36  	},
    37  		// not expected
    38  		todo,
    39  		// output in log
    40  		noLines,
    41  		noLines)
    42  
    43  	// load expectations for model: container_config.go
    44  	flattenRun.AddExpectations("container_config.go", []string{
    45  		`type ContainerConfig struct {`,
    46  		"	ArgsEscaped bool `json:\"ArgsEscaped,omitempty\"`",
    47  		"	AttachStderr bool `json:\"AttachStderr,omitempty\"`",
    48  		"	AttachStdin bool `json:\"AttachStdin,omitempty\"`",
    49  		"	AttachStdout bool `json:\"AttachStdout,omitempty\"`",
    50  		"	Cmd []string `json:\"Cmd\"`",
    51  		"	DiskQuota map[string]string `json:\"DiskQuota,omitempty\"`",
    52  		"	Domainname string `json:\"Domainname,omitempty\"`",
    53  		"	Entrypoint []string `json:\"Entrypoint\"`",
    54  		"	Env []string `json:\"Env\"`",
    55  		"	ExposedPorts map[string]interface{} `json:\"ExposedPorts,omitempty\"`",
    56  		"	Hostname strfmt.Hostname `json:\"Hostname,omitempty\"`",
    57  		"	Image string `json:\"Image\"`",
    58  		"	InitScript string `json:\"InitScript,omitempty\"`",
    59  		"	Labels map[string]string `json:\"Labels,omitempty\"`",
    60  		"	MacAddress string `json:\"MacAddress,omitempty\"`",
    61  		"	NetworkDisabled bool `json:\"NetworkDisabled,omitempty\"`",
    62  		"	OnBuild []string `json:\"OnBuild\"`",
    63  		"	OpenStdin bool `json:\"OpenStdin,omitempty\"`",
    64  		"	QuotaID string `json:\"QuotaID,omitempty\"`",
    65  		"	Rich bool `json:\"Rich,omitempty\"`",
    66  		"	RichMode string `json:\"RichMode,omitempty\"`",
    67  		"	Shell []string `json:\"Shell\"`",
    68  		"	SpecAnnotation map[string]string `json:\"SpecAnnotation,omitempty\"`",
    69  		"	StdinOnce bool `json:\"StdinOnce,omitempty\"`",
    70  		"	StopSignal string `json:\"StopSignal,omitempty\"`",
    71  		"	StopTimeout *int64 `json:\"StopTimeout,omitempty\"`",
    72  		"	Tty bool `json:\"Tty,omitempty\"`",
    73  		"	User string `json:\"User,omitempty\"`",
    74  		"	Volumes map[string]interface{} `json:\"Volumes,omitempty\"`",
    75  		"	WorkingDir string `json:\"WorkingDir,omitempty\"`",
    76  		`func (m *ContainerConfig) Validate(formats strfmt.Registry) error {`,
    77  		`	if err := m.validateExposedPorts(formats); err != nil {`,
    78  		`	if err := m.validateHostname(formats); err != nil {`,
    79  		`	if err := m.validateImage(formats); err != nil {`,
    80  		`	if err := m.validateRichMode(formats); err != nil {`,
    81  		`	if err := m.validateVolumes(formats); err != nil {`,
    82  		`		return errors.CompositeValidationError(res...`,
    83  		`var containerConfigExposedPortsValueEnum []interface{`,
    84  		`	var res []interface{`,
    85  		"	if err := json.Unmarshal([]byte(`[{}]`), &res); err != nil {",
    86  		`	for _, v := range res {`,
    87  		`		containerConfigExposedPortsValueEnum = append(containerConfigExposedPortsValueEnum, v`,
    88  		`func (m *ContainerConfig) validateExposedPortsValueEnum(path, location string, value interface{}) error {`,
    89  		`	if err := validate.Enum(path, location, value, containerConfigExposedPortsValueEnum); err != nil {`,
    90  		`func (m *ContainerConfig) validateExposedPorts(formats strfmt.Registry) error {`,
    91  		`	if swag.IsZero(m.ExposedPorts) {`,
    92  		`	for k := range m.ExposedPorts {`,
    93  		//`		if swag.IsZero(m.ExposedPorts[k]) {`,
    94  		`		if err := m.validateExposedPortsValueEnum("ExposedPorts"+"."+k, "body", m.ExposedPorts[k]); err != nil {`,
    95  		`func (m *ContainerConfig) validateHostname(formats strfmt.Registry) error {`,
    96  		`	if swag.IsZero(m.Hostname) {`,
    97  		`	if err := validate.MinLength("Hostname", "body", string(m.Hostname), 1); err != nil {`,
    98  		`	if err := validate.FormatOf("Hostname", "body", "hostname", m.Hostname.String(), formats); err != nil {`,
    99  		`func (m *ContainerConfig) validateImage(formats strfmt.Registry) error {`,
   100  		`	if err := validate.RequiredString("Image", "body", string(m.Image)); err != nil {`,
   101  		`var containerConfigTypeRichModePropEnum []interface{`,
   102  		`	var res []string`,
   103  		"	if err := json.Unmarshal([]byte(`[\"dumb-init\",\"sbin-init\",\"systemd\"]`), &res); err != nil {",
   104  		`	for _, v := range res {`,
   105  		`		containerConfigTypeRichModePropEnum = append(containerConfigTypeRichModePropEnum, v`,
   106  		`	ContainerConfigRichModeDumbInit string = "dumb-init"`,
   107  		`	ContainerConfigRichModeSbinInit string = "sbin-init"`,
   108  		`	ContainerConfigRichModeSystemd string = "systemd"`,
   109  		`func (m *ContainerConfig) validateRichModeEnum(path, location string, value string) error {`,
   110  		`	if err := validate.Enum(path, location, value, containerConfigTypeRichModePropEnum); err != nil {`,
   111  		`func (m *ContainerConfig) validateRichMode(formats strfmt.Registry) error {`,
   112  		`	if swag.IsZero(m.RichMode) {`,
   113  		`	if err := m.validateRichModeEnum("RichMode", "body", m.RichMode); err != nil {`,
   114  		`var containerConfigVolumesValueEnum []interface{`,
   115  		`	var res []interface{`,
   116  		"	if err := json.Unmarshal([]byte(`[{}]`), &res); err != nil {",
   117  		`	for _, v := range res {`,
   118  		`		containerConfigVolumesValueEnum = append(containerConfigVolumesValueEnum, v`,
   119  		`func (m *ContainerConfig) validateVolumesValueEnum(path, location string, value interface{}) error {`,
   120  		`	if err := validate.Enum(path, location, value, containerConfigVolumesValueEnum); err != nil {`,
   121  		`func (m *ContainerConfig) validateVolumes(formats strfmt.Registry) error {`,
   122  		`	if swag.IsZero(m.Volumes) {`,
   123  		`	for k := range m.Volumes {`,
   124  		//`		if swag.IsZero(m.Volumes[k]) {`,
   125  		`		if err := m.validateVolumesValueEnum("Volumes"+"."+k, "body", m.Volumes[k]); err != nil {`,
   126  	},
   127  		// not expected
   128  		todo,
   129  		// output in log
   130  		noLines,
   131  		noLines)
   132  
   133  	expandRun.AddExpectations("container_config.go", flattenRun.ExpectedFor("ContainerConfig").ExpectedLines, todo, noLines, noLines)
   134  
   135  	// load expectations for model: host_config_all_of0_log_config.go
   136  	flattenRun.AddExpectations("host_config_all_of0_log_config.go", []string{
   137  		`type HostConfigAllOf0LogConfig struct {`,
   138  		"	Config map[string]string `json:\"Config,omitempty\"`",
   139  		"	Type string `json:\"Type,omitempty\"`",
   140  		`func (m *HostConfigAllOf0LogConfig) Validate(formats strfmt.Registry) error {`,
   141  		`	if err := m.validateType(formats); err != nil {`,
   142  		`		return errors.CompositeValidationError(res...`,
   143  		`var hostConfigAllOf0LogConfigTypeTypePropEnum []interface{`,
   144  		`	var res []string`,
   145  		"	if err := json.Unmarshal([]byte(`[\"json-file\",\"syslog\",\"journald\",\"gelf\",\"fluentd\",\"awslogs\",\"splunk\",\"etwlogs\",\"none\"]`), &res); err != nil {",
   146  		`	for _, v := range res {`,
   147  		`		hostConfigAllOf0LogConfigTypeTypePropEnum = append(hostConfigAllOf0LogConfigTypeTypePropEnum, v`,
   148  		`	HostConfigAllOf0LogConfigTypeJSONFile string = "json-file"`,
   149  		`	HostConfigAllOf0LogConfigTypeSyslog string = "syslog"`,
   150  		`	HostConfigAllOf0LogConfigTypeJournald string = "journald"`,
   151  		`	HostConfigAllOf0LogConfigTypeGelf string = "gelf"`,
   152  		`	HostConfigAllOf0LogConfigTypeFluentd string = "fluentd"`,
   153  		`	HostConfigAllOf0LogConfigTypeAwslogs string = "awslogs"`,
   154  		`	HostConfigAllOf0LogConfigTypeSplunk string = "splunk"`,
   155  		`	HostConfigAllOf0LogConfigTypeEtwlogs string = "etwlogs"`,
   156  		`	HostConfigAllOf0LogConfigTypeNone string = "none"`,
   157  		`func (m *HostConfigAllOf0LogConfig) validateTypeEnum(path, location string, value string) error {`,
   158  		`	if err := validate.Enum(path, location, value, hostConfigAllOf0LogConfigTypeTypePropEnum); err != nil {`,
   159  		`func (m *HostConfigAllOf0LogConfig) validateType(formats strfmt.Registry) error {`,
   160  		`	if swag.IsZero(m.Type) {`,
   161  		`	if err := m.validateTypeEnum("Type", "body", m.Type); err != nil {`,
   162  	},
   163  		// not expected
   164  		todo,
   165  		// output in log
   166  		noLines,
   167  		noLines)
   168  
   169  	// load expectations for model: restart_policy.go
   170  	flattenRun.AddExpectations("restart_policy.go", []string{
   171  		`type RestartPolicy struct {`,
   172  		"	MaximumRetryCount int64 `json:\"MaximumRetryCount,omitempty\"`",
   173  		"	Name string `json:\"Name,omitempty\"`",
   174  		// empty validation
   175  		"func (m *RestartPolicy) Validate(formats strfmt.Registry) error {\n	return nil\n}",
   176  	},
   177  		// not expected
   178  		todo,
   179  		// output in log
   180  		noLines,
   181  		noLines)
   182  
   183  	expandRun.AddExpectations("restart_policy.go", flattenRun.ExpectedFor("RestartPolicy").ExpectedLines, todo, noLines, noLines)
   184  
   185  	// load expectations for model: endpoint_ip_a_m_config.go
   186  	flattenRun.AddExpectations("endpoint_ip_a_m_config.go", []string{
   187  		`type EndpointIPAMConfig struct {`,
   188  		"	IPV4Address string `json:\"IPv4Address,omitempty\"`",
   189  		"	IPV6Address string `json:\"IPv6Address,omitempty\"`",
   190  		"	LinkLocalIps []string `json:\"LinkLocalIPs\"`",
   191  		// empty validation
   192  		"func (m *EndpointIPAMConfig) Validate(formats strfmt.Registry) error {\n	return nil\n}",
   193  	},
   194  		// not expected
   195  		todo,
   196  		// output in log
   197  		noLines,
   198  		noLines)
   199  
   200  	expandRun.AddExpectations("endpoint_ip_a_m_config.go", flattenRun.ExpectedFor("EndpointIPAMConfig").ExpectedLines, todo, noLines, noLines)
   201  
   202  	// load expectations for model: host_config_all_of0.go
   203  	flattenRun.AddExpectations("host_config_all_of0.go", []string{
   204  		`type HostConfigAllOf0 struct {`,
   205  		"	AutoRemove bool `json:\"AutoRemove,omitempty\"`",
   206  		"	Binds []string `json:\"Binds\"`",
   207  		"	CapAdd []string `json:\"CapAdd\"`",
   208  		"	CapDrop []string `json:\"CapDrop\"`",
   209  		"	Cgroup string `json:\"Cgroup,omitempty\"`",
   210  		"	ConsoleSize []*int64 `json:\"ConsoleSize\"`",
   211  		"	ContainerIDFile string `json:\"ContainerIDFile,omitempty\"`",
   212  		"	DNS []string `json:\"Dns\"`",
   213  		"	DNSOptions []string `json:\"DnsOptions\"`",
   214  		"	DNSSearch []string `json:\"DnsSearch\"`",
   215  		"	EnableLxcfs bool `json:\"EnableLxcfs,omitempty\"`",
   216  		"	ExtraHosts []string `json:\"ExtraHosts\"`",
   217  		"	GroupAdd []string `json:\"GroupAdd\"`",
   218  		"	InitScript string `json:\"InitScript,omitempty\"`",
   219  		"	IpcMode string `json:\"IpcMode,omitempty\"`",
   220  		"	Isolation string `json:\"Isolation,omitempty\"`",
   221  		"	Links []string `json:\"Links\"`",
   222  		"	LogConfig *HostConfigAllOf0LogConfig `json:\"LogConfig,omitempty\"`",
   223  		"	NetworkMode string `json:\"NetworkMode,omitempty\"`",
   224  		"	OomScoreAdj int64 `json:\"OomScoreAdj,omitempty\"`",
   225  		"	PidMode string `json:\"PidMode,omitempty\"`",
   226  		"	Privileged bool `json:\"Privileged,omitempty\"`",
   227  		"	PublishAllPorts bool `json:\"PublishAllPorts,omitempty\"`",
   228  		"	ReadonlyRootfs bool `json:\"ReadonlyRootfs,omitempty\"`",
   229  		"	RestartPolicy *RestartPolicy `json:\"RestartPolicy,omitempty\"`",
   230  		"	Rich bool `json:\"Rich,omitempty\"`",
   231  		"	RichMode string `json:\"RichMode,omitempty\"`",
   232  		"	Runtime string `json:\"Runtime,omitempty\"`",
   233  		"	SecurityOpt []string `json:\"SecurityOpt\"`",
   234  		"	ShmSize *int64 `json:\"ShmSize,omitempty\"`",
   235  		"	StorageOpt map[string]string `json:\"StorageOpt,omitempty\"`",
   236  		"	Sysctls map[string]string `json:\"Sysctls,omitempty\"`",
   237  		"	Tmpfs map[string]string `json:\"Tmpfs,omitempty\"`",
   238  		"	UTSMode string `json:\"UTSMode,omitempty\"`",
   239  		"	UsernsMode string `json:\"UsernsMode,omitempty\"`",
   240  		"	VolumeDriver string `json:\"VolumeDriver,omitempty\"`",
   241  		"	VolumesFrom []string `json:\"VolumesFrom\"`",
   242  		`func (m *HostConfigAllOf0) Validate(formats strfmt.Registry) error {`,
   243  		`	if err := m.validateConsoleSize(formats); err != nil {`,
   244  		`	if err := m.validateIsolation(formats); err != nil {`,
   245  		`	if err := m.validateLogConfig(formats); err != nil {`,
   246  		`	if err := m.validateOomScoreAdj(formats); err != nil {`,
   247  		`	if err := m.validateRestartPolicy(formats); err != nil {`,
   248  		`	if err := m.validateRichMode(formats); err != nil {`,
   249  		`	if err := m.validateShmSize(formats); err != nil {`,
   250  		`		return errors.CompositeValidationError(res...`,
   251  		`func (m *HostConfigAllOf0) validateConsoleSize(formats strfmt.Registry) error {`,
   252  		`	if swag.IsZero(m.ConsoleSize) {`,
   253  		`	iConsoleSizeSize := int64(len(m.ConsoleSize)`,
   254  		`	if err := validate.MinItems("ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`,
   255  		`	if err := validate.MaxItems("ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`,
   256  		`	for i := 0; i < len(m.ConsoleSize); i++ {`,
   257  		// do we need...?
   258  		`		if swag.IsZero(m.ConsoleSize[i]) {`,
   259  		//`		if err := validate.Required("ConsoleSize"+"."+strconv.Itoa(i), "body", m.ConsoleSize[i]); err != nil {`,
   260  		`		if err := validate.MinimumInt("ConsoleSize"+"."+strconv.Itoa(i), "body", int64(*m.ConsoleSize[i]), 0, false); err != nil {`,
   261  		`var hostConfigAllOf0TypeIsolationPropEnum []interface{`,
   262  		`	var res []string`,
   263  		"	if err := json.Unmarshal([]byte(`[\"default\",\"process\",\"hyperv\"]`), &res); err != nil {",
   264  		`	for _, v := range res {`,
   265  		`		hostConfigAllOf0TypeIsolationPropEnum = append(hostConfigAllOf0TypeIsolationPropEnum, v`,
   266  		`	HostConfigAllOf0IsolationDefault string = "default"`,
   267  		`	HostConfigAllOf0IsolationProcess string = "process"`,
   268  		`	HostConfigAllOf0IsolationHyperv string = "hyperv"`,
   269  		`func (m *HostConfigAllOf0) validateIsolationEnum(path, location string, value string) error {`,
   270  		`	if err := validate.Enum(path, location, value, hostConfigAllOf0TypeIsolationPropEnum); err != nil {`,
   271  		`func (m *HostConfigAllOf0) validateIsolation(formats strfmt.Registry) error {`,
   272  		`	if swag.IsZero(m.Isolation) {`,
   273  		`	if err := m.validateIsolationEnum("Isolation", "body", m.Isolation); err != nil {`,
   274  		`func (m *HostConfigAllOf0) validateLogConfig(formats strfmt.Registry) error {`,
   275  		`	if swag.IsZero(m.LogConfig) {`,
   276  		`	if m.LogConfig != nil {`,
   277  		`		if err := m.LogConfig.Validate(formats); err != nil {`,
   278  		`			if ve, ok := err.(*errors.Validation); ok {`,
   279  		`				return ve.ValidateName("LogConfig"`,
   280  		`func (m *HostConfigAllOf0) validateOomScoreAdj(formats strfmt.Registry) error {`,
   281  		`	if swag.IsZero(m.OomScoreAdj) {`,
   282  		`	if err := validate.MinimumInt("OomScoreAdj", "body", int64(m.OomScoreAdj), -1000, false); err != nil {`,
   283  		`	if err := validate.MaximumInt("OomScoreAdj", "body", int64(m.OomScoreAdj), 1000, false); err != nil {`,
   284  		`func (m *HostConfigAllOf0) validateRestartPolicy(formats strfmt.Registry) error {`,
   285  		`	if swag.IsZero(m.RestartPolicy) {`,
   286  		`	if m.RestartPolicy != nil {`,
   287  		`		if err := m.RestartPolicy.Validate(formats); err != nil {`,
   288  		`			if ve, ok := err.(*errors.Validation); ok {`,
   289  		`				return ve.ValidateName("RestartPolicy"`,
   290  		`var hostConfigAllOf0TypeRichModePropEnum []interface{`,
   291  		`	var res []string`,
   292  		"	if err := json.Unmarshal([]byte(`[\"dumb-init\",\"sbin-init\",\"systemd\"]`), &res); err != nil {",
   293  		`	for _, v := range res {`,
   294  		`		hostConfigAllOf0TypeRichModePropEnum = append(hostConfigAllOf0TypeRichModePropEnum, v`,
   295  		`	HostConfigAllOf0RichModeDumbInit string = "dumb-init"`,
   296  		`	HostConfigAllOf0RichModeSbinInit string = "sbin-init"`,
   297  		`	HostConfigAllOf0RichModeSystemd string = "systemd"`,
   298  		`func (m *HostConfigAllOf0) validateRichModeEnum(path, location string, value string) error {`,
   299  		`	if err := validate.Enum(path, location, value, hostConfigAllOf0TypeRichModePropEnum); err != nil {`,
   300  		`func (m *HostConfigAllOf0) validateRichMode(formats strfmt.Registry) error {`,
   301  		`	if swag.IsZero(m.RichMode) {`,
   302  		`	if err := m.validateRichModeEnum("RichMode", "body", m.RichMode); err != nil {`,
   303  		`func (m *HostConfigAllOf0) validateShmSize(formats strfmt.Registry) error {`,
   304  		`	if swag.IsZero(m.ShmSize) {`,
   305  		`	if err := validate.MinimumInt("ShmSize", "body", int64(*m.ShmSize), 0, false); err != nil {`,
   306  	},
   307  		// not expected
   308  		todo,
   309  		// output in log
   310  		noLines,
   311  		noLines)
   312  
   313  	// load expectations for model: host_config.go
   314  	flattenRun.AddExpectations("host_config.go", []string{
   315  		`type HostConfig struct {`,
   316  		`	HostConfigAllOf0`,
   317  		`	Resources`,
   318  		`func (m *HostConfig) Validate(formats strfmt.Registry) error {`,
   319  		`	if err := m.HostConfigAllOf0.Validate(formats); err != nil {`,
   320  		`	if err := m.Resources.Validate(formats); err != nil {`,
   321  		`		return errors.CompositeValidationError(res...`,
   322  	},
   323  		// not expected
   324  		todo,
   325  		// output in log
   326  		noLines,
   327  		noLines)
   328  
   329  	expandRun.AddExpectations("host_config.go", []string{
   330  		`type HostConfig struct {`,
   331  		"	AutoRemove bool `json:\"AutoRemove,omitempty\"`",
   332  		"	Binds []string `json:\"Binds\"`",
   333  		"	CapAdd []string `json:\"CapAdd\"`",
   334  		"	CapDrop []string `json:\"CapDrop\"`",
   335  		"	Cgroup string `json:\"Cgroup,omitempty\"`",
   336  		"	ConsoleSize []*int64 `json:\"ConsoleSize\"`",
   337  		"	ContainerIDFile string `json:\"ContainerIDFile,omitempty\"`",
   338  		"	DNS []string `json:\"Dns\"`",
   339  		"	DNSOptions []string `json:\"DnsOptions\"`",
   340  		"	DNSSearch []string `json:\"DnsSearch\"`",
   341  		"	EnableLxcfs bool `json:\"EnableLxcfs,omitempty\"`",
   342  		"	ExtraHosts []string `json:\"ExtraHosts\"`",
   343  		"	GroupAdd []string `json:\"GroupAdd\"`",
   344  		"	InitScript string `json:\"InitScript,omitempty\"`",
   345  		"	IpcMode string `json:\"IpcMode,omitempty\"`",
   346  		"	Isolation string `json:\"Isolation,omitempty\"`",
   347  		"	Links []string `json:\"Links\"`",
   348  		"	LogConfig *HostConfigAO0LogConfig `json:\"LogConfig,omitempty\"`",
   349  		"	NetworkMode string `json:\"NetworkMode,omitempty\"`",
   350  		"	OomScoreAdj int64 `json:\"OomScoreAdj,omitempty\"`",
   351  		"	PidMode string `json:\"PidMode,omitempty\"`",
   352  		"	Privileged bool `json:\"Privileged,omitempty\"`",
   353  		"	PublishAllPorts bool `json:\"PublishAllPorts,omitempty\"`",
   354  		"	ReadonlyRootfs bool `json:\"ReadonlyRootfs,omitempty\"`",
   355  		"	RestartPolicy *HostConfigAO0RestartPolicy `json:\"RestartPolicy,omitempty\"`",
   356  		"	Rich bool `json:\"Rich,omitempty\"`",
   357  		"	RichMode string `json:\"RichMode,omitempty\"`",
   358  		"	Runtime string `json:\"Runtime,omitempty\"`",
   359  		"	SecurityOpt []string `json:\"SecurityOpt\"`",
   360  		"	ShmSize *int64 `json:\"ShmSize,omitempty\"`",
   361  		"	StorageOpt map[string]string `json:\"StorageOpt,omitempty\"`",
   362  		"	Sysctls map[string]string `json:\"Sysctls,omitempty\"`",
   363  		"	Tmpfs map[string]string `json:\"Tmpfs,omitempty\"`",
   364  		"	UTSMode string `json:\"UTSMode,omitempty\"`",
   365  		"	UsernsMode string `json:\"UsernsMode,omitempty\"`",
   366  		"	VolumeDriver string `json:\"VolumeDriver,omitempty\"`",
   367  		"	VolumesFrom []string `json:\"VolumesFrom\"`",
   368  		"	BlkioWeight uint16 `json:\"BlkioWeight,omitempty\"`",
   369  		"	CgroupParent string `json:\"CgroupParent,omitempty\"`",
   370  		"	CPUShares int64 `json:\"CpuShares,omitempty\"`",
   371  		"	Memory int64 `json:\"Memory,omitempty\"`",
   372  		`func (m *HostConfig) Validate(formats strfmt.Registry) error {`,
   373  		`	if err := m.validateConsoleSize(formats); err != nil {`,
   374  		`	if err := m.validateIsolation(formats); err != nil {`,
   375  		`	if err := m.validateLogConfig(formats); err != nil {`,
   376  		`	if err := m.validateOomScoreAdj(formats); err != nil {`,
   377  		`	if err := m.validateRestartPolicy(formats); err != nil {`,
   378  		`	if err := m.validateRichMode(formats); err != nil {`,
   379  		`	if err := m.validateShmSize(formats); err != nil {`,
   380  		`	if err := m.validateBlkioWeight(formats); err != nil {`,
   381  		`		return errors.CompositeValidationError(res...`,
   382  		`func (m *HostConfig) validateConsoleSize(formats strfmt.Registry) error {`,
   383  		`	if swag.IsZero(m.ConsoleSize) {`,
   384  		`	iConsoleSizeSize := int64(len(m.ConsoleSize)`,
   385  		`	if err := validate.MinItems("ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`,
   386  		`	if err := validate.MaxItems("ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`,
   387  		`	for i := 0; i < len(m.ConsoleSize); i++ {`,
   388  		// do we need...
   389  		`		if swag.IsZero(m.ConsoleSize[i]) {`,
   390  		//`		if err := validate.Required("ConsoleSize"+"."+strconv.Itoa(i), "body", m.ConsoleSize[i]); err != nil {`,
   391  		`		if err := validate.MinimumInt("ConsoleSize"+"."+strconv.Itoa(i), "body", int64(*m.ConsoleSize[i]), 0, false); err != nil {`,
   392  		`var hostConfigTypeIsolationPropEnum []interface{`,
   393  		`	var res []string`,
   394  		"	if err := json.Unmarshal([]byte(`[\"default\",\"process\",\"hyperv\"]`), &res); err != nil {",
   395  		`	for _, v := range res {`,
   396  		`		hostConfigTypeIsolationPropEnum = append(hostConfigTypeIsolationPropEnum, v`,
   397  		`func (m *HostConfig) validateIsolationEnum(path, location string, value string) error {`,
   398  		`	if err := validate.Enum(path, location, value, hostConfigTypeIsolationPropEnum); err != nil {`,
   399  		`func (m *HostConfig) validateIsolation(formats strfmt.Registry) error {`,
   400  		`	if swag.IsZero(m.Isolation) {`,
   401  		`	if err := m.validateIsolationEnum("Isolation", "body", m.Isolation); err != nil {`,
   402  		`func (m *HostConfig) validateLogConfig(formats strfmt.Registry) error {`,
   403  		`	if swag.IsZero(m.LogConfig) {`,
   404  		`	if m.LogConfig != nil {`,
   405  		`		if err := m.LogConfig.Validate(formats); err != nil {`,
   406  		`			if ve, ok := err.(*errors.Validation); ok {`,
   407  		`				return ve.ValidateName("LogConfig"`,
   408  		`func (m *HostConfig) validateOomScoreAdj(formats strfmt.Registry) error {`,
   409  		`	if swag.IsZero(m.OomScoreAdj) {`,
   410  		`	if err := validate.MinimumInt("OomScoreAdj", "body", int64(m.OomScoreAdj), -1000, false); err != nil {`,
   411  		`	if err := validate.MaximumInt("OomScoreAdj", "body", int64(m.OomScoreAdj), 1000, false); err != nil {`,
   412  		`func (m *HostConfig) validateRestartPolicy(formats strfmt.Registry) error {`,
   413  		`	if swag.IsZero(m.RestartPolicy) {`,
   414  		`	if m.RestartPolicy != nil {`,
   415  		`		if err := m.RestartPolicy.Validate(formats); err != nil {`,
   416  		`			if ve, ok := err.(*errors.Validation); ok {`,
   417  		`				return ve.ValidateName("RestartPolicy"`,
   418  		`var hostConfigTypeRichModePropEnum []interface{`,
   419  		`	var res []string`,
   420  		"	if err := json.Unmarshal([]byte(`[\"dumb-init\",\"sbin-init\",\"systemd\"]`), &res); err != nil {",
   421  		`	for _, v := range res {`,
   422  		`		hostConfigTypeRichModePropEnum = append(hostConfigTypeRichModePropEnum, v`,
   423  		`func (m *HostConfig) validateRichModeEnum(path, location string, value string) error {`,
   424  		`	if err := validate.Enum(path, location, value, hostConfigTypeRichModePropEnum); err != nil {`,
   425  		`func (m *HostConfig) validateRichMode(formats strfmt.Registry) error {`,
   426  		`	if swag.IsZero(m.RichMode) {`,
   427  		`	if err := m.validateRichModeEnum("RichMode", "body", m.RichMode); err != nil {`,
   428  		`func (m *HostConfig) validateShmSize(formats strfmt.Registry) error {`,
   429  		`	if swag.IsZero(m.ShmSize) {`,
   430  		`	if err := validate.MinimumInt("ShmSize", "body", int64(*m.ShmSize), 0, false); err != nil {`,
   431  		`func (m *HostConfig) validateBlkioWeight(formats strfmt.Registry) error {`,
   432  		`	if swag.IsZero(m.BlkioWeight) {`,
   433  		`	if err := validate.MinimumInt("BlkioWeight", "body", int64(m.BlkioWeight), 0, false); err != nil {`,
   434  		`	if err := validate.MaximumInt("BlkioWeight", "body", int64(m.BlkioWeight), 1000, false); err != nil {`,
   435  		`type HostConfigAO0LogConfig struct {`,
   436  		"	Config map[string]string `json:\"Config,omitempty\"`",
   437  		"	Type string `json:\"Type,omitempty\"`",
   438  		`func (m *HostConfigAO0LogConfig) Validate(formats strfmt.Registry) error {`,
   439  		`	if err := m.validateType(formats); err != nil {`,
   440  		`		return errors.CompositeValidationError(res...`,
   441  		`var hostConfigAO0LogConfigTypeTypePropEnum []interface{`,
   442  		`	var res []string`,
   443  		"	if err := json.Unmarshal([]byte(`[\"json-file\",\"syslog\",\"journald\",\"gelf\",\"fluentd\",\"awslogs\",\"splunk\",\"etwlogs\",\"none\"]`), &res); err != nil {",
   444  		`	for _, v := range res {`,
   445  		`		hostConfigAO0LogConfigTypeTypePropEnum = append(hostConfigAO0LogConfigTypeTypePropEnum, v`,
   446  		`	HostConfigAO0LogConfigTypeJSONFile string = "json-file"`,
   447  		`	HostConfigAO0LogConfigTypeSyslog string = "syslog"`,
   448  		`	HostConfigAO0LogConfigTypeJournald string = "journald"`,
   449  		`	HostConfigAO0LogConfigTypeGelf string = "gelf"`,
   450  		`	HostConfigAO0LogConfigTypeFluentd string = "fluentd"`,
   451  		`	HostConfigAO0LogConfigTypeAwslogs string = "awslogs"`,
   452  		`	HostConfigAO0LogConfigTypeSplunk string = "splunk"`,
   453  		`	HostConfigAO0LogConfigTypeEtwlogs string = "etwlogs"`,
   454  		`	HostConfigAO0LogConfigTypeNone string = "none"`,
   455  		`func (m *HostConfigAO0LogConfig) validateTypeEnum(path, location string, value string) error {`,
   456  		`	if err := validate.Enum(path, location, value, hostConfigAO0LogConfigTypeTypePropEnum); err != nil {`,
   457  		`func (m *HostConfigAO0LogConfig) validateType(formats strfmt.Registry) error {`,
   458  		`	if swag.IsZero(m.Type) {`,
   459  		`	if err := m.validateTypeEnum("LogConfig"+"."+"Type", "body", m.Type); err != nil {`,
   460  		`type HostConfigAO0RestartPolicy struct {`,
   461  		"	MaximumRetryCount int64 `json:\"MaximumRetryCount,omitempty\"`",
   462  		"	Name string `json:\"Name,omitempty\"`",
   463  		`func (m *HostConfigAO0RestartPolicy) Validate(formats strfmt.Registry) error {`,
   464  		`		return errors.CompositeValidationError(res...`,
   465  	},
   466  		// not expected
   467  		todo,
   468  		// output in log
   469  		noLines,
   470  		noLines)
   471  
   472  	// load expectations for model: container_create_config.go
   473  	flattenRun.AddExpectations("container_create_config.go", []string{
   474  		`type ContainerCreateConfig struct {`,
   475  		`	ContainerConfig`,
   476  		`	ContainerCreateConfigAllOf1`,
   477  		`func (m *ContainerCreateConfig) Validate(formats strfmt.Registry) error {`,
   478  		`	if err := m.ContainerConfig.Validate(formats); err != nil {`,
   479  		`	if err := m.ContainerCreateConfigAllOf1.Validate(formats); err != nil {`,
   480  		`		return errors.CompositeValidationError(res...`,
   481  	},
   482  		// not expected
   483  		todo,
   484  		// output in log
   485  		noLines,
   486  		noLines)
   487  
   488  	expandRun.AddExpectations("container_create_config.go", []string{
   489  		`type ContainerCreateConfig struct {`,
   490  		"	ArgsEscaped bool `json:\"ArgsEscaped,omitempty\"`",
   491  		"	AttachStderr bool `json:\"AttachStderr,omitempty\"`",
   492  		"	AttachStdin bool `json:\"AttachStdin,omitempty\"`",
   493  		"	AttachStdout bool `json:\"AttachStdout,omitempty\"`",
   494  		"	Cmd []string `json:\"Cmd\"`",
   495  		"	DiskQuota map[string]string `json:\"DiskQuota,omitempty\"`",
   496  		"	Domainname string `json:\"Domainname,omitempty\"`",
   497  		"	Entrypoint []string `json:\"Entrypoint\"`",
   498  		"	Env []string `json:\"Env\"`",
   499  		"	ExposedPorts map[string]interface{} `json:\"ExposedPorts,omitempty\"`",
   500  		"	Hostname strfmt.Hostname `json:\"Hostname,omitempty\"`",
   501  		"	Image string `json:\"Image\"`",
   502  		"	InitScript string `json:\"InitScript,omitempty\"`",
   503  		"	Labels map[string]string `json:\"Labels,omitempty\"`",
   504  		"	MacAddress string `json:\"MacAddress,omitempty\"`",
   505  		"	NetworkDisabled bool `json:\"NetworkDisabled,omitempty\"`",
   506  		"	OnBuild []string `json:\"OnBuild\"`",
   507  		"	OpenStdin bool `json:\"OpenStdin,omitempty\"`",
   508  		"	QuotaID string `json:\"QuotaID,omitempty\"`",
   509  		"	Rich bool `json:\"Rich,omitempty\"`",
   510  		"	RichMode string `json:\"RichMode,omitempty\"`",
   511  		"	Shell []string `json:\"Shell\"`",
   512  		"	SpecAnnotation map[string]string `json:\"SpecAnnotation,omitempty\"`",
   513  		"	StdinOnce bool `json:\"StdinOnce,omitempty\"`",
   514  		"	StopSignal string `json:\"StopSignal,omitempty\"`",
   515  		"	StopTimeout *int64 `json:\"StopTimeout,omitempty\"`",
   516  		"	Tty bool `json:\"Tty,omitempty\"`",
   517  		"	User string `json:\"User,omitempty\"`",
   518  		"	Volumes map[string]interface{} `json:\"Volumes,omitempty\"`",
   519  		"	WorkingDir string `json:\"WorkingDir,omitempty\"`",
   520  		`	HostConfig struct {`,
   521  		"		AutoRemove bool `json:\"AutoRemove,omitempty\"`",
   522  		"		Binds []string `json:\"Binds\"`",
   523  		"		CapAdd []string `json:\"CapAdd\"`",
   524  		"		CapDrop []string `json:\"CapDrop\"`",
   525  		"		Cgroup string `json:\"Cgroup,omitempty\"`",
   526  		"		ConsoleSize []*int64 `json:\"ConsoleSize\"`",
   527  		"		ContainerIDFile string `json:\"ContainerIDFile,omitempty\"`",
   528  		"		DNS []string `json:\"Dns\"`",
   529  		"		DNSOptions []string `json:\"DnsOptions\"`",
   530  		"		DNSSearch []string `json:\"DnsSearch\"`",
   531  		"		EnableLxcfs bool `json:\"EnableLxcfs,omitempty\"`",
   532  		"		ExtraHosts []string `json:\"ExtraHosts\"`",
   533  		"		GroupAdd []string `json:\"GroupAdd\"`",
   534  		"		InitScript string `json:\"InitScript,omitempty\"`",
   535  		"		IpcMode string `json:\"IpcMode,omitempty\"`",
   536  		"		Isolation string `json:\"Isolation,omitempty\"`",
   537  		"		Links []string `json:\"Links\"`",
   538  		"		LogConfig *ContainerCreateConfigHostConfigAO0LogConfig `json:\"LogConfig,omitempty\"`",
   539  		"		NetworkMode string `json:\"NetworkMode,omitempty\"`",
   540  		"		OomScoreAdj int64 `json:\"OomScoreAdj,omitempty\"`",
   541  		"		PidMode string `json:\"PidMode,omitempty\"`",
   542  		"		Privileged bool `json:\"Privileged,omitempty\"`",
   543  		"		PublishAllPorts bool `json:\"PublishAllPorts,omitempty\"`",
   544  		"		ReadonlyRootfs bool `json:\"ReadonlyRootfs,omitempty\"`",
   545  		"		RestartPolicy *ContainerCreateConfigHostConfigAO0RestartPolicy `json:\"RestartPolicy,omitempty\"`",
   546  		"		Rich bool `json:\"Rich,omitempty\"`",
   547  		"		RichMode string `json:\"RichMode,omitempty\"`",
   548  		"		Runtime string `json:\"Runtime,omitempty\"`",
   549  		"		SecurityOpt []string `json:\"SecurityOpt\"`",
   550  		"		ShmSize *int64 `json:\"ShmSize,omitempty\"`",
   551  		"		StorageOpt map[string]string `json:\"StorageOpt,omitempty\"`",
   552  		"		Sysctls map[string]string `json:\"Sysctls,omitempty\"`",
   553  		"		Tmpfs map[string]string `json:\"Tmpfs,omitempty\"`",
   554  		"		UTSMode string `json:\"UTSMode,omitempty\"`",
   555  		"		UsernsMode string `json:\"UsernsMode,omitempty\"`",
   556  		"		VolumeDriver string `json:\"VolumeDriver,omitempty\"`",
   557  		"		VolumesFrom []string `json:\"VolumesFrom\"`",
   558  		"		BlkioWeight uint16 `json:\"BlkioWeight,omitempty\"`",
   559  		"		CgroupParent string `json:\"CgroupParent,omitempty\"`",
   560  		"		CPUShares int64 `json:\"CpuShares,omitempty\"`",
   561  		"		Memory int64 `json:\"Memory,omitempty\"`",
   562  		"	} `json:\"HostConfig,omitempty\"`",
   563  		"	NetworkingConfig *ContainerCreateConfigAO1NetworkingConfig `json:\"NetworkingConfig,omitempty\"`",
   564  		`func (m *ContainerCreateConfig) Validate(formats strfmt.Registry) error {`,
   565  		`	if err := m.validateExposedPorts(formats); err != nil {`,
   566  		`	if err := m.validateHostname(formats); err != nil {`,
   567  		`	if err := m.validateImage(formats); err != nil {`,
   568  		`	if err := m.validateRichMode(formats); err != nil {`,
   569  		`	if err := m.validateVolumes(formats); err != nil {`,
   570  		`	if err := m.validateHostConfig(formats); err != nil {`,
   571  		`	if err := m.validateNetworkingConfig(formats); err != nil {`,
   572  		`		return errors.CompositeValidationError(res...`,
   573  		`var containerCreateConfigExposedPortsValueEnum []interface{`,
   574  		`	var res []interface{`,
   575  		"	if err := json.Unmarshal([]byte(`[{}]`), &res); err != nil {",
   576  		`	for _, v := range res {`,
   577  		`		containerCreateConfigExposedPortsValueEnum = append(containerCreateConfigExposedPortsValueEnum, v`,
   578  		`func (m *ContainerCreateConfig) validateExposedPortsValueEnum(path, location string, value interface{}) error {`,
   579  		`	if err := validate.Enum(path, location, value, containerCreateConfigExposedPortsValueEnum); err != nil {`,
   580  		`func (m *ContainerCreateConfig) validateExposedPorts(formats strfmt.Registry) error {`,
   581  		`	if swag.IsZero(m.ExposedPorts) {`,
   582  		`	for k := range m.ExposedPorts {`,
   583  		//`		if swag.IsZero(m.ExposedPorts[k]) {`,
   584  		`		if err := m.validateExposedPortsValueEnum("ExposedPorts"+"."+k, "body", m.ExposedPorts[k]); err != nil {`,
   585  		`func (m *ContainerCreateConfig) validateHostname(formats strfmt.Registry) error {`,
   586  		`	if swag.IsZero(m.Hostname) {`,
   587  		`	if err := validate.MinLength("Hostname", "body", string(m.Hostname), 1); err != nil {`,
   588  		`	if err := validate.FormatOf("Hostname", "body", "hostname", m.Hostname.String(), formats); err != nil {`,
   589  		`func (m *ContainerCreateConfig) validateImage(formats strfmt.Registry) error {`,
   590  		`	if err := validate.RequiredString("Image", "body", string(m.Image)); err != nil {`,
   591  		`var containerCreateConfigTypeRichModePropEnum []interface{`,
   592  		`	var res []string`,
   593  		"	if err := json.Unmarshal([]byte(`[\"dumb-init\",\"sbin-init\",\"systemd\"]`), &res); err != nil {",
   594  		`	for _, v := range res {`,
   595  		`		containerCreateConfigTypeRichModePropEnum = append(containerCreateConfigTypeRichModePropEnum, v`,
   596  		`func (m *ContainerCreateConfig) validateRichModeEnum(path, location string, value string) error {`,
   597  		`	if err := validate.Enum(path, location, value, containerCreateConfigTypeRichModePropEnum); err != nil {`,
   598  		`func (m *ContainerCreateConfig) validateRichMode(formats strfmt.Registry) error {`,
   599  		`	if swag.IsZero(m.RichMode) {`,
   600  		`	if err := m.validateRichModeEnum("RichMode", "body", m.RichMode); err != nil {`,
   601  		`var containerCreateConfigVolumesValueEnum []interface{`,
   602  		`	var res []interface{`,
   603  		"	if err := json.Unmarshal([]byte(`[{}]`), &res); err != nil {",
   604  		`	for _, v := range res {`,
   605  		`		containerCreateConfigVolumesValueEnum = append(containerCreateConfigVolumesValueEnum, v`,
   606  		`func (m *ContainerCreateConfig) validateVolumesValueEnum(path, location string, value interface{}) error {`,
   607  		`	if err := validate.Enum(path, location, value, containerCreateConfigVolumesValueEnum); err != nil {`,
   608  		`func (m *ContainerCreateConfig) validateVolumes(formats strfmt.Registry) error {`,
   609  		`	if swag.IsZero(m.Volumes) {`,
   610  		`	for k := range m.Volumes {`,
   611  		//`		if swag.IsZero(m.Volumes[k]) {`,
   612  		`		if err := m.validateVolumesValueEnum("Volumes"+"."+k, "body", m.Volumes[k]); err != nil {`,
   613  		`func (m *ContainerCreateConfig) validateHostConfig(formats strfmt.Registry) error {`,
   614  		`	if swag.IsZero(m.HostConfig) {`,
   615  		`	iConsoleSizeSize := int64(len(m.HostConfig.ConsoleSize)`,
   616  		`	if err := validate.MinItems("HostConfig"+"."+"ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`,
   617  		`	if err := validate.MaxItems("HostConfig"+"."+"ConsoleSize", "body", iConsoleSizeSize, 2); err != nil {`,
   618  		`	for i := 0; i < len(m.HostConfig.ConsoleSize); i++ {`,
   619  		// do we need... ?
   620  		`		if swag.IsZero(m.HostConfig.ConsoleSize[i]) {`,
   621  		//`if err := validate.Required("HostConfig"+"."+"ConsoleSize"+"."+strconv.Itoa(i), "body", m.HostConfig.ConsoleSize[i]); err != nil {`,
   622  		`		if err := validate.MinimumInt("HostConfig"+"."+"ConsoleSize"+"."+strconv.Itoa(i), "body", int64(*m.HostConfig.ConsoleSize[i]), 0, false); err != nil {`,
   623  		// TODO: enum if anonymous allOf is not honored (missing func)
   624  		// => will do that with Enum refactoring
   625  		`	if err := m.validateIsolationEnum("HostConfig"+"."+"Isolation", "body", m.HostConfig.Isolation); err != nil {`,
   626  		`	if m.HostConfig.LogConfig != nil {`,
   627  		`		if err := m.HostConfig.LogConfig.Validate(formats); err != nil {`,
   628  		`			if ve, ok := err.(*errors.Validation); ok {`,
   629  		`				return ve.ValidateName("HostConfig" + "." + "LogConfig"`,
   630  		`	if err := validate.MinimumInt("HostConfig"+"."+"OomScoreAdj", "body", int64(m.HostConfig.OomScoreAdj), -1000, false); err != nil {`,
   631  		`	if err := validate.MaximumInt("HostConfig"+"."+"OomScoreAdj", "body", int64(m.HostConfig.OomScoreAdj), 1000, false); err != nil {`,
   632  		`	if m.HostConfig.RestartPolicy != nil {`,
   633  		`		if err := m.HostConfig.RestartPolicy.Validate(formats); err != nil {`,
   634  		`			if ve, ok := err.(*errors.Validation); ok {`,
   635  		`				return ve.ValidateName("HostConfig" + "." + "RestartPolicy"`,
   636  		`	if err := m.validateRichModeEnum("HostConfig"+"."+"RichMode", "body", m.HostConfig.RichMode); err != nil {`,
   637  		`	if err := validate.MinimumInt("HostConfig"+"."+"ShmSize", "body", int64(*m.HostConfig.ShmSize), 0, false); err != nil {`,
   638  		`	if err := validate.MinimumInt("HostConfig"+"."+"BlkioWeight", "body", int64(m.HostConfig.BlkioWeight), 0, false); err != nil {`,
   639  		`	if err := validate.MaximumInt("HostConfig"+"."+"BlkioWeight", "body", int64(m.HostConfig.BlkioWeight), 1000, false); err != nil {`,
   640  		`func (m *ContainerCreateConfig) validateNetworkingConfig(formats strfmt.Registry) error {`,
   641  		`	if swag.IsZero(m.NetworkingConfig) {`,
   642  		`	if m.NetworkingConfig != nil {`,
   643  		`		if err := m.NetworkingConfig.Validate(formats); err != nil {`,
   644  		`			if ve, ok := err.(*errors.Validation); ok {`,
   645  		`				return ve.ValidateName("NetworkingConfig"`,
   646  		`type ContainerCreateConfigAO1NetworkingConfig struct {`,
   647  		"	EndpointsConfig map[string]ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnon `json:\"EndpointsConfig,omitempty\"`",
   648  		`func (m *ContainerCreateConfigAO1NetworkingConfig) Validate(formats strfmt.Registry) error {`,
   649  		`	if err := m.validateEndpointsConfig(formats); err != nil {`,
   650  		`		return errors.CompositeValidationError(res...`,
   651  		`func (m *ContainerCreateConfigAO1NetworkingConfig) validateEndpointsConfig(formats strfmt.Registry) error {`,
   652  		`	if swag.IsZero(m.EndpointsConfig) {`,
   653  		`	for k := range m.EndpointsConfig {`,
   654  		`		if swag.IsZero(m.EndpointsConfig[k]) {`,
   655  		`		if val, ok := m.EndpointsConfig[k]; ok {`,
   656  		// NOTE: fixed incorrect IsNullable status in map element
   657  		//`			if val != nil {`,
   658  		`				if err := val.Validate(formats); err != nil {`,
   659  		`type ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnon struct {`,
   660  		"	Aliases []string `json:\"Aliases\"`",
   661  		"	DriverOpts map[string]string `json:\"DriverOpts,omitempty\"`",
   662  		"	EndpointID string `json:\"EndpointID,omitempty\"`",
   663  		"	Gateway string `json:\"Gateway,omitempty\"`",
   664  		"	GlobalIPV6Address string `json:\"GlobalIPv6Address,omitempty\"`",
   665  		"	GlobalIPV6PrefixLen int64 `json:\"GlobalIPv6PrefixLen,omitempty\"`",
   666  		"	IPAMConfig *ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnonIPAMConfig `json:\"IPAMConfig,omitempty\"`",
   667  		"	IPAddress string `json:\"IPAddress,omitempty\"`",
   668  		"	IPPrefixLen int64 `json:\"IPPrefixLen,omitempty\"`",
   669  		"	IPV6Gateway string `json:\"IPv6Gateway,omitempty\"`",
   670  		"	Links []string `json:\"Links\"`",
   671  		"	MacAddress string `json:\"MacAddress,omitempty\"`",
   672  		"	NetworkID string `json:\"NetworkID,omitempty\"`",
   673  		`func (m *ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnon) Validate(formats strfmt.Registry) error {`,
   674  		`	if err := m.validateIPAMConfig(formats); err != nil {`,
   675  		`		return errors.CompositeValidationError(res...`,
   676  		`func (m *ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnon) validateIPAMConfig(formats strfmt.Registry) error {`,
   677  		`	if swag.IsZero(m.IPAMConfig) {`,
   678  		`	if m.IPAMConfig != nil {`,
   679  		`		if err := m.IPAMConfig.Validate(formats); err != nil {`,
   680  		`			if ve, ok := err.(*errors.Validation); ok {`,
   681  		`				return ve.ValidateName("IPAMConfig"`,
   682  		`type ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnonIPAMConfig struct {`,
   683  		"	IPV4Address string `json:\"IPv4Address,omitempty\"`",
   684  		"	IPV6Address string `json:\"IPv6Address,omitempty\"`",
   685  		"	LinkLocalIps []string `json:\"LinkLocalIPs\"`",
   686  		`func (m *ContainerCreateConfigAO1NetworkingConfigEndpointsConfigAnonIPAMConfig) Validate(formats strfmt.Registry) error {`,
   687  		`		return errors.CompositeValidationError(res...`,
   688  		`type ContainerCreateConfigHostConfigAO0LogConfig struct {`,
   689  		"	Config map[string]string `json:\"Config,omitempty\"`",
   690  		"	Type string `json:\"Type,omitempty\"`",
   691  		`func (m *ContainerCreateConfigHostConfigAO0LogConfig) Validate(formats strfmt.Registry) error {`,
   692  		`	if err := m.validateType(formats); err != nil {`,
   693  		`		return errors.CompositeValidationError(res...`,
   694  		`var containerCreateConfigHostConfigAO0LogConfigTypeTypePropEnum []interface{`,
   695  		`	var res []string`,
   696  		"	if err := json.Unmarshal([]byte(`[\"json-file\",\"syslog\",\"journald\",\"gelf\",\"fluentd\",\"awslogs\",\"splunk\",\"etwlogs\",\"none\"]`), &res); err != nil {",
   697  		`	for _, v := range res {`,
   698  		`		containerCreateConfigHostConfigAO0LogConfigTypeTypePropEnum = append(containerCreateConfigHostConfigAO0LogConfigTypeTypePropEnum, v`,
   699  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeJSONFile string = "json-file"`,
   700  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeSyslog string = "syslog"`,
   701  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeJournald string = "journald"`,
   702  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeGelf string = "gelf"`,
   703  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeFluentd string = "fluentd"`,
   704  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeAwslogs string = "awslogs"`,
   705  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeSplunk string = "splunk"`,
   706  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeEtwlogs string = "etwlogs"`,
   707  		`	ContainerCreateConfigHostConfigAO0LogConfigTypeNone string = "none"`,
   708  		`func (m *ContainerCreateConfigHostConfigAO0LogConfig) validateTypeEnum(path, location string, value string) error {`,
   709  		`	if err := validate.Enum(path, location, value, containerCreateConfigHostConfigAO0LogConfigTypeTypePropEnum); err != nil {`,
   710  		`func (m *ContainerCreateConfigHostConfigAO0LogConfig) validateType(formats strfmt.Registry) error {`,
   711  		`	if swag.IsZero(m.Type) {`,
   712  		`	if err := m.validateTypeEnum("HostConfig"+"."+"LogConfig"+"."+"Type", "body", m.Type); err != nil {`,
   713  		`type ContainerCreateConfigHostConfigAO0RestartPolicy struct {`,
   714  		"	MaximumRetryCount int64 `json:\"MaximumRetryCount,omitempty\"`",
   715  		"	Name string `json:\"Name,omitempty\"`",
   716  		`func (m *ContainerCreateConfigHostConfigAO0RestartPolicy) Validate(formats strfmt.Registry) error {`,
   717  		`		return errors.CompositeValidationError(res...`,
   718  	}, []string{
   719  		// not expected
   720  		`			if val != nil {`,
   721  	},
   722  		// output in log
   723  		noLines,
   724  		noLines)
   725  
   726  	// load expectations for model: resources.go
   727  	flattenRun.AddExpectations("resources.go", []string{
   728  		`type Resources struct {`,
   729  		"	BlkioWeight uint16 `json:\"BlkioWeight,omitempty\"`",
   730  		"	CgroupParent string `json:\"CgroupParent,omitempty\"`",
   731  		"	CPUShares int64 `json:\"CpuShares,omitempty\"`",
   732  		"	Memory int64 `json:\"Memory,omitempty\"`",
   733  		`func (m *Resources) Validate(formats strfmt.Registry) error {`,
   734  		`	if err := m.validateBlkioWeight(formats); err != nil {`,
   735  		`		return errors.CompositeValidationError(res...`,
   736  		`func (m *Resources) validateBlkioWeight(formats strfmt.Registry) error {`,
   737  		`	if swag.IsZero(m.BlkioWeight) {`,
   738  		`	if err := validate.MinimumInt("BlkioWeight", "body", int64(m.BlkioWeight), 0, false); err != nil {`,
   739  		`	if err := validate.MaximumInt("BlkioWeight", "body", int64(m.BlkioWeight), 1000, false); err != nil {`,
   740  	},
   741  		// not expected
   742  		todo,
   743  		// output in log
   744  		noLines,
   745  		noLines)
   746  
   747  	expandRun.AddExpectations("resources.go", flattenRun.ExpectedFor("Resources").ExpectedLines, todo, noLines, noLines)
   748  
   749  	// load expectations for model: networking_config.go
   750  	flattenRun.AddExpectations("networking_config.go", []string{
   751  		`type NetworkingConfig struct {`,
   752  		// maps are now simple types
   753  		//"	EndpointsConfig NetworkingConfigEndpointsConfig `json:\"EndpointsConfig,omitempty\"`",
   754  		"	EndpointsConfig map[string]*EndpointSettings `json:\"EndpointsConfig,omitempty\"`",
   755  		`func (m *NetworkingConfig) Validate(formats strfmt.Registry) error {`,
   756  		`	if err := m.validateEndpointsConfig(formats); err != nil {`,
   757  		`		return errors.CompositeValidationError(res...`,
   758  		`func (m *NetworkingConfig) validateEndpointsConfig(formats strfmt.Registry) error {`,
   759  		`	if swag.IsZero(m.EndpointsConfig) {`,
   760  		//`	if err := m.EndpointsConfig.Validate(formats); err != nil {`,
   761  		`       for k := range m.EndpointsConfig {`,
   762  		`	if err := validate.Required("EndpointsConfig"+"."+k, "body", m.EndpointsConfig[k]); err != nil {`,
   763  		`       	if val, ok := m.EndpointsConfig[k]; ok {`,
   764  		`          		if err := val.Validate(formats); err != nil {`,
   765  	},
   766  		// not expected
   767  		todo,
   768  		// output in log
   769  		noLines,
   770  		noLines)
   771  
   772  	// NOTE(fredbi): maps are now simple types: this definition disappears
   773  
   774  	// load expectations for model: endpoint_settings.go
   775  	flattenRun.AddExpectations("endpoint_settings.go", []string{
   776  		`type EndpointSettings struct {`,
   777  		"	Aliases []string `json:\"Aliases\"`",
   778  		"	DriverOpts map[string]string `json:\"DriverOpts,omitempty\"`",
   779  		"	EndpointID string `json:\"EndpointID,omitempty\"`",
   780  		"	Gateway string `json:\"Gateway,omitempty\"`",
   781  		"	GlobalIPV6Address string `json:\"GlobalIPv6Address,omitempty\"`",
   782  		"	GlobalIPV6PrefixLen int64 `json:\"GlobalIPv6PrefixLen,omitempty\"`",
   783  		"	IPAMConfig *EndpointIPAMConfig `json:\"IPAMConfig,omitempty\"`",
   784  		"	IPAddress string `json:\"IPAddress,omitempty\"`",
   785  		"	IPPrefixLen int64 `json:\"IPPrefixLen,omitempty\"`",
   786  		"	IPV6Gateway string `json:\"IPv6Gateway,omitempty\"`",
   787  		"	Links []string `json:\"Links\"`",
   788  		"	MacAddress string `json:\"MacAddress,omitempty\"`",
   789  		"	NetworkID string `json:\"NetworkID,omitempty\"`",
   790  		`func (m *EndpointSettings) Validate(formats strfmt.Registry) error {`,
   791  		`	if err := m.validateIPAMConfig(formats); err != nil {`,
   792  		`		return errors.CompositeValidationError(res...`,
   793  		`func (m *EndpointSettings) validateIPAMConfig(formats strfmt.Registry) error {`,
   794  		`	if swag.IsZero(m.IPAMConfig) {`,
   795  		`	if m.IPAMConfig != nil {`,
   796  		`		if err := m.IPAMConfig.Validate(formats); err != nil {`,
   797  		`			if ve, ok := err.(*errors.Validation); ok {`,
   798  		`				return ve.ValidateName("IPAMConfig"`,
   799  	},
   800  		// not expected
   801  		todo,
   802  		// output in log
   803  		noLines,
   804  		noLines)
   805  
   806  	expandRun.AddExpectations("endpoint_settings.go", []string{
   807  		`type EndpointSettings struct {`,
   808  		"	Aliases []string `json:\"Aliases\"`",
   809  		"	DriverOpts map[string]string `json:\"DriverOpts,omitempty\"`",
   810  		"	EndpointID string `json:\"EndpointID,omitempty\"`",
   811  		"	Gateway string `json:\"Gateway,omitempty\"`",
   812  		"	GlobalIPV6Address string `json:\"GlobalIPv6Address,omitempty\"`",
   813  		"	GlobalIPV6PrefixLen int64 `json:\"GlobalIPv6PrefixLen,omitempty\"`",
   814  		"	IPAMConfig *EndpointSettingsIPAMConfig `json:\"IPAMConfig,omitempty\"`",
   815  		"	IPAddress string `json:\"IPAddress,omitempty\"`",
   816  		"	IPPrefixLen int64 `json:\"IPPrefixLen,omitempty\"`",
   817  		"	IPV6Gateway string `json:\"IPv6Gateway,omitempty\"`",
   818  		"	Links []string `json:\"Links\"`",
   819  		"	MacAddress string `json:\"MacAddress,omitempty\"`",
   820  		"	NetworkID string `json:\"NetworkID,omitempty\"`",
   821  		`func (m *EndpointSettings) Validate(formats strfmt.Registry) error {`,
   822  		`	if err := m.validateIPAMConfig(formats); err != nil {`,
   823  		`		return errors.CompositeValidationError(res...`,
   824  		`func (m *EndpointSettings) validateIPAMConfig(formats strfmt.Registry) error {`,
   825  		`	if swag.IsZero(m.IPAMConfig) {`,
   826  		`	if m.IPAMConfig != nil {`,
   827  		`		if err := m.IPAMConfig.Validate(formats); err != nil {`,
   828  		`			if ve, ok := err.(*errors.Validation); ok {`,
   829  		`				return ve.ValidateName("IPAMConfig"`,
   830  		`type EndpointSettingsIPAMConfig struct {`,
   831  		"	IPV4Address string `json:\"IPv4Address,omitempty\"`",
   832  		"	IPV6Address string `json:\"IPv6Address,omitempty\"`",
   833  		"	LinkLocalIps []string `json:\"LinkLocalIPs\"`",
   834  		`func (m *EndpointSettingsIPAMConfig) Validate(formats strfmt.Registry) error {`,
   835  		`		return errors.CompositeValidationError(res...`,
   836  	},
   837  		// not expected
   838  		noLines,
   839  		// output in log
   840  		noLines,
   841  		noLines)
   842  
   843  	// load expectations for model: networking_config_endpoints_config.go
   844  	// NOTE(fredbi): maps are now simple types - this definition disappears
   845  }
   846  func initFixtureSimpleAllOf() {
   847  	// testing ../fixtures/bugs/1487/fixture-simple-allOf.yaml with flatten and expand (--skip-flatten)
   848  
   849  	/* we test various composition combinations, including nested, and nested isolated with a properties (e.g. issue #1479) */
   850  
   851  	f := newModelFixture("../fixtures/bugs/1487/fixture-simple-allOf.yaml", "fixture for nested allOf with ref")
   852  	flattenRun := f.AddRun(false)
   853  	expandRun := f.AddRun(true)
   854  
   855  	// load expectations for model: not_really_composed_thing_all_of0.go
   856  	flattenRun.AddExpectations("not_really_composed_thing_all_of0.go", []string{
   857  		`type NotReallyComposedThingAllOf0 struct {`,
   858  		"	Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
   859  		`func (m *NotReallyComposedThingAllOf0) Validate(formats strfmt.Registry) error {`,
   860  		`	if err := m.validateProp0(formats); err != nil {`,
   861  		`		return errors.CompositeValidationError(res...`,
   862  		`func (m *NotReallyComposedThingAllOf0) validateProp0(formats strfmt.Registry) error {`,
   863  		`	if swag.IsZero(m.Prop0) {`,
   864  		`	if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`,
   865  	},
   866  		// not expected
   867  		todo,
   868  		// output in log
   869  		noLines,
   870  		noLines)
   871  
   872  	// load expectations for model: not_really_composed_thing.go
   873  	expandRun.AddExpectations("not_really_composed_thing.go", []string{
   874  		`type NotReallyComposedThing struct {`,
   875  		"	Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
   876  		`func (m *NotReallyComposedThing) UnmarshalJSON(raw []byte) error {`,
   877  		`	var dataAO0 struct {`,
   878  		"		Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
   879  		`	if err := swag.ReadJSON(raw, &dataAO0); err != nil {`,
   880  		`	m.Prop0 = dataAO0.Prop0`,
   881  		`func (m NotReallyComposedThing) MarshalJSON() ([]byte, error) {`,
   882  		`	_parts := make([][]byte, 0, 1`,
   883  		`	var dataAO0 struct {`,
   884  		"		Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
   885  		`	dataAO0.Prop0 = m.Prop0`,
   886  		`	jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`,
   887  		`	if errAO0 != nil {`,
   888  		`		return nil, errAO0`,
   889  		`	_parts = append(_parts, jsonDataAO0`,
   890  		`	return swag.ConcatJSON(_parts...), nil`,
   891  		`func (m *NotReallyComposedThing) Validate(formats strfmt.Registry) error {`,
   892  		`	if err := m.validateProp0(formats); err != nil {`,
   893  		`		return errors.CompositeValidationError(res...`,
   894  		`func (m *NotReallyComposedThing) validateProp0(formats strfmt.Registry) error {`,
   895  		`	if swag.IsZero(m.Prop0) {`,
   896  		`	if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`,
   897  		`func (m *NotReallyComposedThing) MarshalBinary() ([]byte, error) {`,
   898  		`	if m == nil {`,
   899  		`		return nil, nil`,
   900  		`	return swag.WriteJSON(m`,
   901  		`func (m *NotReallyComposedThing) UnmarshalBinary(b []byte) error {`,
   902  		`	var res NotReallyComposedThing`,
   903  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
   904  		`	*m = res`,
   905  	},
   906  		// not expected
   907  		noLines,
   908  		// output in log
   909  		noLines,
   910  		noLines)
   911  
   912  	// load expectations for model: simple_nested_object_all_of1.go
   913  	flattenRun.AddExpectations("simple_nested_object_all_of1.go", []string{
   914  		`type SimpleNestedObjectAllOf1 struct {`,
   915  		"	Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
   916  		`func (m *SimpleNestedObjectAllOf1) Validate(formats strfmt.Registry) error {`,
   917  		`	if err := m.validateProp3(formats); err != nil {`,
   918  		`		return errors.CompositeValidationError(res...`,
   919  		`func (m *SimpleNestedObjectAllOf1) validateProp3(formats strfmt.Registry) error {`,
   920  		`	if swag.IsZero(m.Prop3) {`,
   921  		`	if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`,
   922  	},
   923  		// not expected
   924  		todo,
   925  		// output in log
   926  		noLines,
   927  		noLines)
   928  
   929  	// load expectations for model: break_nested_object_all_of1_prop7.go
   930  	flattenRun.AddExpectations("break_nested_object_all_of1_prop7.go", []string{
   931  		`type BreakNestedObjectAllOf1Prop7 struct {`,
   932  		`	BreakNestedObjectAllOf1Prop7AllOf0`,
   933  		`	BreakNestedObjectAllOf1Prop7AllOf1`,
   934  		`func (m *BreakNestedObjectAllOf1Prop7) Validate(formats strfmt.Registry) error {`,
   935  		`	if err := m.BreakNestedObjectAllOf1Prop7AllOf0.Validate(formats); err != nil {`,
   936  		`	if err := m.BreakNestedObjectAllOf1Prop7AllOf1.Validate(formats); err != nil {`,
   937  		`		return errors.CompositeValidationError(res...`,
   938  	},
   939  		// not expected
   940  		todo,
   941  		// output in log
   942  		noLines,
   943  		noLines)
   944  
   945  	// load expectations for model: composed_thing.go
   946  	flattenRun.AddExpectations("composed_thing.go", []string{
   947  		`type ComposedThing struct {`,
   948  		`	ComposedThingAllOf0`,
   949  		`	ComposedThingAllOf1`,
   950  		`func (m *ComposedThing) Validate(formats strfmt.Registry) error {`,
   951  		`	if err := m.ComposedThingAllOf0.Validate(formats); err != nil {`,
   952  		`	if err := m.ComposedThingAllOf1.Validate(formats); err != nil {`,
   953  		`		return errors.CompositeValidationError(res...`,
   954  	},
   955  		// not expected
   956  		todo,
   957  		// output in log
   958  		noLines,
   959  		noLines)
   960  
   961  	// load expectations for model: composed_thing.go
   962  	expandRun.AddExpectations("composed_thing.go", []string{
   963  		`type ComposedThing struct {`,
   964  		"	Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
   965  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
   966  		`func (m *ComposedThing) UnmarshalJSON(raw []byte) error {`,
   967  		`	var dataAO0 struct {`,
   968  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
   969  		`	if err := swag.ReadJSON(raw, &dataAO0); err != nil {`,
   970  		`	m.Prop1 = dataAO0.Prop1`,
   971  		`	var dataAO1 struct {`,
   972  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
   973  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
   974  		`	m.Prop2 = dataAO1.Prop2`,
   975  		`func (m ComposedThing) MarshalJSON() ([]byte, error) {`,
   976  		`	_parts := make([][]byte, 0, 2`,
   977  		`	var dataAO0 struct {`,
   978  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
   979  		`	dataAO0.Prop1 = m.Prop1`,
   980  		`	jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`,
   981  		`	if errAO0 != nil {`,
   982  		`		return nil, errAO0`,
   983  		`	_parts = append(_parts, jsonDataAO0`,
   984  		`	var dataAO1 struct {`,
   985  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
   986  		`	dataAO1.Prop2 = m.Prop2`,
   987  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
   988  		`	if errAO1 != nil {`,
   989  		`		return nil, errAO1`,
   990  		`	_parts = append(_parts, jsonDataAO1`,
   991  		`	return swag.ConcatJSON(_parts...), nil`,
   992  		`func (m *ComposedThing) Validate(formats strfmt.Registry) error {`,
   993  		`	if err := m.validateProp1(formats); err != nil {`,
   994  		`	if err := m.validateProp2(formats); err != nil {`,
   995  		`		return errors.CompositeValidationError(res...`,
   996  		`func (m *ComposedThing) validateProp1(formats strfmt.Registry) error {`,
   997  		`	if swag.IsZero(m.Prop1) {`,
   998  		`	if err := validate.FormatOf("prop1", "body", "uuid", m.Prop1.String(), formats); err != nil {`,
   999  		`func (m *ComposedThing) validateProp2(formats strfmt.Registry) error {`,
  1000  		`	if swag.IsZero(m.Prop2) {`,
  1001  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  1002  		`func (m *ComposedThing) MarshalBinary() ([]byte, error) {`,
  1003  		`	if m == nil {`,
  1004  		`		return nil, nil`,
  1005  		`	return swag.WriteJSON(m`,
  1006  		`func (m *ComposedThing) UnmarshalBinary(b []byte) error {`,
  1007  		`	var res ComposedThing`,
  1008  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1009  		`	*m = res`,
  1010  	},
  1011  		// not expected
  1012  		noLines,
  1013  		// output in log
  1014  		noLines,
  1015  		noLines)
  1016  
  1017  	// load expectations for model: break_nested_object.go
  1018  	flattenRun.AddExpectations("break_nested_object.go", []string{
  1019  		`type BreakNestedObject struct {`,
  1020  		`	SimpleNestedObject`,
  1021  		`	BreakNestedObjectAllOf1`,
  1022  		`func (m *BreakNestedObject) Validate(formats strfmt.Registry) error {`,
  1023  		`	if err := m.SimpleNestedObject.Validate(formats); err != nil {`,
  1024  		`	if err := m.BreakNestedObjectAllOf1.Validate(formats); err != nil {`,
  1025  		`		return errors.CompositeValidationError(res...`,
  1026  	},
  1027  		// not expected
  1028  		todo,
  1029  		// output in log
  1030  		noLines,
  1031  		noLines)
  1032  
  1033  	// load expectations for model: break_nested_object.go
  1034  	expandRun.AddExpectations("break_nested_object.go", []string{
  1035  		`type BreakNestedObject struct {`,
  1036  		`	BreakNestedObjectAllOf0`,
  1037  		"	Prop6 strfmt.UUID `json:\"prop6,omitempty\"`",
  1038  		`	Prop7 struct {`,
  1039  		"		Prop8 int64 `json:\"prop8,omitempty\"`",
  1040  		"		Prop9 int64 `json:\"prop9,omitempty\"`",
  1041  		"	} `json:\"prop7,omitempty\"`",
  1042  		`func (m *BreakNestedObject) UnmarshalJSON(raw []byte) error {`,
  1043  		`	var aO0 BreakNestedObjectAllOf0`,
  1044  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  1045  		`	m.BreakNestedObjectAllOf0 = aO0`,
  1046  		`	var dataAO1 struct {`,
  1047  		"		Prop6 strfmt.UUID `json:\"prop6,omitempty\"`",
  1048  		`		Prop7 struct {`,
  1049  		"			Prop8 int64 `json:\"prop8,omitempty\"`",
  1050  		"			Prop9 int64 `json:\"prop9,omitempty\"`",
  1051  		"		} `json:\"prop7,omitempty\"`",
  1052  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  1053  		`	m.Prop6 = dataAO1.Prop6`,
  1054  		`	m.Prop7 = dataAO1.Prop7`,
  1055  		`func (m BreakNestedObject) MarshalJSON() ([]byte, error) {`,
  1056  		`	_parts := make([][]byte, 0, 2`,
  1057  		`	aO0, err := swag.WriteJSON(m.BreakNestedObjectAllOf0`,
  1058  		`	if err != nil {`,
  1059  		`		return nil, err`,
  1060  		`	_parts = append(_parts, aO0`,
  1061  		`	var dataAO1 struct {`,
  1062  		"		Prop6 strfmt.UUID `json:\"prop6,omitempty\"`",
  1063  		`		Prop7 struct {`,
  1064  		"			Prop8 int64 `json:\"prop8,omitempty\"`",
  1065  		"			Prop9 int64 `json:\"prop9,omitempty\"`",
  1066  		"		} `json:\"prop7,omitempty\"`",
  1067  		`	dataAO1.Prop6 = m.Prop6`,
  1068  		`	dataAO1.Prop7 = m.Prop7`,
  1069  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  1070  		`	if errAO1 != nil {`,
  1071  		`		return nil, errAO1`,
  1072  		`	_parts = append(_parts, jsonDataAO1`,
  1073  		`	return swag.ConcatJSON(_parts...), nil`,
  1074  		`func (m *BreakNestedObject) Validate(formats strfmt.Registry) error {`,
  1075  		`	if err := m.BreakNestedObjectAllOf0.Validate(formats); err != nil {`,
  1076  		`	if err := m.validateProp6(formats); err != nil {`,
  1077  		`	if err := m.validateProp7(formats); err != nil {`,
  1078  		`		return errors.CompositeValidationError(res...`,
  1079  		`func (m *BreakNestedObject) validateProp6(formats strfmt.Registry) error {`,
  1080  		`	if swag.IsZero(m.Prop6) {`,
  1081  		`	if err := validate.FormatOf("prop6", "body", "uuid", m.Prop6.String(), formats); err != nil {`,
  1082  		`func (m *BreakNestedObject) validateProp7(formats strfmt.Registry) error {`,
  1083  		`	if swag.IsZero(m.Prop7) {`,
  1084  		`	if err := validate.MinimumInt("prop7"+"."+"prop8", "body", int64(m.Prop7.Prop8), 12, false); err != nil {`,
  1085  		`	if err := validate.MaximumInt("prop7"+"."+"prop9", "body", int64(m.Prop7.Prop9), 12, false); err != nil {`,
  1086  		`func (m *BreakNestedObject) MarshalBinary() ([]byte, error) {`,
  1087  		`	if m == nil {`,
  1088  		`		return nil, nil`,
  1089  		`	return swag.WriteJSON(m`,
  1090  		`func (m *BreakNestedObject) UnmarshalBinary(b []byte) error {`,
  1091  		`	var res BreakNestedObject`,
  1092  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1093  		`	*m = res`,
  1094  		`type BreakNestedObjectAllOf0 struct {`,
  1095  		`	BreakNestedObjectAllOf0AllOf0`,
  1096  		"	Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1097  		`func (m *BreakNestedObjectAllOf0) UnmarshalJSON(raw []byte) error {`,
  1098  		`	var aO0 BreakNestedObjectAllOf0AllOf0`,
  1099  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  1100  		`	m.BreakNestedObjectAllOf0AllOf0 = aO0`,
  1101  		`	var dataAO1 struct {`,
  1102  		"		Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1103  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  1104  		`	m.Prop3 = dataAO1.Prop3`,
  1105  		`func (m BreakNestedObjectAllOf0) MarshalJSON() ([]byte, error) {`,
  1106  		`	_parts := make([][]byte, 0, 2`,
  1107  		`	aO0, err := swag.WriteJSON(m.BreakNestedObjectAllOf0AllOf0`,
  1108  		`	if err != nil {`,
  1109  		`		return nil, err`,
  1110  		`	_parts = append(_parts, aO0`,
  1111  		`	var dataAO1 struct {`,
  1112  		"		Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1113  		`	dataAO1.Prop3 = m.Prop3`,
  1114  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  1115  		`	if errAO1 != nil {`,
  1116  		`		return nil, errAO1`,
  1117  		`	_parts = append(_parts, jsonDataAO1`,
  1118  		`	return swag.ConcatJSON(_parts...), nil`,
  1119  		`func (m *BreakNestedObjectAllOf0) Validate(formats strfmt.Registry) error {`,
  1120  		`	if err := m.BreakNestedObjectAllOf0AllOf0.Validate(formats); err != nil {`,
  1121  		`	if err := m.validateProp3(formats); err != nil {`,
  1122  		`		return errors.CompositeValidationError(res...`,
  1123  		`func (m *BreakNestedObjectAllOf0) validateProp3(formats strfmt.Registry) error {`,
  1124  		`	if swag.IsZero(m.Prop3) {`,
  1125  		`	if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`,
  1126  		`func (m *BreakNestedObjectAllOf0) MarshalBinary() ([]byte, error) {`,
  1127  		`	if m == nil {`,
  1128  		`		return nil, nil`,
  1129  		`	return swag.WriteJSON(m`,
  1130  		`func (m *BreakNestedObjectAllOf0) UnmarshalBinary(b []byte) error {`,
  1131  		`	var res BreakNestedObjectAllOf0`,
  1132  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1133  		`	*m = res`,
  1134  		`type BreakNestedObjectAllOf0AllOf0 struct {`,
  1135  		"	Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1136  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1137  		`func (m *BreakNestedObjectAllOf0AllOf0) UnmarshalJSON(raw []byte) error {`,
  1138  		`	var dataAO0 struct {`,
  1139  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1140  		`	if err := swag.ReadJSON(raw, &dataAO0); err != nil {`,
  1141  		`	m.Prop1 = dataAO0.Prop1`,
  1142  		`	var dataAO1 struct {`,
  1143  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1144  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  1145  		`	m.Prop2 = dataAO1.Prop2`,
  1146  		`func (m BreakNestedObjectAllOf0AllOf0) MarshalJSON() ([]byte, error) {`,
  1147  		`	_parts := make([][]byte, 0, 2`,
  1148  		`	var dataAO0 struct {`,
  1149  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1150  		`	dataAO0.Prop1 = m.Prop1`,
  1151  		`	jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`,
  1152  		`	if errAO0 != nil {`,
  1153  		`		return nil, errAO0`,
  1154  		`	_parts = append(_parts, jsonDataAO0`,
  1155  		`	var dataAO1 struct {`,
  1156  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1157  		`	dataAO1.Prop2 = m.Prop2`,
  1158  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  1159  		`	if errAO1 != nil {`,
  1160  		`		return nil, errAO1`,
  1161  		`	_parts = append(_parts, jsonDataAO1`,
  1162  		`	return swag.ConcatJSON(_parts...), nil`,
  1163  		`func (m *BreakNestedObjectAllOf0AllOf0) Validate(formats strfmt.Registry) error {`,
  1164  		`	if err := m.validateProp1(formats); err != nil {`,
  1165  		`	if err := m.validateProp2(formats); err != nil {`,
  1166  		`		return errors.CompositeValidationError(res...`,
  1167  		`func (m *BreakNestedObjectAllOf0AllOf0) validateProp1(formats strfmt.Registry) error {`,
  1168  		`	if swag.IsZero(m.Prop1) {`,
  1169  		`	if err := validate.FormatOf("prop1", "body", "uuid", m.Prop1.String(), formats); err != nil {`,
  1170  		`func (m *BreakNestedObjectAllOf0AllOf0) validateProp2(formats strfmt.Registry) error {`,
  1171  		`	if swag.IsZero(m.Prop2) {`,
  1172  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  1173  		`func (m *BreakNestedObjectAllOf0AllOf0) MarshalBinary() ([]byte, error) {`,
  1174  		`	if m == nil {`,
  1175  		`		return nil, nil`,
  1176  		`	return swag.WriteJSON(m`,
  1177  		`func (m *BreakNestedObjectAllOf0AllOf0) UnmarshalBinary(b []byte) error {`,
  1178  		`	var res BreakNestedObjectAllOf0AllOf0`,
  1179  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1180  		`	*m = res`,
  1181  	},
  1182  		// not expected
  1183  		noLines,
  1184  		// output in log
  1185  		noLines,
  1186  		noLines)
  1187  
  1188  	// load expectations for model: deep_nested_object_all_of1_all_of1.go
  1189  	flattenRun.AddExpectations("deep_nested_object_all_of1_all_of1.go", []string{
  1190  		`type DeepNestedObjectAllOf1AllOf1 struct {`,
  1191  		"	Prop5 strfmt.Date `json:\"prop5,omitempty\"`",
  1192  		`func (m *DeepNestedObjectAllOf1AllOf1) Validate(formats strfmt.Registry) error {`,
  1193  		`	if err := m.validateProp5(formats); err != nil {`,
  1194  		`		return errors.CompositeValidationError(res...`,
  1195  		`func (m *DeepNestedObjectAllOf1AllOf1) validateProp5(formats strfmt.Registry) error {`,
  1196  		`	if swag.IsZero(m.Prop5) {`,
  1197  		`	if err := validate.FormatOf("prop5", "body", "date", m.Prop5.String(), formats); err != nil {`,
  1198  	},
  1199  		// not expected
  1200  		todo,
  1201  		// output in log
  1202  		noLines,
  1203  		noLines)
  1204  
  1205  	// load expectations for model: deep_nested_object.go
  1206  	flattenRun.AddExpectations("deep_nested_object.go", []string{
  1207  		`type DeepNestedObject struct {`,
  1208  		`	SimpleNestedObject`,
  1209  		`	DeepNestedObjectAllOf1`,
  1210  		`func (m *DeepNestedObject) Validate(formats strfmt.Registry) error {`,
  1211  		`	if err := m.SimpleNestedObject.Validate(formats); err != nil {`,
  1212  		`	if err := m.DeepNestedObjectAllOf1.Validate(formats); err != nil {`,
  1213  		`		return errors.CompositeValidationError(res...`,
  1214  	},
  1215  		// not expected
  1216  		todo,
  1217  		// output in log
  1218  		noLines,
  1219  		noLines)
  1220  
  1221  	// load expectations for model: deep_nested_object.go
  1222  	expandRun.AddExpectations("deep_nested_object.go", []string{
  1223  		`type DeepNestedObject struct {`,
  1224  		`	DeepNestedObjectAllOf0`,
  1225  		`	DeepNestedObjectAllOf1`,
  1226  		`func (m *DeepNestedObject) UnmarshalJSON(raw []byte) error {`,
  1227  		`	var aO0 DeepNestedObjectAllOf0`,
  1228  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  1229  		`	m.DeepNestedObjectAllOf0 = aO0`,
  1230  		`	var aO1 DeepNestedObjectAllOf1`,
  1231  		`	if err := swag.ReadJSON(raw, &aO1); err != nil {`,
  1232  		`	m.DeepNestedObjectAllOf1 = aO1`,
  1233  		`func (m DeepNestedObject) MarshalJSON() ([]byte, error) {`,
  1234  		`	_parts := make([][]byte, 0, 2`,
  1235  		`	aO0, err := swag.WriteJSON(m.DeepNestedObjectAllOf0`,
  1236  		`	if err != nil {`,
  1237  		`		return nil, err`,
  1238  		`	_parts = append(_parts, aO0`,
  1239  		`	aO1, err := swag.WriteJSON(m.DeepNestedObjectAllOf1`,
  1240  		`	if err != nil {`,
  1241  		`		return nil, err`,
  1242  		`	_parts = append(_parts, aO1`,
  1243  		`	return swag.ConcatJSON(_parts...), nil`,
  1244  		`func (m *DeepNestedObject) Validate(formats strfmt.Registry) error {`,
  1245  		`	if err := m.DeepNestedObjectAllOf0.Validate(formats); err != nil {`,
  1246  		`	if err := m.DeepNestedObjectAllOf1.Validate(formats); err != nil {`,
  1247  		`		return errors.CompositeValidationError(res...`,
  1248  		`func (m *DeepNestedObject) MarshalBinary() ([]byte, error) {`,
  1249  		`	if m == nil {`,
  1250  		`		return nil, nil`,
  1251  		`	return swag.WriteJSON(m`,
  1252  		`func (m *DeepNestedObject) UnmarshalBinary(b []byte) error {`,
  1253  		`	var res DeepNestedObject`,
  1254  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1255  		`	*m = res`,
  1256  		`type DeepNestedObjectAllOf0 struct {`,
  1257  		`	DeepNestedObjectAllOf0AllOf0`,
  1258  		"	Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1259  		`func (m *DeepNestedObjectAllOf0) UnmarshalJSON(raw []byte) error {`,
  1260  		`	var aO0 DeepNestedObjectAllOf0AllOf0`,
  1261  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  1262  		`	m.DeepNestedObjectAllOf0AllOf0 = aO0`,
  1263  		`	var dataAO1 struct {`,
  1264  		"		Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1265  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  1266  		`	m.Prop3 = dataAO1.Prop3`,
  1267  		`func (m DeepNestedObjectAllOf0) MarshalJSON() ([]byte, error) {`,
  1268  		`	_parts := make([][]byte, 0, 2`,
  1269  		`	aO0, err := swag.WriteJSON(m.DeepNestedObjectAllOf0AllOf0`,
  1270  		`	if err != nil {`,
  1271  		`		return nil, err`,
  1272  		`	_parts = append(_parts, aO0`,
  1273  		`	var dataAO1 struct {`,
  1274  		"		Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1275  		`	dataAO1.Prop3 = m.Prop3`,
  1276  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  1277  		`	if errAO1 != nil {`,
  1278  		`		return nil, errAO1`,
  1279  		`	_parts = append(_parts, jsonDataAO1`,
  1280  		`	return swag.ConcatJSON(_parts...), nil`,
  1281  		`func (m *DeepNestedObjectAllOf0) Validate(formats strfmt.Registry) error {`,
  1282  		`	if err := m.DeepNestedObjectAllOf0AllOf0.Validate(formats); err != nil {`,
  1283  		`	if err := m.validateProp3(formats); err != nil {`,
  1284  		`		return errors.CompositeValidationError(res...`,
  1285  		`func (m *DeepNestedObjectAllOf0) validateProp3(formats strfmt.Registry) error {`,
  1286  		`	if swag.IsZero(m.Prop3) {`,
  1287  		`	if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`,
  1288  		`func (m *DeepNestedObjectAllOf0) MarshalBinary() ([]byte, error) {`,
  1289  		`	if m == nil {`,
  1290  		`		return nil, nil`,
  1291  		`	return swag.WriteJSON(m`,
  1292  		`func (m *DeepNestedObjectAllOf0) UnmarshalBinary(b []byte) error {`,
  1293  		`	var res DeepNestedObjectAllOf0`,
  1294  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1295  		`	*m = res`,
  1296  		`type DeepNestedObjectAllOf0AllOf0 struct {`,
  1297  		"	Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1298  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1299  		`func (m *DeepNestedObjectAllOf0AllOf0) UnmarshalJSON(raw []byte) error {`,
  1300  		`	var dataAO0 struct {`,
  1301  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1302  		`	if err := swag.ReadJSON(raw, &dataAO0); err != nil {`,
  1303  		`	m.Prop1 = dataAO0.Prop1`,
  1304  		`	var dataAO1 struct {`,
  1305  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1306  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  1307  		`	m.Prop2 = dataAO1.Prop2`,
  1308  		`func (m DeepNestedObjectAllOf0AllOf0) MarshalJSON() ([]byte, error) {`,
  1309  		`	_parts := make([][]byte, 0, 2`,
  1310  		`	var dataAO0 struct {`,
  1311  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1312  		`	dataAO0.Prop1 = m.Prop1`,
  1313  		`	jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`,
  1314  		`	if errAO0 != nil {`,
  1315  		`		return nil, errAO0`,
  1316  		`	_parts = append(_parts, jsonDataAO0`,
  1317  		`	var dataAO1 struct {`,
  1318  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1319  		`	dataAO1.Prop2 = m.Prop2`,
  1320  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  1321  		`	if errAO1 != nil {`,
  1322  		`		return nil, errAO1`,
  1323  		`	_parts = append(_parts, jsonDataAO1`,
  1324  		`	return swag.ConcatJSON(_parts...), nil`,
  1325  		`func (m *DeepNestedObjectAllOf0AllOf0) Validate(formats strfmt.Registry) error {`,
  1326  		`	if err := m.validateProp1(formats); err != nil {`,
  1327  		`	if err := m.validateProp2(formats); err != nil {`,
  1328  		`		return errors.CompositeValidationError(res...`,
  1329  		`func (m *DeepNestedObjectAllOf0AllOf0) validateProp1(formats strfmt.Registry) error {`,
  1330  		`	if swag.IsZero(m.Prop1) {`,
  1331  		`	if err := validate.FormatOf("prop1", "body", "uuid", m.Prop1.String(), formats); err != nil {`,
  1332  		`func (m *DeepNestedObjectAllOf0AllOf0) validateProp2(formats strfmt.Registry) error {`,
  1333  		`	if swag.IsZero(m.Prop2) {`,
  1334  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  1335  		`func (m *DeepNestedObjectAllOf0AllOf0) MarshalBinary() ([]byte, error) {`,
  1336  		`	if m == nil {`,
  1337  		`		return nil, nil`,
  1338  		`	return swag.WriteJSON(m`,
  1339  		`func (m *DeepNestedObjectAllOf0AllOf0) UnmarshalBinary(b []byte) error {`,
  1340  		`	var res DeepNestedObjectAllOf0AllOf0`,
  1341  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1342  		`	*m = res`,
  1343  		`type DeepNestedObjectAllOf1 struct {`,
  1344  		"	Prop4 strfmt.UUID `json:\"prop4,omitempty\"`",
  1345  		"	Prop5 strfmt.Date `json:\"prop5,omitempty\"`",
  1346  		`func (m *DeepNestedObjectAllOf1) UnmarshalJSON(raw []byte) error {`,
  1347  		`	var dataAO0 struct {`,
  1348  		"		Prop4 strfmt.UUID `json:\"prop4,omitempty\"`",
  1349  		`	if err := swag.ReadJSON(raw, &dataAO0); err != nil {`,
  1350  		`	m.Prop4 = dataAO0.Prop4`,
  1351  		`	var dataAO1 struct {`,
  1352  		"		Prop5 strfmt.Date `json:\"prop5,omitempty\"`",
  1353  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  1354  		`	m.Prop5 = dataAO1.Prop5`,
  1355  		`func (m DeepNestedObjectAllOf1) MarshalJSON() ([]byte, error) {`,
  1356  		`	_parts := make([][]byte, 0, 2`,
  1357  		`	var dataAO0 struct {`,
  1358  		"		Prop4 strfmt.UUID `json:\"prop4,omitempty\"`",
  1359  		`	dataAO0.Prop4 = m.Prop4`,
  1360  		`	jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`,
  1361  		`	if errAO0 != nil {`,
  1362  		`		return nil, errAO0`,
  1363  		`	_parts = append(_parts, jsonDataAO0`,
  1364  		`	var dataAO1 struct {`,
  1365  		"		Prop5 strfmt.Date `json:\"prop5,omitempty\"`",
  1366  		`	dataAO1.Prop5 = m.Prop5`,
  1367  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  1368  		`	if errAO1 != nil {`,
  1369  		`		return nil, errAO1`,
  1370  		`	_parts = append(_parts, jsonDataAO1`,
  1371  		`	return swag.ConcatJSON(_parts...), nil`,
  1372  		`func (m *DeepNestedObjectAllOf1) Validate(formats strfmt.Registry) error {`,
  1373  		`	if err := m.validateProp4(formats); err != nil {`,
  1374  		`	if err := m.validateProp5(formats); err != nil {`,
  1375  		`		return errors.CompositeValidationError(res...`,
  1376  		`func (m *DeepNestedObjectAllOf1) validateProp4(formats strfmt.Registry) error {`,
  1377  		`	if swag.IsZero(m.Prop4) {`,
  1378  		`	if err := validate.FormatOf("prop4", "body", "uuid", m.Prop4.String(), formats); err != nil {`,
  1379  		`func (m *DeepNestedObjectAllOf1) validateProp5(formats strfmt.Registry) error {`,
  1380  		`	if swag.IsZero(m.Prop5) {`,
  1381  		`	if err := validate.FormatOf("prop5", "body", "date", m.Prop5.String(), formats); err != nil {`,
  1382  		`func (m *DeepNestedObjectAllOf1) MarshalBinary() ([]byte, error) {`,
  1383  		`	if m == nil {`,
  1384  		`		return nil, nil`,
  1385  		`	return swag.WriteJSON(m`,
  1386  		`func (m *DeepNestedObjectAllOf1) UnmarshalBinary(b []byte) error {`,
  1387  		`	var res DeepNestedObjectAllOf1`,
  1388  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1389  		`	*m = res`,
  1390  	},
  1391  		// not expected
  1392  		noLines,
  1393  		// output in log
  1394  		noLines,
  1395  		noLines)
  1396  
  1397  	// load expectations for model: break_nested_object_all_of1.go
  1398  	flattenRun.AddExpectations("break_nested_object_all_of1.go", []string{
  1399  		`type BreakNestedObjectAllOf1 struct {`,
  1400  		"	Prop6 strfmt.UUID `json:\"prop6,omitempty\"`",
  1401  		"	Prop7 *BreakNestedObjectAllOf1Prop7 `json:\"prop7,omitempty\"`",
  1402  		`func (m *BreakNestedObjectAllOf1) Validate(formats strfmt.Registry) error {`,
  1403  		`	if err := m.validateProp6(formats); err != nil {`,
  1404  		`	if err := m.validateProp7(formats); err != nil {`,
  1405  		`		return errors.CompositeValidationError(res...`,
  1406  		`func (m *BreakNestedObjectAllOf1) validateProp6(formats strfmt.Registry) error {`,
  1407  		`	if swag.IsZero(m.Prop6) {`,
  1408  		`	if err := validate.FormatOf("prop6", "body", "uuid", m.Prop6.String(), formats); err != nil {`,
  1409  		`func (m *BreakNestedObjectAllOf1) validateProp7(formats strfmt.Registry) error {`,
  1410  		`	if swag.IsZero(m.Prop7) {`,
  1411  		`	if m.Prop7 != nil {`,
  1412  		`		if err := m.Prop7.Validate(formats); err != nil {`,
  1413  		`			if ve, ok := err.(*errors.Validation); ok {`,
  1414  		`				return ve.ValidateName("prop7"`,
  1415  	},
  1416  		// not expected
  1417  		todo,
  1418  		// output in log
  1419  		noLines,
  1420  		noLines)
  1421  
  1422  	// load expectations for model: not_really_composed_thing.go
  1423  	flattenRun.AddExpectations("not_really_composed_thing.go", []string{
  1424  		`type NotReallyComposedThing struct {`,
  1425  		`	NotReallyComposedThingAllOf0`,
  1426  		`func (m *NotReallyComposedThing) Validate(formats strfmt.Registry) error {`,
  1427  		`	if err := m.NotReallyComposedThingAllOf0.Validate(formats); err != nil {`,
  1428  		`		return errors.CompositeValidationError(res...`,
  1429  	},
  1430  		// not expected
  1431  		todo,
  1432  		// output in log
  1433  		noLines,
  1434  		noLines)
  1435  
  1436  	expandRun.AddExpectations("not_really_composed_thing.go", []string{
  1437  		`type NotReallyComposedThing struct {`,
  1438  		"	Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
  1439  		`func (m *NotReallyComposedThing) Validate(formats strfmt.Registry) error {`,
  1440  		`	if err := m.validateProp0(formats); err != nil {`,
  1441  		`		return errors.CompositeValidationError(res...`,
  1442  		`func (m *NotReallyComposedThing) validateProp0(formats strfmt.Registry) error {`,
  1443  		`	if swag.IsZero(m.Prop0) {`,
  1444  		`	if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`,
  1445  	},
  1446  		// not expected
  1447  		noLines,
  1448  		// output in log
  1449  		noLines,
  1450  		noLines)
  1451  
  1452  	// load expectations for model: simple_nested_object.go
  1453  	flattenRun.AddExpectations("simple_nested_object.go", []string{
  1454  		`type SimpleNestedObject struct {`,
  1455  		`	ComposedThing`,
  1456  		`	SimpleNestedObjectAllOf1`,
  1457  		`func (m *SimpleNestedObject) Validate(formats strfmt.Registry) error {`,
  1458  		`	if err := m.ComposedThing.Validate(formats); err != nil {`,
  1459  		`	if err := m.SimpleNestedObjectAllOf1.Validate(formats); err != nil {`,
  1460  		`		return errors.CompositeValidationError(res...`,
  1461  	},
  1462  		// not expected
  1463  		todo,
  1464  		// output in log
  1465  		noLines,
  1466  		noLines)
  1467  
  1468  	// load expectations for model: simple_nested_object.go
  1469  	expandRun.AddExpectations("simple_nested_object.go", []string{
  1470  		`type SimpleNestedObject struct {`,
  1471  		`	SimpleNestedObjectAllOf0`,
  1472  		"	Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1473  		`func (m *SimpleNestedObject) UnmarshalJSON(raw []byte) error {`,
  1474  		`	var aO0 SimpleNestedObjectAllOf0`,
  1475  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  1476  		`	m.SimpleNestedObjectAllOf0 = aO0`,
  1477  		`	var dataAO1 struct {`,
  1478  		"		Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1479  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  1480  		`	m.Prop3 = dataAO1.Prop3`,
  1481  		`func (m SimpleNestedObject) MarshalJSON() ([]byte, error) {`,
  1482  		`	_parts := make([][]byte, 0, 2`,
  1483  		`	aO0, err := swag.WriteJSON(m.SimpleNestedObjectAllOf0`,
  1484  		`	if err != nil {`,
  1485  		`		return nil, err`,
  1486  		`	_parts = append(_parts, aO0`,
  1487  		`	var dataAO1 struct {`,
  1488  		"		Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  1489  		`	dataAO1.Prop3 = m.Prop3`,
  1490  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  1491  		`	if errAO1 != nil {`,
  1492  		`		return nil, errAO1`,
  1493  		`	_parts = append(_parts, jsonDataAO1`,
  1494  		`	return swag.ConcatJSON(_parts...), nil`,
  1495  		`func (m *SimpleNestedObject) Validate(formats strfmt.Registry) error {`,
  1496  		`	if err := m.SimpleNestedObjectAllOf0.Validate(formats); err != nil {`,
  1497  		`	if err := m.validateProp3(formats); err != nil {`,
  1498  		`		return errors.CompositeValidationError(res...`,
  1499  		`func (m *SimpleNestedObject) validateProp3(formats strfmt.Registry) error {`,
  1500  		`	if swag.IsZero(m.Prop3) {`,
  1501  		`	if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`,
  1502  		`func (m *SimpleNestedObject) MarshalBinary() ([]byte, error) {`,
  1503  		`	if m == nil {`,
  1504  		`		return nil, nil`,
  1505  		`	return swag.WriteJSON(m`,
  1506  		`func (m *SimpleNestedObject) UnmarshalBinary(b []byte) error {`,
  1507  		`	var res SimpleNestedObject`,
  1508  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1509  		`	*m = res`,
  1510  		`type SimpleNestedObjectAllOf0 struct {`,
  1511  		"	Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1512  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1513  		`func (m *SimpleNestedObjectAllOf0) UnmarshalJSON(raw []byte) error {`,
  1514  		`	var dataAO0 struct {`,
  1515  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1516  		`	if err := swag.ReadJSON(raw, &dataAO0); err != nil {`,
  1517  		`	m.Prop1 = dataAO0.Prop1`,
  1518  		`	var dataAO1 struct {`,
  1519  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1520  		`	if err := swag.ReadJSON(raw, &dataAO1); err != nil {`,
  1521  		`	m.Prop2 = dataAO1.Prop2`,
  1522  		`func (m SimpleNestedObjectAllOf0) MarshalJSON() ([]byte, error) {`,
  1523  		`	_parts := make([][]byte, 0, 2`,
  1524  		`	var dataAO0 struct {`,
  1525  		"		Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1526  		`	dataAO0.Prop1 = m.Prop1`,
  1527  		`	jsonDataAO0, errAO0 := swag.WriteJSON(dataAO0`,
  1528  		`	if errAO0 != nil {`,
  1529  		`		return nil, errAO0`,
  1530  		`	_parts = append(_parts, jsonDataAO0`,
  1531  		`	var dataAO1 struct {`,
  1532  		"		Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1533  		`	dataAO1.Prop2 = m.Prop2`,
  1534  		`	jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1`,
  1535  		`	if errAO1 != nil {`,
  1536  		`		return nil, errAO1`,
  1537  		`	_parts = append(_parts, jsonDataAO1`,
  1538  		`	return swag.ConcatJSON(_parts...), nil`,
  1539  		`func (m *SimpleNestedObjectAllOf0) Validate(formats strfmt.Registry) error {`,
  1540  		`	if err := m.validateProp1(formats); err != nil {`,
  1541  		`	if err := m.validateProp2(formats); err != nil {`,
  1542  		`		return errors.CompositeValidationError(res...`,
  1543  		`func (m *SimpleNestedObjectAllOf0) validateProp1(formats strfmt.Registry) error {`,
  1544  		`	if swag.IsZero(m.Prop1) {`,
  1545  		`	if err := validate.FormatOf("prop1", "body", "uuid", m.Prop1.String(), formats); err != nil {`,
  1546  		`func (m *SimpleNestedObjectAllOf0) validateProp2(formats strfmt.Registry) error {`,
  1547  		`	if swag.IsZero(m.Prop2) {`,
  1548  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  1549  		`func (m *SimpleNestedObjectAllOf0) MarshalBinary() ([]byte, error) {`,
  1550  		`	if m == nil {`,
  1551  		`		return nil, nil`,
  1552  		`	return swag.WriteJSON(m`,
  1553  		`func (m *SimpleNestedObjectAllOf0) UnmarshalBinary(b []byte) error {`,
  1554  		`	var res SimpleNestedObjectAllOf0`,
  1555  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
  1556  		`	*m = res`,
  1557  	},
  1558  		// not expected
  1559  		noLines,
  1560  		// output in log
  1561  		noLines,
  1562  		noLines)
  1563  
  1564  	// load expectations for model: break_nested_object_all_of1_prop7_all_of0.go
  1565  	flattenRun.AddExpectations("break_nested_object_all_of1_prop7_all_of0.go", []string{
  1566  		`type BreakNestedObjectAllOf1Prop7AllOf0 struct {`,
  1567  		"	Prop8 int64 `json:\"prop8,omitempty\"`",
  1568  		`func (m *BreakNestedObjectAllOf1Prop7AllOf0) Validate(formats strfmt.Registry) error {`,
  1569  		`	if err := m.validateProp8(formats); err != nil {`,
  1570  		`		return errors.CompositeValidationError(res...`,
  1571  		`func (m *BreakNestedObjectAllOf1Prop7AllOf0) validateProp8(formats strfmt.Registry) error {`,
  1572  		`	if swag.IsZero(m.Prop8) {`,
  1573  		`	if err := validate.MinimumInt("prop8", "body", int64(m.Prop8), 12, false); err != nil {`,
  1574  	},
  1575  		// not expected
  1576  		todo,
  1577  		// output in log
  1578  		noLines,
  1579  		noLines)
  1580  
  1581  	// load expectations for model: deep_nested_object_all_of1_all_of0.go
  1582  	flattenRun.AddExpectations("deep_nested_object_all_of1_all_of0.go", []string{
  1583  		`type DeepNestedObjectAllOf1AllOf0 struct {`,
  1584  		"	Prop4 strfmt.UUID `json:\"prop4,omitempty\"`",
  1585  		`func (m *DeepNestedObjectAllOf1AllOf0) Validate(formats strfmt.Registry) error {`,
  1586  		`	if err := m.validateProp4(formats); err != nil {`,
  1587  		`		return errors.CompositeValidationError(res...`,
  1588  		`func (m *DeepNestedObjectAllOf1AllOf0) validateProp4(formats strfmt.Registry) error {`,
  1589  		`	if swag.IsZero(m.Prop4) {`,
  1590  		`	if err := validate.FormatOf("prop4", "body", "uuid", m.Prop4.String(), formats); err != nil {`,
  1591  	},
  1592  		// not expected
  1593  		todo,
  1594  		// output in log
  1595  		noLines,
  1596  		noLines)
  1597  
  1598  	// load expectations for model: break_nested_object_all_of1_prop7_all_of1.go
  1599  	flattenRun.AddExpectations("break_nested_object_all_of1_prop7_all_of1.go", []string{
  1600  		`type BreakNestedObjectAllOf1Prop7AllOf1 struct {`,
  1601  		"	Prop9 int64 `json:\"prop9,omitempty\"`",
  1602  		`func (m *BreakNestedObjectAllOf1Prop7AllOf1) Validate(formats strfmt.Registry) error {`,
  1603  		`	if err := m.validateProp9(formats); err != nil {`,
  1604  		`		return errors.CompositeValidationError(res...`,
  1605  		`func (m *BreakNestedObjectAllOf1Prop7AllOf1) validateProp9(formats strfmt.Registry) error {`,
  1606  		`	if swag.IsZero(m.Prop9) {`,
  1607  		`	if err := validate.MaximumInt("prop9", "body", int64(m.Prop9), 12, false); err != nil {`,
  1608  	},
  1609  		// not expected
  1610  		todo,
  1611  		// output in log
  1612  		noLines,
  1613  		noLines)
  1614  
  1615  	// load expectations for model: composed_thing_all_of0.go
  1616  	flattenRun.AddExpectations("composed_thing_all_of0.go", []string{
  1617  		`type ComposedThingAllOf0 struct {`,
  1618  		"	Prop1 strfmt.UUID `json:\"prop1,omitempty\"`",
  1619  		`func (m *ComposedThingAllOf0) Validate(formats strfmt.Registry) error {`,
  1620  		`	if err := m.validateProp1(formats); err != nil {`,
  1621  		`		return errors.CompositeValidationError(res...`,
  1622  		`func (m *ComposedThingAllOf0) validateProp1(formats strfmt.Registry) error {`,
  1623  		`	if swag.IsZero(m.Prop1) {`,
  1624  		`	if err := validate.FormatOf("prop1", "body", "uuid", m.Prop1.String(), formats); err != nil {`,
  1625  	},
  1626  		// not expected
  1627  		todo,
  1628  		// output in log
  1629  		noLines,
  1630  		noLines)
  1631  
  1632  	// load expectations for model: composed_thing_all_of1.go
  1633  	flattenRun.AddExpectations("composed_thing_all_of1.go", []string{
  1634  		`type ComposedThingAllOf1 struct {`,
  1635  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  1636  		`func (m *ComposedThingAllOf1) Validate(formats strfmt.Registry) error {`,
  1637  		`	if err := m.validateProp2(formats); err != nil {`,
  1638  		`		return errors.CompositeValidationError(res...`,
  1639  		`func (m *ComposedThingAllOf1) validateProp2(formats strfmt.Registry) error {`,
  1640  		`	if swag.IsZero(m.Prop2) {`,
  1641  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  1642  	},
  1643  		// not expected
  1644  		todo,
  1645  		// output in log
  1646  		noLines,
  1647  		noLines)
  1648  
  1649  	// load expectations for model: deep_nested_object_all_of1.go
  1650  	flattenRun.AddExpectations("deep_nested_object_all_of1.go", []string{
  1651  		`type DeepNestedObjectAllOf1 struct {`,
  1652  		`	DeepNestedObjectAllOf1AllOf0`,
  1653  		`	DeepNestedObjectAllOf1AllOf1`,
  1654  		`func (m *DeepNestedObjectAllOf1) Validate(formats strfmt.Registry) error {`,
  1655  		`	if err := m.DeepNestedObjectAllOf1AllOf0.Validate(formats); err != nil {`,
  1656  		`	if err := m.DeepNestedObjectAllOf1AllOf1.Validate(formats); err != nil {`,
  1657  		`		return errors.CompositeValidationError(res...`,
  1658  	},
  1659  		// not expected
  1660  		todo,
  1661  		// output in log
  1662  		noLines,
  1663  		noLines)
  1664  
  1665  }
  1666  
  1667  func initFixtureComplexAllOf() {
  1668  	// testing ../fixtures/bugs/1487/fixture-complex-allOf.yaml with flatten and expand (--skip-flatten)
  1669  
  1670  	/*
  1671  	 */
  1672  	f := newModelFixture("../fixtures/bugs/1487/fixture-complex-allOf.yaml", "fixture for nested allOf with ref")
  1673  	flattenRun := f.AddRun(false)
  1674  	expandRun := f.AddRun(true)
  1675  
  1676  	// load expectations for model: aliased_date.go
  1677  	flattenRun.AddExpectations("aliased_date.go", []string{
  1678  		`type AliasedDate strfmt.Date`,
  1679  		`func (m AliasedDate) Validate(formats strfmt.Registry) error {`,
  1680  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  1681  		`		return errors.CompositeValidationError(res...`,
  1682  	},
  1683  		// not expected
  1684  		todo,
  1685  		// output in log
  1686  		noLines,
  1687  		noLines)
  1688  
  1689  	expandRun.AddExpectations("aliased_date.go", flattenRun.ExpectedFor("AliasedDate").ExpectedLines, todo, noLines, noLines)
  1690  
  1691  	// load expectations for model: object_mix_all_of2.go
  1692  	flattenRun.AddExpectations("object_mix_all_of2.go", []string{
  1693  		`type ObjectMixAllOf2 struct {`,
  1694  		"	Prop2 *ObjectMixAllOf2Prop2 `json:\"prop2,omitempty\"`",
  1695  		`func (m *ObjectMixAllOf2) Validate(formats strfmt.Registry) error {`,
  1696  		`	if err := m.validateProp2(formats); err != nil {`,
  1697  		`		return errors.CompositeValidationError(res...`,
  1698  		`func (m *ObjectMixAllOf2) validateProp2(formats strfmt.Registry) error {`,
  1699  		`	if swag.IsZero(m.Prop2) {`,
  1700  		`	if m.Prop2 != nil {`,
  1701  		`		if err := m.Prop2.Validate(formats); err != nil {`,
  1702  		`			if ve, ok := err.(*errors.Validation); ok {`,
  1703  		`				return ve.ValidateName("prop2"`,
  1704  	},
  1705  		// not expected
  1706  		todo,
  1707  		// output in log
  1708  		noLines,
  1709  		noLines)
  1710  
  1711  	// load expectations for model: object_mix.go
  1712  	flattenRun.AddExpectations("object_mix.go", []string{
  1713  		`type ObjectMix struct {`,
  1714  		`	ObjectMixAllOf1`,
  1715  		`	ObjectMixAllOf2`,
  1716  		`func (m *ObjectMix) Validate(formats strfmt.Registry) error {`,
  1717  		`	if err := m.ObjectMixAllOf1.Validate(formats); err != nil {`,
  1718  		`	if err := m.ObjectMixAllOf2.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  	expandRun.AddExpectations("object_mix.go", []string{
  1728  		`type ObjectMix struct {`,
  1729  		`	Prop1 struct {`,
  1730  		`		ObjectMixProp1AllOf0`,
  1731  		`		ObjectMixProp1AllOf1`,
  1732  		"	} `json:\"prop1,omitempty\"`",
  1733  		`	Prop2 struct {`,
  1734  		`		ObjectMixProp2AllOf0`,
  1735  		`		ObjectMixProp2AllOf1`,
  1736  		"	} `json:\"prop2,omitempty\"`",
  1737  		`func (m *ObjectMix) Validate(formats strfmt.Registry) error {`,
  1738  		`	if err := m.validateProp1(formats); err != nil {`,
  1739  		`	if err := m.validateProp2(formats); err != nil {`,
  1740  		`		return errors.CompositeValidationError(res...`,
  1741  		`func (m *ObjectMix) validateProp1(formats strfmt.Registry) error {`,
  1742  		`	if swag.IsZero(m.Prop1) {`,
  1743  		`func (m *ObjectMix) validateProp2(formats strfmt.Registry) error {`,
  1744  		`	if swag.IsZero(m.Prop2) {`,
  1745  		`type ObjectMixProp1AllOf0 strfmt.Date`,
  1746  		`func (m ObjectMixProp1AllOf0) Validate(formats strfmt.Registry) error {`,
  1747  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  1748  		`		return errors.CompositeValidationError(res...`,
  1749  		`type ObjectMixProp1AllOf1 strfmt.Date`,
  1750  		`func (m ObjectMixProp1AllOf1) Validate(formats strfmt.Registry) error {`,
  1751  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  1752  		`		return errors.CompositeValidationError(res...`,
  1753  		`type ObjectMixProp2AllOf0 strfmt.Date`,
  1754  		`func (m ObjectMixProp2AllOf0) Validate(formats strfmt.Registry) error {`,
  1755  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  1756  		`		return errors.CompositeValidationError(res...`,
  1757  		`type ObjectMixProp2AllOf1 strfmt.Date`,
  1758  		`func (m ObjectMixProp2AllOf1) Validate(formats strfmt.Registry) error {`,
  1759  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  1760  		`		return errors.CompositeValidationError(res...`,
  1761  	},
  1762  		// not expected
  1763  		noLines,
  1764  		// output in log
  1765  		noLines,
  1766  		noLines)
  1767  
  1768  	// load expectations for model: all_of_slices_of_aliases.go
  1769  	flattenRun.AddExpectations("all_of_slices_of_aliases.go", []string{
  1770  		`type AllOfSlicesOfAliases struct {`,
  1771  		`	AllOfSlicesOfAliasesAllOf0`,
  1772  		`	AllOfSlicesOfAliasesAllOf1`,
  1773  		`func (m *AllOfSlicesOfAliases) Validate(formats strfmt.Registry) error {`,
  1774  		`	if err := m.AllOfSlicesOfAliasesAllOf0.Validate(formats); err != nil {`,
  1775  		`	if err := m.AllOfSlicesOfAliasesAllOf1.Validate(formats); err != nil {`,
  1776  		`		return errors.CompositeValidationError(res...`,
  1777  	},
  1778  		// not expected
  1779  		todo,
  1780  		// output in log
  1781  		noLines,
  1782  		noLines)
  1783  
  1784  	expandRun.AddExpectations("all_of_slices_of_aliases.go", []string{
  1785  		`type AllOfSlicesOfAliases struct {`,
  1786  		"	Prop1 []strfmt.Date `json:\"prop1\"`",
  1787  		"	Prop2 []*strfmt.Date `json:\"prop2\"`",
  1788  		`func (m *AllOfSlicesOfAliases) Validate(formats strfmt.Registry) error {`,
  1789  		`	if err := m.validateProp1(formats); err != nil {`,
  1790  		`	if err := m.validateProp2(formats); err != nil {`,
  1791  		`		return errors.CompositeValidationError(res...`,
  1792  		`func (m *AllOfSlicesOfAliases) validateProp1(formats strfmt.Registry) error {`,
  1793  		`	if swag.IsZero(m.Prop1) {`,
  1794  		`	iProp1Size := int64(len(m.Prop1)`,
  1795  		`	if err := validate.MaxItems("prop1", "body", iProp1Size, 10); err != nil {`,
  1796  		`	for i := 0; i < len(m.Prop1); i++ {`,
  1797  		`		if err := validate.FormatOf("prop1"+"."+strconv.Itoa(i), "body", "date", m.Prop1[i].String(), formats); err != nil {`,
  1798  		`func (m *AllOfSlicesOfAliases) validateProp2(formats strfmt.Registry) error {`,
  1799  		`	if swag.IsZero(m.Prop2) {`,
  1800  		`	iProp2Size := int64(len(m.Prop2)`,
  1801  		`	if err := validate.MaxItems("prop2", "body", iProp2Size, 20); err != nil {`,
  1802  		`	for i := 0; i < len(m.Prop2); i++ {`,
  1803  		// do we need Required when item is nullable?
  1804  		// nullable not required:
  1805  		`		if swag.IsZero(m.Prop2[i]) {`,
  1806  		// nullable required:
  1807  		//`	if err := validate.Required("prop2"+"."+strconv.Itoa(i), "body", m.Prop2[i]); err != nil`,
  1808  		`		if err := validate.FormatOf("prop2"+"."+strconv.Itoa(i), "body", "date", m.Prop2[i].String(), formats); err != nil {`,
  1809  	},
  1810  		// not expected
  1811  		noLines,
  1812  		// output in log
  1813  		noLines,
  1814  		noLines)
  1815  
  1816  	// load expectations for model: all_of_aliases.go
  1817  	flattenRun.AddExpectations("all_of_aliases.go", []string{
  1818  		`type AllOfAliases struct {`,
  1819  		`	AliasedDate`,
  1820  		`	AliasedNullableDate`,
  1821  		`func (m *AllOfAliases) Validate(formats strfmt.Registry) error {`,
  1822  		`	if err := m.AliasedDate.Validate(formats); err != nil {`,
  1823  		`	if err := m.AliasedNullableDate.Validate(formats); err != nil {`,
  1824  		`		return errors.CompositeValidationError(res...`,
  1825  	},
  1826  		// not expected
  1827  		todo,
  1828  		// output in log
  1829  		noLines,
  1830  		noLines)
  1831  
  1832  	expandRun.AddExpectations("all_of_aliases.go", []string{
  1833  		`type AllOfAliases struct {`,
  1834  		`	AllOfAliasesAllOf0`,
  1835  		`	AllOfAliasesAllOf1`,
  1836  		`func (m *AllOfAliases) Validate(formats strfmt.Registry) error {`,
  1837  		`	if err := m.AllOfAliasesAllOf0.Validate(formats); err != nil {`,
  1838  		`	if err := m.AllOfAliasesAllOf1.Validate(formats); err != nil {`,
  1839  		`		return errors.CompositeValidationError(res...`,
  1840  		`type AllOfAliasesAllOf0 strfmt.Date`,
  1841  		`func (m AllOfAliasesAllOf0) Validate(formats strfmt.Registry) error {`,
  1842  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  1843  		`		return errors.CompositeValidationError(res...`,
  1844  		// NOTE: the x-nullable has not been honored here
  1845  		// so we don't have: `type AllOfAliasesAllOf1 *strfmt.Date`,
  1846  		// this is by design, since nullability is honored by the container of the alias, not the
  1847  		// alias itself. An allOf branch container is composing types, not pointers.
  1848  		`type AllOfAliasesAllOf1 strfmt.Date`,
  1849  		`func (m AllOfAliasesAllOf1) Validate(formats strfmt.Registry) error {`,
  1850  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  1851  		`		return errors.CompositeValidationError(res...`,
  1852  	},
  1853  		// not expected
  1854  		noLines,
  1855  		// output in log
  1856  		noLines,
  1857  		noLines)
  1858  
  1859  	// load expectations for model: object_mix_all_of1.go
  1860  	flattenRun.AddExpectations("object_mix_all_of1.go", []string{
  1861  		`type ObjectMixAllOf1 struct {`,
  1862  		"	Prop1 *ObjectMixAllOf1Prop1 `json:\"prop1,omitempty\"`",
  1863  		`func (m *ObjectMixAllOf1) Validate(formats strfmt.Registry) error {`,
  1864  		`	if err := m.validateProp1(formats); err != nil {`,
  1865  		`		return errors.CompositeValidationError(res...`,
  1866  		`func (m *ObjectMixAllOf1) validateProp1(formats strfmt.Registry) error {`,
  1867  		`	if swag.IsZero(m.Prop1) {`,
  1868  		`	if m.Prop1 != nil {`,
  1869  		`		if err := m.Prop1.Validate(formats); err != nil {`,
  1870  		`			if ve, ok := err.(*errors.Validation); ok {`,
  1871  		`				return ve.ValidateName("prop1"`,
  1872  	},
  1873  		// not expected
  1874  		todo,
  1875  		// output in log
  1876  		noLines,
  1877  		noLines)
  1878  
  1879  	// load expectations for model: all_of_slices_of_aliases_all_of0.go
  1880  	flattenRun.AddExpectations("all_of_slices_of_aliases_all_of0.go", []string{
  1881  		`type AllOfSlicesOfAliasesAllOf0 struct {`,
  1882  		"	Prop1 []AliasedDate `json:\"prop1\"`",
  1883  		`func (m *AllOfSlicesOfAliasesAllOf0) Validate(formats strfmt.Registry) error {`,
  1884  		`	if err := m.validateProp1(formats); err != nil {`,
  1885  		`		return errors.CompositeValidationError(res...`,
  1886  		`func (m *AllOfSlicesOfAliasesAllOf0) validateProp1(formats strfmt.Registry) error {`,
  1887  		`	if swag.IsZero(m.Prop1) {`,
  1888  		`	iProp1Size := int64(len(m.Prop1)`,
  1889  		`	if err := validate.MaxItems("prop1", "body", iProp1Size, 10); err != nil {`,
  1890  		`	for i := 0; i < len(m.Prop1); i++ {`,
  1891  		`		if err := m.Prop1[i].Validate(formats); err != nil {`,
  1892  		`			if ve, ok := err.(*errors.Validation); ok {`,
  1893  		`				return ve.ValidateName("prop1" + "." + strconv.Itoa(i)`,
  1894  	},
  1895  		// not expected
  1896  		todo,
  1897  		// output in log
  1898  		noLines,
  1899  		noLines)
  1900  
  1901  	// load expectations for model: slice_of_all_of.go
  1902  	flattenRun.AddExpectations("slice_of_all_of.go", []string{
  1903  		`type SliceOfAllOf []*SliceOfAllOfItems`,
  1904  		`func (m SliceOfAllOf) Validate(formats strfmt.Registry) error {`,
  1905  		`	if err := validate.UniqueItems("", "body", m); err != nil {`,
  1906  		`	for i := 0; i < len(m); i++ {`,
  1907  		// do we need Required when item is nullable?
  1908  		// nullable not required:
  1909  		`		if swag.IsZero(m[i]) {`,
  1910  		// nullable required:
  1911  		//`if err := validate.Required(strconv.Itoa(i), "body", m[i]); err != nil {`,
  1912  		`		if m[i] != nil {`,
  1913  		`			if err := m[i].Validate(formats); err != nil {`,
  1914  		`				if ve, ok := err.(*errors.Validation); ok {`,
  1915  		`					return ve.ValidateName(strconv.Itoa(i)`,
  1916  		`		return errors.CompositeValidationError(res...`,
  1917  	},
  1918  		// not expected
  1919  		todo,
  1920  		// output in log
  1921  		noLines,
  1922  		noLines)
  1923  
  1924  	expandRun.AddExpectations("slice_of_all_of.go", []string{
  1925  		`type SliceOfAllOf []*SliceOfAllOfItems0`,
  1926  		`func (m SliceOfAllOf) Validate(formats strfmt.Registry) error {`,
  1927  		`	if err := validate.UniqueItems("", "body", m); err != nil {`,
  1928  		`	for i := 0; i < len(m); i++ {`,
  1929  		// do we need Required when item is nullable?
  1930  		// nullable not required:
  1931  		`		if swag.IsZero(m[i]) {`,
  1932  		// nullable required:
  1933  		//`if err := validate.Required(strconv.Itoa(i), "body", m[i]); err != nil {`,
  1934  		`		if m[i] != nil {`,
  1935  		`			if err := m[i].Validate(formats); err != nil {`,
  1936  		`				if ve, ok := err.(*errors.Validation); ok {`,
  1937  		`					return ve.ValidateName(strconv.Itoa(i)`,
  1938  		`		return errors.CompositeValidationError(res...`,
  1939  		`type SliceOfAllOfItems0 struct {`,
  1940  		"	Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
  1941  		`	SliceOfAllOfItems0AllOf1`,
  1942  		`func (m *SliceOfAllOfItems0) Validate(formats strfmt.Registry) error {`,
  1943  		`	if err := m.validateProp0(formats); err != nil {`,
  1944  		`		return errors.CompositeValidationError(res...`,
  1945  		`func (m *SliceOfAllOfItems0) validateProp0(formats strfmt.Registry) error {`,
  1946  		`	if swag.IsZero(m.Prop0) {`,
  1947  		`	if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`,
  1948  		`type SliceOfAllOfItems0AllOf1 []interface{`,
  1949  		// empty validation
  1950  		"func (m SliceOfAllOfItems0AllOf1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  1951  	},
  1952  		// not expected
  1953  		noLines,
  1954  		// output in log
  1955  		noLines,
  1956  		noLines)
  1957  
  1958  	// load expectations for model: object_mix_all_of2_prop2.go
  1959  	flattenRun.AddExpectations("object_mix_all_of2_prop2.go", []string{
  1960  		`type ObjectMixAllOf2Prop2 struct {`,
  1961  		`	AliasedDate`,
  1962  		`	AliasedNullableDate`,
  1963  		`func (m *ObjectMixAllOf2Prop2) Validate(formats strfmt.Registry) error {`,
  1964  		`	if err := m.AliasedDate.Validate(formats); err != nil {`,
  1965  		`	if err := m.AliasedNullableDate.Validate(formats); err != nil {`,
  1966  		`		return errors.CompositeValidationError(res...`,
  1967  	},
  1968  		// not expected
  1969  		todo,
  1970  		// output in log
  1971  		noLines,
  1972  		noLines)
  1973  
  1974  	// load expectations for model: slice_of_all_of_items_all_of0.go
  1975  	flattenRun.AddExpectations("slice_of_all_of_items_all_of0.go", []string{
  1976  		`type SliceOfAllOfItemsAllOf0 struct {`,
  1977  		"	Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
  1978  		`func (m *SliceOfAllOfItemsAllOf0) Validate(formats strfmt.Registry) error {`,
  1979  		`	if err := m.validateProp0(formats); err != nil {`,
  1980  		`		return errors.CompositeValidationError(res...`,
  1981  		`func (m *SliceOfAllOfItemsAllOf0) validateProp0(formats strfmt.Registry) error {`,
  1982  		`	if swag.IsZero(m.Prop0) {`,
  1983  		`	if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`,
  1984  	},
  1985  		// not expected
  1986  		todo,
  1987  		// output in log
  1988  		noLines,
  1989  		noLines)
  1990  
  1991  	// load expectations for model: slice_of_interfaces.go
  1992  	flattenRun.AddExpectations("slice_of_interfaces.go", []string{
  1993  		`type SliceOfInterfaces []interface{`,
  1994  		// empty validation
  1995  		"func (m SliceOfInterfaces) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  1996  	},
  1997  		// not expected
  1998  		todo,
  1999  		// output in log
  2000  		noLines,
  2001  		noLines)
  2002  
  2003  	expandRun.AddExpectations("slice_of_interfaces.go", flattenRun.ExpectedFor("SliceOfInterfaces").ExpectedLines, todo, noLines, noLines)
  2004  
  2005  	// load expectations for model: slice_of_interfaces_with_validation.go
  2006  	flattenRun.AddExpectations("slice_of_interfaces_with_validation.go", []string{
  2007  		`type SliceOfInterfacesWithValidation []interface{`,
  2008  		`func (m SliceOfInterfacesWithValidation) Validate(formats strfmt.Registry) error {`,
  2009  		`	iSliceOfInterfacesWithValidationSize := int64(len(m)`,
  2010  		`	if err := validate.MaxItems("", "body", iSliceOfInterfacesWithValidationSize, 10); err != nil {`,
  2011  		`		return errors.CompositeValidationError(res...`,
  2012  	},
  2013  		// not expected
  2014  		todo,
  2015  		// output in log
  2016  		noLines,
  2017  		noLines)
  2018  
  2019  	expandRun.AddExpectations("slice_of_interfaces_with_validation.go", flattenRun.ExpectedFor("SliceOfInterfacesWithValidation").ExpectedLines, todo, noLines, noLines)
  2020  
  2021  	// load expectations for model: aliased_nullable_date.go
  2022  	flattenRun.AddExpectations("aliased_nullable_date.go", []string{
  2023  		`type AliasedNullableDate strfmt.Date`,
  2024  		`func (m AliasedNullableDate) Validate(formats strfmt.Registry) error {`,
  2025  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  2026  		`		return errors.CompositeValidationError(res...`,
  2027  	},
  2028  		// not expected
  2029  		todo,
  2030  		// output in log
  2031  		noLines,
  2032  		noLines)
  2033  
  2034  	expandRun.AddExpectations("aliased_nullable_date.go", flattenRun.ExpectedFor("AliasedNullableDate").ExpectedLines, todo, noLines, noLines)
  2035  
  2036  	// load expectations for model: slice_mix.go
  2037  	flattenRun.AddExpectations("slice_mix.go", []string{
  2038  		`type SliceMix struct {`,
  2039  		`	SliceOfAllOf`,
  2040  		`	SliceOfInterfaces`,
  2041  		`func (m *SliceMix) Validate(formats strfmt.Registry) error {`,
  2042  		`	if err := m.SliceOfAllOf.Validate(formats); err != nil {`,
  2043  		`	if err := m.SliceOfInterfaces.Validate(formats); err != nil {`,
  2044  		`		return errors.CompositeValidationError(res...`,
  2045  	},
  2046  		// not expected
  2047  		todo,
  2048  		// output in log
  2049  		warning,
  2050  		noLines)
  2051  
  2052  	expandRun.AddExpectations("slice_mix.go", []string{
  2053  		`type SliceMix struct {`,
  2054  		`	SliceMixAllOf0`,
  2055  		`	SliceMixAllOf1`,
  2056  		`func (m *SliceMix) Validate(formats strfmt.Registry) error {`,
  2057  		`	if err := m.SliceMixAllOf0.Validate(formats); err != nil {`,
  2058  		`		return errors.CompositeValidationError(res...`,
  2059  		`type SliceMixAllOf0 []*SliceMixAllOf0Items0`,
  2060  		`func (m SliceMixAllOf0) Validate(formats strfmt.Registry) error {`,
  2061  		`	if err := validate.UniqueItems("", "body", m); err != nil {`,
  2062  		`	for i := 0; i < len(m); i++ {`,
  2063  		// do we need Required when item is nullable?
  2064  		// nullable not required:
  2065  		`		if swag.IsZero(m[i]) {`,
  2066  		// nullable required:
  2067  		//`if err := validate.Required(strconv.Itoa(i), "body", m[i]); err != nil {`,
  2068  		`		if m[i] != nil {`,
  2069  		`			if err := m[i].Validate(formats); err != nil {`,
  2070  		`				if ve, ok := err.(*errors.Validation); ok {`,
  2071  		`					return ve.ValidateName(strconv.Itoa(i)`,
  2072  		`		return errors.CompositeValidationError(res...`,
  2073  		`type SliceMixAllOf0Items0 struct {`,
  2074  		"	Prop0 strfmt.UUID `json:\"prop0,omitempty\"`",
  2075  		`	SliceMixAllOf0Items0AllOf1`,
  2076  		`func (m *SliceMixAllOf0Items0) Validate(formats strfmt.Registry) error {`,
  2077  		`	if err := m.validateProp0(formats); err != nil {`,
  2078  		`		return errors.CompositeValidationError(res...`,
  2079  		`func (m *SliceMixAllOf0Items0) validateProp0(formats strfmt.Registry) error {`,
  2080  		`	if swag.IsZero(m.Prop0) {`,
  2081  		`	if err := validate.FormatOf("prop0", "body", "uuid", m.Prop0.String(), formats); err != nil {`,
  2082  		`type SliceMixAllOf0Items0AllOf1 []interface{`,
  2083  		`type SliceMixAllOf1 []interface{`,
  2084  		// empty validation
  2085  		"func (m SliceMixAllOf0Items0AllOf1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  2086  	},
  2087  		// not expected
  2088  		noLines,
  2089  		// output in log
  2090  		noLines,
  2091  		noLines)
  2092  
  2093  	// load expectations for model: object_mix_all_of1_prop1.go
  2094  	flattenRun.AddExpectations("object_mix_all_of1_prop1.go", []string{
  2095  		`type ObjectMixAllOf1Prop1 struct {`,
  2096  		`	AliasedDate`,
  2097  		`	AliasedNullableDate`,
  2098  		`func (m *ObjectMixAllOf1Prop1) Validate(formats strfmt.Registry) error {`,
  2099  		`	if err := m.AliasedDate.Validate(formats); err != nil {`,
  2100  		`	if err := m.AliasedNullableDate.Validate(formats); err != nil {`,
  2101  		`		return errors.CompositeValidationError(res...`,
  2102  	},
  2103  		// not expected
  2104  		todo,
  2105  		// output in log
  2106  		noLines,
  2107  		noLines)
  2108  
  2109  	// load expectations for model: slice_of_all_of_items.go
  2110  	flattenRun.AddExpectations("slice_of_all_of_items.go", []string{
  2111  		`type SliceOfAllOfItems struct {`,
  2112  		`	SliceOfAllOfItemsAllOf0`,
  2113  		`	SliceOfInterfaces`,
  2114  		`func (m *SliceOfAllOfItems) Validate(formats strfmt.Registry) error {`,
  2115  		`	if err := m.SliceOfAllOfItemsAllOf0.Validate(formats); err != nil {`,
  2116  		`	if err := m.SliceOfInterfaces.Validate(formats); err != nil {`,
  2117  		`		return errors.CompositeValidationError(res...`,
  2118  	},
  2119  		// not expected
  2120  		todo,
  2121  		// output in log
  2122  		noLines,
  2123  		noLines)
  2124  
  2125  	// load expectations for model: all_of_slices_of_aliases_all_of1.go
  2126  	flattenRun.AddExpectations("all_of_slices_of_aliases_all_of1.go", []string{
  2127  		`type AllOfSlicesOfAliasesAllOf1 struct {`,
  2128  		"	Prop2 []*AliasedNullableDate `json:\"prop2\"`",
  2129  		`func (m *AllOfSlicesOfAliasesAllOf1) Validate(formats strfmt.Registry) error {`,
  2130  		`	if err := m.validateProp2(formats); err != nil {`,
  2131  		`		return errors.CompositeValidationError(res...`,
  2132  		`func (m *AllOfSlicesOfAliasesAllOf1) validateProp2(formats strfmt.Registry) error {`,
  2133  		`	if swag.IsZero(m.Prop2) {`,
  2134  		`	iProp2Size := int64(len(m.Prop2)`,
  2135  		`	if err := validate.MaxItems("prop2", "body", iProp2Size, 20); err != nil {`,
  2136  		`	for i := 0; i < len(m.Prop2); i++ {`,
  2137  		// do we need Required when item is nullable?
  2138  		// nullable not required:
  2139  		`		if swag.IsZero(m.Prop2[i]) {`,
  2140  		// nullable required:
  2141  		//`if err := validate.Required("prop2"+"."+strconv.Itoa(i), "body", m.Prop2[i]); err != nil {`,
  2142  		`		if m.Prop2[i] != nil {`,
  2143  		`			if err := m.Prop2[i].Validate(formats); err != nil {`,
  2144  		`				if ve, ok := err.(*errors.Validation); ok {`,
  2145  		`					return ve.ValidateName("prop2" + "." + strconv.Itoa(i)`,
  2146  	},
  2147  		// not expected
  2148  		todo,
  2149  		// output in log
  2150  		noLines,
  2151  		noLines)
  2152  
  2153  }
  2154  
  2155  func initFixtureIsNullable() {
  2156  	// testing ../fixtures/bugs/1487/fixture-is-nullable.yaml with flatten and expand (--skip-flatten)
  2157  
  2158  	/* just an elementary check with the x-nullable tag
  2159  	 */
  2160  	f := newModelFixture("../fixtures/bugs/1487/fixture-is-nullable.yaml", "fixture for x-nullable flag")
  2161  	flattenRun := f.AddRun(false)
  2162  	expandRun := f.AddRun(true)
  2163  
  2164  	// load expectations for model: thing_with_nullable_dates.go
  2165  	flattenRun.AddExpectations("thing_with_nullable_dates.go", []string{
  2166  		`type ThingWithNullableDates struct {`,
  2167  		"	Prop1 strfmt.Date `json:\"prop1,omitempty\"`",
  2168  		"	Prop2 *strfmt.Date `json:\"prop2,omitempty\"`",
  2169  		`func (m *ThingWithNullableDates) Validate(formats strfmt.Registry) error {`,
  2170  		`	if err := m.validateProp1(formats); err != nil {`,
  2171  		`	if err := m.validateProp2(formats); err != nil {`,
  2172  		`		return errors.CompositeValidationError(res...`,
  2173  		`func (m *ThingWithNullableDates) validateProp1(formats strfmt.Registry) error {`,
  2174  		`	if swag.IsZero(m.Prop1) {`,
  2175  		`	if err := validate.FormatOf("prop1", "body", "date", m.Prop1.String(), formats); err != nil {`,
  2176  		`func (m *ThingWithNullableDates) validateProp2(formats strfmt.Registry) error {`,
  2177  		`	if swag.IsZero(m.Prop2) {`,
  2178  		`	if err := validate.FormatOf("prop2", "body", "date", m.Prop2.String(), formats); err != nil {`,
  2179  	},
  2180  		// not expected
  2181  		todo,
  2182  		// output in log
  2183  		noLines,
  2184  		noLines)
  2185  
  2186  	expandRun.AddExpectations("thing_with_nullable_dates.go", flattenRun.ExpectedFor("ThingWithNullableDates").ExpectedLines, todo, noLines, noLines)
  2187  
  2188  }
  2189  
  2190  func initFixtureItching() {
  2191  	// testing ../fixtures/bugs/1487/fixture-itching.yaml with flatten and expand (--skip-flatten)
  2192  
  2193  	/*
  2194  		This one regroups a number of itching cases, essentially around additionalProperties.
  2195  		In particular, we test some things with empty objects (no properties) which have additionalProperties of diverse sorts.
  2196  		We also added here some funny models using the special types Files, string format: binary and interface{}
  2197  		These special cases do not correspond to actual API specs: we use them to verify the internal behavior of the general.
  2198  	*/
  2199  	f := newModelFixture("../fixtures/bugs/1487/fixture-itching.yaml", "fixture for additionalProperties")
  2200  	flattenRun := f.AddRun(false)
  2201  	expandRun := f.AddRun(true)
  2202  
  2203  	// load expectations for model: top_level_format_issue_my_alternate_file.go
  2204  	flattenRun.AddExpectations("top_level_format_issue_my_alternate_file.go", []string{
  2205  		`import "io"`,
  2206  		`type TopLevelFormatIssueMyAlternateFile io.ReadCloser`,
  2207  	},
  2208  		// not expected
  2209  		todo,
  2210  		// output in log
  2211  		noLines,
  2212  		noLines)
  2213  
  2214  	// load expectations for model: not_validated_additional_props.go
  2215  	flattenRun.AddExpectations("not_validated_additional_props.go", []string{
  2216  		`type NotValidatedAdditionalProps struct {`,
  2217  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  2218  		"	NotValidatedAdditionalProps map[string]map[string]map[string]string `json:\"-\"`",
  2219  		`func (m *NotValidatedAdditionalProps) Validate(formats strfmt.Registry) error {`,
  2220  		`	if err := m.validateProp2(formats); err != nil {`,
  2221  		`		return errors.CompositeValidationError(res...`,
  2222  		`func (m *NotValidatedAdditionalProps) validateProp2(formats strfmt.Registry) error {`,
  2223  		`	if swag.IsZero(m.Prop2) {`,
  2224  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  2225  	},
  2226  		// not expected
  2227  		todo,
  2228  		// output in log
  2229  		noLines,
  2230  		noLines)
  2231  
  2232  	expandRun.AddExpectations("not_validated_additional_props.go", flattenRun.ExpectedFor("NotValidatedAdditionalProps").ExpectedLines, todo, noLines, noLines)
  2233  
  2234  	// load expectations for model: aliased_nullable_file.go
  2235  	flattenRun.AddExpectations("aliased_nullable_file.go", []string{
  2236  		`import "io"`,
  2237  		`type AliasedNullableFile io.ReadCloser`,
  2238  	},
  2239  		// not expected
  2240  		todo,
  2241  		// output in log
  2242  		noLines,
  2243  		noLines)
  2244  
  2245  	expandRun.AddExpectations("aliased_nullable_file.go", flattenRun.ExpectedFor("AliasedNullableFile").ExpectedLines, todo, noLines, noLines)
  2246  
  2247  	// load expectations for model: empty_object_with_additional_nullable_primitive.go
  2248  	flattenRun.AddExpectations("empty_object_with_additional_nullable_primitive.go", []string{
  2249  		`type EmptyObjectWithAdditionalNullablePrimitive map[string]*strfmt.Date`,
  2250  		`func (m EmptyObjectWithAdditionalNullablePrimitive) Validate(formats strfmt.Registry) error {`,
  2251  		`	for k := range m {`,
  2252  		`		if swag.IsZero(m[k]) {`,
  2253  		`		if err := validate.FormatOf(k, "body", "date", m[k].String(), formats); err != nil {`,
  2254  		`		return errors.CompositeValidationError(res...`,
  2255  	},
  2256  		// not expected
  2257  		todo,
  2258  		// output in log
  2259  		noLines,
  2260  		noLines)
  2261  
  2262  	expandRun.AddExpectations("empty_object_with_additional_nullable_primitive.go", flattenRun.ExpectedFor("EmptyObjectWithAdditionalNullablePrimitive").ExpectedLines, todo, noLines, noLines)
  2263  
  2264  	// load expectations for model: empty_object_with_additional_alias.go
  2265  	flattenRun.AddExpectations("empty_object_with_additional_alias.go", []string{
  2266  		`type EmptyObjectWithAdditionalAlias map[string]AliasedThing`,
  2267  		`func (m EmptyObjectWithAdditionalAlias) Validate(formats strfmt.Registry) error {`,
  2268  		`	for k := range m {`,
  2269  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  2270  		`		if val, ok := m[k]; ok {`,
  2271  		`			if err := val.Validate(formats); err != nil {`,
  2272  		`		return errors.CompositeValidationError(res...`,
  2273  	},
  2274  		// not expected
  2275  		todo,
  2276  		// output in log
  2277  		noLines,
  2278  		noLines)
  2279  
  2280  	expandRun.AddExpectations("empty_object_with_additional_alias.go", []string{
  2281  		`type EmptyObjectWithAdditionalAlias map[string]EmptyObjectWithAdditionalAliasAnon`,
  2282  		`func (m EmptyObjectWithAdditionalAlias) Validate(formats strfmt.Registry) error {`,
  2283  		`	for k := range m {`,
  2284  		`		if swag.IsZero(m[k]) {`,
  2285  		`		if val, ok := m[k]; ok {`,
  2286  		`			if err := val.Validate(formats); err != nil {`,
  2287  		`		return errors.CompositeValidationError(res...`,
  2288  		`type EmptyObjectWithAdditionalAliasAnon struct {`,
  2289  		"	Prop1 strfmt.Date `json:\"prop1,omitempty\"`",
  2290  		`func (m *EmptyObjectWithAdditionalAliasAnon) Validate(formats strfmt.Registry) error {`,
  2291  		`	if err := m.validateProp1(formats); err != nil {`,
  2292  		`		return errors.CompositeValidationError(res...`,
  2293  		`func (m *EmptyObjectWithAdditionalAliasAnon) validateProp1(formats strfmt.Registry) error {`,
  2294  		`	if swag.IsZero(m.Prop1) {`,
  2295  		`	if err := validate.FormatOf("prop1", "body", "date", m.Prop1.String(), formats); err != nil {`,
  2296  	},
  2297  		// not expected
  2298  		noLines,
  2299  		// output in log
  2300  		noLines,
  2301  		noLines)
  2302  
  2303  	// load expectations for model: nullable_thing.go
  2304  	flattenRun.AddExpectations("nullable_thing.go", []string{
  2305  		`type NullableThing strfmt.Date`,
  2306  		`func (m NullableThing) Validate(formats strfmt.Registry) error {`,
  2307  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  2308  		`		return errors.CompositeValidationError(res...`,
  2309  	},
  2310  		// not expected
  2311  		todo,
  2312  		// output in log
  2313  		noLines,
  2314  		noLines)
  2315  
  2316  	expandRun.AddExpectations("nullable_thing.go", flattenRun.ExpectedFor("NullableThing").ExpectedLines, todo, noLines, noLines)
  2317  
  2318  	// load expectations for model: slice_of_aliased_files.go
  2319  	flattenRun.AddExpectations("slice_of_aliased_files.go", []string{
  2320  		`type SliceOfAliasedFiles []AliasedFile`,
  2321  		`func (m SliceOfAliasedFiles) Validate(formats strfmt.Registry) error {`,
  2322  		`	iSliceOfAliasedFilesSize := int64(len(m)`,
  2323  		`	if err := validate.MinItems("", "body", iSliceOfAliasedFilesSize, 4); err != nil {`,
  2324  		`		return errors.CompositeValidationError(res...`,
  2325  	},
  2326  		// not expected
  2327  		todo,
  2328  		// output in log
  2329  		noLines,
  2330  		noLines)
  2331  
  2332  	expandRun.AddExpectations("slice_of_aliased_files.go", []string{
  2333  		`type SliceOfAliasedFiles []io.ReadCloser`,
  2334  		`func (m SliceOfAliasedFiles) Validate(formats strfmt.Registry) error {`,
  2335  		`	iSliceOfAliasedFilesSize := int64(len(m)`,
  2336  		`	if err := validate.MinItems("", "body", iSliceOfAliasedFilesSize, 4); err != nil {`,
  2337  		`		return errors.CompositeValidationError(res...`,
  2338  	},
  2339  		// not expected
  2340  		noLines,
  2341  		// output in log
  2342  		noLines,
  2343  		noLines)
  2344  
  2345  	// load expectations for model: empty_object_with_additional_non_nullable_primitive.go
  2346  	flattenRun.AddExpectations("empty_object_with_additional_non_nullable_primitive.go", []string{
  2347  		`type EmptyObjectWithAdditionalNonNullablePrimitive map[string]strfmt.Date`,
  2348  		`func (m EmptyObjectWithAdditionalNonNullablePrimitive) Validate(formats strfmt.Registry) error {`,
  2349  		`	for k := range m {`,
  2350  		// fix undue IsZero call
  2351  		//`		if swag.IsZero(m[k]) {`,
  2352  		`		if err := validate.FormatOf(k, "body", "date", m[k].String(), formats); err != nil {`,
  2353  		`		return errors.CompositeValidationError(res...`,
  2354  	},
  2355  		// not expected
  2356  		todo,
  2357  		// output in log
  2358  		noLines,
  2359  		noLines)
  2360  
  2361  	expandRun.AddExpectations("empty_object_with_additional_non_nullable_primitive.go", flattenRun.ExpectedFor("EmptyObjectWithAdditionalNonNullablePrimitive").ExpectedLines, todo, noLines, noLines)
  2362  
  2363  	// load expectations for model: good_old_format_issue.go
  2364  	flattenRun.AddExpectations("good_old_format_issue.go", []string{
  2365  		`type GoodOldFormatIssue struct {`,
  2366  		"	AlternateFile GoodOldFormatIssueAlternateFile `json:\"alternateFile,omitempty\"`",
  2367  		"	AnotherFile io.ReadCloser `json:\"anotherFile,omitempty\"`",
  2368  		"	MyBytes strfmt.Base64 `json:\"myBytes,omitempty\"`",
  2369  		"	MyFile io.ReadCloser `json:\"myFile\"`",
  2370  		"	ThisAliasedFile AliasedFile `json:\"thisAliasedFile,omitempty\"`",
  2371  		"	ThisAlternateAliasedFile AliasedTypeFile `json:\"thisAlternateAliasedFile,omitempty\"`",
  2372  		"	ThisNullableAliasedFile *AliasedNullableFile `json:\"thisNullableAliasedFile,omitempty\"`",
  2373  		"	ThisNullableAlternateAliasedFile *AliasedTypeNullableFile `json:\"thisNullableAlternateAliasedFile,omitempty\"`",
  2374  		`func (m *GoodOldFormatIssue) Validate(formats strfmt.Registry) error {`,
  2375  		`	if err := m.validateMyBytes(formats); err != nil {`,
  2376  		`	if err := m.validateMyFile(formats); err != nil {`,
  2377  		`		return errors.CompositeValidationError(res...`,
  2378  		`func (m *GoodOldFormatIssue) validateMyBytes(formats strfmt.Registry) error {`,
  2379  		`	if swag.IsZero(m.MyBytes) {`,
  2380  		// Fixed this: we don't want to call validate.FormatOf() for base64
  2381  		//`	if err := validate.FormatOf("myBytes", "body", "byte", m.MyBytes.String(), formats); err != nil {`,
  2382  		`func (m *GoodOldFormatIssue) validateMyFile(formats strfmt.Registry) error {`,
  2383  		`	if err := validate.Required("myFile", "body", io.ReadCloser(m.MyFile)); err != nil {`,
  2384  	},
  2385  		// not expected
  2386  		todo,
  2387  		// output in log
  2388  		noLines,
  2389  		noLines)
  2390  
  2391  	expandRun.AddExpectations("good_old_format_issue.go", []string{
  2392  		`type GoodOldFormatIssue struct {`,
  2393  		"	AlternateFile io.ReadCloser `json:\"alternateFile,omitempty\"`",
  2394  		"	AnotherFile io.ReadCloser `json:\"anotherFile,omitempty\"`",
  2395  		"	MyBytes strfmt.Base64 `json:\"myBytes,omitempty\"`",
  2396  		"	MyFile io.ReadCloser `json:\"myFile\"`",
  2397  		"	ThisAliasedFile io.ReadCloser `json:\"thisAliasedFile,omitempty\"`",
  2398  		"	ThisAlternateAliasedFile io.ReadCloser `json:\"thisAlternateAliasedFile,omitempty\"`",
  2399  		"	ThisNullableAliasedFile io.ReadCloser `json:\"thisNullableAliasedFile,omitempty\"`",
  2400  		"	ThisNullableAlternateAliasedFile io.ReadCloser `json:\"thisNullableAlternateAliasedFile,omitempty\"`",
  2401  		`func (m *GoodOldFormatIssue) Validate(formats strfmt.Registry) error {`,
  2402  		`	if err := m.validateMyBytes(formats); err != nil {`,
  2403  		`	if err := m.validateMyFile(formats); err != nil {`,
  2404  		`		return errors.CompositeValidationError(res...`,
  2405  		`func (m *GoodOldFormatIssue) validateMyBytes(formats strfmt.Registry) error {`,
  2406  		`	if swag.IsZero(m.MyBytes) {`,
  2407  		// Fixed this: we don't want to call validate.FormatOf() for base64
  2408  		//`	if err := validate.FormatOf("myBytes", "body", "byte", m.MyBytes.String(), formats); err != nil {`,
  2409  		`func (m *GoodOldFormatIssue) validateMyFile(formats strfmt.Registry) error {`,
  2410  		`	if err := validate.Required("myFile", "body", io.ReadCloser(m.MyFile)); err != nil {`,
  2411  	},
  2412  		// not expected
  2413  		noLines,
  2414  		// output in log
  2415  		noLines,
  2416  		noLines)
  2417  
  2418  	// load expectations for model: empty_object_with_additional_slice_additional_properties_items.go
  2419  	flattenRun.AddExpectations("empty_object_with_additional_slice_additional_properties_items.go", []string{
  2420  		`type EmptyObjectWithAdditionalSliceAdditionalPropertiesItems struct {`,
  2421  		"	DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`",
  2422  		`func (m *EmptyObjectWithAdditionalSliceAdditionalPropertiesItems) Validate(formats strfmt.Registry) error {`,
  2423  		`	if err := m.validateDummyProp1(formats); err != nil {`,
  2424  		`		return errors.CompositeValidationError(res...`,
  2425  		`func (m *EmptyObjectWithAdditionalSliceAdditionalPropertiesItems) validateDummyProp1(formats strfmt.Registry) error {`,
  2426  		`	if swag.IsZero(m.DummyProp1) {`,
  2427  		`	if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`,
  2428  	},
  2429  		// not expected
  2430  		todo,
  2431  		// output in log
  2432  		noLines,
  2433  		noLines)
  2434  
  2435  	// load expectations for model: not_validated_additional_props_slice.go
  2436  	flattenRun.AddExpectations("not_validated_additional_props_slice.go", []string{
  2437  		`type NotValidatedAdditionalPropsSlice struct {`,
  2438  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  2439  		"	NotValidatedAdditionalPropsSlice map[string][]map[string]map[string]string `json:\"-\"`",
  2440  		`func (m *NotValidatedAdditionalPropsSlice) Validate(formats strfmt.Registry) error {`,
  2441  		`	if err := m.validateProp2(formats); err != nil {`,
  2442  		`		return errors.CompositeValidationError(res...`,
  2443  		`func (m *NotValidatedAdditionalPropsSlice) validateProp2(formats strfmt.Registry) error {`,
  2444  		`	if swag.IsZero(m.Prop2) {`,
  2445  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  2446  	},
  2447  		// not expected
  2448  		todo,
  2449  		// output in log
  2450  		noLines,
  2451  		noLines)
  2452  
  2453  	// load expectations for model: aliased_type_file.go
  2454  	flattenRun.AddExpectations("aliased_type_file.go", []string{
  2455  		`import "io"`,
  2456  		`type AliasedTypeFile io.ReadCloser`,
  2457  	},
  2458  		// not expected
  2459  		todo,
  2460  		// output in log
  2461  		noLines,
  2462  		noLines)
  2463  
  2464  	expandRun.AddExpectations("aliased_type_file.go", flattenRun.ExpectedFor("AliasedTypeFile").ExpectedLines, todo, noLines, noLines)
  2465  
  2466  	// load expectations for model: object_with_empty_object.go
  2467  	flattenRun.AddExpectations("object_with_empty_object.go", []string{
  2468  		`type ObjectWithEmptyObject struct {`,
  2469  		"	EmptyObj EmptyObjectWithAdditionalAlias `json:\"emptyObj,omitempty\"`",
  2470  		"	NonEmptyObj *NullableThing `json:\"nonEmptyObj,omitempty\"`",
  2471  		`func (m *ObjectWithEmptyObject) Validate(formats strfmt.Registry) error {`,
  2472  		`	if err := m.validateEmptyObj(formats); err != nil {`,
  2473  		`	if err := m.validateNonEmptyObj(formats); err != nil {`,
  2474  		`		return errors.CompositeValidationError(res...`,
  2475  		`func (m *ObjectWithEmptyObject) validateEmptyObj(formats strfmt.Registry) error {`,
  2476  		`	if swag.IsZero(m.EmptyObj) {`,
  2477  		`	if err := m.EmptyObj.Validate(formats); err != nil {`,
  2478  		`		if ve, ok := err.(*errors.Validation); ok {`,
  2479  		`			return ve.ValidateName("emptyObj"`,
  2480  		`func (m *ObjectWithEmptyObject) validateNonEmptyObj(formats strfmt.Registry) error {`,
  2481  		`	if swag.IsZero(m.NonEmptyObj) {`,
  2482  		`	if m.NonEmptyObj != nil {`,
  2483  		`		if err := m.NonEmptyObj.Validate(formats); err != nil {`,
  2484  		`			if ve, ok := err.(*errors.Validation); ok {`,
  2485  		`				return ve.ValidateName("nonEmptyObj"`,
  2486  	},
  2487  		// not expected
  2488  		todo,
  2489  		// output in log
  2490  		noLines,
  2491  		noLines)
  2492  
  2493  	expandRun.AddExpectations("object_with_empty_object.go", []string{
  2494  		`type ObjectWithEmptyObject struct {`,
  2495  		"	EmptyObj map[string]ObjectWithEmptyObjectEmptyObjAnon `json:\"emptyObj,omitempty\"`",
  2496  		"	NonEmptyObj *strfmt.Date `json:\"nonEmptyObj,omitempty\"`",
  2497  		`func (m *ObjectWithEmptyObject) Validate(formats strfmt.Registry) error {`,
  2498  		`	if err := m.validateEmptyObj(formats); err != nil {`,
  2499  		`	if err := m.validateNonEmptyObj(formats); err != nil {`,
  2500  		`		return errors.CompositeValidationError(res...`,
  2501  		`func (m *ObjectWithEmptyObject) validateEmptyObj(formats strfmt.Registry) error {`,
  2502  		`	if swag.IsZero(m.EmptyObj) {`,
  2503  		`	for k := range m.EmptyObj {`,
  2504  		`		if swag.IsZero(m.EmptyObj[k]) {`,
  2505  		`		if val, ok := m.EmptyObj[k]; ok {`,
  2506  		`			if err := val.Validate(formats); err != nil {`,
  2507  		`func (m *ObjectWithEmptyObject) validateNonEmptyObj(formats strfmt.Registry) error {`,
  2508  		`	if swag.IsZero(m.NonEmptyObj) {`,
  2509  		`	if err := validate.FormatOf("nonEmptyObj", "body", "date", m.NonEmptyObj.String(), formats); err != nil {`,
  2510  		`type ObjectWithEmptyObjectEmptyObjAnon struct {`,
  2511  		"	Prop1 strfmt.Date `json:\"prop1,omitempty\"`",
  2512  		`func (m *ObjectWithEmptyObjectEmptyObjAnon) Validate(formats strfmt.Registry) error {`,
  2513  		`	if err := m.validateProp1(formats); err != nil {`,
  2514  		`		return errors.CompositeValidationError(res...`,
  2515  		`func (m *ObjectWithEmptyObjectEmptyObjAnon) validateProp1(formats strfmt.Registry) error {`,
  2516  		`	if swag.IsZero(m.Prop1) {`,
  2517  		`	if err := validate.FormatOf("prop1", "body", "date", m.Prop1.String(), formats); err != nil {`,
  2518  	},
  2519  		// not expected
  2520  		noLines,
  2521  		// output in log
  2522  		noLines,
  2523  		noLines)
  2524  
  2525  	// load expectations for model: aliased_file.go
  2526  	flattenRun.AddExpectations("aliased_file.go", []string{
  2527  		`import "io"`,
  2528  		`type AliasedFile io.ReadCloser`,
  2529  	},
  2530  		// not expected
  2531  		todo,
  2532  		// output in log
  2533  		noLines,
  2534  		noLines)
  2535  
  2536  	expandRun.AddExpectations("aliased_file.go", flattenRun.ExpectedFor("AliasedFile").ExpectedLines, todo, noLines, noLines)
  2537  
  2538  	// load expectations for model: empty_object_with_additional_slice.go
  2539  	flattenRun.AddExpectations("empty_object_with_additional_slice.go", []string{
  2540  		`type EmptyObjectWithAdditionalSlice map[string][]EmptyObjectWithAdditionalSliceAdditionalPropertiesItems`,
  2541  		`func (m EmptyObjectWithAdditionalSlice) Validate(formats strfmt.Registry) error {`,
  2542  		// fixed undue Required on this aliased type
  2543  		//`	if err := validate.Required("", "body", EmptyObjectWithAdditionalSlice(m)); err != nil {`,
  2544  		`	for k := range m {`,
  2545  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  2546  		`		for i := 0; i < len(m[k]); i++ {`,
  2547  		`			if err := m[k][i].Validate(formats); err != nil {`,
  2548  		`				if ve, ok := err.(*errors.Validation); ok {`,
  2549  		`					return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  2550  		`		return errors.CompositeValidationError(res...`,
  2551  	},
  2552  		// not expected
  2553  		todo,
  2554  		// output in log
  2555  		noLines,
  2556  		noLines)
  2557  
  2558  	expandRun.AddExpectations("empty_object_with_additional_slice.go", []string{
  2559  		`type EmptyObjectWithAdditionalSlice map[string][]EmptyObjectWithAdditionalSliceItems0`,
  2560  		`func (m EmptyObjectWithAdditionalSlice) Validate(formats strfmt.Registry) error {`,
  2561  		// fixed undue Required on this aliased type
  2562  		//`	if err := validate.Required("", "body", EmptyObjectWithAdditionalSlice(m)); err != nil {`,
  2563  		`	for k := range m {`,
  2564  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  2565  		`		for i := 0; i < len(m[k]); i++ {`,
  2566  		`			if err := m[k][i].Validate(formats); err != nil {`,
  2567  		`				if ve, ok := err.(*errors.Validation); ok {`,
  2568  		`					return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  2569  		`		return errors.CompositeValidationError(res...`,
  2570  		`type EmptyObjectWithAdditionalSliceItems0 struct {`,
  2571  		"	DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`",
  2572  		`func (m *EmptyObjectWithAdditionalSliceItems0) Validate(formats strfmt.Registry) error {`,
  2573  		`	if err := m.validateDummyProp1(formats); err != nil {`,
  2574  		`		return errors.CompositeValidationError(res...`,
  2575  		`func (m *EmptyObjectWithAdditionalSliceItems0) validateDummyProp1(formats strfmt.Registry) error {`,
  2576  		`	if swag.IsZero(m.DummyProp1) {`,
  2577  		`	if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`,
  2578  	},
  2579  		// not expected
  2580  		noLines,
  2581  		// output in log
  2582  		noLines,
  2583  		noLines)
  2584  
  2585  	// load expectations for model: additional_aliased_file.go
  2586  	flattenRun.AddExpectations("additional_aliased_file.go", []string{
  2587  		`type AdditionalAliasedFile interface{`,
  2588  	},
  2589  		// not expected
  2590  		todo,
  2591  		// output in log
  2592  		noLines,
  2593  		noLines)
  2594  
  2595  	expandRun.AddExpectations("additional_aliased_file.go", flattenRun.ExpectedFor("AdditionalAliasedFile").ExpectedLines, todo, noLines, noLines)
  2596  
  2597  	// load expectations for model: good_old_format_issue_alternate_file.go
  2598  	flattenRun.AddExpectations("good_old_format_issue_alternate_file.go", []string{
  2599  		`import "io"`,
  2600  		`type GoodOldFormatIssueAlternateFile io.ReadCloser`,
  2601  	},
  2602  		// not expected
  2603  		todo,
  2604  		// output in log
  2605  		noLines,
  2606  		noLines)
  2607  
  2608  	// load expectations for model: empty_object_with_additional_nested_slice_additional_properties_items_items_items.go
  2609  	flattenRun.AddExpectations("empty_object_with_additional_nested_slice_additional_properties_items_items_items.go", []string{
  2610  		`type EmptyObjectWithAdditionalNestedSliceAdditionalPropertiesItemsItemsItems struct {`,
  2611  		"	DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`",
  2612  		`func (m *EmptyObjectWithAdditionalNestedSliceAdditionalPropertiesItemsItemsItems) Validate(formats strfmt.Registry) error {`,
  2613  		`	if err := m.validateDummyProp1(formats); err != nil {`,
  2614  		`		return errors.CompositeValidationError(res...`,
  2615  		`func (m *EmptyObjectWithAdditionalNestedSliceAdditionalPropertiesItemsItemsItems) validateDummyProp1(formats strfmt.Registry) error {`,
  2616  		`	if swag.IsZero(m.DummyProp1) {`,
  2617  		`	if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`,
  2618  	},
  2619  		// not expected
  2620  		todo,
  2621  		// output in log
  2622  		noLines,
  2623  		noLines)
  2624  
  2625  	// load expectations for model: aliased_thing.go
  2626  	flattenRun.AddExpectations("aliased_thing.go", []string{
  2627  		`type AliasedThing struct {`,
  2628  		"	Prop1 strfmt.Date `json:\"prop1,omitempty\"`",
  2629  		`func (m *AliasedThing) Validate(formats strfmt.Registry) error {`,
  2630  		`	if err := m.validateProp1(formats); err != nil {`,
  2631  		`		return errors.CompositeValidationError(res...`,
  2632  		`func (m *AliasedThing) validateProp1(formats strfmt.Registry) error {`,
  2633  		`	if swag.IsZero(m.Prop1) {`,
  2634  		`	if err := validate.FormatOf("prop1", "body", "date", m.Prop1.String(), formats); err != nil {`,
  2635  	},
  2636  		// not expected
  2637  		todo,
  2638  		// output in log
  2639  		noLines,
  2640  		noLines)
  2641  
  2642  	expandRun.AddExpectations("aliased_thing.go", flattenRun.ExpectedFor("AliasedThing").ExpectedLines, todo, noLines, noLines)
  2643  
  2644  	// load expectations for model: additional_file.go
  2645  	flattenRun.AddExpectations("additional_file.go", []string{
  2646  		`type AdditionalFile struct {`,
  2647  		"	DirName string `json:\"dirName,omitempty\"`",
  2648  		"	AdditionalFile map[string]io.ReadCloser `json:\"-\"`",
  2649  		// empty validation
  2650  		"func (m *AdditionalFile) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  2651  	},
  2652  		// not expected
  2653  		todo,
  2654  		// output in log
  2655  		noLines,
  2656  		noLines)
  2657  
  2658  	expandRun.AddExpectations("additional_file.go", flattenRun.ExpectedFor("AdditionalFile").ExpectedLines, todo, noLines, noLines)
  2659  
  2660  	// load expectations for model: aliased_type_nullable_file.go
  2661  	flattenRun.AddExpectations("aliased_type_nullable_file.go", []string{
  2662  		`import "io"`,
  2663  		`type AliasedTypeNullableFile io.ReadCloser`,
  2664  	},
  2665  		// not expected
  2666  		validatable,
  2667  		// output in log
  2668  		noLines,
  2669  		noLines)
  2670  
  2671  	expandRun.AddExpectations("aliased_type_nullable_file.go", flattenRun.ExpectedFor("AliasedTypeNullableFile").ExpectedLines, validatable, noLines, noLines)
  2672  
  2673  	// load expectations for model: top_level_format_issue.go
  2674  	flattenRun.AddExpectations("top_level_format_issue.go", []string{
  2675  		`type TopLevelFormatIssue struct {`,
  2676  		"	MyAlternateFile TopLevelFormatIssueMyAlternateFile `json:\"myAlternateFile,omitempty\"`",
  2677  		"	MyFile io.ReadCloser `json:\"myFile,omitempty\"`",
  2678  		// empty validation
  2679  		"func (m *TopLevelFormatIssue) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  2680  	},
  2681  		// not expected
  2682  		todo,
  2683  		// output in log
  2684  		noLines,
  2685  		noLines)
  2686  
  2687  	expandRun.AddExpectations("top_level_format_issue.go", []string{
  2688  		`type TopLevelFormatIssue struct {`,
  2689  		"	MyAlternateFile io.ReadCloser `json:\"myAlternateFile,omitempty\"`",
  2690  		"	MyFile io.ReadCloser `json:\"myFile,omitempty\"`",
  2691  		// empty validation
  2692  		"func (m *TopLevelFormatIssue) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  2693  	},
  2694  		// not expected
  2695  		noLines,
  2696  		// output in log
  2697  		noLines,
  2698  		noLines)
  2699  
  2700  	// load expectations for model: enums_with_additional_props.go
  2701  	flattenRun.AddExpectations("enums_with_additional_props.go", []string{
  2702  		`type EnumsWithAdditionalProps map[string]interface{`,
  2703  		`var enumsWithAdditionalPropsEnum []interface{`,
  2704  		`	var res []EnumsWithAdditionalProps`,
  2705  		"	if err := json.Unmarshal([]byte(`[\"{ \\\"a\\\": 1, \\\"b\\\": 2 }\",\"{ \\\"a\\\": 3, \\\"b\\\": 4 }\"]`), &res); err != nil {",
  2706  		`	for _, v := range res {`,
  2707  		`		enumsWithAdditionalPropsEnum = append(enumsWithAdditionalPropsEnum, v`,
  2708  		`func (m *EnumsWithAdditionalProps) validateEnumsWithAdditionalPropsEnum(path, location string, value EnumsWithAdditionalProps) error {`,
  2709  		`	if err := validate.Enum(path, location, value, enumsWithAdditionalPropsEnum); err != nil {`,
  2710  		`var enumsWithAdditionalPropsValueEnum []interface{`,
  2711  		`	var res []interface{`,
  2712  		"	if err := json.Unmarshal([]byte(`[\"{ \\\"b\\\": 2 }\",\"{ \\\"b\\\": 4 }\"]`), &res); err != nil {",
  2713  		`	for _, v := range res {`,
  2714  		`		enumsWithAdditionalPropsValueEnum = append(enumsWithAdditionalPropsValueEnum, v`,
  2715  		`func (m *EnumsWithAdditionalProps) validateEnumsWithAdditionalPropsValueEnum(path, location string, value interface{}) error {`,
  2716  		`	if err := validate.Enum(path, location, value, enumsWithAdditionalPropsValueEnum); err != nil {`,
  2717  		`func (m EnumsWithAdditionalProps) Validate(formats strfmt.Registry) error {`,
  2718  		`	for k := range m {`,
  2719  		`		if err := m.validateEnumsWithAdditionalPropsValueEnum(k, "body", m[k]); err != nil {`,
  2720  		`	if err := m.validateEnumsWithAdditionalPropsEnum("", "body", m); err != nil {`,
  2721  		`		return errors.CompositeValidationError(res...`,
  2722  	},
  2723  		// not expected
  2724  		todo,
  2725  		// output in log
  2726  		noLines,
  2727  		noLines)
  2728  
  2729  	expandRun.AddExpectations("enums_with_additional_props.go", flattenRun.ExpectedFor("EnumsWithAdditionalProps").ExpectedLines, todo, noLines, noLines)
  2730  
  2731  	// load expectations for model: empty_object_with_additional_nested_slice.go
  2732  	flattenRun.AddExpectations("empty_object_with_additional_nested_slice.go", []string{
  2733  		`type EmptyObjectWithAdditionalNestedSlice map[string][][][]EmptyObjectWithAdditionalNestedSliceAdditionalPropertiesItemsItemsItems`,
  2734  		`func (m EmptyObjectWithAdditionalNestedSlice) Validate(formats strfmt.Registry) error {`,
  2735  		`	for k := range m {`,
  2736  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  2737  		`		for i := 0; i < len(m[k]); i++ {`,
  2738  		`			for ii := 0; ii < len(m[k][i]); ii++ {`,
  2739  		`				for iii := 0; iii < len(m[k][i][ii]); iii++ {`,
  2740  		`					if err := m[k][i][ii][iii].Validate(formats); err != nil {`,
  2741  		`						if ve, ok := err.(*errors.Validation); ok {`,
  2742  		`							return ve.ValidateName(k + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii) + "." + strconv.Itoa(iii)`,
  2743  		`		return errors.CompositeValidationError(res...`,
  2744  	},
  2745  		// not expected
  2746  		todo,
  2747  		// output in log
  2748  		noLines,
  2749  		noLines)
  2750  
  2751  	expandRun.AddExpectations("empty_object_with_additional_nested_slice.go", []string{
  2752  		`type EmptyObjectWithAdditionalNestedSlice map[string][][][]EmptyObjectWithAdditionalNestedSliceItems0`,
  2753  		`func (m EmptyObjectWithAdditionalNestedSlice) Validate(formats strfmt.Registry) error {`,
  2754  		`	for k := range m {`,
  2755  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  2756  		`		for i := 0; i < len(m[k]); i++ {`,
  2757  		`			for ii := 0; ii < len(m[k][i]); ii++ {`,
  2758  		`				for iii := 0; iii < len(m[k][i][ii]); iii++ {`,
  2759  		`					if err := m[k][i][ii][iii].Validate(formats); err != nil {`,
  2760  		`						if ve, ok := err.(*errors.Validation); ok {`,
  2761  		`							return ve.ValidateName(k + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii) + "." + strconv.Itoa(iii)`,
  2762  		`		return errors.CompositeValidationError(res...`,
  2763  		`type EmptyObjectWithAdditionalNestedSliceItems0 struct {`,
  2764  		"	DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`",
  2765  		`func (m *EmptyObjectWithAdditionalNestedSliceItems0) Validate(formats strfmt.Registry) error {`,
  2766  		`	if err := m.validateDummyProp1(formats); err != nil {`,
  2767  		`		return errors.CompositeValidationError(res...`,
  2768  		`func (m *EmptyObjectWithAdditionalNestedSliceItems0) validateDummyProp1(formats strfmt.Registry) error {`,
  2769  		`	if swag.IsZero(m.DummyProp1) {`,
  2770  		`	if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`,
  2771  	},
  2772  		// not expected
  2773  		noLines,
  2774  		// output in log
  2775  		noLines,
  2776  		noLines)
  2777  
  2778  	// load expectations for model: empty_object_with_additional_nullable.go
  2779  	// fixed nullability of aliased type
  2780  	flattenRun.AddExpectations("empty_object_with_additional_nullable.go", []string{
  2781  		`type EmptyObjectWithAdditionalNullable map[string]*NullableThing`,
  2782  		`func (m EmptyObjectWithAdditionalNullable) Validate(formats strfmt.Registry) error {`,
  2783  		`	for k := range m {`,
  2784  		`		if swag.IsZero(m[k]) {`,
  2785  		`		if val, ok := m[k]; ok {`,
  2786  		`			if err := val.Validate(formats); err != nil {`,
  2787  		`		return errors.CompositeValidationError(res...`,
  2788  	},
  2789  		// not expected
  2790  		todo,
  2791  		// output in log
  2792  		noLines,
  2793  		noLines)
  2794  
  2795  	expandRun.AddExpectations("empty_object_with_additional_nullable.go", []string{
  2796  		`type EmptyObjectWithAdditionalNullable map[string]*strfmt.Date`,
  2797  		`func (m EmptyObjectWithAdditionalNullable) Validate(formats strfmt.Registry) error {`,
  2798  		`	for k := range m {`,
  2799  		`		if swag.IsZero(m[k]) {`,
  2800  		`		if err := validate.FormatOf(k, "body", "date", m[k].String(), formats); err != nil {`,
  2801  		`		return errors.CompositeValidationError(res...`,
  2802  	},
  2803  		// not expected
  2804  		noLines,
  2805  		// output in log
  2806  		noLines,
  2807  		noLines)
  2808  
  2809  	// load expectations for model: not_validated_at_all.go
  2810  	flattenRun.AddExpectations("not_validated_at_all.go", []string{
  2811  		`type NotValidatedAtAll struct {`,
  2812  		"	Prop2 string `json:\"prop2,omitempty\"`",
  2813  		"	NotValidatedAtAll map[string][]map[string]map[string]string `json:\"-\"`",
  2814  		// empty validation
  2815  		"func (m *NotValidatedAtAll) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  2816  	},
  2817  		// not expected
  2818  		todo,
  2819  		// output in log
  2820  		noLines,
  2821  		noLines)
  2822  
  2823  	expandRun.AddExpectations("not_validated_at_all.go", flattenRun.ExpectedFor("NotValidatedAtAll").ExpectedLines, todo, noLines, noLines)
  2824  }
  2825  
  2826  func initFixtureAdditionalProps() {
  2827  	// testing ../fixtures/bugs/1487/fixture-additionalProps.yaml with flatten and expand (--skip-flatten)
  2828  
  2829  	/*
  2830  		various patterns of additionalProperties
  2831  	*/
  2832  	f := newModelFixture("../fixtures/bugs/1487/fixture-additionalProps.yaml", "fixture for additionalProperties")
  2833  	flattenRun := f.AddRun(false)
  2834  	expandRun := f.AddRun(true)
  2835  
  2836  	// load expectations for model: additional_object_with_formated_thing.go
  2837  	flattenRun.AddExpectations("additional_object_with_formated_thing.go", []string{
  2838  		`type AdditionalObjectWithFormatedThing struct {`,
  2839  		"	Blob *int64 `json:\"blob\"`",
  2840  		"	AdditionalObjectWithFormatedThing map[string]strfmt.Date `json:\"-\"`",
  2841  		`func (m *AdditionalObjectWithFormatedThing) Validate(formats strfmt.Registry) error {`,
  2842  		`	if err := m.validateBlob(formats); err != nil {`,
  2843  		`	for k := range m.AdditionalObjectWithFormatedThing {`,
  2844  		// removed undue IZero call
  2845  		//`		if swag.IsZero(m.AdditionalObjectWithFormatedThing[k]) {`,
  2846  		`		if err := validate.FormatOf(k, "body", "date", m.AdditionalObjectWithFormatedThing[k].String(), formats); err != nil {`,
  2847  		`		return errors.CompositeValidationError(res...`,
  2848  		`func (m *AdditionalObjectWithFormatedThing) validateBlob(formats strfmt.Registry) error {`,
  2849  		`	if err := validate.Required("blob", "body", m.Blob); err != nil {`,
  2850  		`	if err := validate.MinimumInt("blob", "body", int64(*m.Blob), 1, false); err != nil {`,
  2851  	},
  2852  		// not expected
  2853  		todo,
  2854  		// output in log
  2855  		noLines,
  2856  		noLines)
  2857  
  2858  	expandRun.AddExpectations("additional_object_with_formated_thing.go", flattenRun.ExpectedFor("AdditionalObjectWithFormatedThing").ExpectedLines, todo, noLines, noLines)
  2859  
  2860  	// load expectations for model: aliased_date.go
  2861  	flattenRun.AddExpectations("aliased_date.go", []string{
  2862  		`type AliasedDate strfmt.Date`,
  2863  		`func (m AliasedDate) Validate(formats strfmt.Registry) error {`,
  2864  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  2865  		`		return errors.CompositeValidationError(res...`,
  2866  	},
  2867  		// not expected
  2868  		todo,
  2869  		// output in log
  2870  		noLines,
  2871  		noLines)
  2872  
  2873  	expandRun.AddExpectations("aliased_date.go", flattenRun.ExpectedFor("AliasedDate").ExpectedLines, todo, noLines, noLines)
  2874  
  2875  	// load expectations for model: additional_array_of_refed_thing.go
  2876  	flattenRun.AddExpectations("additional_array_of_refed_thing.go", []string{
  2877  		`type AdditionalArrayOfRefedThing struct {`,
  2878  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  2879  		"	AdditionalArrayOfRefedThing map[string][]AliasedDate `json:\"-\"`",
  2880  		`func (m *AdditionalArrayOfRefedThing) Validate(formats strfmt.Registry) error {`,
  2881  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  2882  		`	for k := range m.AdditionalArrayOfRefedThing {`,
  2883  		// removed undue IsZero call
  2884  		//`		if swag.IsZero(m.AdditionalArrayOfRefedThing[k]) {`,
  2885  		`		if err := validate.UniqueItems(k, "body", m.AdditionalArrayOfRefedThing[k]); err != nil {`,
  2886  		`		for i := 0; i < len(m.AdditionalArrayOfRefedThing[k]); i++ {`,
  2887  		`			if err := m.AdditionalArrayOfRefedThing[k][i].Validate(formats); err != nil {`,
  2888  		`				if ve, ok := err.(*errors.Validation); ok {`,
  2889  		`					return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  2890  		`		return errors.CompositeValidationError(res...`,
  2891  		`func (m *AdditionalArrayOfRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  2892  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  2893  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", int64(m.ThisOneNotRequired), 10, false); err != nil {`,
  2894  	},
  2895  		// not expected
  2896  		todo,
  2897  		// output in log
  2898  		noLines,
  2899  		noLines)
  2900  
  2901  	expandRun.AddExpectations("additional_array_of_refed_thing.go", []string{
  2902  		`type AdditionalArrayOfRefedThing struct {`,
  2903  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  2904  		"	AdditionalArrayOfRefedThing map[string][]strfmt.Date `json:\"-\"`",
  2905  		`func (m *AdditionalArrayOfRefedThing) Validate(formats strfmt.Registry) error {`,
  2906  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  2907  		`	for k := range m.AdditionalArrayOfRefedThing {`,
  2908  		// removed undue IsZero() call
  2909  		//`		if swag.IsZero(m.AdditionalArrayOfRefedThing[k]) {`,
  2910  		`		if err := validate.UniqueItems(k, "body", m.AdditionalArrayOfRefedThing[k]); err != nil {`,
  2911  		`		for i := 0; i < len(m.AdditionalArrayOfRefedThing[k]); i++ {`,
  2912  		`			if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "date", m.AdditionalArrayOfRefedThing[k][i].String(), formats); err != nil {`,
  2913  		`		return errors.CompositeValidationError(res...`,
  2914  		`func (m *AdditionalArrayOfRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  2915  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  2916  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", int64(m.ThisOneNotRequired), 10, false); err != nil {`,
  2917  	},
  2918  		// not expected
  2919  		todo,
  2920  		// output in log
  2921  		noLines,
  2922  		noLines)
  2923  
  2924  	// load expectations for model: additional_object_with_nullable_thing.go
  2925  	flattenRun.AddExpectations("additional_object_with_nullable_thing.go", []string{
  2926  		`type AdditionalObjectWithNullableThing struct {`,
  2927  		"	Blob int64 `json:\"blob,omitempty\"`",
  2928  		"	AdditionalObjectWithNullableThing map[string]*AliasedNullableDate `json:\"-\"`",
  2929  		`func (m *AdditionalObjectWithNullableThing) Validate(formats strfmt.Registry) error {`,
  2930  		`	if err := m.validateBlob(formats); err != nil {`,
  2931  		`	for k := range m.AdditionalObjectWithNullableThing {`,
  2932  		`		if swag.IsZero(m.AdditionalObjectWithNullableThing[k]) {`,
  2933  		`		if val, ok := m.AdditionalObjectWithNullableThing[k]; ok {`,
  2934  		`			if val != nil {`,
  2935  		`				if err := val.Validate(formats); err != nil {`,
  2936  		`		return errors.CompositeValidationError(res...`,
  2937  		`func (m *AdditionalObjectWithNullableThing) validateBlob(formats strfmt.Registry) error {`,
  2938  		`	if swag.IsZero(m.Blob) {`,
  2939  		`	if err := validate.MinimumInt("blob", "body", int64(m.Blob), 1, false); err != nil {`,
  2940  	},
  2941  		// not expected
  2942  		todo,
  2943  		// output in log
  2944  		noLines,
  2945  		noLines)
  2946  
  2947  	expandRun.AddExpectations("additional_object_with_nullable_thing.go", []string{
  2948  		`type AdditionalObjectWithNullableThing struct {`,
  2949  		"	Blob int64 `json:\"blob,omitempty\"`",
  2950  		"	AdditionalObjectWithNullableThing map[string]*strfmt.Date `json:\"-\"`",
  2951  		`func (m *AdditionalObjectWithNullableThing) Validate(formats strfmt.Registry) error {`,
  2952  		`	if err := m.validateBlob(formats); err != nil {`,
  2953  		`	for k := range m.AdditionalObjectWithNullableThing {`,
  2954  		`		if swag.IsZero(m.AdditionalObjectWithNullableThing[k]) {`,
  2955  		`		if err := validate.FormatOf(k, "body", "date", m.AdditionalObjectWithNullableThing[k].String(), formats); err != nil {`,
  2956  		`		return errors.CompositeValidationError(res...`,
  2957  		`func (m *AdditionalObjectWithNullableThing) validateBlob(formats strfmt.Registry) error {`,
  2958  		`	if swag.IsZero(m.Blob) {`,
  2959  		`	if err := validate.MinimumInt("blob", "body", int64(m.Blob), 1, false); err != nil {`,
  2960  	},
  2961  		// not expected
  2962  		todo,
  2963  		// output in log
  2964  		noLines,
  2965  		noLines)
  2966  
  2967  	// load expectations for model: additional_things.go
  2968  	flattenRun.AddExpectations("additional_things.go", []string{
  2969  		`type AdditionalThings struct {`,
  2970  		"	Origin *string `json:\"origin\"`",
  2971  		"	Status string `json:\"status,omitempty\"`",
  2972  		"	AdditionalThings map[string]string `json:\"-\"`",
  2973  		`var additionalThingsValueEnum []interface{`,
  2974  		`	var res []string`,
  2975  		"	if err := json.Unmarshal([]byte(`[\"bookshop\",\"amazon\",\"library\"]`), &res); err != nil {",
  2976  		`	for _, v := range res {`,
  2977  		`		additionalThingsValueEnum = append(additionalThingsValueEnum, v`,
  2978  		`func (m *AdditionalThings) validateAdditionalThingsValueEnum(path, location string, value string) error {`,
  2979  		`	if err := validate.Enum(path, location, value, additionalThingsValueEnum); err != nil {`,
  2980  		`func (m *AdditionalThings) Validate(formats strfmt.Registry) error {`,
  2981  		`	if err := m.validateOrigin(formats); err != nil {`,
  2982  		`	if err := m.validateStatus(formats); err != nil {`,
  2983  		`	for k := range m.AdditionalThings {`,
  2984  		// removed undue IsZero call
  2985  		//`		if swag.IsZero(m.AdditionalThings[k]) {`,
  2986  		`		if err := m.validateAdditionalThingsValueEnum(k, "body", m.AdditionalThings[k]); err != nil {`,
  2987  		`		return errors.CompositeValidationError(res...`,
  2988  		`var additionalThingsTypeOriginPropEnum []interface{`,
  2989  		`	var res []string`,
  2990  		"	if err := json.Unmarshal([]byte(`[\"print\",\"e-book\",\"collection\",\"museum\"]`), &res); err != nil {",
  2991  		`	for _, v := range res {`,
  2992  		`		additionalThingsTypeOriginPropEnum = append(additionalThingsTypeOriginPropEnum, v`,
  2993  		`	AdditionalThingsOriginPrint string = "print"`,
  2994  		`	AdditionalThingsOriginEBook string = "e-book"`,
  2995  		`	AdditionalThingsOriginCollection string = "collection"`,
  2996  		`	AdditionalThingsOriginMuseum string = "museum"`,
  2997  		`func (m *AdditionalThings) validateOriginEnum(path, location string, value string) error {`,
  2998  		`	if err := validate.Enum(path, location, value, additionalThingsTypeOriginPropEnum); err != nil {`,
  2999  		`func (m *AdditionalThings) validateOrigin(formats strfmt.Registry) error {`,
  3000  		`	if err := validate.Required("origin", "body", m.Origin); err != nil {`,
  3001  		`	if err := m.validateOriginEnum("origin", "body", *m.Origin); err != nil {`,
  3002  		`var additionalThingsTypeStatusPropEnum []interface{`,
  3003  		`	var res []string`,
  3004  		"	if err := json.Unmarshal([]byte(`[\"OK\",\"KO\"]`), &res); err != nil {",
  3005  		`	for _, v := range res {`,
  3006  		`		additionalThingsTypeStatusPropEnum = append(additionalThingsTypeStatusPropEnum, v`,
  3007  		`	AdditionalThingsStatusOK string = "OK"`,
  3008  		`	AdditionalThingsStatusKO string = "KO"`,
  3009  		`func (m *AdditionalThings) validateStatusEnum(path, location string, value string) error {`,
  3010  		`	if err := validate.Enum(path, location, value, additionalThingsTypeStatusPropEnum); err != nil {`,
  3011  		`func (m *AdditionalThings) validateStatus(formats strfmt.Registry) error {`,
  3012  		`	if swag.IsZero(m.Status) {`,
  3013  		`	if err := m.validateStatusEnum("status", "body", m.Status); err != nil {`,
  3014  	},
  3015  		// not expected
  3016  		todo,
  3017  		// output in log
  3018  		noLines,
  3019  		noLines)
  3020  
  3021  	expandRun.AddExpectations("additional_things.go", flattenRun.ExpectedFor("AdditionalThings").ExpectedLines, todo, noLines, noLines)
  3022  
  3023  	// load expectations for model: transitive_refed_thing_additional_properties.go
  3024  	flattenRun.AddExpectations("transitive_refed_thing_additional_properties.go", []string{
  3025  		`type TransitiveRefedThingAdditionalProperties struct {`,
  3026  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  3027  		"	TransitiveRefedThingAdditionalProperties map[string]*NoValidationThing `json:\"-\"`",
  3028  		`func (m *TransitiveRefedThingAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  3029  		`	if err := m.validateA1(formats); err != nil {`,
  3030  		`	for k := range m.TransitiveRefedThingAdditionalProperties {`,
  3031  		`		if val, ok := m.TransitiveRefedThingAdditionalProperties[k]; ok {`,
  3032  		`			if val != nil {`,
  3033  		`				if err := val.Validate(formats); err != nil {`,
  3034  		`		return errors.CompositeValidationError(res...`,
  3035  		`func (m *TransitiveRefedThingAdditionalProperties) validateA1(formats strfmt.Registry) error {`,
  3036  		`	if swag.IsZero(m.A1) {`,
  3037  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  3038  	},
  3039  		// not expected
  3040  		todo,
  3041  		// output in log
  3042  		noLines,
  3043  		noLines)
  3044  
  3045  	// load expectations for model: additional_object.go
  3046  	flattenRun.AddExpectations("additional_object.go", []string{
  3047  		`type AdditionalObject struct {`,
  3048  		"	MockID float64 `json:\"mockId,omitempty\"`",
  3049  		"	AdditionalObject map[string]*AdditionalObjectAdditionalProperties `json:\"-\"`",
  3050  		`func (m *AdditionalObject) Validate(formats strfmt.Registry) error {`,
  3051  		`	for k := range m.AdditionalObject {`,
  3052  		`		if val, ok := m.AdditionalObject[k]; ok {`,
  3053  		`			if val != nil {`,
  3054  		`				if err := val.Validate(formats); err != nil {`,
  3055  		`		return errors.CompositeValidationError(res...`,
  3056  	},
  3057  		// not expected
  3058  		todo,
  3059  		// output in log
  3060  		noLines,
  3061  		noLines)
  3062  
  3063  	expandRun.AddExpectations("additional_object.go", []string{
  3064  		`type AdditionalObject struct {`,
  3065  		"	MockID float64 `json:\"mockId,omitempty\"`",
  3066  		"	AdditionalObject map[string]*AdditionalObjectAnon `json:\"-\"`",
  3067  		`func (m *AdditionalObject) Validate(formats strfmt.Registry) error {`,
  3068  		`	for k := range m.AdditionalObject {`,
  3069  		`		if val, ok := m.AdditionalObject[k]; ok {`,
  3070  		`			if val != nil {`,
  3071  		`				if err := val.Validate(formats); err != nil {`,
  3072  		`		return errors.CompositeValidationError(res...`,
  3073  		`type AdditionalObjectAnon struct {`,
  3074  		"	MockA string `json:\"mockA,omitempty\"`",
  3075  		"	MockB *string `json:\"mockB\"`",
  3076  		"	MockC float64 `json:\"mockC,omitempty\"`",
  3077  		`func (m *AdditionalObjectAnon) Validate(formats strfmt.Registry) error {`,
  3078  		`	if err := m.validateMockA(formats); err != nil {`,
  3079  		`	if err := m.validateMockB(formats); err != nil {`,
  3080  		`		return errors.CompositeValidationError(res...`,
  3081  		`func (m *AdditionalObjectAnon) validateMockA(formats strfmt.Registry) error {`,
  3082  		`	if swag.IsZero(m.MockA) {`,
  3083  		"	if err := validate.Pattern(\"mockA\", \"body\", string(m.MockA), `^[A-Z]$`); err != nil {",
  3084  		`func (m *AdditionalObjectAnon) validateMockB(formats strfmt.Registry) error {`,
  3085  		`	if err := validate.Required("mockB", "body", m.MockB); err != nil {`,
  3086  		`	if err := validate.MinLength("mockB", "body", string(*m.MockB), 1); err != nil {`,
  3087  	},
  3088  		// not expected
  3089  		todo,
  3090  		// output in log
  3091  		noLines,
  3092  		noLines)
  3093  
  3094  	// load expectations for model: additional_slice_of_objects_additional_properties_items.go
  3095  	flattenRun.AddExpectations("additional_slice_of_objects_additional_properties_items.go", []string{
  3096  		`type AdditionalSliceOfObjectsAdditionalPropertiesItems struct {`,
  3097  		"	Prop2 int64 `json:\"prop2,omitempty\"`",
  3098  		// empty validation
  3099  		"func (m *AdditionalSliceOfObjectsAdditionalPropertiesItems) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  3100  	},
  3101  		// not expected
  3102  		todo,
  3103  		// output in log
  3104  		noLines,
  3105  		noLines)
  3106  
  3107  	// load expectations for model: additional_slice_of_aliased_nullable_primitives.go
  3108  	flattenRun.AddExpectations("additional_slice_of_aliased_nullable_primitives.go", []string{
  3109  		`type AdditionalSliceOfAliasedNullablePrimitives struct {`,
  3110  		"	Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  3111  		"	AdditionalSliceOfAliasedNullablePrimitives map[string][]*AliasedNullableDate `json:\"-\"`",
  3112  		`func (m *AdditionalSliceOfAliasedNullablePrimitives) Validate(formats strfmt.Registry) error {`,
  3113  		`	if err := m.validateProp3(formats); err != nil {`,
  3114  		`	for k := range m.AdditionalSliceOfAliasedNullablePrimitives {`,
  3115  		// removed undue IsSzero call
  3116  		//`		if swag.IsZero(m.AdditionalSliceOfAliasedNullablePrimitives[k]) {`,
  3117  		`		iAdditionalSliceOfAliasedNullablePrimitivesSize := int64(len(m.AdditionalSliceOfAliasedNullablePrimitives[k])`,
  3118  		`		if err := validate.MinItems(k, "body", iAdditionalSliceOfAliasedNullablePrimitivesSize, 10); err != nil {`,
  3119  		`		for i := 0; i < len(m.AdditionalSliceOfAliasedNullablePrimitives[k]); i++ {`,
  3120  		// do we need Required when item is nullable?
  3121  		// nullable not required:
  3122  		`			if swag.IsZero(m.AdditionalSliceOfAliasedNullablePrimitives[k][i]) {`,
  3123  		// nullable required:
  3124  		//`			if err := validate.Required(k+"."+strconv.Itoa(i), "body", m.AdditionalSliceOfAliasedNullablePrimitives[k][i]); err != nil {`,
  3125  		`			if m.AdditionalSliceOfAliasedNullablePrimitives[k][i] != nil {`,
  3126  		`				if err := m.AdditionalSliceOfAliasedNullablePrimitives[k][i].Validate(formats); err != nil {`,
  3127  		`					if ve, ok := err.(*errors.Validation); ok {`,
  3128  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  3129  		`		return errors.CompositeValidationError(res...`,
  3130  		`func (m *AdditionalSliceOfAliasedNullablePrimitives) validateProp3(formats strfmt.Registry) error {`,
  3131  		`	if swag.IsZero(m.Prop3) {`,
  3132  		`	if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`,
  3133  	},
  3134  		// not expected
  3135  		todo,
  3136  		// output in log
  3137  		noLines,
  3138  		noLines)
  3139  
  3140  	expandRun.AddExpectations("additional_slice_of_aliased_nullable_primitives.go", []string{
  3141  		`type AdditionalSliceOfAliasedNullablePrimitives struct {`,
  3142  		"	Prop3 strfmt.UUID `json:\"prop3,omitempty\"`",
  3143  		"	AdditionalSliceOfAliasedNullablePrimitives map[string][]*strfmt.Date `json:\"-\"`",
  3144  		`func (m *AdditionalSliceOfAliasedNullablePrimitives) Validate(formats strfmt.Registry) error {`,
  3145  		`	if err := m.validateProp3(formats); err != nil {`,
  3146  		`	for k := range m.AdditionalSliceOfAliasedNullablePrimitives {`,
  3147  		//`		if swag.IsZero(m.AdditionalSliceOfAliasedNullablePrimitives[k]) {`,
  3148  		`		iAdditionalSliceOfAliasedNullablePrimitivesSize := int64(len(m.AdditionalSliceOfAliasedNullablePrimitives[k])`,
  3149  		`		if err := validate.MinItems(k, "body", iAdditionalSliceOfAliasedNullablePrimitivesSize, 10); err != nil {`,
  3150  		`		for i := 0; i < len(m.AdditionalSliceOfAliasedNullablePrimitives[k]); i++ {`,
  3151  		// do we need Required when item is nullable?
  3152  		// nullable not required:
  3153  		`			if swag.IsZero(m.AdditionalSliceOfAliasedNullablePrimitives[k][i]) {`,
  3154  		// nullable required:
  3155  		//`			if err := validate.Required(k+"."+strconv.Itoa(i), "body", m.AdditionalSliceOfAliasedNullablePrimitives[k][i]); err != nil {`,
  3156  		`			if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "date", m.AdditionalSliceOfAliasedNullablePrimitives[k][i].String(), formats); err != nil {`,
  3157  		`		return errors.CompositeValidationError(res...`,
  3158  		`func (m *AdditionalSliceOfAliasedNullablePrimitives) validateProp3(formats strfmt.Registry) error {`,
  3159  		`	if swag.IsZero(m.Prop3) {`,
  3160  		`	if err := validate.FormatOf("prop3", "body", "uuid", m.Prop3.String(), formats); err != nil {`,
  3161  	},
  3162  		// not expected
  3163  		todo,
  3164  		// output in log
  3165  		noLines,
  3166  		noLines)
  3167  
  3168  	// load expectations for model: additional_slice_of_slice.go
  3169  	flattenRun.AddExpectations("additional_slice_of_slice.go", []string{
  3170  		`type AdditionalSliceOfSlice struct {`,
  3171  		"	Prop4 strfmt.UUID `json:\"prop4,omitempty\"`",
  3172  		"	AdditionalSliceOfSlice map[string][][]*AdditionalSliceOfSliceAdditionalPropertiesItemsItems `json:\"-\"`",
  3173  		`func (m *AdditionalSliceOfSlice) Validate(formats strfmt.Registry) error {`,
  3174  		`	if err := m.validateProp4(formats); err != nil {`,
  3175  		`	for k := range m.AdditionalSliceOfSlice {`,
  3176  		`		if err := validate.Required(k, "body", m.AdditionalSliceOfSlice[k]); err != nil {`,
  3177  		`		for i := 0; i < len(m.AdditionalSliceOfSlice[k]); i++ {`,
  3178  		`			iiAdditionalSliceOfSliceSize := int64(len(m.AdditionalSliceOfSlice[k][i])`,
  3179  		`			if err := validate.MaxItems(k+"."+strconv.Itoa(i), "body", iiAdditionalSliceOfSliceSize, 10); err != nil {`,
  3180  		`			for ii := 0; ii < len(m.AdditionalSliceOfSlice[k][i]); ii++ {`,
  3181  		// do we need Required when item is nullable?
  3182  		// nullable not required:
  3183  		`				if swag.IsZero(m.AdditionalSliceOfSlice[k][i][ii]) {`,
  3184  		// nullable not required:
  3185  		//`				if err := validate.Required(k+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", m.AdditionalSliceOfSlice[k][i][ii]); err != nil {`,
  3186  		`				if m.AdditionalSliceOfSlice[k][i][ii] != nil {`,
  3187  		`					if err := m.AdditionalSliceOfSlice[k][i][ii].Validate(formats); err != nil {`,
  3188  		`						if ve, ok := err.(*errors.Validation); ok {`,
  3189  		`							return ve.ValidateName(k + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)`,
  3190  		`		return errors.CompositeValidationError(res...`,
  3191  		`func (m *AdditionalSliceOfSlice) validateProp4(formats strfmt.Registry) error {`,
  3192  		`	if swag.IsZero(m.Prop4) {`,
  3193  		`	if err := validate.FormatOf("prop4", "body", "uuid", m.Prop4.String(), formats); err != nil {`,
  3194  	},
  3195  		// not expected
  3196  		todo,
  3197  		// output in log
  3198  		noLines,
  3199  		noLines)
  3200  
  3201  	expandRun.AddExpectations("additional_slice_of_slice.go", []string{
  3202  		`type AdditionalSliceOfSlice struct {`,
  3203  		"	Prop4 strfmt.UUID `json:\"prop4,omitempty\"`",
  3204  		"	AdditionalSliceOfSlice map[string][][]*AdditionalSliceOfSliceItems0 `json:\"-\"`",
  3205  		`func (m *AdditionalSliceOfSlice) Validate(formats strfmt.Registry) error {`,
  3206  		`	if err := m.validateProp4(formats); err != nil {`,
  3207  		`	for k := range m.AdditionalSliceOfSlice {`,
  3208  		`		if err := validate.Required(k, "body", m.AdditionalSliceOfSlice[k]); err != nil {`,
  3209  		`		for i := 0; i < len(m.AdditionalSliceOfSlice[k]); i++ {`,
  3210  		`			iiAdditionalSliceOfSliceSize := int64(len(m.AdditionalSliceOfSlice[k][i])`,
  3211  		`			if err := validate.MaxItems(k+"."+strconv.Itoa(i), "body", iiAdditionalSliceOfSliceSize, 10); err != nil {`,
  3212  		`			for ii := 0; ii < len(m.AdditionalSliceOfSlice[k][i]); ii++ {`,
  3213  		// do we need Required when item is nullable?
  3214  		// nullable not required:
  3215  		`				if swag.IsZero(m.AdditionalSliceOfSlice[k][i][ii]) {`,
  3216  		// nullable required:
  3217  		//`				if err := validate.Required(k+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", m.AdditionalSliceOfSlice[k][i][ii]); err != nil {`,
  3218  		`				if m.AdditionalSliceOfSlice[k][i][ii] != nil {`,
  3219  		`					if err := m.AdditionalSliceOfSlice[k][i][ii].Validate(formats); err != nil {`,
  3220  		`						if ve, ok := err.(*errors.Validation); ok {`,
  3221  		`							return ve.ValidateName(k + "." + strconv.Itoa(i) + "." + strconv.Itoa(ii)`,
  3222  		`		return errors.CompositeValidationError(res...`,
  3223  		`func (m *AdditionalSliceOfSlice) validateProp4(formats strfmt.Registry) error {`,
  3224  		`	if swag.IsZero(m.Prop4) {`,
  3225  		`	if err := validate.FormatOf("prop4", "body", "uuid", m.Prop4.String(), formats); err != nil {`,
  3226  		`type AdditionalSliceOfSliceItems0 struct {`,
  3227  		"	Prop5 int64 `json:\"prop5,omitempty\"`",
  3228  		`func (m *AdditionalSliceOfSliceItems0) Validate(formats strfmt.Registry) error {`,
  3229  		`	if err := m.validateProp5(formats); err != nil {`,
  3230  		`		return errors.CompositeValidationError(res...`,
  3231  		`func (m *AdditionalSliceOfSliceItems0) validateProp5(formats strfmt.Registry) error {`,
  3232  		`	if swag.IsZero(m.Prop5) {`,
  3233  		`	if err := validate.MaximumInt("prop5", "body", int64(m.Prop5), 10, false); err != nil {`,
  3234  	},
  3235  		// not expected
  3236  		todo,
  3237  		// output in log
  3238  		noLines,
  3239  		noLines)
  3240  
  3241  	// load expectations for model: additional_object_with_aliased_thing.go
  3242  	flattenRun.AddExpectations("additional_object_with_aliased_thing.go", []string{
  3243  		`type AdditionalObjectWithAliasedThing struct {`,
  3244  		"	Blob int64 `json:\"blob,omitempty\"`",
  3245  		"	AdditionalObjectWithAliasedThing map[string]AliasedDate `json:\"-\"`",
  3246  		`func (m *AdditionalObjectWithAliasedThing) Validate(formats strfmt.Registry) error {`,
  3247  		`	if err := m.validateBlob(formats); err != nil {`,
  3248  		`	for k := range m.AdditionalObjectWithAliasedThing {`,
  3249  		// removed undue IsZero call
  3250  		//`		if swag.IsZero(m.AdditionalObjectWithAliasedThing[k]) {`,
  3251  		`		if val, ok := m.AdditionalObjectWithAliasedThing[k]; ok {`,
  3252  		`			if err := val.Validate(formats); err != nil {`,
  3253  		`		return errors.CompositeValidationError(res...`,
  3254  		`func (m *AdditionalObjectWithAliasedThing) validateBlob(formats strfmt.Registry) error {`,
  3255  		`	if swag.IsZero(m.Blob) {`,
  3256  		`	if err := validate.MinimumInt("blob", "body", int64(m.Blob), 1, false); err != nil {`,
  3257  	},
  3258  		// not expected
  3259  		todo,
  3260  		// output in log
  3261  		noLines,
  3262  		noLines)
  3263  
  3264  	expandRun.AddExpectations("additional_object_with_aliased_thing.go", []string{
  3265  		`type AdditionalObjectWithAliasedThing struct {`,
  3266  		"	Blob int64 `json:\"blob,omitempty\"`",
  3267  		"	AdditionalObjectWithAliasedThing map[string]strfmt.Date `json:\"-\"`",
  3268  		`func (m *AdditionalObjectWithAliasedThing) Validate(formats strfmt.Registry) error {`,
  3269  		`	if err := m.validateBlob(formats); err != nil {`,
  3270  		`	for k := range m.AdditionalObjectWithAliasedThing {`,
  3271  		//`		if swag.IsZero(m.AdditionalObjectWithAliasedThing[k]) {`,
  3272  		`		if err := validate.FormatOf(k, "body", "date", m.AdditionalObjectWithAliasedThing[k].String(), formats); err != nil {`,
  3273  		`		return errors.CompositeValidationError(res...`,
  3274  		`func (m *AdditionalObjectWithAliasedThing) validateBlob(formats strfmt.Registry) error {`,
  3275  		`	if swag.IsZero(m.Blob) {`,
  3276  		`	if err := validate.MinimumInt("blob", "body", int64(m.Blob), 1, false); err != nil {`,
  3277  	},
  3278  		// not expected
  3279  		todo,
  3280  		// output in log
  3281  		noLines,
  3282  		noLines)
  3283  
  3284  	// load expectations for model: additional_things_nested_additional_properties.go
  3285  	flattenRun.AddExpectations("additional_things_nested_additional_properties.go", []string{
  3286  		`type AdditionalThingsNestedAdditionalProperties struct {`,
  3287  		"	PrinterAddress string `json:\"printerAddress,omitempty\"`",
  3288  		"	PrinterCountry string `json:\"printerCountry,omitempty\"`",
  3289  		"	PrinterDate strfmt.Date `json:\"printerDate,omitempty\"`",
  3290  		"	AdditionalThingsNestedAdditionalProperties map[string]*AdditionalThingsNestedAdditionalPropertiesAdditionalProperties `json:\"-\"`",
  3291  		`func (m *AdditionalThingsNestedAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  3292  		`	if err := m.validatePrinterCountry(formats); err != nil {`,
  3293  		`	if err := m.validatePrinterDate(formats); err != nil {`,
  3294  		`	for k := range m.AdditionalThingsNestedAdditionalProperties {`,
  3295  		`		if val, ok := m.AdditionalThingsNestedAdditionalProperties[k]; ok {`,
  3296  		`			if val != nil {`,
  3297  		`				if err := val.Validate(formats); err != nil {`,
  3298  		`		return errors.CompositeValidationError(res...`,
  3299  		`var additionalThingsNestedAdditionalPropertiesTypePrinterCountryPropEnum []interface{`,
  3300  		`	var res []string`,
  3301  		"	if err := json.Unmarshal([]byte(`[\"US\",\"FR\",\"UK\",\"BE\",\"CA\",\"DE\"]`), &res); err != nil {",
  3302  		`	for _, v := range res {`,
  3303  		`		additionalThingsNestedAdditionalPropertiesTypePrinterCountryPropEnum = append(additionalThingsNestedAdditionalPropertiesTypePrinterCountryPropEnum, v`,
  3304  		`	AdditionalThingsNestedAdditionalPropertiesPrinterCountryUS string = "US"`,
  3305  		`	AdditionalThingsNestedAdditionalPropertiesPrinterCountryFR string = "FR"`,
  3306  		`	AdditionalThingsNestedAdditionalPropertiesPrinterCountryUK string = "UK"`,
  3307  		`	AdditionalThingsNestedAdditionalPropertiesPrinterCountryBE string = "BE"`,
  3308  		`	AdditionalThingsNestedAdditionalPropertiesPrinterCountryCA string = "CA"`,
  3309  		`	AdditionalThingsNestedAdditionalPropertiesPrinterCountryDE string = "DE"`,
  3310  		`func (m *AdditionalThingsNestedAdditionalProperties) validatePrinterCountryEnum(path, location string, value string) error {`,
  3311  		`	if err := validate.Enum(path, location, value, additionalThingsNestedAdditionalPropertiesTypePrinterCountryPropEnum); err != nil {`,
  3312  		`func (m *AdditionalThingsNestedAdditionalProperties) validatePrinterCountry(formats strfmt.Registry) error {`,
  3313  		`	if swag.IsZero(m.PrinterCountry) {`,
  3314  		`	if err := m.validatePrinterCountryEnum("printerCountry", "body", m.PrinterCountry); err != nil {`,
  3315  		`func (m *AdditionalThingsNestedAdditionalProperties) validatePrinterDate(formats strfmt.Registry) error {`,
  3316  		`	if swag.IsZero(m.PrinterDate) {`,
  3317  		`	if err := validate.FormatOf("printerDate", "body", "date", m.PrinterDate.String(), formats); err != nil {`,
  3318  	},
  3319  		// not expected
  3320  		todo,
  3321  		// output in log
  3322  		noLines,
  3323  		noLines)
  3324  
  3325  	// load expectations for model: empty_object_with_additional_slice_additional_properties_items.go
  3326  	flattenRun.AddExpectations("empty_object_with_additional_slice_additional_properties_items.go", []string{
  3327  		`type EmptyObjectWithAdditionalSliceAdditionalPropertiesItems struct {`,
  3328  		"	DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`",
  3329  		`func (m *EmptyObjectWithAdditionalSliceAdditionalPropertiesItems) Validate(formats strfmt.Registry) error {`,
  3330  		`	if err := m.validateDummyProp1(formats); err != nil {`,
  3331  		`		return errors.CompositeValidationError(res...`,
  3332  		`func (m *EmptyObjectWithAdditionalSliceAdditionalPropertiesItems) validateDummyProp1(formats strfmt.Registry) error {`,
  3333  		`	if swag.IsZero(m.DummyProp1) {`,
  3334  		`	if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`,
  3335  	},
  3336  		// not expected
  3337  		todo,
  3338  		// output in log
  3339  		noLines,
  3340  		noLines)
  3341  
  3342  	// load expectations for model: additional_things_nested_additional_properties_additional_properties.go
  3343  	flattenRun.AddExpectations("additional_things_nested_additional_properties_additional_properties.go", []string{
  3344  		`type AdditionalThingsNestedAdditionalPropertiesAdditionalProperties struct {`,
  3345  		"	AverageDelay strfmt.Duration `json:\"averageDelay,omitempty\"`",
  3346  		`func (m *AdditionalThingsNestedAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  3347  		`	if err := m.validateAverageDelay(formats); err != nil {`,
  3348  		`		return errors.CompositeValidationError(res...`,
  3349  		`func (m *AdditionalThingsNestedAdditionalPropertiesAdditionalProperties) validateAverageDelay(formats strfmt.Registry) error {`,
  3350  		`	if swag.IsZero(m.AverageDelay) {`,
  3351  		`	if err := validate.FormatOf("averageDelay", "body", "duration", m.AverageDelay.String(), formats); err != nil {`,
  3352  	},
  3353  		// not expected
  3354  		todo,
  3355  		// output in log
  3356  		noLines,
  3357  		noLines)
  3358  
  3359  	// load expectations for model: additional_slice_of_slice_additional_properties_items_items.go
  3360  	flattenRun.AddExpectations("additional_slice_of_slice_additional_properties_items_items.go", []string{
  3361  		`type AdditionalSliceOfSliceAdditionalPropertiesItemsItems struct {`,
  3362  		"	Prop5 int64 `json:\"prop5,omitempty\"`",
  3363  		`func (m *AdditionalSliceOfSliceAdditionalPropertiesItemsItems) Validate(formats strfmt.Registry) error {`,
  3364  		`	if err := m.validateProp5(formats); err != nil {`,
  3365  		`		return errors.CompositeValidationError(res...`,
  3366  		`func (m *AdditionalSliceOfSliceAdditionalPropertiesItemsItems) validateProp5(formats strfmt.Registry) error {`,
  3367  		`	if swag.IsZero(m.Prop5) {`,
  3368  		`	if err := validate.MaximumInt("prop5", "body", int64(m.Prop5), 10, false); err != nil {`,
  3369  	},
  3370  		// not expected
  3371  		todo,
  3372  		// output in log
  3373  		noLines,
  3374  		noLines)
  3375  
  3376  	// load expectations for model: additional_object_additional_properties.go
  3377  	flattenRun.AddExpectations("additional_object_additional_properties.go", []string{
  3378  		`type AdditionalObjectAdditionalProperties struct {`,
  3379  		"	MockA string `json:\"mockA,omitempty\"`",
  3380  		"	MockB *string `json:\"mockB\"`",
  3381  		"	MockC float64 `json:\"mockC,omitempty\"`",
  3382  		`func (m *AdditionalObjectAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  3383  		`	if err := m.validateMockA(formats); err != nil {`,
  3384  		`	if err := m.validateMockB(formats); err != nil {`,
  3385  		`		return errors.CompositeValidationError(res...`,
  3386  		`func (m *AdditionalObjectAdditionalProperties) validateMockA(formats strfmt.Registry) error {`,
  3387  		`	if swag.IsZero(m.MockA) {`,
  3388  		"	if err := validate.Pattern(\"mockA\", \"body\", string(m.MockA), `^[A-Z]$`); err != nil {",
  3389  		`func (m *AdditionalObjectAdditionalProperties) validateMockB(formats strfmt.Registry) error {`,
  3390  		`	if err := validate.Required("mockB", "body", m.MockB); err != nil {`,
  3391  		`	if err := validate.MinLength("mockB", "body", string(*m.MockB), 1); err != nil {`,
  3392  	},
  3393  		// not expected
  3394  		todo,
  3395  		// output in log
  3396  		noLines,
  3397  		noLines)
  3398  
  3399  	// load expectations for model: additional_transitive_refed_thing.go
  3400  	flattenRun.AddExpectations("additional_transitive_refed_thing.go", []string{
  3401  		`type AdditionalTransitiveRefedThing struct {`,
  3402  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  3403  		"	AdditionalTransitiveRefedThing map[string][]*TransitiveRefedThing `json:\"-\"`",
  3404  		`func (m *AdditionalTransitiveRefedThing) Validate(formats strfmt.Registry) error {`,
  3405  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  3406  		`	for k := range m.AdditionalTransitiveRefedThing {`,
  3407  		`		if err := validate.Required(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  3408  		`		if err := validate.UniqueItems(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  3409  		`		for i := 0; i < len(m.AdditionalTransitiveRefedThing[k]); i++ {`,
  3410  		// do we need Required when item is nullable?
  3411  		// nullable not required:
  3412  		`			if swag.IsZero(m.AdditionalTransitiveRefedThing[k][i]) {`,
  3413  		// nullable required:
  3414  		//`			if err := validate.Required(k+"."+strconv.Itoa(i), "body", m.AdditionalTransitiveRefedThing[k][i]); err != nil {`,
  3415  		`			if m.AdditionalTransitiveRefedThing[k][i] != nil {`,
  3416  		`				if err := m.AdditionalTransitiveRefedThing[k][i].Validate(formats); err != nil {`,
  3417  		`					if ve, ok := err.(*errors.Validation); ok {`,
  3418  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  3419  		`		return errors.CompositeValidationError(res...`,
  3420  		`func (m *AdditionalTransitiveRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  3421  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  3422  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", int64(m.ThisOneNotRequired), 10, false); err != nil {`,
  3423  	},
  3424  		// not expected
  3425  		todo,
  3426  		// output in log
  3427  		noLines,
  3428  		noLines)
  3429  
  3430  	expandRun.AddExpectations("additional_transitive_refed_thing.go", []string{
  3431  		`type AdditionalTransitiveRefedThing struct {`,
  3432  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  3433  		"	AdditionalTransitiveRefedThing map[string][]*AdditionalTransitiveRefedThingItems0 `json:\"-\"`",
  3434  		`func (m *AdditionalTransitiveRefedThing) Validate(formats strfmt.Registry) error {`,
  3435  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  3436  		`	for k := range m.AdditionalTransitiveRefedThing {`,
  3437  		`		if err := validate.Required(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  3438  		`		if err := validate.UniqueItems(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  3439  		`		for i := 0; i < len(m.AdditionalTransitiveRefedThing[k]); i++ {`,
  3440  		// do we need Required when item is nullable?
  3441  		// nullable not required:
  3442  		`			if swag.IsZero(m.AdditionalTransitiveRefedThing[k][i]) {`,
  3443  		// nullable required:
  3444  		//`			if err := validate.Required(k+"."+strconv.Itoa(i), "body", m.AdditionalTransitiveRefedThing[k][i]); err != nil {`,
  3445  		`			if m.AdditionalTransitiveRefedThing[k][i] != nil {`,
  3446  		`				if err := m.AdditionalTransitiveRefedThing[k][i].Validate(formats); err != nil {`,
  3447  		`					if ve, ok := err.(*errors.Validation); ok {`,
  3448  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  3449  		`		return errors.CompositeValidationError(res...`,
  3450  		`func (m *AdditionalTransitiveRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  3451  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  3452  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", int64(m.ThisOneNotRequired), 10, false); err != nil {`,
  3453  		`type AdditionalTransitiveRefedThingItems0 struct {`,
  3454  		"	ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`",
  3455  		"	AdditionalTransitiveRefedThingItems0 map[string]*AdditionalTransitiveRefedThingItems0Anon `json:\"-\"`",
  3456  		`func (m *AdditionalTransitiveRefedThingItems0) Validate(formats strfmt.Registry) error {`,
  3457  		`	if err := m.validateThisOneNotRequiredEither(formats); err != nil {`,
  3458  		`	for k := range m.AdditionalTransitiveRefedThingItems0 {`,
  3459  		`		if val, ok := m.AdditionalTransitiveRefedThingItems0[k]; ok {`,
  3460  		`			if val != nil {`,
  3461  		`				if err := val.Validate(formats); err != nil {`,
  3462  		`		return errors.CompositeValidationError(res...`,
  3463  		`func (m *AdditionalTransitiveRefedThingItems0) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`,
  3464  		`	if swag.IsZero(m.ThisOneNotRequiredEither) {`,
  3465  		`	if err := validate.MaximumInt("thisOneNotRequiredEither", "body", int64(m.ThisOneNotRequiredEither), 20, false); err != nil {`,
  3466  		`type AdditionalTransitiveRefedThingItems0Anon struct {`,
  3467  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  3468  		"	AdditionalTransitiveRefedThingItems0Anon map[string]*AdditionalTransitiveRefedThingItems0AnonAnon `json:\"-\"`",
  3469  		`func (m *AdditionalTransitiveRefedThingItems0Anon) Validate(formats strfmt.Registry) error {`,
  3470  		`	if err := m.validateA1(formats); err != nil {`,
  3471  		`	for k := range m.AdditionalTransitiveRefedThingItems0Anon {`,
  3472  		`		if val, ok := m.AdditionalTransitiveRefedThingItems0Anon[k]; ok {`,
  3473  		`			if val != nil {`,
  3474  		`				if err := val.Validate(formats); err != nil {`,
  3475  		`		return errors.CompositeValidationError(res...`,
  3476  		`func (m *AdditionalTransitiveRefedThingItems0Anon) validateA1(formats strfmt.Registry) error {`,
  3477  		`	if swag.IsZero(m.A1) {`,
  3478  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  3479  		`type AdditionalTransitiveRefedThingItems0AnonAnon struct {`,
  3480  		"	Discourse string `json:\"discourse,omitempty\"`",
  3481  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  3482  		"	AdditionalTransitiveRefedThingItems0AnonAnonAdditionalProperties map[string]interface{} `json:\"-\"`",
  3483  		// empty validation
  3484  		"func (m *AdditionalTransitiveRefedThingItems0AnonAnon) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  3485  	},
  3486  		// not expected
  3487  		todo,
  3488  		// output in log
  3489  		noLines,
  3490  		noLines)
  3491  
  3492  	// load expectations for model: additional_nullable_array_thing.go
  3493  	flattenRun.AddExpectations("additional_nullable_array_thing.go", []string{
  3494  		`type AdditionalNullableArrayThing struct {`,
  3495  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  3496  		"	AdditionalNullableArrayThing map[string][]strfmt.ISBN `json:\"-\"`",
  3497  		`func (m *AdditionalNullableArrayThing) Validate(formats strfmt.Registry) error {`,
  3498  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  3499  		`	for k := range m.AdditionalNullableArrayThing {`,
  3500  		//`		if swag.IsZero(m.AdditionalNullableArrayThing[k]) {`,
  3501  		`		if err := validate.UniqueItems(k, "body", m.AdditionalNullableArrayThing[k]); err != nil {`,
  3502  		`		for i := 0; i < len(m.AdditionalNullableArrayThing[k]); i++ {`,
  3503  		`			if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "isbn", m.AdditionalNullableArrayThing[k][i].String(), formats); err != nil {`,
  3504  		`		return errors.CompositeValidationError(res...`,
  3505  		`func (m *AdditionalNullableArrayThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  3506  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  3507  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", int64(m.ThisOneNotRequired), 10, false); err != nil {`,
  3508  	},
  3509  		// not expected
  3510  		todo,
  3511  		// output in log
  3512  		noLines,
  3513  		noLines)
  3514  
  3515  	expandRun.AddExpectations("additional_nullable_array_thing.go", flattenRun.ExpectedFor("AdditionalNullableArrayThing").ExpectedLines, todo, noLines, noLines)
  3516  
  3517  	// load expectations for model: additional_slice_of_primitives.go
  3518  	flattenRun.AddExpectations("additional_slice_of_primitives.go", []string{
  3519  		`type AdditionalSliceOfPrimitives struct {`,
  3520  		"	Prop1 string `json:\"prop1,omitempty\"`",
  3521  		"	AdditionalSliceOfPrimitives map[string][]strfmt.Date `json:\"-\"`",
  3522  		`func (m *AdditionalSliceOfPrimitives) Validate(formats strfmt.Registry) error {`,
  3523  		`	for k := range m.AdditionalSliceOfPrimitives {`,
  3524  		//`		if swag.IsZero(m.AdditionalSliceOfPrimitives[k]) {`,
  3525  		`		if err := validate.UniqueItems(k, "body", m.AdditionalSliceOfPrimitives[k]); err != nil {`,
  3526  		`		for i := 0; i < len(m.AdditionalSliceOfPrimitives[k]); i++ {`,
  3527  		`			if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "date", m.AdditionalSliceOfPrimitives[k][i].String(), formats); err != nil {`,
  3528  		`		return errors.CompositeValidationError(res...`,
  3529  	},
  3530  		// not expected
  3531  		todo,
  3532  		// output in log
  3533  		noLines,
  3534  		noLines)
  3535  
  3536  	expandRun.AddExpectations("additional_slice_of_primitives.go", flattenRun.ExpectedFor("AdditionalSliceOfPrimitives").ExpectedLines, todo, noLines, noLines)
  3537  
  3538  	// load expectations for model: additional_array_thing.go
  3539  	flattenRun.AddExpectations("additional_array_thing.go", []string{
  3540  		`type AdditionalArrayThing struct {`,
  3541  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  3542  		"	AdditionalArrayThing map[string][]strfmt.UUID `json:\"-\"`",
  3543  		`func (m *AdditionalArrayThing) Validate(formats strfmt.Registry) error {`,
  3544  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  3545  		`	for k := range m.AdditionalArrayThing {`,
  3546  		//`		if swag.IsZero(m.AdditionalArrayThing[k]) {`,
  3547  		`		if err := validate.UniqueItems(k, "body", m.AdditionalArrayThing[k]); err != nil {`,
  3548  		`		for i := 0; i < len(m.AdditionalArrayThing[k]); i++ {`,
  3549  		`			if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "uuid", m.AdditionalArrayThing[k][i].String(), formats); err != nil {`,
  3550  		`		return errors.CompositeValidationError(res...`,
  3551  		`func (m *AdditionalArrayThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  3552  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  3553  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", int64(m.ThisOneNotRequired), 10, false); err != nil {`,
  3554  	},
  3555  		// not expected
  3556  		todo,
  3557  		// output in log
  3558  		noLines,
  3559  		noLines)
  3560  
  3561  	expandRun.AddExpectations("additional_array_thing.go", flattenRun.ExpectedFor("AdditionalArrayThing").ExpectedLines, todo, noLines, noLines)
  3562  
  3563  	// load expectations for model: interface_thing.go
  3564  	flattenRun.AddExpectations("interface_thing.go", []string{
  3565  		`type InterfaceThing interface{}`,
  3566  	},
  3567  		// not expected
  3568  		todo,
  3569  		// output in log
  3570  		noLines,
  3571  		noLines)
  3572  
  3573  	expandRun.AddExpectations("interface_thing.go", flattenRun.ExpectedFor("InterfaceThing").ExpectedLines, todo, noLines, noLines)
  3574  
  3575  	// load expectations for model: empty_object_with_additional_slice.go
  3576  	flattenRun.AddExpectations("empty_object_with_additional_slice.go", []string{
  3577  		`type EmptyObjectWithAdditionalSlice map[string][]EmptyObjectWithAdditionalSliceAdditionalPropertiesItems`,
  3578  		`func (m EmptyObjectWithAdditionalSlice) Validate(formats strfmt.Registry) error {`,
  3579  		//`	if err := validate.Required("", "body", EmptyObjectWithAdditionalSlice(m)); err != nil {`,
  3580  		`	for k := range m {`,
  3581  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  3582  		`		for i := 0; i < len(m[k]); i++ {`,
  3583  		`			if err := m[k][i].Validate(formats); err != nil {`,
  3584  		`				if ve, ok := err.(*errors.Validation); ok {`,
  3585  		`					return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  3586  		`		return errors.CompositeValidationError(res...`,
  3587  	},
  3588  		// not expected
  3589  		todo,
  3590  		// output in log
  3591  		noLines,
  3592  		noLines)
  3593  
  3594  	expandRun.AddExpectations("empty_object_with_additional_slice.go", []string{
  3595  		`type EmptyObjectWithAdditionalSlice map[string][]EmptyObjectWithAdditionalSliceItems0`,
  3596  		`func (m EmptyObjectWithAdditionalSlice) Validate(formats strfmt.Registry) error {`,
  3597  		//`	if err := validate.Required("", "body", EmptyObjectWithAdditionalSlice(m)); err != nil {`,
  3598  		`	for k := range m {`,
  3599  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  3600  		`		for i := 0; i < len(m[k]); i++ {`,
  3601  		`			if err := m[k][i].Validate(formats); err != nil {`,
  3602  		`				if ve, ok := err.(*errors.Validation); ok {`,
  3603  		`					return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  3604  		`		return errors.CompositeValidationError(res...`,
  3605  		`type EmptyObjectWithAdditionalSliceItems0 struct {`,
  3606  		"	DummyProp1 strfmt.Date `json:\"dummyProp1,omitempty\"`",
  3607  		`func (m *EmptyObjectWithAdditionalSliceItems0) Validate(formats strfmt.Registry) error {`,
  3608  		`	if err := m.validateDummyProp1(formats); err != nil {`,
  3609  		`		return errors.CompositeValidationError(res...`,
  3610  		`func (m *EmptyObjectWithAdditionalSliceItems0) validateDummyProp1(formats strfmt.Registry) error {`,
  3611  		`	if swag.IsZero(m.DummyProp1) {`,
  3612  		`	if err := validate.FormatOf("dummyProp1", "body", "date", m.DummyProp1.String(), formats); err != nil {`,
  3613  	},
  3614  		// not expected
  3615  		todo,
  3616  		// output in log
  3617  		noLines,
  3618  		noLines)
  3619  
  3620  	// load expectations for model: additional_slice_of_objects.go
  3621  	flattenRun.AddExpectations("additional_slice_of_objects.go", []string{
  3622  		`type AdditionalSliceOfObjects struct {`,
  3623  		"	Prop1 string `json:\"prop1,omitempty\"`",
  3624  		"	AdditionalSliceOfObjects map[string][]*AdditionalSliceOfObjectsAdditionalPropertiesItems `json:\"-\"`",
  3625  		`func (m *AdditionalSliceOfObjects) Validate(formats strfmt.Registry) error {`,
  3626  		`	for k := range m.AdditionalSliceOfObjects {`,
  3627  		`		if err := validate.Required(k, "body", m.AdditionalSliceOfObjects[k]); err != nil {`,
  3628  		`		if err := validate.UniqueItems(k, "body", m.AdditionalSliceOfObjects[k]); err != nil {`,
  3629  		`		for i := 0; i < len(m.AdditionalSliceOfObjects[k]); i++ {`,
  3630  		// do we need Required when item is nullable?
  3631  		// nullable not required:
  3632  		`			if swag.IsZero(m.AdditionalSliceOfObjects[k][i]) {`,
  3633  		// nullable required:
  3634  		//`if err := validate.Required(k, "body", m.AdditionalSliceOfObjects[k]); err != nil {`,
  3635  		`			if m.AdditionalSliceOfObjects[k][i] != nil {`,
  3636  		`				if err := m.AdditionalSliceOfObjects[k][i].Validate(formats); err != nil {`,
  3637  		`					if ve, ok := err.(*errors.Validation); ok {`,
  3638  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  3639  		`		return errors.CompositeValidationError(res...`,
  3640  	},
  3641  		// not expected
  3642  		todo,
  3643  		// output in log
  3644  		noLines,
  3645  		noLines)
  3646  
  3647  	expandRun.AddExpectations("additional_slice_of_objects.go", []string{
  3648  		`type AdditionalSliceOfObjects struct {`,
  3649  		"	Prop1 string `json:\"prop1,omitempty\"`",
  3650  		"	AdditionalSliceOfObjects map[string][]*AdditionalSliceOfObjectsItems0 `json:\"-\"`",
  3651  		`func (m *AdditionalSliceOfObjects) Validate(formats strfmt.Registry) error {`,
  3652  		`	for k := range m.AdditionalSliceOfObjects {`,
  3653  		`		if err := validate.Required(k, "body", m.AdditionalSliceOfObjects[k]); err != nil {`,
  3654  		`		if err := validate.UniqueItems(k, "body", m.AdditionalSliceOfObjects[k]); err != nil {`,
  3655  		`		for i := 0; i < len(m.AdditionalSliceOfObjects[k]); i++ {`,
  3656  		// do we need Required when item is nullable?
  3657  		// nullable not required:
  3658  		`			if swag.IsZero(m.AdditionalSliceOfObjects[k][i]) {`,
  3659  		// nullable required:
  3660  		//`if err := validate.Required(k, "body", m.AdditionalSliceOfObjects[k]); err != nil {`,
  3661  		`			if m.AdditionalSliceOfObjects[k][i] != nil {`,
  3662  		`				if err := m.AdditionalSliceOfObjects[k][i].Validate(formats); err != nil {`,
  3663  		`					if ve, ok := err.(*errors.Validation); ok {`,
  3664  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  3665  		`		return errors.CompositeValidationError(res...`,
  3666  		`type AdditionalSliceOfObjectsItems0 struct {`,
  3667  		"	Prop2 int64 `json:\"prop2,omitempty\"`",
  3668  		// empty validation
  3669  		"func (m *AdditionalSliceOfObjectsItems0) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  3670  	},
  3671  		// not expected
  3672  		todo,
  3673  		// output in log
  3674  		noLines,
  3675  		noLines)
  3676  
  3677  	// load expectations for model: additional_things_nested.go
  3678  	flattenRun.AddExpectations("additional_things_nested.go", []string{
  3679  		`type AdditionalThingsNested struct {`,
  3680  		"	Origin string `json:\"origin,omitempty\"`",
  3681  		"	AdditionalThingsNested map[string]*AdditionalThingsNestedAdditionalProperties `json:\"-\"`",
  3682  		`func (m *AdditionalThingsNested) Validate(formats strfmt.Registry) error {`,
  3683  		`	if err := m.validateOrigin(formats); err != nil {`,
  3684  		`	for k := range m.AdditionalThingsNested {`,
  3685  		`		if val, ok := m.AdditionalThingsNested[k]; ok {`,
  3686  		`			if val != nil {`,
  3687  		`				if err := val.Validate(formats); err != nil {`,
  3688  		`		return errors.CompositeValidationError(res...`,
  3689  		`var additionalThingsNestedTypeOriginPropEnum []interface{`,
  3690  		`	var res []string`,
  3691  		"	if err := json.Unmarshal([]byte(`[\"goPrint\",\"goE-book\",\"goCollection\",\"goMuseum\"]`), &res); err != nil {",
  3692  		`	for _, v := range res {`,
  3693  		`		additionalThingsNestedTypeOriginPropEnum = append(additionalThingsNestedTypeOriginPropEnum, v`,
  3694  		`	AdditionalThingsNestedOriginGoPrint string = "goPrint"`,
  3695  		`	AdditionalThingsNestedOriginGoEBook string = "goE-book"`,
  3696  		`	AdditionalThingsNestedOriginGoCollection string = "goCollection"`,
  3697  		`	AdditionalThingsNestedOriginGoMuseum string = "goMuseum"`,
  3698  		`func (m *AdditionalThingsNested) validateOriginEnum(path, location string, value string) error {`,
  3699  		`	if err := validate.Enum(path, location, value, additionalThingsNestedTypeOriginPropEnum); err != nil {`,
  3700  		`func (m *AdditionalThingsNested) validateOrigin(formats strfmt.Registry) error {`,
  3701  		`	if swag.IsZero(m.Origin) {`,
  3702  		`	if err := m.validateOriginEnum("origin", "body", m.Origin); err != nil {`,
  3703  	},
  3704  		// not expected
  3705  		todo,
  3706  		// output in log
  3707  		noLines,
  3708  		noLines)
  3709  
  3710  	expandRun.AddExpectations("additional_things_nested.go", []string{
  3711  		`type AdditionalThingsNested struct {`,
  3712  		"	Origin string `json:\"origin,omitempty\"`",
  3713  		"	AdditionalThingsNested map[string]*AdditionalThingsNestedAnon `json:\"-\"`",
  3714  		`func (m *AdditionalThingsNested) Validate(formats strfmt.Registry) error {`,
  3715  		`	if err := m.validateOrigin(formats); err != nil {`,
  3716  		`	for k := range m.AdditionalThingsNested {`,
  3717  		`		if val, ok := m.AdditionalThingsNested[k]; ok {`,
  3718  		`			if val != nil {`,
  3719  		`				if err := val.Validate(formats); err != nil {`,
  3720  		`		return errors.CompositeValidationError(res...`,
  3721  		`var additionalThingsNestedTypeOriginPropEnum []interface{`,
  3722  		`	var res []string`,
  3723  		"	if err := json.Unmarshal([]byte(`[\"goPrint\",\"goE-book\",\"goCollection\",\"goMuseum\"]`), &res); err != nil {",
  3724  		`	for _, v := range res {`,
  3725  		`		additionalThingsNestedTypeOriginPropEnum = append(additionalThingsNestedTypeOriginPropEnum, v`,
  3726  		`	AdditionalThingsNestedOriginGoPrint string = "goPrint"`,
  3727  		`	AdditionalThingsNestedOriginGoEBook string = "goE-book"`,
  3728  		`	AdditionalThingsNestedOriginGoCollection string = "goCollection"`,
  3729  		`	AdditionalThingsNestedOriginGoMuseum string = "goMuseum"`,
  3730  		`func (m *AdditionalThingsNested) validateOriginEnum(path, location string, value string) error {`,
  3731  		`	if err := validate.Enum(path, location, value, additionalThingsNestedTypeOriginPropEnum); err != nil {`,
  3732  		`func (m *AdditionalThingsNested) validateOrigin(formats strfmt.Registry) error {`,
  3733  		`	if swag.IsZero(m.Origin) {`,
  3734  		`	if err := m.validateOriginEnum("origin", "body", m.Origin); err != nil {`,
  3735  		`type AdditionalThingsNestedAnon struct {`,
  3736  		"	PrinterAddress string `json:\"printerAddress,omitempty\"`",
  3737  		"	PrinterCountry string `json:\"printerCountry,omitempty\"`",
  3738  		"	PrinterDate strfmt.Date `json:\"printerDate,omitempty\"`",
  3739  		"	AdditionalThingsNestedAnon map[string]*AdditionalThingsNestedAnonAnon `json:\"-\"`",
  3740  		`func (m *AdditionalThingsNestedAnon) Validate(formats strfmt.Registry) error {`,
  3741  		`	if err := m.validatePrinterCountry(formats); err != nil {`,
  3742  		`	if err := m.validatePrinterDate(formats); err != nil {`,
  3743  		`	for k := range m.AdditionalThingsNestedAnon {`,
  3744  		`		if val, ok := m.AdditionalThingsNestedAnon[k]; ok {`,
  3745  		`			if val != nil {`,
  3746  		`				if err := val.Validate(formats); err != nil {`,
  3747  		`		return errors.CompositeValidationError(res...`,
  3748  		`var additionalThingsNestedAnonTypePrinterCountryPropEnum []interface{`,
  3749  		`	var res []string`,
  3750  		"	if err := json.Unmarshal([]byte(`[\"US\",\"FR\",\"UK\",\"BE\",\"CA\",\"DE\"]`), &res); err != nil {",
  3751  		`	for _, v := range res {`,
  3752  		`		additionalThingsNestedAnonTypePrinterCountryPropEnum = append(additionalThingsNestedAnonTypePrinterCountryPropEnum, v`,
  3753  		`	AdditionalThingsNestedAnonPrinterCountryUS string = "US"`,
  3754  		`	AdditionalThingsNestedAnonPrinterCountryFR string = "FR"`,
  3755  		`	AdditionalThingsNestedAnonPrinterCountryUK string = "UK"`,
  3756  		`	AdditionalThingsNestedAnonPrinterCountryBE string = "BE"`,
  3757  		`	AdditionalThingsNestedAnonPrinterCountryCA string = "CA"`,
  3758  		`	AdditionalThingsNestedAnonPrinterCountryDE string = "DE"`,
  3759  		`func (m *AdditionalThingsNestedAnon) validatePrinterCountryEnum(path, location string, value string) error {`,
  3760  		`	if err := validate.Enum(path, location, value, additionalThingsNestedAnonTypePrinterCountryPropEnum); err != nil {`,
  3761  		`func (m *AdditionalThingsNestedAnon) validatePrinterCountry(formats strfmt.Registry) error {`,
  3762  		`	if swag.IsZero(m.PrinterCountry) {`,
  3763  		`	if err := m.validatePrinterCountryEnum("printerCountry", "body", m.PrinterCountry); err != nil {`,
  3764  		`func (m *AdditionalThingsNestedAnon) validatePrinterDate(formats strfmt.Registry) error {`,
  3765  		`	if swag.IsZero(m.PrinterDate) {`,
  3766  		`	if err := validate.FormatOf("printerDate", "body", "date", m.PrinterDate.String(), formats); err != nil {`,
  3767  		`type AdditionalThingsNestedAnonAnon struct {`,
  3768  		"	AverageDelay strfmt.Duration `json:\"averageDelay,omitempty\"`",
  3769  		`func (m *AdditionalThingsNestedAnonAnon) Validate(formats strfmt.Registry) error {`,
  3770  		`	if err := m.validateAverageDelay(formats); err != nil {`,
  3771  		`		return errors.CompositeValidationError(res...`,
  3772  		`func (m *AdditionalThingsNestedAnonAnon) validateAverageDelay(formats strfmt.Registry) error {`,
  3773  		`	if swag.IsZero(m.AverageDelay) {`,
  3774  		`	if err := validate.FormatOf("averageDelay", "body", "duration", m.AverageDelay.String(), formats); err != nil {`,
  3775  	},
  3776  		// not expected
  3777  		todo,
  3778  		// output in log
  3779  		noLines,
  3780  		noLines)
  3781  
  3782  	// load expectations for model: no_validation_thing.go
  3783  	flattenRun.AddExpectations("no_validation_thing.go", []string{
  3784  		`type NoValidationThing struct {`,
  3785  		"	Discourse string `json:\"discourse,omitempty\"`",
  3786  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  3787  		"	NoValidationThingAdditionalProperties map[string]interface{} `json:\"-\"`",
  3788  		// empty validation
  3789  		"func (m *NoValidationThing) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  3790  	},
  3791  		// not expected
  3792  		todo,
  3793  		// output in log
  3794  		noLines,
  3795  		noLines)
  3796  
  3797  	expandRun.AddExpectations("no_validation_thing.go", flattenRun.ExpectedFor("NoValidationThing").ExpectedLines, todo, noLines, noLines)
  3798  
  3799  	// load expectations for model: additional_array_of_interface.go
  3800  	flattenRun.AddExpectations("additional_array_of_interface.go", []string{
  3801  		`type AdditionalArrayOfInterface struct {`,
  3802  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  3803  		"	AdditionalArrayOfInterface map[string][]interface{} `json:\"-\"`",
  3804  		`func (m *AdditionalArrayOfInterface) Validate(formats strfmt.Registry) error {`,
  3805  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  3806  		`	for k := range m.AdditionalArrayOfInterface {`,
  3807  		// remove undue IsZero call
  3808  		//`		if swag.IsZero(m.AdditionalArrayOfInterface[k]) {`,
  3809  		`		if err := validate.UniqueItems(k, "body", m.AdditionalArrayOfInterface[k]); err != nil {`,
  3810  		`		return errors.CompositeValidationError(res...`,
  3811  		`func (m *AdditionalArrayOfInterface) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  3812  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  3813  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", int64(m.ThisOneNotRequired), 10, false); err != nil {`,
  3814  	},
  3815  		// not expected
  3816  		todo,
  3817  		// output in log
  3818  		noLines,
  3819  		noLines)
  3820  
  3821  	expandRun.AddExpectations("additional_array_of_interface.go", flattenRun.ExpectedFor("AdditionalArrayOfInterface").ExpectedLines, todo, noLines, noLines)
  3822  
  3823  	// load expectations for model: additional_formated_thing.go
  3824  	flattenRun.AddExpectations("additional_formated_thing.go", []string{
  3825  		`type AdditionalFormatedThing map[string]strfmt.Date`,
  3826  		`func (m AdditionalFormatedThing) Validate(formats strfmt.Registry) error {`,
  3827  		`	for k := range m {`,
  3828  		//`		if swag.IsZero(m[k]) {`,
  3829  		`		if err := validate.FormatOf(k, "body", "date", m[k].String(), formats); err != nil {`,
  3830  		`		return errors.CompositeValidationError(res...`,
  3831  	},
  3832  		// not expected
  3833  		todo,
  3834  		// output in log
  3835  		noLines,
  3836  		noLines)
  3837  
  3838  	expandRun.AddExpectations("additional_formated_thing.go", flattenRun.ExpectedFor("AdditionalFormatedThing").ExpectedLines, todo, noLines, noLines)
  3839  
  3840  	// load expectations for model: aliased_nullable_date.go
  3841  	flattenRun.AddExpectations("aliased_nullable_date.go", []string{
  3842  		`type AliasedNullableDate strfmt.Date`,
  3843  		`func (m AliasedNullableDate) Validate(formats strfmt.Registry) error {`,
  3844  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
  3845  		`		return errors.CompositeValidationError(res...`,
  3846  	},
  3847  		// not expected
  3848  		todo,
  3849  		// output in log
  3850  		noLines,
  3851  		noLines)
  3852  
  3853  	expandRun.AddExpectations("aliased_nullable_date.go", flattenRun.ExpectedFor("AliasedNullableDate").ExpectedLines, todo, noLines, noLines)
  3854  
  3855  	// load expectations for model: additional_array_of_refed_object.go
  3856  	flattenRun.AddExpectations("additional_array_of_refed_object.go", []string{
  3857  		`type AdditionalArrayOfRefedObject struct {`,
  3858  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  3859  		"	AdditionalArrayOfRefedObject map[string][]*NoValidationThing `json:\"-\"`",
  3860  		`func (m *AdditionalArrayOfRefedObject) Validate(formats strfmt.Registry) error {`,
  3861  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  3862  		`	for k := range m.AdditionalArrayOfRefedObject {`,
  3863  		`		if err := validate.Required(k, "body", m.AdditionalArrayOfRefedObject[k]); err != nil {`,
  3864  		`		if err := validate.UniqueItems(k, "body", m.AdditionalArrayOfRefedObject[k]); err != nil {`,
  3865  		`		for i := 0; i < len(m.AdditionalArrayOfRefedObject[k]); i++ {`,
  3866  		// do we need Required when item is nullable?
  3867  		// nullable not required:
  3868  		`			if swag.IsZero(m.AdditionalArrayOfRefedObject[k][i]) {`,
  3869  		// nullable required:
  3870  		//`			if err := validate.Required(k+"."+strconv.Itoa(i), "body", m.AdditionalArrayOfRefedObject[k][i]); err != nil {`,
  3871  		`			if m.AdditionalArrayOfRefedObject[k][i] != nil {`,
  3872  		`				if err := m.AdditionalArrayOfRefedObject[k][i].Validate(formats); err != nil {`,
  3873  		`					if ve, ok := err.(*errors.Validation); ok {`,
  3874  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  3875  		`		return errors.CompositeValidationError(res...`,
  3876  		`func (m *AdditionalArrayOfRefedObject) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  3877  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  3878  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", int64(m.ThisOneNotRequired), 10, false); err != nil {`,
  3879  	},
  3880  		// not expected
  3881  		todo,
  3882  		// output in log
  3883  		noLines,
  3884  		noLines)
  3885  
  3886  	expandRun.AddExpectations("additional_array_of_refed_object.go", []string{
  3887  		`type AdditionalArrayOfRefedObject struct {`,
  3888  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  3889  		"	AdditionalArrayOfRefedObject map[string][]*AdditionalArrayOfRefedObjectItems0 `json:\"-\"`",
  3890  		`func (m *AdditionalArrayOfRefedObject) Validate(formats strfmt.Registry) error {`,
  3891  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  3892  		`	for k := range m.AdditionalArrayOfRefedObject {`,
  3893  		`		if err := validate.Required(k, "body", m.AdditionalArrayOfRefedObject[k]); err != nil {`,
  3894  		`		if err := validate.UniqueItems(k, "body", m.AdditionalArrayOfRefedObject[k]); err != nil {`,
  3895  		`		for i := 0; i < len(m.AdditionalArrayOfRefedObject[k]); i++ {`,
  3896  		// do we need Required when item is nullable?
  3897  		// nullable not required:
  3898  		`			if swag.IsZero(m.AdditionalArrayOfRefedObject[k][i]) {`,
  3899  		// nullable required:
  3900  		//`			if err := validate.Required(k+"."+strconv.Itoa(i), "body", m.AdditionalArrayOfRefedObject[k][i]); err != nil {`,
  3901  		`			if m.AdditionalArrayOfRefedObject[k][i] != nil {`,
  3902  		`				if err := m.AdditionalArrayOfRefedObject[k][i].Validate(formats); err != nil {`,
  3903  		`					if ve, ok := err.(*errors.Validation); ok {`,
  3904  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  3905  		`		return errors.CompositeValidationError(res...`,
  3906  		`func (m *AdditionalArrayOfRefedObject) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  3907  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  3908  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", int64(m.ThisOneNotRequired), 10, false); err != nil {`,
  3909  		`type AdditionalArrayOfRefedObjectItems0 struct {`,
  3910  		"	Discourse string `json:\"discourse,omitempty\"`",
  3911  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  3912  		"	AdditionalArrayOfRefedObjectItems0AdditionalProperties map[string]interface{} `json:\"-\"`",
  3913  		// empty validation
  3914  		"func (m *AdditionalArrayOfRefedObjectItems0) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  3915  	},
  3916  		// not expected
  3917  		todo,
  3918  		// output in log
  3919  		noLines,
  3920  		noLines)
  3921  
  3922  	// load expectations for model: additional_slice_of_aliased_primitives.go
  3923  	flattenRun.AddExpectations("additional_slice_of_aliased_primitives.go", []string{
  3924  		`type AdditionalSliceOfAliasedPrimitives struct {`,
  3925  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  3926  		"	AdditionalSliceOfAliasedPrimitives map[string][]AliasedDate `json:\"-\"`",
  3927  		`func (m *AdditionalSliceOfAliasedPrimitives) Validate(formats strfmt.Registry) error {`,
  3928  		`	if err := m.validateProp2(formats); err != nil {`,
  3929  		`	for k := range m.AdditionalSliceOfAliasedPrimitives {`,
  3930  		// removed undue IsZero call
  3931  		//`		if swag.IsZero(m.AdditionalSliceOfAliasedPrimitives[k]) {`,
  3932  		`		iAdditionalSliceOfAliasedPrimitivesSize := int64(len(m.AdditionalSliceOfAliasedPrimitives[k])`,
  3933  		`		if err := validate.MaxItems(k, "body", iAdditionalSliceOfAliasedPrimitivesSize, 10); err != nil {`,
  3934  		`		for i := 0; i < len(m.AdditionalSliceOfAliasedPrimitives[k]); i++ {`,
  3935  		`			if err := m.AdditionalSliceOfAliasedPrimitives[k][i].Validate(formats); err != nil {`,
  3936  		`				if ve, ok := err.(*errors.Validation); ok {`,
  3937  		`					return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  3938  		`		return errors.CompositeValidationError(res...`,
  3939  		`func (m *AdditionalSliceOfAliasedPrimitives) validateProp2(formats strfmt.Registry) error {`,
  3940  		`	if swag.IsZero(m.Prop2) {`,
  3941  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  3942  	},
  3943  		// not expected
  3944  		todo,
  3945  		// output in log
  3946  		noLines,
  3947  		noLines)
  3948  
  3949  	expandRun.AddExpectations("additional_slice_of_aliased_primitives.go", []string{
  3950  		`type AdditionalSliceOfAliasedPrimitives struct {`,
  3951  		"	Prop2 strfmt.UUID `json:\"prop2,omitempty\"`",
  3952  		"	AdditionalSliceOfAliasedPrimitives map[string][]strfmt.Date `json:\"-\"`",
  3953  		`func (m *AdditionalSliceOfAliasedPrimitives) Validate(formats strfmt.Registry) error {`,
  3954  		`	if err := m.validateProp2(formats); err != nil {`,
  3955  		`	for k := range m.AdditionalSliceOfAliasedPrimitives {`,
  3956  		//`		if swag.IsZero(m.AdditionalSliceOfAliasedPrimitives[k]) {`,
  3957  		`		iAdditionalSliceOfAliasedPrimitivesSize := int64(len(m.AdditionalSliceOfAliasedPrimitives[k])`,
  3958  		`		if err := validate.MaxItems(k, "body", iAdditionalSliceOfAliasedPrimitivesSize, 10); err != nil {`,
  3959  		`		for i := 0; i < len(m.AdditionalSliceOfAliasedPrimitives[k]); i++ {`,
  3960  		`			if err := validate.FormatOf(k+"."+strconv.Itoa(i), "body", "date", m.AdditionalSliceOfAliasedPrimitives[k][i].String(), formats); err != nil {`,
  3961  		`		return errors.CompositeValidationError(res...`,
  3962  		`func (m *AdditionalSliceOfAliasedPrimitives) validateProp2(formats strfmt.Registry) error {`,
  3963  		`	if swag.IsZero(m.Prop2) {`,
  3964  		`	if err := validate.FormatOf("prop2", "body", "uuid", m.Prop2.String(), formats); err != nil {`,
  3965  	},
  3966  		// not expected
  3967  		todo,
  3968  		// output in log
  3969  		noLines,
  3970  		noLines)
  3971  
  3972  	// load expectations for model: transitive_refed_thing.go
  3973  	flattenRun.AddExpectations("transitive_refed_thing.go", []string{
  3974  		`type TransitiveRefedThing struct {`,
  3975  		"	ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`",
  3976  		"	TransitiveRefedThing map[string]*TransitiveRefedThingAdditionalProperties `json:\"-\"`",
  3977  		`func (m *TransitiveRefedThing) Validate(formats strfmt.Registry) error {`,
  3978  		`	if err := m.validateThisOneNotRequiredEither(formats); err != nil {`,
  3979  		`	for k := range m.TransitiveRefedThing {`,
  3980  		`		if val, ok := m.TransitiveRefedThing[k]; ok {`,
  3981  		`			if val != nil {`,
  3982  		`				if err := val.Validate(formats); err != nil {`,
  3983  		`		return errors.CompositeValidationError(res...`,
  3984  		`func (m *TransitiveRefedThing) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`,
  3985  		`	if swag.IsZero(m.ThisOneNotRequiredEither) {`,
  3986  		`	if err := validate.MaximumInt("thisOneNotRequiredEither", "body", int64(m.ThisOneNotRequiredEither), 20, false); err != nil {`,
  3987  	},
  3988  		// not expected
  3989  		todo,
  3990  		// output in log
  3991  		noLines,
  3992  		noLines)
  3993  
  3994  	expandRun.AddExpectations("transitive_refed_thing.go", []string{
  3995  		`type TransitiveRefedThing struct {`,
  3996  		"	ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`",
  3997  		"	TransitiveRefedThing map[string]*TransitiveRefedThingAnon `json:\"-\"`",
  3998  		`func (m *TransitiveRefedThing) Validate(formats strfmt.Registry) error {`,
  3999  		`	if err := m.validateThisOneNotRequiredEither(formats); err != nil {`,
  4000  		`	for k := range m.TransitiveRefedThing {`,
  4001  		`		if val, ok := m.TransitiveRefedThing[k]; ok {`,
  4002  		`			if val != nil {`,
  4003  		`				if err := val.Validate(formats); err != nil {`,
  4004  		`		return errors.CompositeValidationError(res...`,
  4005  		`func (m *TransitiveRefedThing) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`,
  4006  		`	if swag.IsZero(m.ThisOneNotRequiredEither) {`,
  4007  		`	if err := validate.MaximumInt("thisOneNotRequiredEither", "body", int64(m.ThisOneNotRequiredEither), 20, false); err != nil {`,
  4008  		`type TransitiveRefedThingAnon struct {`,
  4009  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  4010  		"	TransitiveRefedThingAnon map[string]*TransitiveRefedThingAnonAnon `json:\"-\"`",
  4011  		`func (m *TransitiveRefedThingAnon) Validate(formats strfmt.Registry) error {`,
  4012  		`	if err := m.validateA1(formats); err != nil {`,
  4013  		`	for k := range m.TransitiveRefedThingAnon {`,
  4014  		`		if val, ok := m.TransitiveRefedThingAnon[k]; ok {`,
  4015  		`			if val != nil {`,
  4016  		`				if err := val.Validate(formats); err != nil {`,
  4017  		`		return errors.CompositeValidationError(res...`,
  4018  		`func (m *TransitiveRefedThingAnon) validateA1(formats strfmt.Registry) error {`,
  4019  		`	if swag.IsZero(m.A1) {`,
  4020  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  4021  		`type TransitiveRefedThingAnonAnon struct {`,
  4022  		"	Discourse string `json:\"discourse,omitempty\"`",
  4023  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  4024  		"	TransitiveRefedThingAnonAnonAdditionalProperties map[string]interface{} `json:\"-\"`",
  4025  		// empty validation
  4026  		"func (m *TransitiveRefedThingAnonAnon) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  4027  	},
  4028  		// not expected
  4029  		todo,
  4030  		// output in log
  4031  		noLines,
  4032  		noLines)
  4033  
  4034  	// load expectations for model: additional_empty_object.go
  4035  	flattenRun.AddExpectations("additional_empty_object.go", []string{
  4036  		`type AdditionalEmptyObject struct {`,
  4037  		"	PropA interface{} `json:\"propA,omitempty\"`",
  4038  		"	AdditionalEmptyObject map[string]interface{} `json:\"-\"`",
  4039  		// empty validation
  4040  		"func (m *AdditionalEmptyObject) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  4041  	},
  4042  		// not expected
  4043  		todo,
  4044  		// output in log
  4045  		noLines,
  4046  		noLines)
  4047  
  4048  	expandRun.AddExpectations("additional_empty_object.go", flattenRun.ExpectedFor("AdditionalEmptyObject").ExpectedLines, todo, noLines, noLines)
  4049  
  4050  	// load expectations for model: additional_date_with_nullable_thing.go
  4051  	flattenRun.AddExpectations("additional_date_with_nullable_thing.go", []string{
  4052  		`type AdditionalDateWithNullableThing struct {`,
  4053  		"	Blob int64 `json:\"blob,omitempty\"`",
  4054  		"	NullableDate *AliasedNullableDate `json:\"nullableDate,omitempty\"`",
  4055  		"	AdditionalDateWithNullableThing map[string]*AliasedNullableDate `json:\"-\"`",
  4056  		`func (m *AdditionalDateWithNullableThing) Validate(formats strfmt.Registry) error {`,
  4057  		`	if err := m.validateBlob(formats); err != nil {`,
  4058  		`	if err := m.validateNullableDate(formats); err != nil {`,
  4059  		`	for k := range m.AdditionalDateWithNullableThing {`,
  4060  		`		if swag.IsZero(m.AdditionalDateWithNullableThing[k]) {`,
  4061  		`		if val, ok := m.AdditionalDateWithNullableThing[k]; ok {`,
  4062  		`			if val != nil {`,
  4063  		`				if err := val.Validate(formats); err != nil {`,
  4064  		`		return errors.CompositeValidationError(res...`,
  4065  		`func (m *AdditionalDateWithNullableThing) validateBlob(formats strfmt.Registry) error {`,
  4066  		`	if swag.IsZero(m.Blob) {`,
  4067  		`	if err := validate.MinimumInt("blob", "body", int64(m.Blob), 1, false); err != nil {`,
  4068  		`func (m *AdditionalDateWithNullableThing) validateNullableDate(formats strfmt.Registry) error {`,
  4069  		`	if swag.IsZero(m.NullableDate) {`,
  4070  		`	if m.NullableDate != nil {`,
  4071  		`		if err := m.NullableDate.Validate(formats); err != nil {`,
  4072  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4073  		`				return ve.ValidateName("nullableDate"`,
  4074  	},
  4075  		// not expected
  4076  		todo,
  4077  		// output in log
  4078  		noLines,
  4079  		noLines)
  4080  
  4081  	expandRun.AddExpectations("additional_date_with_nullable_thing.go", []string{
  4082  		`type AdditionalDateWithNullableThing struct {`,
  4083  		"	Blob int64 `json:\"blob,omitempty\"`",
  4084  		"	NullableDate *strfmt.Date `json:\"nullableDate,omitempty\"`",
  4085  		"	AdditionalDateWithNullableThing map[string]*strfmt.Date `json:\"-\"`",
  4086  		`func (m *AdditionalDateWithNullableThing) Validate(formats strfmt.Registry) error {`,
  4087  		`	if err := m.validateBlob(formats); err != nil {`,
  4088  		`	if err := m.validateNullableDate(formats); err != nil {`,
  4089  		`	for k := range m.AdditionalDateWithNullableThing {`,
  4090  		`		if swag.IsZero(m.AdditionalDateWithNullableThing[k]) {`,
  4091  		`		if err := validate.FormatOf(k, "body", "date", m.AdditionalDateWithNullableThing[k].String(), formats); err != nil {`,
  4092  		`		return errors.CompositeValidationError(res...`,
  4093  		`func (m *AdditionalDateWithNullableThing) validateBlob(formats strfmt.Registry) error {`,
  4094  		`	if swag.IsZero(m.Blob) {`,
  4095  		`	if err := validate.MinimumInt("blob", "body", int64(m.Blob), 1, false); err != nil {`,
  4096  		`func (m *AdditionalDateWithNullableThing) validateNullableDate(formats strfmt.Registry) error {`,
  4097  		`	if swag.IsZero(m.NullableDate) {`,
  4098  		`	if err := validate.FormatOf("nullableDate", "body", "date", m.NullableDate.String(), formats); err != nil {`,
  4099  	},
  4100  		// not expected
  4101  		todo,
  4102  		// output in log
  4103  		noLines,
  4104  		noLines)
  4105  
  4106  }
  4107  
  4108  func initFixtureTuple() {
  4109  	// testing ../fixtures/bugs/1487/fixture-tuple.yaml with expand (--skip-flatten)
  4110  
  4111  	/* check different patterns of additionalItems validations or absence thereof
  4112  	 */
  4113  	f := newModelFixture("../fixtures/bugs/1487/fixture-tuple.yaml", "fixture for tuples and additionalItems")
  4114  	flattenRun := f.AddRun(false)
  4115  	expandRun := f.AddRun(true)
  4116  
  4117  	// load expectations for model: classics.go
  4118  	flattenRun.AddExpectations("classics.go", []string{
  4119  		`type Classics struct {`,
  4120  		"	P0 *int64 `json:\"-\"`",
  4121  		"	P1 *strfmt.ISBN `json:\"-\"`",
  4122  		"	P2 Comics `json:\"-\"`",
  4123  		"	ClassicsItems []ClassicsTupleAdditionalItems `json:\"-\"`",
  4124  		`func (m *Classics) Validate(formats strfmt.Registry) error {`,
  4125  		`	if err := m.validateP0(formats); err != nil {`,
  4126  		`	if err := m.validateP1(formats); err != nil {`,
  4127  		`	if err := m.validateP2(formats); err != nil {`,
  4128  		`	if err := m.validateClassicsItems(formats); err != nil {`,
  4129  		`		return errors.CompositeValidationError(res...`,
  4130  		`func (m *Classics) validateP0(formats strfmt.Registry) error {`,
  4131  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  4132  		`func (m *Classics) validateP1(formats strfmt.Registry) error {`,
  4133  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  4134  		`	if err := validate.FormatOf("1", "body", "isbn", m.P1.String(), formats); err != nil {`,
  4135  		`func (m *Classics) validateP2(formats strfmt.Registry) error {`,
  4136  		`	if err := m.P2.Validate(formats); err != nil {`,
  4137  		`		if ve, ok := err.(*errors.Validation); ok {`,
  4138  		`			return ve.ValidateName("2"`,
  4139  		`func (m *Classics) validateClassicsItems(formats strfmt.Registry) error {`,
  4140  		`	for i := range m.ClassicsItems {`,
  4141  		`		if err := m.ClassicsItems[i].Validate(formats); err != nil {`,
  4142  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4143  		`				return ve.ValidateName(strconv.Itoa(i + 3)`,
  4144  	},
  4145  		// not expected
  4146  		todo,
  4147  		// output in log
  4148  		noLines,
  4149  		noLines)
  4150  
  4151  	expandRun.AddExpectations("classics.go", []string{
  4152  		`type Classics struct {`,
  4153  		"	P0 *int64 `json:\"-\"`",
  4154  		"	P1 *strfmt.ISBN `json:\"-\"`",
  4155  		"	P2 *ClassicsTuple0 `json:\"-\"`",
  4156  		// TODO: items should not be pointer
  4157  		"	ClassicsItems []*ClassicsClassicsItemsTuple0 `json:\"-\"`",
  4158  		`func (m *Classics) Validate(formats strfmt.Registry) error {`,
  4159  		`	if err := m.validateP0(formats); err != nil {`,
  4160  		`	if err := m.validateP1(formats); err != nil {`,
  4161  		`	if err := m.validateP2(formats); err != nil {`,
  4162  		`	if err := m.validateClassicsItems(formats); err != nil {`,
  4163  		`		return errors.CompositeValidationError(res...`,
  4164  		`func (m *Classics) validateP0(formats strfmt.Registry) error {`,
  4165  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  4166  		`func (m *Classics) validateP1(formats strfmt.Registry) error {`,
  4167  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  4168  		`	if err := validate.FormatOf("1", "body", "isbn", m.P1.String(), formats); err != nil {`,
  4169  		`func (m *Classics) validateP2(formats strfmt.Registry) error {`,
  4170  		`	if err := validate.Required("2", "body", m.P2); err != nil {`,
  4171  		`	if m.P2 != nil {`,
  4172  		`		if err := m.P2.Validate(formats); err != nil {`,
  4173  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4174  		`				return ve.ValidateName("2"`,
  4175  		`func (m *Classics) validateClassicsItems(formats strfmt.Registry) error {`,
  4176  		`	for i := range m.ClassicsItems {`,
  4177  		`		if m.ClassicsItems[i] != nil {`,
  4178  		`			if err := m.ClassicsItems[i].Validate(formats); err != nil {`,
  4179  		`				if ve, ok := err.(*errors.Validation); ok {`,
  4180  		`					return ve.ValidateName(strconv.Itoa(i + 3)`,
  4181  		`type ClassicsClassicsItemsTuple0 struct {`,
  4182  		"	P0 *ClassicsClassicsItemsTuple0P0 `json:\"-\"`",
  4183  		"	P1 []strfmt.Date `json:\"-\"`",
  4184  		"	P2 *ClassicsClassicsItemsTuple0P2 `json:\"-\"`",
  4185  		"	P3 *ClassicsClassicsItemsTuple0P3Tuple0 `json:\"-\"`",
  4186  		`func (m *ClassicsClassicsItemsTuple0) Validate(formats strfmt.Registry) error {`,
  4187  		`	if err := m.validateP0(formats); err != nil {`,
  4188  		`	if err := m.validateP1(formats); err != nil {`,
  4189  		`	if err := m.validateP2(formats); err != nil {`,
  4190  		`	if err := m.validateP3(formats); err != nil {`,
  4191  		`		return errors.CompositeValidationError(res...`,
  4192  		`func (m *ClassicsClassicsItemsTuple0) validateP0(formats strfmt.Registry) error {`,
  4193  		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
  4194  		`	if m.P0 != nil {`,
  4195  		`		if err := m.P0.Validate(formats); err != nil {`,
  4196  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4197  		`				return ve.ValidateName("P0"`,
  4198  		`func (m *ClassicsClassicsItemsTuple0) validateP1(formats strfmt.Registry) error {`,
  4199  		`	if err := validate.Required("P1", "body", m.P1); err != nil {`,
  4200  		`	for i := 0; i < len(m.P1); i++ {`,
  4201  		`		if err := validate.FormatOf("P1"+"."+strconv.Itoa(i), "body", "date", m.P1[i].String(), formats); err != nil {`,
  4202  		`func (m *ClassicsClassicsItemsTuple0) validateP2(formats strfmt.Registry) error {`,
  4203  		`	if err := validate.Required("P2", "body", m.P2); err != nil {`,
  4204  		`	if m.P2 != nil {`,
  4205  		`		if err := m.P2.Validate(formats); err != nil {`,
  4206  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4207  		`				return ve.ValidateName("P2"`,
  4208  		`func (m *ClassicsClassicsItemsTuple0) validateP3(formats strfmt.Registry) error {`,
  4209  		`	if err := validate.Required("P3", "body", m.P3); err != nil {`,
  4210  		`	if m.P3 != nil {`,
  4211  		`		if err := m.P3.Validate(formats); err != nil {`,
  4212  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4213  		`				return ve.ValidateName("P3"`,
  4214  		`type ClassicsClassicsItemsTuple0P0 struct {`,
  4215  		"	Period *string `json:\"period,omitempty\"`",
  4216  		"	Title *string `json:\"title,omitempty\"`",
  4217  		`func (m *ClassicsClassicsItemsTuple0P0) Validate(formats strfmt.Registry) error {`,
  4218  		`	if err := m.validateTitle(formats); err != nil {`,
  4219  		`		return errors.CompositeValidationError(res...`,
  4220  		`var classicsClassicsItemsTuple0P0TypeTitlePropEnum []interface{`,
  4221  		`	var res []string`,
  4222  		"	if err := json.Unmarshal([]byte(`[\"Les Misérables\",\"Bleak House\",\"Sherlock Holmes\",\"Siddhartha\"]`), &res); err != nil {",
  4223  		`	for _, v := range res {`,
  4224  		`		classicsClassicsItemsTuple0P0TypeTitlePropEnum = append(classicsClassicsItemsTuple0P0TypeTitlePropEnum, v`,
  4225  		`	ClassicsClassicsItemsTuple0P0TitleLesMisérables string = "Les Misérables"`,
  4226  		`	ClassicsClassicsItemsTuple0P0TitleBleakHouse string = "Bleak House"`,
  4227  		`	ClassicsClassicsItemsTuple0P0TitleSherlockHolmes string = "Sherlock Holmes"`,
  4228  		`	ClassicsClassicsItemsTuple0P0TitleSiddhartha string = "Siddhartha"`,
  4229  		`func (m *ClassicsClassicsItemsTuple0P0) validateTitleEnum(path, location string, value string) error {`,
  4230  		`	if err := validate.Enum(path, location, value, classicsClassicsItemsTuple0P0TypeTitlePropEnum); err != nil {`,
  4231  		`func (m *ClassicsClassicsItemsTuple0P0) validateTitle(formats strfmt.Registry) error {`,
  4232  		`	if swag.IsZero(m.Title) {`,
  4233  		`	if err := m.validateTitleEnum("P0"+"."+"title", "body", *m.Title); err != nil {`,
  4234  		`type ClassicsClassicsItemsTuple0P2 struct {`,
  4235  		"	Origin *string `json:\"origin,omitempty\"`",
  4236  		"	ClassicsClassicsItemsTuple0P2 map[string]string `json:\"-\"`",
  4237  		`var classicsClassicsItemsTuple0P2ValueEnum []interface{`,
  4238  		`	var res []string`,
  4239  		"	if err := json.Unmarshal([]byte(`[\"bookshop\",\"amazon\",\"library\"]`), &res); err != nil {",
  4240  		`	for _, v := range res {`,
  4241  		`		classicsClassicsItemsTuple0P2ValueEnum = append(classicsClassicsItemsTuple0P2ValueEnum, v`,
  4242  		`func (m *ClassicsClassicsItemsTuple0P2) validateClassicsClassicsItemsTuple0P2ValueEnum(path, location string, value string) error {`,
  4243  		`	if err := validate.Enum(path, location, value, classicsClassicsItemsTuple0P2ValueEnum); err != nil {`,
  4244  		`func (m *ClassicsClassicsItemsTuple0P2) Validate(formats strfmt.Registry) error {`,
  4245  		`	if err := m.validateOrigin(formats); err != nil {`,
  4246  		`	for k := range m.ClassicsClassicsItemsTuple0P2 {`,
  4247  		// removed undue IsZero() call
  4248  		//`		if swag.IsZero(m.ClassicsClassicsItemsTuple0P2[k]) {`,
  4249  		`		if err := m.validateClassicsClassicsItemsTuple0P2ValueEnum("P2"+"."+k, "body", m.ClassicsClassicsItemsTuple0P2[k]); err != nil {`,
  4250  		`		return errors.CompositeValidationError(res...`,
  4251  		`var classicsClassicsItemsTuple0P2TypeOriginPropEnum []interface{`,
  4252  		`	var res []string`,
  4253  		"	if err := json.Unmarshal([]byte(`[\"print\",\"e-book\",\"collection\",\"museum\"]`), &res); err != nil {",
  4254  		`	for _, v := range res {`,
  4255  		`		classicsClassicsItemsTuple0P2TypeOriginPropEnum = append(classicsClassicsItemsTuple0P2TypeOriginPropEnum, v`,
  4256  		`	ClassicsClassicsItemsTuple0P2OriginPrint string = "print"`,
  4257  		`	ClassicsClassicsItemsTuple0P2OriginEBook string = "e-book"`,
  4258  		`	ClassicsClassicsItemsTuple0P2OriginCollection string = "collection"`,
  4259  		`	ClassicsClassicsItemsTuple0P2OriginMuseum string = "museum"`,
  4260  		`func (m *ClassicsClassicsItemsTuple0P2) validateOriginEnum(path, location string, value string) error {`,
  4261  		`	if err := validate.Enum(path, location, value, classicsClassicsItemsTuple0P2TypeOriginPropEnum); err != nil {`,
  4262  		`func (m *ClassicsClassicsItemsTuple0P2) validateOrigin(formats strfmt.Registry) error {`,
  4263  		`	if swag.IsZero(m.Origin) {`,
  4264  		`	if err := m.validateOriginEnum("P2"+"."+"origin", "body", *m.Origin); err != nil {`,
  4265  		`type ClassicsClassicsItemsTuple0P3Tuple0 struct {`,
  4266  		"	P0 *string `json:\"-\"`",
  4267  		"	P1 *ClassicsClassicsItemsTuple0P3Tuple0P1 `json:\"-\"`",
  4268  		"	P2 *ClassicsClassicsItemsTuple0P3Tuple0P2 `json:\"-\"`",
  4269  		"	P3 *ClassicsClassicsItemsTuple0P3Tuple0P3 `json:\"-\"`",
  4270  		"	P4 []strfmt.ISBN `json:\"-\"`",
  4271  		"	P5 *int64 `json:\"-\"`",
  4272  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0) Validate(formats strfmt.Registry) error {`,
  4273  		`	if err := m.validateP0(formats); err != nil {`,
  4274  		`	if err := m.validateP1(formats); err != nil {`,
  4275  		`	if err := m.validateP2(formats); err != nil {`,
  4276  		`	if err := m.validateP3(formats); err != nil {`,
  4277  		`	if err := m.validateP4(formats); err != nil {`,
  4278  		`	if err := m.validateP5(formats); err != nil {`,
  4279  		`		return errors.CompositeValidationError(res...`,
  4280  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP0(formats strfmt.Registry) error {`,
  4281  		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
  4282  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP1(formats strfmt.Registry) error {`,
  4283  		`	if err := validate.Required("P1", "body", m.P1); err != nil {`,
  4284  		`	if m.P1 != nil {`,
  4285  		`		if err := m.P1.Validate(formats); err != nil {`,
  4286  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4287  		`				return ve.ValidateName("P1"`,
  4288  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP2(formats strfmt.Registry) error {`,
  4289  		`	if err := validate.Required("P2", "body", m.P2); err != nil {`,
  4290  		`	if m.P2 != nil {`,
  4291  		`		if err := m.P2.Validate(formats); err != nil {`,
  4292  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4293  		`				return ve.ValidateName("P2"`,
  4294  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP3(formats strfmt.Registry) error {`,
  4295  		`	if err := validate.Required("P3", "body", m.P3); err != nil {`,
  4296  		`	if m.P3 != nil {`,
  4297  		`		if err := m.P3.Validate(formats); err != nil {`,
  4298  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4299  		`				return ve.ValidateName("P3"`,
  4300  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP4(formats strfmt.Registry) error {`,
  4301  		`	if err := validate.Required("P4", "body", m.P4); err != nil {`,
  4302  		`	for i := 0; i < len(m.P4); i++ {`,
  4303  		`		if err := validate.FormatOf("P4"+"."+strconv.Itoa(i), "body", "isbn", m.P4[i].String(), formats); err != nil {`,
  4304  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0) validateP5(formats strfmt.Registry) error {`,
  4305  		`	if err := validate.Required("P5", "body", m.P5); err != nil {`,
  4306  		`type ClassicsClassicsItemsTuple0P3Tuple0P1 struct {`,
  4307  		"	Narrative *string `json:\"narrative\"`",
  4308  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0P1) Validate(formats strfmt.Registry) error {`,
  4309  		`	if err := m.validateNarrative(formats); err != nil {`,
  4310  		`		return errors.CompositeValidationError(res...`,
  4311  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0P1) validateNarrative(formats strfmt.Registry) error {`,
  4312  		`	if err := validate.Required("P1"+"."+"narrative", "body", m.Narrative); err != nil {`,
  4313  		`type ClassicsClassicsItemsTuple0P3Tuple0P2 struct {`,
  4314  		"	MarketingBS *string `json:\"marketingBS,omitempty\"`",
  4315  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0P2) Validate(formats strfmt.Registry) error {`,
  4316  		`		return errors.CompositeValidationError(res...`,
  4317  		`type ClassicsClassicsItemsTuple0P3Tuple0P3 struct {`,
  4318  		"	Author *string `json:\"author,omitempty\"`",
  4319  		"	Character *string `json:\"character,omitempty\"`",
  4320  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0P3) Validate(formats strfmt.Registry) error {`,
  4321  		`	if err := m.validateAuthor(formats); err != nil {`,
  4322  		`	if err := m.validateCharacter(formats); err != nil {`,
  4323  		`		return errors.CompositeValidationError(res...`,
  4324  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0P3) validateAuthor(formats strfmt.Registry) error {`,
  4325  		`	if swag.IsZero(m.Author) {`,
  4326  		`	if err := validate.MinLength("P3"+"."+"author", "body", string(*m.Author), 1); err != nil {`,
  4327  		`func (m *ClassicsClassicsItemsTuple0P3Tuple0P3) validateCharacter(formats strfmt.Registry) error {`,
  4328  		`	if swag.IsZero(m.Character) {`,
  4329  		"	if err := validate.Pattern(\"P3\"+\".\"+\"character\", \"body\", string(*m.Character), `^[A-Z]+$`); err != nil {",
  4330  		`type ClassicsTuple0 struct {`,
  4331  		"	P0 *string `json:\"-\"`",
  4332  		"	P1 *ClassicsTuple0P1 `json:\"-\"`",
  4333  		"	P2 *ClassicsTuple0P2 `json:\"-\"`",
  4334  		"	P3 *ClassicsTuple0P3 `json:\"-\"`",
  4335  		"	P4 []strfmt.ISBN `json:\"-\"`",
  4336  		"	P5 *int64 `json:\"-\"`",
  4337  		`func (m *ClassicsTuple0) Validate(formats strfmt.Registry) error {`,
  4338  		`	if err := m.validateP0(formats); err != nil {`,
  4339  		`	if err := m.validateP1(formats); err != nil {`,
  4340  		`	if err := m.validateP2(formats); err != nil {`,
  4341  		`	if err := m.validateP3(formats); err != nil {`,
  4342  		`	if err := m.validateP4(formats); err != nil {`,
  4343  		`	if err := m.validateP5(formats); err != nil {`,
  4344  		`		return errors.CompositeValidationError(res...`,
  4345  		`func (m *ClassicsTuple0) validateP0(formats strfmt.Registry) error {`,
  4346  		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
  4347  		`func (m *ClassicsTuple0) validateP1(formats strfmt.Registry) error {`,
  4348  		`	if err := validate.Required("P1", "body", m.P1); err != nil {`,
  4349  		`	if m.P1 != nil {`,
  4350  		`		if err := m.P1.Validate(formats); err != nil {`,
  4351  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4352  		`				return ve.ValidateName("P1"`,
  4353  		`func (m *ClassicsTuple0) validateP2(formats strfmt.Registry) error {`,
  4354  		`	if err := validate.Required("P2", "body", m.P2); err != nil {`,
  4355  		`	if m.P2 != nil {`,
  4356  		`		if err := m.P2.Validate(formats); err != nil {`,
  4357  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4358  		`				return ve.ValidateName("P2"`,
  4359  		`func (m *ClassicsTuple0) validateP3(formats strfmt.Registry) error {`,
  4360  		`	if err := validate.Required("P3", "body", m.P3); err != nil {`,
  4361  		`	if m.P3 != nil {`,
  4362  		`		if err := m.P3.Validate(formats); err != nil {`,
  4363  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4364  		`				return ve.ValidateName("P3"`,
  4365  		`func (m *ClassicsTuple0) validateP4(formats strfmt.Registry) error {`,
  4366  		`	if err := validate.Required("P4", "body", m.P4); err != nil {`,
  4367  		`	for i := 0; i < len(m.P4); i++ {`,
  4368  		`		if err := validate.FormatOf("P4"+"."+strconv.Itoa(i), "body", "isbn", m.P4[i].String(), formats); err != nil {`,
  4369  		`func (m *ClassicsTuple0) validateP5(formats strfmt.Registry) error {`,
  4370  		`	if err := validate.Required("P5", "body", m.P5); err != nil {`,
  4371  		`type ClassicsTuple0P1 struct {`,
  4372  		"	Narrative *string `json:\"narrative\"`",
  4373  		`func (m *ClassicsTuple0P1) Validate(formats strfmt.Registry) error {`,
  4374  		`	if err := m.validateNarrative(formats); err != nil {`,
  4375  		`		return errors.CompositeValidationError(res...`,
  4376  		`func (m *ClassicsTuple0P1) validateNarrative(formats strfmt.Registry) error {`,
  4377  		`	if err := validate.Required("P1"+"."+"narrative", "body", m.Narrative); err != nil {`,
  4378  		`type ClassicsTuple0P2 struct {`,
  4379  		"	MarketingBS *string `json:\"marketingBS,omitempty\"`",
  4380  		`func (m *ClassicsTuple0P2) Validate(formats strfmt.Registry) error {`,
  4381  		`		return errors.CompositeValidationError(res...`,
  4382  		`type ClassicsTuple0P3 struct {`,
  4383  		"	Author *string `json:\"author,omitempty\"`",
  4384  		"	Character *string `json:\"character,omitempty\"`",
  4385  		`func (m *ClassicsTuple0P3) Validate(formats strfmt.Registry) error {`,
  4386  		`	if err := m.validateAuthor(formats); err != nil {`,
  4387  		`	if err := m.validateCharacter(formats); err != nil {`,
  4388  		`		return errors.CompositeValidationError(res...`,
  4389  		`func (m *ClassicsTuple0P3) validateAuthor(formats strfmt.Registry) error {`,
  4390  		`	if swag.IsZero(m.Author) {`,
  4391  		`	if err := validate.MinLength("P3"+"."+"author", "body", string(*m.Author), 1); err != nil {`,
  4392  		`func (m *ClassicsTuple0P3) validateCharacter(formats strfmt.Registry) error {`,
  4393  		`	if swag.IsZero(m.Character) {`,
  4394  		"	if err := validate.Pattern(\"P3\"+\".\"+\"character\", \"body\", string(*m.Character), `^[A-Z]+$`); err != nil {",
  4395  	},
  4396  		// not expected
  4397  		todo,
  4398  		// output in log
  4399  		noLines,
  4400  		noLines)
  4401  
  4402  	// load expectations for model: comics_items2.go
  4403  	flattenRun.AddExpectations("comics_items2.go", []string{
  4404  		`type ComicsItems2 struct {`,
  4405  		"	MarketingBS string `json:\"marketingBS,omitempty\"`",
  4406  		// empty validation
  4407  		"func (m *ComicsItems2) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  4408  	},
  4409  		// not expected
  4410  		todo,
  4411  		// output in log
  4412  		noLines,
  4413  		noLines)
  4414  
  4415  	// load expectations for model: classics_items_additional_items_items2.go
  4416  	flattenRun.AddExpectations("classics_items_additional_items_items2.go", []string{
  4417  		`type ClassicsItemsAdditionalItemsItems2 struct {`,
  4418  		"	Origin string `json:\"origin,omitempty\"`",
  4419  		"	ClassicsItemsAdditionalItemsItems2 map[string]string `json:\"-\"`",
  4420  		`var classicsItemsAdditionalItemsItems2ValueEnum []interface{`,
  4421  		`	var res []string`,
  4422  		"	if err := json.Unmarshal([]byte(`[\"bookshop\",\"amazon\",\"library\"]`), &res); err != nil {",
  4423  		`	for _, v := range res {`,
  4424  		`		classicsItemsAdditionalItemsItems2ValueEnum = append(classicsItemsAdditionalItemsItems2ValueEnum, v`,
  4425  		`func (m *ClassicsItemsAdditionalItemsItems2) validateClassicsItemsAdditionalItemsItems2ValueEnum(path, location string, value string) error {`,
  4426  		`	if err := validate.Enum(path, location, value, classicsItemsAdditionalItemsItems2ValueEnum); err != nil {`,
  4427  		`func (m *ClassicsItemsAdditionalItemsItems2) Validate(formats strfmt.Registry) error {`,
  4428  		`	if err := m.validateOrigin(formats); err != nil {`,
  4429  		`	for k := range m.ClassicsItemsAdditionalItemsItems2 {`,
  4430  		// removed undue IsZero()
  4431  		//`		if swag.IsZero(m.ClassicsItemsAdditionalItemsItems2[k]) {`,
  4432  		`		if err := m.validateClassicsItemsAdditionalItemsItems2ValueEnum(k, "body", m.ClassicsItemsAdditionalItemsItems2[k]); err != nil {`,
  4433  		`		return errors.CompositeValidationError(res...`,
  4434  		`var classicsItemsAdditionalItemsItems2TypeOriginPropEnum []interface{`,
  4435  		`	var res []string`,
  4436  		"	if err := json.Unmarshal([]byte(`[\"print\",\"e-book\",\"collection\",\"museum\"]`), &res); err != nil {",
  4437  		`	for _, v := range res {`,
  4438  		`		classicsItemsAdditionalItemsItems2TypeOriginPropEnum = append(classicsItemsAdditionalItemsItems2TypeOriginPropEnum, v`,
  4439  		`	ClassicsItemsAdditionalItemsItems2OriginPrint string = "print"`,
  4440  		`	ClassicsItemsAdditionalItemsItems2OriginEBook string = "e-book"`,
  4441  		`	ClassicsItemsAdditionalItemsItems2OriginCollection string = "collection"`,
  4442  		`	ClassicsItemsAdditionalItemsItems2OriginMuseum string = "museum"`,
  4443  		`func (m *ClassicsItemsAdditionalItemsItems2) validateOriginEnum(path, location string, value string) error {`,
  4444  		`	if err := validate.Enum(path, location, value, classicsItemsAdditionalItemsItems2TypeOriginPropEnum); err != nil {`,
  4445  		`func (m *ClassicsItemsAdditionalItemsItems2) validateOrigin(formats strfmt.Registry) error {`,
  4446  		`	if swag.IsZero(m.Origin) {`,
  4447  		`	if err := m.validateOriginEnum("origin", "body", m.Origin); err != nil {`,
  4448  	},
  4449  		// not expected
  4450  		todo,
  4451  		// output in log
  4452  		noLines,
  4453  		noLines)
  4454  
  4455  	// load expectations for model: comics.go
  4456  	flattenRun.AddExpectations("comics.go", []string{
  4457  		`type Comics struct {`,
  4458  		"	P0 *string `json:\"-\"`",
  4459  		"	P1 *ComicsItems1 `json:\"-\"`",
  4460  		"	P2 *ComicsItems2 `json:\"-\"`",
  4461  		"	P3 *ComicsItems3 `json:\"-\"`",
  4462  		"	P4 []strfmt.ISBN `json:\"-\"`",
  4463  		"	P5 *int64 `json:\"-\"`",
  4464  		`func (m *Comics) Validate(formats strfmt.Registry) error {`,
  4465  		`	if err := m.validateP0(formats); err != nil {`,
  4466  		`	if err := m.validateP1(formats); err != nil {`,
  4467  		`	if err := m.validateP2(formats); err != nil {`,
  4468  		`	if err := m.validateP3(formats); err != nil {`,
  4469  		`	if err := m.validateP4(formats); err != nil {`,
  4470  		`	if err := m.validateP5(formats); err != nil {`,
  4471  		`		return errors.CompositeValidationError(res...`,
  4472  		`func (m *Comics) validateP0(formats strfmt.Registry) error {`,
  4473  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  4474  		`func (m *Comics) validateP1(formats strfmt.Registry) error {`,
  4475  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  4476  		`	if m.P1 != nil {`,
  4477  		`		if err := m.P1.Validate(formats); err != nil {`,
  4478  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4479  		`				return ve.ValidateName("1"`,
  4480  		`func (m *Comics) validateP2(formats strfmt.Registry) error {`,
  4481  		`	if err := validate.Required("2", "body", m.P2); err != nil {`,
  4482  		`	if m.P2 != nil {`,
  4483  		`		if err := m.P2.Validate(formats); err != nil {`,
  4484  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4485  		`				return ve.ValidateName("2"`,
  4486  		`func (m *Comics) validateP3(formats strfmt.Registry) error {`,
  4487  		`	if err := validate.Required("3", "body", m.P3); err != nil {`,
  4488  		`	if m.P3 != nil {`,
  4489  		`		if err := m.P3.Validate(formats); err != nil {`,
  4490  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4491  		`				return ve.ValidateName("3"`,
  4492  		`func (m *Comics) validateP4(formats strfmt.Registry) error {`,
  4493  		`	if err := validate.Required("4", "body", m.P4); err != nil {`,
  4494  		`	for i := 0; i < len(m.P4); i++ {`,
  4495  		`		if err := validate.FormatOf("4"+"."+strconv.Itoa(i), "body", "isbn", m.P4[i].String(), formats); err != nil {`,
  4496  		`func (m *Comics) validateP5(formats strfmt.Registry) error {`,
  4497  		`	if err := validate.Required("5", "body", m.P5); err != nil {`,
  4498  	},
  4499  		// not expected
  4500  		todo,
  4501  		// output in log
  4502  		noLines,
  4503  		noLines)
  4504  
  4505  	expandRun.AddExpectations("comics.go", []string{
  4506  		`type Comics struct {`,
  4507  		"	P0 *string `json:\"-\"`",
  4508  		"   P1 *ComicsItems1 `json:\"-\"`",
  4509  		"   P2 *ComicsItems2 `json:\"-\"`",
  4510  		"   P3 *ComicsItems3 `json:\"-\"`",
  4511  		"	P4 []strfmt.ISBN `json:\"-\"`",
  4512  		"	P5 *int64 `json:\"-\"`",
  4513  		`func (m *Comics) Validate(formats strfmt.Registry) error {`,
  4514  		`	if err := m.validateP0(formats); err != nil {`,
  4515  		`	if err := m.validateP1(formats); err != nil {`,
  4516  		`	if err := m.validateP2(formats); err != nil {`,
  4517  		`	if err := m.validateP3(formats); err != nil {`,
  4518  		`	if err := m.validateP4(formats); err != nil {`,
  4519  		`	if err := m.validateP5(formats); err != nil {`,
  4520  		`		return errors.CompositeValidationError(res...`,
  4521  		`func (m *Comics) validateP0(formats strfmt.Registry) error {`,
  4522  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  4523  		`func (m *Comics) validateP1(formats strfmt.Registry) error {`,
  4524  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  4525  		`func (m *Comics) validateP2(formats strfmt.Registry) error {`,
  4526  		`	if err := validate.Required("2", "body", m.P2); err != nil {`,
  4527  		`func (m *Comics) validateP3(formats strfmt.Registry) error {`,
  4528  		`	if err := validate.Required("3", "body", m.P3); err != nil {`,
  4529  		`func (m *Comics) validateP4(formats strfmt.Registry) error {`,
  4530  		`	if err := validate.Required("4", "body", m.P4); err != nil {`,
  4531  		`	for i := 0; i < len(m.P4); i++ {`,
  4532  		`		if err := validate.FormatOf("4"+"."+strconv.Itoa(i), "body", "isbn", m.P4[i].String(), formats); err != nil {`,
  4533  		`func (m *Comics) validateP5(formats strfmt.Registry) error {`,
  4534  		`	if err := validate.Required("5", "body", m.P5); err != nil {`,
  4535  		`type ComicsItems1 struct {`,
  4536  		`type ComicsItems2 struct {`,
  4537  		`type ComicsItems3 struct {`,
  4538  	},
  4539  		// not expected
  4540  		todo,
  4541  		// output in log
  4542  		noLines,
  4543  		noLines)
  4544  
  4545  	// load expectations for model: classics_items_additional_items_items0.go
  4546  	flattenRun.AddExpectations("classics_items_additional_items_items0.go", []string{
  4547  		`type ClassicsItemsAdditionalItemsItems0 struct {`,
  4548  		"	Period string `json:\"period,omitempty\"`",
  4549  		"	Title string `json:\"title,omitempty\"`",
  4550  		`func (m *ClassicsItemsAdditionalItemsItems0) Validate(formats strfmt.Registry) error {`,
  4551  		`	if err := m.validateTitle(formats); err != nil {`,
  4552  		`		return errors.CompositeValidationError(res...`,
  4553  		`var classicsItemsAdditionalItemsItems0TypeTitlePropEnum []interface{`,
  4554  		`	var res []string`,
  4555  		"	if err := json.Unmarshal([]byte(`[\"Les Misérables\",\"Bleak House\",\"Sherlock Holmes\",\"Siddhartha\"]`), &res); err != nil {",
  4556  		`	for _, v := range res {`,
  4557  		`		classicsItemsAdditionalItemsItems0TypeTitlePropEnum = append(classicsItemsAdditionalItemsItems0TypeTitlePropEnum, v`,
  4558  		`	ClassicsItemsAdditionalItemsItems0TitleLesMisérables string = "Les Misérables"`,
  4559  		`	ClassicsItemsAdditionalItemsItems0TitleBleakHouse string = "Bleak House"`,
  4560  		`	ClassicsItemsAdditionalItemsItems0TitleSherlockHolmes string = "Sherlock Holmes"`,
  4561  		`	ClassicsItemsAdditionalItemsItems0TitleSiddhartha string = "Siddhartha"`,
  4562  		`func (m *ClassicsItemsAdditionalItemsItems0) validateTitleEnum(path, location string, value string) error {`,
  4563  		`	if err := validate.Enum(path, location, value, classicsItemsAdditionalItemsItems0TypeTitlePropEnum); err != nil {`,
  4564  		`func (m *ClassicsItemsAdditionalItemsItems0) validateTitle(formats strfmt.Registry) error {`,
  4565  		`	if swag.IsZero(m.Title) {`,
  4566  		`	if err := m.validateTitleEnum("title", "body", m.Title); err != nil {`,
  4567  	},
  4568  		// not expected
  4569  		todo,
  4570  		// output in log
  4571  		noLines,
  4572  		noLines)
  4573  
  4574  	// load expectations for model: comics_items1.go
  4575  	flattenRun.AddExpectations("comics_items1.go", []string{
  4576  		`type ComicsItems1 struct {`,
  4577  		"	Narrative *string `json:\"narrative\"`",
  4578  		`func (m *ComicsItems1) Validate(formats strfmt.Registry) error {`,
  4579  		`	if err := m.validateNarrative(formats); err != nil {`,
  4580  		`		return errors.CompositeValidationError(res...`,
  4581  		`func (m *ComicsItems1) validateNarrative(formats strfmt.Registry) error {`,
  4582  		`	if err := validate.Required("narrative", "body", m.Narrative); err != nil {`,
  4583  	},
  4584  		// not expected
  4585  		todo,
  4586  		// output in log
  4587  		noLines,
  4588  		noLines)
  4589  
  4590  	// load expectations for model: comics_items3.go
  4591  	flattenRun.AddExpectations("comics_items3.go", []string{
  4592  		`type ComicsItems3 struct {`,
  4593  		"	Author string `json:\"author,omitempty\"`",
  4594  		"	Character string `json:\"character,omitempty\"`",
  4595  		`func (m *ComicsItems3) Validate(formats strfmt.Registry) error {`,
  4596  		`	if err := m.validateAuthor(formats); err != nil {`,
  4597  		`	if err := m.validateCharacter(formats); err != nil {`,
  4598  		`		return errors.CompositeValidationError(res...`,
  4599  		`func (m *ComicsItems3) validateAuthor(formats strfmt.Registry) error {`,
  4600  		`	if swag.IsZero(m.Author) {`,
  4601  		`	if err := validate.MinLength("author", "body", string(m.Author), 1); err != nil {`,
  4602  		`func (m *ComicsItems3) validateCharacter(formats strfmt.Registry) error {`,
  4603  		`	if swag.IsZero(m.Character) {`,
  4604  		"	if err := validate.Pattern(\"character\", \"body\", string(m.Character), `^[A-Z]+$`); err != nil {",
  4605  	},
  4606  		// not expected
  4607  		todo,
  4608  		// output in log
  4609  		noLines,
  4610  		noLines)
  4611  
  4612  	// load expectations for model: classics_tuple_additional_items.go
  4613  	flattenRun.AddExpectations("classics_tuple_additional_items.go", []string{
  4614  		`type ClassicsTupleAdditionalItems struct {`,
  4615  		"	P0 *ClassicsItemsAdditionalItemsItems0 `json:\"-\"`",
  4616  		"	P1 []strfmt.Date `json:\"-\"`",
  4617  		"	P2 *ClassicsItemsAdditionalItemsItems2 `json:\"-\"`",
  4618  		"	P3 Comics `json:\"-\"`",
  4619  		`func (m *ClassicsTupleAdditionalItems) Validate(formats strfmt.Registry) error {`,
  4620  		`	if err := m.validateP0(formats); err != nil {`,
  4621  		`	if err := m.validateP1(formats); err != nil {`,
  4622  		`	if err := m.validateP2(formats); err != nil {`,
  4623  		`	if err := m.validateP3(formats); err != nil {`,
  4624  		`		return errors.CompositeValidationError(res...`,
  4625  		`func (m *ClassicsTupleAdditionalItems) validateP0(formats strfmt.Registry) error {`,
  4626  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  4627  		`	if m.P0 != nil {`,
  4628  		`		if err := m.P0.Validate(formats); err != nil {`,
  4629  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4630  		`				return ve.ValidateName("0"`,
  4631  		`func (m *ClassicsTupleAdditionalItems) validateP1(formats strfmt.Registry) error {`,
  4632  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  4633  		`	for i := 0; i < len(m.P1); i++ {`,
  4634  		`		if err := validate.FormatOf("1"+"."+strconv.Itoa(i), "body", "date", m.P1[i].String(), formats); err != nil {`,
  4635  		`func (m *ClassicsTupleAdditionalItems) validateP2(formats strfmt.Registry) error {`,
  4636  		`	if err := validate.Required("2", "body", m.P2); err != nil {`,
  4637  		`	if m.P2 != nil {`,
  4638  		`		if err := m.P2.Validate(formats); err != nil {`,
  4639  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4640  		`				return ve.ValidateName("2"`,
  4641  		`func (m *ClassicsTupleAdditionalItems) validateP3(formats strfmt.Registry) error {`,
  4642  		`	if err := m.P3.Validate(formats); err != nil {`,
  4643  		`		if ve, ok := err.(*errors.Validation); ok {`,
  4644  		`			return ve.ValidateName("3"`,
  4645  	},
  4646  		// not expected
  4647  		todo,
  4648  		// output in log
  4649  		noLines,
  4650  		noLines)
  4651  
  4652  }
  4653  
  4654  func initFixture1198() {
  4655  	// testing ../fixtures/bugs/1487/fixture-1198.yaml with expand (--skip-flatten)
  4656  
  4657  	f := newModelFixture("../fixtures/bugs/1198/fixture-1198.yaml", "string-body-api")
  4658  	flattenRun := f.AddRun(false)
  4659  
  4660  	// load expectations for model: pet.go
  4661  	flattenRun.AddExpectations("pet.go", []string{
  4662  		`type Pet struct {`,
  4663  		"	Date interface{} `json:\"date\"`",
  4664  		`func (m *Pet) Validate(formats strfmt.Registry) error {`,
  4665  		`	if err := m.validateDate(formats); err != nil {`,
  4666  		`		return errors.CompositeValidationError(res...`,
  4667  		`func (m *Pet) validateDate(formats strfmt.Registry) error {`,
  4668  	},
  4669  		// not expected
  4670  		todo,
  4671  		// output in log
  4672  		noLines,
  4673  		noLines)
  4674  
  4675  }
  4676  
  4677  func initFixture1042() {
  4678  	// testing ../fixtures/bugs/1487/fixture-1042.yaml with expand (--skip-flatten)
  4679  
  4680  	/* when the specification incorrectly defines the allOf,
  4681  	generated unmarshalling is wrong.
  4682  	This fixture asserts that with correct spec, the generated models are correct.
  4683  
  4684  	*/
  4685  
  4686  	f := newModelFixture("../fixtures/bugs/1042/fixture-1042.yaml", "allOf marshalling")
  4687  	flattenRun := f.AddRun(false)
  4688  
  4689  	// load expectations for model: b.go
  4690  	flattenRun.AddExpectations("b.go", []string{
  4691  		`type B struct {`,
  4692  		`	A`,
  4693  		`	BAllOf1`,
  4694  		`func (m *B) UnmarshalJSON(raw []byte) error {`,
  4695  		`	var aO0 A`,
  4696  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  4697  		`	m.A = aO0`,
  4698  		`	var aO1 BAllOf1`,
  4699  		`	if err := swag.ReadJSON(raw, &aO1); err != nil {`,
  4700  		`	m.BAllOf1 = aO1`,
  4701  		`func (m B) MarshalJSON() ([]byte, error) {`,
  4702  		//`	var _parts [][]byte`,
  4703  		// slight optimization of allocations
  4704  		`	_parts := make([][]byte, 0, 2)`,
  4705  		`	aO0, err := swag.WriteJSON(m.A`,
  4706  		`	if err != nil {`,
  4707  		`		return nil, err`,
  4708  		`	_parts = append(_parts, aO0`,
  4709  		`	aO1, err := swag.WriteJSON(m.BAllOf1`,
  4710  		`	if err != nil {`,
  4711  		`		return nil, err`,
  4712  		`	_parts = append(_parts, aO1`,
  4713  		`	return swag.ConcatJSON(_parts...), nil`,
  4714  		`func (m *B) Validate(formats strfmt.Registry) error {`,
  4715  		`	if err := m.A.Validate(formats); err != nil {`,
  4716  		`	if err := m.BAllOf1.Validate(formats); err != nil {`,
  4717  		`		return errors.CompositeValidationError(res...`,
  4718  	},
  4719  		// not expected
  4720  		todo,
  4721  		// output in log
  4722  		noLines,
  4723  		noLines)
  4724  
  4725  	// load expectations for model: b_all_of1.go
  4726  	flattenRun.AddExpectations("b_all_of1.go", []string{
  4727  		`type BAllOf1 struct {`,
  4728  		"	F3 *string `json:\"f3\"`",
  4729  		"	F4 []string `json:\"f4\"`",
  4730  		`func (m *BAllOf1) Validate(formats strfmt.Registry) error {`,
  4731  		`	if err := m.validateF3(formats); err != nil {`,
  4732  		`	if err := m.validateF4(formats); err != nil {`,
  4733  		`		return errors.CompositeValidationError(res...`,
  4734  		`func (m *BAllOf1) validateF3(formats strfmt.Registry) error {`,
  4735  		`	if err := validate.Required("f3", "body", m.F3); err != nil {`,
  4736  		`func (m *BAllOf1) validateF4(formats strfmt.Registry) error {`,
  4737  		`	if err := validate.Required("f4", "body", m.F4); err != nil {`,
  4738  	},
  4739  		// not expected
  4740  		todo,
  4741  		// output in log
  4742  		noLines,
  4743  		noLines)
  4744  
  4745  	// load expectations for model: a.go
  4746  	flattenRun.AddExpectations("a.go", []string{
  4747  		`type A struct {`,
  4748  		"	F1 string `json:\"f1,omitempty\"`",
  4749  		"	F2 string `json:\"f2,omitempty\"`",
  4750  		// empty validation
  4751  		"func (m *A) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  4752  	},
  4753  		// not expected
  4754  		todo,
  4755  		// output in log
  4756  		noLines,
  4757  		noLines)
  4758  
  4759  }
  4760  
  4761  func initFixture1042V2() {
  4762  	// testing ../fixtures/bugs/1487/fixture-1042-2.yaml with expand (--skip-flatten)
  4763  
  4764  	/* when the specification incorrectly defines the allOf,
  4765  	generated unmarshalling is wrong.
  4766  	This fixture asserts that with correct spec, the generated models are correct.
  4767  
  4768  	*/
  4769  
  4770  	f := newModelFixture("../fixtures/bugs/1042/fixture-1042-2.yaml", "allOf marshalling")
  4771  	flattenRun := f.AddRun(false)
  4772  
  4773  	// load expectations for model: error_model.go
  4774  	flattenRun.AddExpectations("error_model.go", []string{
  4775  		`type ErrorModel struct {`,
  4776  		"	Code *int64 `json:\"code\"`",
  4777  		"	Message *string `json:\"message\"`",
  4778  		`func (m *ErrorModel) Validate(formats strfmt.Registry) error {`,
  4779  		`	if err := m.validateCode(formats); err != nil {`,
  4780  		`	if err := m.validateMessage(formats); err != nil {`,
  4781  		`		return errors.CompositeValidationError(res...`,
  4782  		`func (m *ErrorModel) validateCode(formats strfmt.Registry) error {`,
  4783  		`	if err := validate.Required("code", "body", m.Code); err != nil {`,
  4784  		`	if err := validate.MinimumInt("code", "body", int64(*m.Code), 100, false); err != nil {`,
  4785  		`	if err := validate.MaximumInt("code", "body", int64(*m.Code), 600, false); err != nil {`,
  4786  		`func (m *ErrorModel) validateMessage(formats strfmt.Registry) error {`,
  4787  		`	if err := validate.Required("message", "body", m.Message); err != nil {`,
  4788  	},
  4789  		// not expected
  4790  		todo,
  4791  		// output in log
  4792  		noLines,
  4793  		noLines)
  4794  
  4795  	// load expectations for model: extended_error_model.go
  4796  	flattenRun.AddExpectations("extended_error_model.go", []string{
  4797  		`type ExtendedErrorModel struct {`,
  4798  		`	ErrorModel`,
  4799  		`	ExtendedErrorModelAllOf1`,
  4800  		`func (m *ExtendedErrorModel) UnmarshalJSON(raw []byte) error {`,
  4801  		`	var aO0 ErrorModel`,
  4802  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  4803  		`	m.ErrorModel = aO0`,
  4804  		`	var aO1 ExtendedErrorModelAllOf1`,
  4805  		`	if err := swag.ReadJSON(raw, &aO1); err != nil {`,
  4806  		`	m.ExtendedErrorModelAllOf1 = aO1`,
  4807  		`func (m ExtendedErrorModel) MarshalJSON() ([]byte, error) {`,
  4808  		//`	var _parts [][]byte`,
  4809  		// slight optimization of allocations
  4810  		`	_parts := make([][]byte, 0, 2)`,
  4811  		`	aO0, err := swag.WriteJSON(m.ErrorModel`,
  4812  		`	if err != nil {`,
  4813  		`		return nil, err`,
  4814  		`	_parts = append(_parts, aO0`,
  4815  		`	aO1, err := swag.WriteJSON(m.ExtendedErrorModelAllOf1`,
  4816  		`	if err != nil {`,
  4817  		`		return nil, err`,
  4818  		`	_parts = append(_parts, aO1`,
  4819  		`	return swag.ConcatJSON(_parts...), nil`,
  4820  		`func (m *ExtendedErrorModel) Validate(formats strfmt.Registry) error {`,
  4821  		`	if err := m.ErrorModel.Validate(formats); err != nil {`,
  4822  		`	if err := m.ExtendedErrorModelAllOf1.Validate(formats); err != nil {`,
  4823  		`		return errors.CompositeValidationError(res...`,
  4824  	},
  4825  		// not expected
  4826  		todo,
  4827  		// output in log
  4828  		noLines,
  4829  		noLines)
  4830  
  4831  	// load expectations for model: extended_error_model_all_of1.go
  4832  	flattenRun.AddExpectations("extended_error_model_all_of1.go", []string{
  4833  		`type ExtendedErrorModelAllOf1 struct {`,
  4834  		"	RootCause *string `json:\"rootCause\"`",
  4835  		`func (m *ExtendedErrorModelAllOf1) Validate(formats strfmt.Registry) error {`,
  4836  		`	if err := m.validateRootCause(formats); err != nil {`,
  4837  		`		return errors.CompositeValidationError(res...`,
  4838  		`func (m *ExtendedErrorModelAllOf1) validateRootCause(formats strfmt.Registry) error {`,
  4839  		`	if err := validate.Required("rootCause", "body", m.RootCause); err != nil {`,
  4840  	},
  4841  		// not expected
  4842  		todo,
  4843  		// output in log
  4844  		noLines,
  4845  		noLines)
  4846  
  4847  }
  4848  
  4849  func initFixture979() {
  4850  	// testing ../fixtures/bugs/1487/fixture-979.yaml with expand (--skip-flatten)
  4851  
  4852  	/* checking that properties is enough to figure out an object schema
  4853  	 */
  4854  
  4855  	f := newModelFixture("../fixtures/bugs/979/fixture-979.yaml", "allOf without the explicit type object")
  4856  	flattenRun := f.AddRun(false)
  4857  
  4858  	// load expectations for model: cluster.go
  4859  	flattenRun.AddExpectations("cluster.go", []string{
  4860  		`type Cluster struct {`,
  4861  		`	NewCluster`,
  4862  		`	ClusterAllOf1`,
  4863  		`func (m *Cluster) UnmarshalJSON(raw []byte) error {`,
  4864  		`	var aO0 NewCluster`,
  4865  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
  4866  		`	m.NewCluster = aO0`,
  4867  		`	var aO1 ClusterAllOf1`,
  4868  		`	if err := swag.ReadJSON(raw, &aO1); err != nil {`,
  4869  		`	m.ClusterAllOf1 = aO1`,
  4870  		`func (m Cluster) MarshalJSON() ([]byte, error) {`,
  4871  		//`	var _parts [][]byte`,
  4872  		// slight optimization of allocations
  4873  		`	_parts := make([][]byte, 0, 2)`,
  4874  		`	aO0, err := swag.WriteJSON(m.NewCluster`,
  4875  		`	if err != nil {`,
  4876  		`		return nil, err`,
  4877  		`	_parts = append(_parts, aO0`,
  4878  		`	aO1, err := swag.WriteJSON(m.ClusterAllOf1`,
  4879  		`	if err != nil {`,
  4880  		`		return nil, err`,
  4881  		`	_parts = append(_parts, aO1`,
  4882  		`	return swag.ConcatJSON(_parts...), nil`,
  4883  		`func (m *Cluster) Validate(formats strfmt.Registry) error {`,
  4884  		`	if err := m.NewCluster.Validate(formats); err != nil {`,
  4885  		`	if err := m.ClusterAllOf1.Validate(formats); err != nil {`,
  4886  		`		return errors.CompositeValidationError(res...`,
  4887  	},
  4888  		// not expected
  4889  		todo,
  4890  		// output in log
  4891  		noLines,
  4892  		noLines)
  4893  
  4894  	// load expectations for model: new_cluster.go
  4895  	flattenRun.AddExpectations("new_cluster.go", []string{
  4896  		`type NewCluster struct {`,
  4897  		"	DummyProp1 int64 `json:\"dummyProp1,omitempty\"`",
  4898  		// empty validation
  4899  		"func (m *NewCluster) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  4900  	},
  4901  		// not expected
  4902  		todo,
  4903  		// output in log
  4904  		noLines,
  4905  		noLines)
  4906  
  4907  	// load expectations for model: cluster_all_of1.go
  4908  	flattenRun.AddExpectations("cluster_all_of1.go", []string{
  4909  		`type ClusterAllOf1 struct {`,
  4910  		"	Result string `json:\"result,omitempty\"`",
  4911  		"	Status string `json:\"status,omitempty\"`",
  4912  		// empty validation
  4913  		"func (m *ClusterAllOf1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  4914  	},
  4915  		// not expected
  4916  		todo,
  4917  		// output in log
  4918  		noLines,
  4919  		noLines)
  4920  
  4921  }
  4922  
  4923  func initFixture842() {
  4924  	// testing ../fixtures/bugs/1487/fixture-842.yaml with expand (--skip-flatten)
  4925  
  4926  	/* codegen fails to produce code that builds
  4927  	 */
  4928  
  4929  	f := newModelFixture("../fixtures/bugs/842/fixture-842.yaml", "polymorphic type containing an array of the base type")
  4930  	flattenRun := f.AddRun(false)
  4931  
  4932  	// load expectations for model: value_array_all_of1.go
  4933  	flattenRun.AddExpectations("value_array_all_of1.go", []string{
  4934  		`type ValueArrayAllOf1 struct {`,
  4935  		`	valuesField []Value`,
  4936  		`func (m *ValueArrayAllOf1) Values() []Value {`,
  4937  		`	return m.valuesField`,
  4938  		`func (m *ValueArrayAllOf1) SetValues(val []Value) {`,
  4939  		`	m.valuesField = val`,
  4940  		`func (m *ValueArrayAllOf1) Validate(formats strfmt.Registry) error {`,
  4941  		`	if err := m.validateValues(formats); err != nil {`,
  4942  		`		return errors.CompositeValidationError(res...`,
  4943  		`func (m *ValueArrayAllOf1) validateValues(formats strfmt.Registry) error {`,
  4944  		`	if err := validate.Required("Values", "body", m.Values()); err != nil {`,
  4945  		`	for i := 0; i < len(m.Values()); i++ {`,
  4946  		`		if err := m.valuesField[i].Validate(formats); err != nil {`,
  4947  		`			if ve, ok := err.(*errors.Validation); ok {`,
  4948  		`				return ve.ValidateName("Values" + "." + strconv.Itoa(i)`,
  4949  	},
  4950  		// not expected
  4951  		todo,
  4952  		// output in log
  4953  		noLines,
  4954  		noLines)
  4955  
  4956  	// load expectations for model: value_array.go
  4957  	flattenRun.AddExpectations("value_array.go", []string{
  4958  		`type ValueArray struct {`,
  4959  		`	ValueArrayAllOf1`,
  4960  		`func (m *ValueArray) ValueType() string {`,
  4961  		`	return "ValueArray"`,
  4962  		`func (m *ValueArray) SetValueType(val string) {`,
  4963  		`func (m *ValueArray) Validate(formats strfmt.Registry) error {`,
  4964  		`	if err := m.ValueArrayAllOf1.Validate(formats); err != nil {`,
  4965  		`		return errors.CompositeValidationError(res...`,
  4966  	},
  4967  		// not expected
  4968  		todo,
  4969  		// output in log
  4970  		noLines,
  4971  		noLines)
  4972  
  4973  	// load expectations for model: value.go
  4974  	flattenRun.AddExpectations("value.go", []string{
  4975  		`type Value interface {`,
  4976  		`	runtime.Validatable`,
  4977  		`	ValueType() string`,
  4978  		`	SetValueType(string`,
  4979  		`type value struct {`,
  4980  		`	valueTypeField string`,
  4981  		`func (m *value) ValueType() string {`,
  4982  		`	return "Value"`,
  4983  		`func (m *value) SetValueType(val string) {`,
  4984  		`func UnmarshalValueSlice(reader io.Reader, consumer runtime.Consumer) ([]Value, error) {`,
  4985  		`	var elements []json.RawMessage`,
  4986  		`	if err := consumer.Consume(reader, &elements); err != nil {`,
  4987  		`		return nil, err`,
  4988  		`	var result []Value`,
  4989  		`	for _, element := range elements {`,
  4990  		`		obj, err := unmarshalValue(element, consumer`,
  4991  		`		if err != nil {`,
  4992  		`			return nil, err`,
  4993  		`		result = append(result, obj`,
  4994  		`	return result, nil`,
  4995  		`func UnmarshalValue(reader io.Reader, consumer runtime.Consumer) (Value, error) {`,
  4996  		`	data, err := ioutil.ReadAll(reader`,
  4997  		`	if err != nil {`,
  4998  		`		return nil, err`,
  4999  		`	return unmarshalValue(data, consumer`,
  5000  		`func unmarshalValue(data []byte, consumer runtime.Consumer) (Value, error) {`,
  5001  		`	buf := bytes.NewBuffer(data`,
  5002  		`	buf2 := bytes.NewBuffer(data`,
  5003  		`	var getType struct {`,
  5004  		"		ValueType string `json:\"ValueType\"`",
  5005  		`	if err := consumer.Consume(buf, &getType); err != nil {`,
  5006  		`		return nil, err`,
  5007  		`	if err := validate.RequiredString("ValueType", "body", getType.ValueType); err != nil {`,
  5008  		`		return nil, err`,
  5009  		`	switch getType.ValueType {`,
  5010  		`	case "Value":`,
  5011  		`		var result value`,
  5012  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  5013  		`			return nil, err`,
  5014  		`		return &result, nil`,
  5015  		`	case "ValueArray":`,
  5016  		`		var result ValueArray`,
  5017  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  5018  		`			return nil, err`,
  5019  		`		return &result, nil`,
  5020  		`	return nil, errors.New(422, "invalid ValueType value: %q", getType.ValueType`,
  5021  		// empty validation
  5022  		"func (m *value) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  5023  	},
  5024  		// not expected
  5025  		todo,
  5026  		// output in log
  5027  		noLines,
  5028  		noLines)
  5029  
  5030  }
  5031  
  5032  func initFixture607() {
  5033  	// testing ../fixtures/bugs/1487/fixture-607.yaml with expand (--skip-flatten)
  5034  
  5035  	/* broken code produced on polymorphic type
  5036  	 */
  5037  
  5038  	f := newModelFixture("../fixtures/bugs/607/fixture-607.yaml", "broken code when using array of polymorphic type")
  5039  	flattenRun := f.AddRun(false)
  5040  
  5041  	// load expectations for model: range_filter_all_of1.go
  5042  	flattenRun.AddExpectations("range_filter_all_of1.go", []string{
  5043  		`type RangeFilterAllOf1 struct {`,
  5044  		"	Config *RangeFilterAllOf1Config `json:\"config\"`",
  5045  		`func (m *RangeFilterAllOf1) Validate(formats strfmt.Registry) error {`,
  5046  		`	if err := m.validateConfig(formats); err != nil {`,
  5047  		`		return errors.CompositeValidationError(res...`,
  5048  		`func (m *RangeFilterAllOf1) validateConfig(formats strfmt.Registry) error {`,
  5049  		`	if err := validate.Required("config", "body", m.Config); err != nil {`,
  5050  		`	if m.Config != nil {`,
  5051  		`		if err := m.Config.Validate(formats); err != nil {`,
  5052  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5053  		`				return ve.ValidateName("config"`,
  5054  	},
  5055  		// not expected
  5056  		todo,
  5057  		// output in log
  5058  		noLines,
  5059  		noLines)
  5060  
  5061  	// load expectations for model: filter.go
  5062  	flattenRun.AddExpectations("filter.go", []string{
  5063  		`type Filter interface {`,
  5064  		`	runtime.Validatable`,
  5065  		`	Type() string`,
  5066  		`	SetType(string`,
  5067  		`type filter struct {`,
  5068  		`	typeField string`,
  5069  		`func (m *filter) Type() string {`,
  5070  		`	return "Filter"`,
  5071  		`func (m *filter) SetType(val string) {`,
  5072  		`func UnmarshalFilterSlice(reader io.Reader, consumer runtime.Consumer) ([]Filter, error) {`,
  5073  		`	var elements []json.RawMessage`,
  5074  		`	if err := consumer.Consume(reader, &elements); err != nil {`,
  5075  		`		return nil, err`,
  5076  		`	var result []Filter`,
  5077  		`	for _, element := range elements {`,
  5078  		`		obj, err := unmarshalFilter(element, consumer`,
  5079  		`		if err != nil {`,
  5080  		`			return nil, err`,
  5081  		`		result = append(result, obj`,
  5082  		`	return result, nil`,
  5083  		`func UnmarshalFilter(reader io.Reader, consumer runtime.Consumer) (Filter, error) {`,
  5084  		`	data, err := ioutil.ReadAll(reader`,
  5085  		`	if err != nil {`,
  5086  		`		return nil, err`,
  5087  		`	return unmarshalFilter(data, consumer`,
  5088  		`func unmarshalFilter(data []byte, consumer runtime.Consumer) (Filter, error) {`,
  5089  		`	buf := bytes.NewBuffer(data`,
  5090  		`	buf2 := bytes.NewBuffer(data`,
  5091  		`	var getType struct {`,
  5092  		"		Type string `json:\"type\"`",
  5093  		`	if err := consumer.Consume(buf, &getType); err != nil {`,
  5094  		`		return nil, err`,
  5095  		`	if err := validate.RequiredString("type", "body", getType.Type); err != nil {`,
  5096  		`		return nil, err`,
  5097  		`	switch getType.Type {`,
  5098  		`	case "AndFilter":`,
  5099  		`		var result AndFilter`,
  5100  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  5101  		`			return nil, err`,
  5102  		`		return &result, nil`,
  5103  		`	case "Filter":`,
  5104  		`		var result filter`,
  5105  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  5106  		`			return nil, err`,
  5107  		`		return &result, nil`,
  5108  		`	case "RangeFilter":`,
  5109  		`		var result RangeFilter`,
  5110  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  5111  		`			return nil, err`,
  5112  		`		return &result, nil`,
  5113  		`	return nil, errors.New(422, "invalid type value: %q", getType.Type`,
  5114  		// empty validation
  5115  		"func (m *filter) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  5116  	},
  5117  		// not expected
  5118  		todo,
  5119  		// output in log
  5120  		noLines,
  5121  		noLines)
  5122  
  5123  	// load expectations for model: and_filter_all_of1.go
  5124  	flattenRun.AddExpectations("and_filter_all_of1.go", []string{
  5125  		`type AndFilterAllOf1 struct {`,
  5126  		`	configField []Filter`,
  5127  		`func (m *AndFilterAllOf1) Config() []Filter {`,
  5128  		`	return m.configField`,
  5129  		`func (m *AndFilterAllOf1) SetConfig(val []Filter) {`,
  5130  		`	m.configField = val`,
  5131  		`func (m *AndFilterAllOf1) UnmarshalJSON(raw []byte) error {`,
  5132  		`	var data struct {`,
  5133  		"		Config json.RawMessage `json:\"config\"`",
  5134  		`	buf := bytes.NewBuffer(raw`,
  5135  		`	dec := json.NewDecoder(buf`,
  5136  		`	dec.UseNumber(`,
  5137  		`	if err := dec.Decode(&data); err != nil {`,
  5138  		`	propConfig, err := UnmarshalFilterSlice(bytes.NewBuffer(data.Config), runtime.JSONConsumer()`,
  5139  		`	if err != nil && err != io.EOF {`,
  5140  		`	var result AndFilterAllOf1`,
  5141  		`	result.configField = propConfig`,
  5142  		`	*m = result`,
  5143  		`func (m AndFilterAllOf1) MarshalJSON() ([]byte, error) {`,
  5144  		`	var b1, b2, b3 []byte`,
  5145  		`	var err error`,
  5146  		`	b1, err = json.Marshal(struct {`,
  5147  		`	}{},`,
  5148  		`	if err != nil {`,
  5149  		`		return nil, err`,
  5150  		`	b2, err = json.Marshal(struct {`,
  5151  		"		Config []Filter `json:\"config\"`",
  5152  		`	}{`,
  5153  		`		Config: m.configField,`,
  5154  		`	},`,
  5155  		`	if err != nil {`,
  5156  		`		return nil, err`,
  5157  		`	return swag.ConcatJSON(b1, b2, b3), nil`,
  5158  		`func (m *AndFilterAllOf1) Validate(formats strfmt.Registry) error {`,
  5159  		`	if err := m.validateConfig(formats); err != nil {`,
  5160  		`		return errors.CompositeValidationError(res...`,
  5161  		`func (m *AndFilterAllOf1) validateConfig(formats strfmt.Registry) error {`,
  5162  		`	if err := validate.Required("config", "body", m.Config()); err != nil {`,
  5163  		`	for i := 0; i < len(m.Config()); i++ {`,
  5164  		`		if err := m.configField[i].Validate(formats); err != nil {`,
  5165  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5166  		`				return ve.ValidateName("config" + "." + strconv.Itoa(i)`,
  5167  	},
  5168  		// not expected
  5169  		todo,
  5170  		// output in log
  5171  		noLines,
  5172  		noLines)
  5173  
  5174  	// load expectations for model: and_filter.go
  5175  	flattenRun.AddExpectations("and_filter.go", []string{
  5176  		`type AndFilter struct {`,
  5177  		`	AndFilterAllOf1`,
  5178  		`func (m *AndFilter) Type() string {`,
  5179  		`	return "AndFilter"`,
  5180  		`func (m *AndFilter) SetType(val string) {`,
  5181  		`func (m *AndFilter) UnmarshalJSON(raw []byte) error {`,
  5182  		`	var data struct {`,
  5183  		`		AndFilterAllOf1`,
  5184  		`	buf := bytes.NewBuffer(raw`,
  5185  		`	dec := json.NewDecoder(buf`,
  5186  		`	dec.UseNumber(`,
  5187  		`	if err := dec.Decode(&data); err != nil {`,
  5188  		`	var base struct {`,
  5189  		"		Type string `json:\"type\"`",
  5190  		`	buf = bytes.NewBuffer(raw`,
  5191  		`	dec = json.NewDecoder(buf`,
  5192  		`	dec.UseNumber(`,
  5193  		`	if err := dec.Decode(&base); err != nil {`,
  5194  		`	var result AndFilter`,
  5195  		`	if base.Type != result.Type() {`,
  5196  		`		return errors.New(422, "invalid type value: %q", base.Type`,
  5197  		`	result.AndFilterAllOf1 = data.AndFilterAllOf1`,
  5198  		`	*m = result`,
  5199  		`func (m AndFilter) MarshalJSON() ([]byte, error) {`,
  5200  		`	var b1, b2, b3 []byte`,
  5201  		`	var err error`,
  5202  		`	b1, err = json.Marshal(struct {`,
  5203  		`		AndFilterAllOf1`,
  5204  		`	}{`,
  5205  		`		AndFilterAllOf1: m.AndFilterAllOf1,`,
  5206  		`	},`,
  5207  		`	if err != nil {`,
  5208  		`		return nil, err`,
  5209  		`	b2, err = json.Marshal(struct {`,
  5210  		"		Type string `json:\"type\"`",
  5211  		`	}{`,
  5212  		`		Type: m.Type(),`,
  5213  		`	},`,
  5214  		`	if err != nil {`,
  5215  		`		return nil, err`,
  5216  		`	return swag.ConcatJSON(b1, b2, b3), nil`,
  5217  		`func (m *AndFilter) Validate(formats strfmt.Registry) error {`,
  5218  		`	if err := m.AndFilterAllOf1.Validate(formats); err != nil {`,
  5219  		`		return errors.CompositeValidationError(res...`,
  5220  	},
  5221  		// not expected
  5222  		todo,
  5223  		// output in log
  5224  		noLines,
  5225  		noLines)
  5226  
  5227  	// load expectations for model: range_filter.go
  5228  	flattenRun.AddExpectations("range_filter.go", []string{
  5229  		`type RangeFilter struct {`,
  5230  		`	RangeFilterAllOf1`,
  5231  		`func (m *RangeFilter) Type() string {`,
  5232  		`	return "RangeFilter"`,
  5233  		`func (m *RangeFilter) SetType(val string) {`,
  5234  		`func (m *RangeFilter) UnmarshalJSON(raw []byte) error {`,
  5235  		`	var data struct {`,
  5236  		`		RangeFilterAllOf1`,
  5237  		`	buf := bytes.NewBuffer(raw`,
  5238  		`	dec := json.NewDecoder(buf`,
  5239  		`	dec.UseNumber(`,
  5240  		`	if err := dec.Decode(&data); err != nil {`,
  5241  		`	var base struct {`,
  5242  		"		Type string `json:\"type\"`",
  5243  		`	buf = bytes.NewBuffer(raw`,
  5244  		`	dec = json.NewDecoder(buf`,
  5245  		`	dec.UseNumber(`,
  5246  		`	if err := dec.Decode(&base); err != nil {`,
  5247  		`	var result RangeFilter`,
  5248  		`	if base.Type != result.Type() {`,
  5249  		`		return errors.New(422, "invalid type value: %q", base.Type`,
  5250  		`	result.RangeFilterAllOf1 = data.RangeFilterAllOf1`,
  5251  		`	*m = result`,
  5252  		`func (m RangeFilter) MarshalJSON() ([]byte, error) {`,
  5253  		`	var b1, b2, b3 []byte`,
  5254  		`	var err error`,
  5255  		`	b1, err = json.Marshal(struct {`,
  5256  		`		RangeFilterAllOf1`,
  5257  		`	}{`,
  5258  		`		RangeFilterAllOf1: m.RangeFilterAllOf1,`,
  5259  		`	},`,
  5260  		`	if err != nil {`,
  5261  		`		return nil, err`,
  5262  		`	b2, err = json.Marshal(struct {`,
  5263  		"		Type string `json:\"type\"`",
  5264  		`	}{`,
  5265  		`		Type: m.Type(),`,
  5266  		`	},`,
  5267  		`	if err != nil {`,
  5268  		`		return nil, err`,
  5269  		`	return swag.ConcatJSON(b1, b2, b3), nil`,
  5270  		`func (m *RangeFilter) Validate(formats strfmt.Registry) error {`,
  5271  		`	if err := m.RangeFilterAllOf1.Validate(formats); err != nil {`,
  5272  		`		return errors.CompositeValidationError(res...`,
  5273  	},
  5274  		// not expected
  5275  		todo,
  5276  		// output in log
  5277  		noLines,
  5278  		noLines)
  5279  
  5280  	// load expectations for model: range_filter_all_of1_config.go
  5281  	flattenRun.AddExpectations("range_filter_all_of1_config.go", []string{
  5282  		`type RangeFilterAllOf1Config struct {`,
  5283  		"	Gt float64 `json:\"gt,omitempty\"`",
  5284  		"	Gte float64 `json:\"gte,omitempty\"`",
  5285  		"	Lt float64 `json:\"lt,omitempty\"`",
  5286  		"	Lte float64 `json:\"lte,omitempty\"`",
  5287  		// empty validation
  5288  		"func (m *RangeFilterAllOf1Config) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  5289  	},
  5290  		// not expected
  5291  		todo,
  5292  		// output in log
  5293  		noLines,
  5294  		noLines)
  5295  
  5296  }
  5297  
  5298  func initFixture1336() {
  5299  	// testing ../fixtures/bugs/1487/fixture-1336.yaml with expand (--skip-flatten)
  5300  
  5301  	/* broken code produced on polymorphic type
  5302  	 */
  5303  
  5304  	f := newModelFixture("../fixtures/bugs/1336/fixture-1336.yaml", "broken code when using array of polymorphic type")
  5305  	flattenRun := f.AddRun(false)
  5306  
  5307  	// load expectations for model: node.go
  5308  	flattenRun.AddExpectations("node.go", []string{
  5309  		`type Node interface {`,
  5310  		`	runtime.Validatable`,
  5311  		`	NodeType() string`,
  5312  		`	SetNodeType(string`,
  5313  		`type node struct {`,
  5314  		`	nodeTypeField string`,
  5315  		`func (m *node) NodeType() string {`,
  5316  		`	return "Node"`,
  5317  		`func (m *node) SetNodeType(val string) {`,
  5318  		`func UnmarshalNodeSlice(reader io.Reader, consumer runtime.Consumer) ([]Node, error) {`,
  5319  		`	var elements []json.RawMessage`,
  5320  		`	if err := consumer.Consume(reader, &elements); err != nil {`,
  5321  		`		return nil, err`,
  5322  		`	var result []Node`,
  5323  		`	for _, element := range elements {`,
  5324  		`		obj, err := unmarshalNode(element, consumer`,
  5325  		`		if err != nil {`,
  5326  		`			return nil, err`,
  5327  		`		result = append(result, obj`,
  5328  		`	return result, nil`,
  5329  		`func UnmarshalNode(reader io.Reader, consumer runtime.Consumer) (Node, error) {`,
  5330  		`	data, err := ioutil.ReadAll(reader`,
  5331  		`	if err != nil {`,
  5332  		`		return nil, err`,
  5333  		`	return unmarshalNode(data, consumer`,
  5334  		`func unmarshalNode(data []byte, consumer runtime.Consumer) (Node, error) {`,
  5335  		`	buf := bytes.NewBuffer(data`,
  5336  		`	buf2 := bytes.NewBuffer(data`,
  5337  		`	var getType struct {`,
  5338  		"		NodeType string `json:\"NodeType\"`",
  5339  		`	if err := consumer.Consume(buf, &getType); err != nil {`,
  5340  		`		return nil, err`,
  5341  		`	if err := validate.RequiredString("NodeType", "body", getType.NodeType); err != nil {`,
  5342  		`		return nil, err`,
  5343  		`	switch getType.NodeType {`,
  5344  		`	case "CodeBlockNode":`,
  5345  		`		var result CodeBlockNode`,
  5346  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  5347  		`			return nil, err`,
  5348  		`		return &result, nil`,
  5349  		`	case "DocBlockNode":`,
  5350  		`		var result DocBlockNode`,
  5351  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  5352  		`			return nil, err`,
  5353  		`		return &result, nil`,
  5354  		`	case "Node":`,
  5355  		`		var result node`,
  5356  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
  5357  		`			return nil, err`,
  5358  		`		return &result, nil`,
  5359  		`	return nil, errors.New(422, "invalid NodeType value: %q", getType.NodeType`,
  5360  		// empty validation
  5361  		"func (m *node) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  5362  	},
  5363  		// not expected
  5364  		todo,
  5365  		// output in log
  5366  		noLines,
  5367  		noLines)
  5368  
  5369  	// load expectations for model: code_block_node_all_of1.go
  5370  	flattenRun.AddExpectations("code_block_node_all_of1.go", []string{
  5371  		`type CodeBlockNodeAllOf1 struct {`,
  5372  		"	Code string `json:\"Code,omitempty\"`",
  5373  		// empty validation
  5374  		"func (m *CodeBlockNodeAllOf1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  5375  	},
  5376  		// not expected
  5377  		todo,
  5378  		// output in log
  5379  		noLines,
  5380  		noLines)
  5381  
  5382  	// load expectations for model: graph.go
  5383  	flattenRun.AddExpectations("graph.go", []string{
  5384  		`type Graph struct {`,
  5385  		`	nodesField []Node`,
  5386  		`func (m *Graph) Nodes() []Node {`,
  5387  		`	return m.nodesField`,
  5388  		`func (m *Graph) SetNodes(val []Node) {`,
  5389  		`	m.nodesField = val`,
  5390  		`func (m *Graph) UnmarshalJSON(raw []byte) error {`,
  5391  		`	var data struct {`,
  5392  		"		Nodes json.RawMessage `json:\"Nodes\"`",
  5393  		`	buf := bytes.NewBuffer(raw`,
  5394  		`	dec := json.NewDecoder(buf`,
  5395  		`	dec.UseNumber(`,
  5396  		`	if err := dec.Decode(&data); err != nil {`,
  5397  		`		nodes, err := UnmarshalNodeSlice(bytes.NewBuffer(data.Nodes), runtime.JSONConsumer()`,
  5398  		`	if err != nil && err != io.EOF {`,
  5399  		`	var result Graph`,
  5400  		`	result.nodesField = propNodes`,
  5401  		`	*m = result`,
  5402  		`func (m Graph) MarshalJSON() ([]byte, error) {`,
  5403  		`	var b1, b2, b3 []byte`,
  5404  		`	var err error`,
  5405  		`	b1, err = json.Marshal(struct {`,
  5406  		`	}{},`,
  5407  		`	if err != nil {`,
  5408  		`		return nil, err`,
  5409  		`	b2, err = json.Marshal(struct {`,
  5410  		"		Nodes []Node `json:\"Nodes\"`",
  5411  		`	}{`,
  5412  		`		Nodes: m.nodesField,`,
  5413  		`	},`,
  5414  		`	if err != nil {`,
  5415  		`		return nil, err`,
  5416  		`	return swag.ConcatJSON(b1, b2, b3), nil`,
  5417  		`func (m *Graph) Validate(formats strfmt.Registry) error {`,
  5418  		`		return errors.CompositeValidationError(res...`,
  5419  	},
  5420  		// not expected
  5421  		todo,
  5422  		// output in log
  5423  		noLines,
  5424  		noLines)
  5425  
  5426  	// load expectations for model: doc_block_node_all_of1.go
  5427  	flattenRun.AddExpectations("doc_block_node_all_of1.go", []string{
  5428  		`type DocBlockNodeAllOf1 struct {`,
  5429  		"	Doc string `json:\"Doc,omitempty\"`",
  5430  		// empty validation
  5431  		"func (m *DocBlockNodeAllOf1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  5432  	},
  5433  		// not expected
  5434  		todo,
  5435  		// output in log
  5436  		noLines,
  5437  		noLines)
  5438  
  5439  	// load expectations for model: doc_block_node.go
  5440  	flattenRun.AddExpectations("doc_block_node.go", []string{
  5441  		`type DocBlockNode struct {`,
  5442  		`	DocBlockNodeAllOf1`,
  5443  		`func (m *DocBlockNode) NodeType() string {`,
  5444  		`	return "DocBlockNode"`,
  5445  		`func (m *DocBlockNode) SetNodeType(val string) {`,
  5446  		`func (m *DocBlockNode) UnmarshalJSON(raw []byte) error {`,
  5447  		`	var data struct {`,
  5448  		`		DocBlockNodeAllOf1`,
  5449  		`	buf := bytes.NewBuffer(raw`,
  5450  		`	dec := json.NewDecoder(buf`,
  5451  		`	dec.UseNumber(`,
  5452  		`	if err := dec.Decode(&data); err != nil {`,
  5453  		`	var base struct {`,
  5454  		"		NodeType string `json:\"NodeType\"`",
  5455  		`	buf = bytes.NewBuffer(raw`,
  5456  		`	dec = json.NewDecoder(buf`,
  5457  		`	dec.UseNumber(`,
  5458  		`	if err := dec.Decode(&base); err != nil {`,
  5459  		`	var result DocBlockNode`,
  5460  		`	if base.NodeType != result.NodeType() {`,
  5461  		`		return errors.New(422, "invalid NodeType value: %q", base.NodeType`,
  5462  		`	result.DocBlockNodeAllOf1 = data.DocBlockNodeAllOf1`,
  5463  		`	*m = result`,
  5464  		`func (m DocBlockNode) MarshalJSON() ([]byte, error) {`,
  5465  		`	var b1, b2, b3 []byte`,
  5466  		`	var err error`,
  5467  		`	b1, err = json.Marshal(struct {`,
  5468  		`		DocBlockNodeAllOf1`,
  5469  		`	}{`,
  5470  		`		DocBlockNodeAllOf1: m.DocBlockNodeAllOf1,`,
  5471  		`	},`,
  5472  		`	if err != nil {`,
  5473  		`		return nil, err`,
  5474  		`	b2, err = json.Marshal(struct {`,
  5475  		"		NodeType string `json:\"NodeType\"`",
  5476  		`	}{`,
  5477  		`		NodeType: m.NodeType(),`,
  5478  		`	},`,
  5479  		`	if err != nil {`,
  5480  		`		return nil, err`,
  5481  		`	return swag.ConcatJSON(b1, b2, b3), nil`,
  5482  		`func (m *DocBlockNode) Validate(formats strfmt.Registry) error {`,
  5483  		`	if err := m.DocBlockNodeAllOf1.Validate(formats); err != nil {`,
  5484  		`		return errors.CompositeValidationError(res...`,
  5485  	},
  5486  		// not expected
  5487  		todo,
  5488  		// output in log
  5489  		noLines,
  5490  		noLines)
  5491  
  5492  	// load expectations for model: code_block_node.go
  5493  	flattenRun.AddExpectations("code_block_node.go", []string{
  5494  		`type CodeBlockNode struct {`,
  5495  		`	CodeBlockNodeAllOf1`,
  5496  		`func (m *CodeBlockNode) NodeType() string {`,
  5497  		`	return "CodeBlockNode"`,
  5498  		`func (m *CodeBlockNode) SetNodeType(val string) {`,
  5499  		`func (m *CodeBlockNode) UnmarshalJSON(raw []byte) error {`,
  5500  		`	var data struct {`,
  5501  		`		CodeBlockNodeAllOf1`,
  5502  		`	buf := bytes.NewBuffer(raw`,
  5503  		`	dec := json.NewDecoder(buf`,
  5504  		`	dec.UseNumber(`,
  5505  		`	if err := dec.Decode(&data); err != nil {`,
  5506  		`	var base struct {`,
  5507  		"		NodeType string `json:\"NodeType\"`",
  5508  		`	buf = bytes.NewBuffer(raw`,
  5509  		`	dec = json.NewDecoder(buf`,
  5510  		`	dec.UseNumber(`,
  5511  		`	if err := dec.Decode(&base); err != nil {`,
  5512  		`	var result CodeBlockNode`,
  5513  		`	if base.NodeType != result.NodeType() {`,
  5514  		`		return errors.New(422, "invalid NodeType value: %q", base.NodeType`,
  5515  		`	result.CodeBlockNodeAllOf1 = data.CodeBlockNodeAllOf1`,
  5516  		`	*m = result`,
  5517  		`func (m CodeBlockNode) MarshalJSON() ([]byte, error) {`,
  5518  		`	var b1, b2, b3 []byte`,
  5519  		`	var err error`,
  5520  		`	b1, err = json.Marshal(struct {`,
  5521  		`		CodeBlockNodeAllOf1`,
  5522  		`	}{`,
  5523  		`		CodeBlockNodeAllOf1: m.CodeBlockNodeAllOf1,`,
  5524  		`	},`,
  5525  		`	if err != nil {`,
  5526  		`		return nil, err`,
  5527  		`	b2, err = json.Marshal(struct {`,
  5528  		"		NodeType string `json:\"NodeType\"`",
  5529  		`	}{`,
  5530  		`		NodeType: m.NodeType(),`,
  5531  		`	},`,
  5532  		`	if err != nil {`,
  5533  		`		return nil, err`,
  5534  		`	return swag.ConcatJSON(b1, b2, b3), nil`,
  5535  		`func (m *CodeBlockNode) Validate(formats strfmt.Registry) error {`,
  5536  		`	if err := m.CodeBlockNodeAllOf1.Validate(formats); err != nil {`,
  5537  		`		return errors.CompositeValidationError(res...`,
  5538  	},
  5539  		// not expected
  5540  		todo,
  5541  		// output in log
  5542  		noLines,
  5543  		noLines)
  5544  
  5545  }
  5546  
  5547  func initFixtureErrors() {
  5548  	// testing ../fixtures/bugs/1487/fixture-errors.yaml with expand (--skip-flatten)
  5549  
  5550  	/*
  5551  		invalid specs supported by go-swagger
  5552  	*/
  5553  
  5554  	f := newModelFixture("../fixtures/bugs/1487/fixture-errors.yaml", "broken spec to exercise error handling")
  5555  	flattenRun := f.AddRun(false)
  5556  	expandRun := f.AddRun(true)
  5557  
  5558  	// load expectations for model: node.go
  5559  	flattenRun.AddExpectations("array_without_items.go", []string{
  5560  		`type ArrayWithoutItems []interface{}`,
  5561  		// empty validation
  5562  		"func (m ArrayWithoutItems) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  5563  	},
  5564  		// not expected
  5565  		todo,
  5566  		// output in log
  5567  		// NOTE would expect warning for a non-swagger compliant, but nonetheless supposed construct (not implemented)
  5568  		noLines,
  5569  		noLines)
  5570  
  5571  	expandRun.AddExpectations("array_without_items.go", flattenRun.ExpectedFor("ArrayWithoutItems").ExpectedLines, todo, noLines, noLines)
  5572  
  5573  	flattenRun.AddExpectations("multiple_types.go", []string{
  5574  		`type MultipleTypes interface{`,
  5575  	},
  5576  		// not expected
  5577  		validatable,
  5578  		// output in log
  5579  		// expect warning
  5580  		warning,
  5581  		noLines)
  5582  
  5583  	expandRun.AddExpectations("multiple_types.go", flattenRun.ExpectedFor("MultipleTypes").ExpectedLines, validatable, noLines, noLines)
  5584  }
  5585  
  5586  func initTodolistSchemavalidation() {
  5587  	// testing todolist.schemavalidation.yaml with flatten and expand (--skip-flatten)
  5588  
  5589  	/*
  5590  	   A very simple api description that makes a json only API to submit to do's.
  5591  
  5592  	*/
  5593  
  5594  	f := newModelFixture("../fixtures/codegen/todolist.schemavalidation.yml", "Private to-do list")
  5595  	flattenRun := f.AddRun(false)
  5596  	expandRun := f.AddRun(true)
  5597  
  5598  	// load expectations for model: all_of_validations_meta_all_of6.go
  5599  	flattenRun.AddExpectations("all_of_validations_meta_all_of6.go", []string{
  5600  		`type AllOfValidationsMetaAllOf6 struct {`,
  5601  		"	Coords *AllOfValidationsMetaAllOf6Coords `json:\"coords,omitempty\"`",
  5602  		`func (m *AllOfValidationsMetaAllOf6) Validate(formats strfmt.Registry) error {`,
  5603  		`	if err := m.validateCoords(formats); err != nil {`,
  5604  		`		return errors.CompositeValidationError(res...`,
  5605  		`func (m *AllOfValidationsMetaAllOf6) validateCoords(formats strfmt.Registry) error {`,
  5606  		`	if swag.IsZero(m.Coords) {`,
  5607  		`	if m.Coords != nil {`,
  5608  		`		if err := m.Coords.Validate(formats); err != nil {`,
  5609  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5610  		`				return ve.ValidateName("coords"`,
  5611  	},
  5612  		// not expected
  5613  		todo,
  5614  		// output in log
  5615  		noLines,
  5616  		noLines)
  5617  
  5618  	// load expectations for model: nested_array_validations.go
  5619  	flattenRun.AddExpectations("nested_array_validations.go", []string{
  5620  		`type NestedArrayValidations struct {`,
  5621  		"	Tags [][][]string `json:\"tags\"`",
  5622  		`func (m *NestedArrayValidations) Validate(formats strfmt.Registry) error {`,
  5623  		`	if err := m.validateTags(formats); err != nil {`,
  5624  		`		return errors.CompositeValidationError(res...`,
  5625  		`func (m *NestedArrayValidations) validateTags(formats strfmt.Registry) error {`,
  5626  		`	if swag.IsZero(m.Tags) {`,
  5627  		`	iTagsSize := int64(len(m.Tags)`,
  5628  		`	if err := validate.MinItems("tags", "body", iTagsSize, 3); err != nil {`,
  5629  		`	if err := validate.MaxItems("tags", "body", iTagsSize, 10); err != nil {`,
  5630  		`	for i := 0; i < len(m.Tags); i++ {`,
  5631  		`		iiTagsSize := int64(len(m.Tags[i])`,
  5632  		`		if err := validate.MinItems("tags"+"."+strconv.Itoa(i), "body", iiTagsSize, 3); err != nil {`,
  5633  		`		if err := validate.MaxItems("tags"+"."+strconv.Itoa(i), "body", iiTagsSize, 10); err != nil {`,
  5634  		`		for ii := 0; ii < len(m.Tags[i]); ii++ {`,
  5635  		`			iiiTagsSize := int64(len(m.Tags[i][ii])`,
  5636  		`			if err := validate.MinItems("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiTagsSize, 3); err != nil {`,
  5637  		`			if err := validate.MaxItems("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiTagsSize, 10); err != nil {`,
  5638  		`			for iii := 0; iii < len(m.Tags[i][ii]); iii++ {`,
  5639  		`				if err := validate.MinLength("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Tags[i][ii][iii]), 3); err != nil {`,
  5640  		`				if err := validate.MaxLength("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Tags[i][ii][iii]), 10); err != nil {`,
  5641  		"				if err := validate.Pattern(\"tags\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", string(m.Tags[i][ii][iii]), `\\w+`); err != nil {",
  5642  	},
  5643  		// not expected
  5644  		todo,
  5645  		// output in log
  5646  		noLines,
  5647  		noLines)
  5648  
  5649  	expandRun.AddExpectations("nested_array_validations.go", flattenRun.ExpectedFor("NestedArrayValidations").ExpectedLines, todo, noLines, noLines)
  5650  
  5651  	// load expectations for model: all_of_validations_meta_all_of4.go
  5652  	flattenRun.AddExpectations("all_of_validations_meta_all_of4.go", []string{
  5653  		`type AllOfValidationsMetaAllOf4 struct {`,
  5654  		"	Opts map[string]int32 `json:\"opts,omitempty\"`",
  5655  		`func (m *AllOfValidationsMetaAllOf4) Validate(formats strfmt.Registry) error {`,
  5656  		`	if err := m.validateOpts(formats); err != nil {`,
  5657  		`		return errors.CompositeValidationError(res...`,
  5658  		`func (m *AllOfValidationsMetaAllOf4) validateOpts(formats strfmt.Registry) error {`,
  5659  		`	if swag.IsZero(m.Opts) {`,
  5660  		`	for k := range m.Opts {`,
  5661  		//`		if swag.IsZero(m.Opts[k]) {`,
  5662  		`		if err := validate.MinimumInt("opts"+"."+k, "body", int64(m.Opts[k]), 2, false); err != nil {`,
  5663  		`		if err := validate.MaximumInt("opts"+"."+k, "body", int64(m.Opts[k]), 50, false); err != nil {`,
  5664  		`		if err := validate.MultipleOf("opts"+"."+k, "body", float64(m.Opts[k]), 1.5); err != nil {`,
  5665  	},
  5666  		// not expected
  5667  		todo,
  5668  		// output in log
  5669  		noLines,
  5670  		noLines)
  5671  
  5672  	// load expectations for model: simple_zero_allowed.go
  5673  	flattenRun.AddExpectations("simple_zero_allowed.go", []string{
  5674  		`type SimpleZeroAllowed struct {`,
  5675  		"	ID string `json:\"id,omitempty\"`",
  5676  		"	Name *string `json:\"name\"`",
  5677  		"	Urls []string `json:\"urls\"`",
  5678  		`func (m *SimpleZeroAllowed) Validate(formats strfmt.Registry) error {`,
  5679  		`	if err := m.validateID(formats); err != nil {`,
  5680  		`	if err := m.validateName(formats); err != nil {`,
  5681  		`	if err := m.validateUrls(formats); err != nil {`,
  5682  		`		return errors.CompositeValidationError(res...`,
  5683  		`func (m *SimpleZeroAllowed) validateID(formats strfmt.Registry) error {`,
  5684  		`	if swag.IsZero(m.ID) {`,
  5685  		`	if err := validate.MinLength("id", "body", string(m.ID), 2); err != nil {`,
  5686  		`	if err := validate.MaxLength("id", "body", string(m.ID), 50); err != nil {`,
  5687  		"	if err := validate.Pattern(\"id\", \"body\", string(m.ID), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  5688  		`func (m *SimpleZeroAllowed) validateName(formats strfmt.Registry) error {`,
  5689  		`	if err := validate.Required("name", "body", m.Name); err != nil {`,
  5690  		`	if err := validate.MinLength("name", "body", string(*m.Name), 2); err != nil {`,
  5691  		`	if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil {`,
  5692  		"	if err := validate.Pattern(\"name\", \"body\", string(*m.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  5693  		`func (m *SimpleZeroAllowed) validateUrls(formats strfmt.Registry) error {`,
  5694  		`	if err := validate.Required("urls", "body", m.Urls); err != nil {`,
  5695  	},
  5696  		// not expected
  5697  		todo,
  5698  		// output in log
  5699  		noLines,
  5700  		noLines)
  5701  
  5702  	expandRun.AddExpectations("simple_zero_allowed.go", flattenRun.ExpectedFor("SimpleZeroAllowed").ExpectedLines, todo, noLines, noLines)
  5703  
  5704  	// load expectations for model: named_all_of_all_of6_coords_all_of0.go
  5705  	flattenRun.AddExpectations("named_all_of_all_of6_coords_all_of0.go", []string{
  5706  		`type NamedAllOfAllOf6CoordsAllOf0 struct {`,
  5707  		"	Name string `json:\"name,omitempty\"`",
  5708  		`func (m *NamedAllOfAllOf6CoordsAllOf0) Validate(formats strfmt.Registry) error {`,
  5709  		`	if err := m.validateName(formats); err != nil {`,
  5710  		`		return errors.CompositeValidationError(res...`,
  5711  		`func (m *NamedAllOfAllOf6CoordsAllOf0) validateName(formats strfmt.Registry) error {`,
  5712  		`	if swag.IsZero(m.Name) {`,
  5713  		`	if err := validate.MinLength("name", "body", string(m.Name), 2); err != nil {`,
  5714  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  5715  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  5716  	},
  5717  		// not expected
  5718  		todo,
  5719  		// output in log
  5720  		noLines,
  5721  		noLines)
  5722  
  5723  	// load expectations for model: named_all_of_all_of6.go
  5724  	flattenRun.AddExpectations("named_all_of_all_of6.go", []string{
  5725  		`type NamedAllOfAllOf6 struct {`,
  5726  		"	Coords *NamedAllOfAllOf6Coords `json:\"coords,omitempty\"`",
  5727  		`func (m *NamedAllOfAllOf6) Validate(formats strfmt.Registry) error {`,
  5728  		`	if err := m.validateCoords(formats); err != nil {`,
  5729  		`		return errors.CompositeValidationError(res...`,
  5730  		`func (m *NamedAllOfAllOf6) validateCoords(formats strfmt.Registry) error {`,
  5731  		`	if swag.IsZero(m.Coords) {`,
  5732  		`	if m.Coords != nil {`,
  5733  		`		if err := m.Coords.Validate(formats); err != nil {`,
  5734  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5735  		`				return ve.ValidateName("coords"`,
  5736  	},
  5737  		// not expected
  5738  		todo,
  5739  		// output in log
  5740  		noLines,
  5741  		noLines)
  5742  
  5743  	// load expectations for model: named_array_multi.go
  5744  	flattenRun.AddExpectations("named_array_multi.go", []string{
  5745  		`type NamedArrayMulti struct {`,
  5746  		"	P0 *string `json:\"-\"`",
  5747  		"	P1 *float64 `json:\"-\"`",
  5748  		`func (m *NamedArrayMulti) Validate(formats strfmt.Registry) error {`,
  5749  		`	if err := m.validateP0(formats); err != nil {`,
  5750  		`	if err := m.validateP1(formats); err != nil {`,
  5751  		`		return errors.CompositeValidationError(res...`,
  5752  		`func (m *NamedArrayMulti) validateP0(formats strfmt.Registry) error {`,
  5753  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  5754  		`	if err := validate.MinLength("0", "body", string(*m.P0), 3); err != nil {`,
  5755  		`	if err := validate.MaxLength("0", "body", string(*m.P0), 10); err != nil {`,
  5756  		"	if err := validate.Pattern(\"0\", \"body\", string(*m.P0), `\\w+`); err != nil {",
  5757  		`func (m *NamedArrayMulti) validateP1(formats strfmt.Registry) error {`,
  5758  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  5759  		`	if err := validate.Minimum("1", "body", float64(*m.P1), 3, false); err != nil {`,
  5760  		`	if err := validate.Maximum("1", "body", float64(*m.P1), 12, false); err != nil {`,
  5761  		`	if err := validate.MultipleOf("1", "body", float64(*m.P1), 1.5); err != nil {`,
  5762  	},
  5763  		// not expected
  5764  		todo,
  5765  		// output in log
  5766  		noLines,
  5767  		noLines)
  5768  
  5769  	expandRun.AddExpectations("named_array_multi.go", flattenRun.ExpectedFor("NamedArrayMulti").ExpectedLines, todo, noLines, noLines)
  5770  
  5771  	// load expectations for model: named_array.go
  5772  	flattenRun.AddExpectations("named_array.go", []string{
  5773  		`type NamedArray []string`,
  5774  		`func (m NamedArray) Validate(formats strfmt.Registry) error {`,
  5775  		`	iNamedArraySize := int64(len(m)`,
  5776  		`	if err := validate.MinItems("", "body", iNamedArraySize, 3); err != nil {`,
  5777  		`	if err := validate.MaxItems("", "body", iNamedArraySize, 10); err != nil {`,
  5778  		`	for i := 0; i < len(m); i++ {`,
  5779  		`		if err := validate.MinLength(strconv.Itoa(i), "body", string(m[i]), 3); err != nil {`,
  5780  		`		if err := validate.MaxLength(strconv.Itoa(i), "body", string(m[i]), 10); err != nil {`,
  5781  		"		if err := validate.Pattern(strconv.Itoa(i), \"body\", string(m[i]), `\\w+`); err != nil {",
  5782  		`		return errors.CompositeValidationError(res...`,
  5783  	},
  5784  		// not expected
  5785  		todo,
  5786  		// output in log
  5787  		noLines,
  5788  		noLines)
  5789  
  5790  	expandRun.AddExpectations("named_array.go", flattenRun.ExpectedFor("NamedArray").ExpectedLines, todo, noLines, noLines)
  5791  
  5792  	// load expectations for model: named_number.go
  5793  	flattenRun.AddExpectations("named_number.go", []string{
  5794  		`type NamedNumber int32`,
  5795  		`func (m NamedNumber) Validate(formats strfmt.Registry) error {`,
  5796  		`	if err := validate.MinimumInt("", "body", int64(m), 0, true); err != nil {`,
  5797  		`	if err := validate.MaximumInt("", "body", int64(m), 500, false); err != nil {`,
  5798  		`	if err := validate.MultipleOf("", "body", float64(m), 1.5); err != nil {`,
  5799  		`		return errors.CompositeValidationError(res...`,
  5800  	},
  5801  		// not expected
  5802  		todo,
  5803  		// output in log
  5804  		noLines,
  5805  		noLines)
  5806  
  5807  	expandRun.AddExpectations("named_number.go", flattenRun.ExpectedFor("NamedNumber").ExpectedLines, todo, noLines, noLines)
  5808  
  5809  	// load expectations for model: nested_map_validations.go
  5810  	flattenRun.AddExpectations("nested_map_validations.go", []string{
  5811  		`type NestedMapValidations struct {`,
  5812  		"	Meta map[string]map[string]map[string]int64 `json:\"meta,omitempty\"`",
  5813  		`func (m *NestedMapValidations) Validate(formats strfmt.Registry) error {`,
  5814  		`	if err := m.validateMeta(formats); err != nil {`,
  5815  		`		return errors.CompositeValidationError(res...`,
  5816  		`func (m *NestedMapValidations) validateMeta(formats strfmt.Registry) error {`,
  5817  		`	if swag.IsZero(m.Meta) {`,
  5818  		`	for k := range m.Meta {`,
  5819  		//`		if swag.IsZero(m.Meta[k]) {`,
  5820  		`		for kk := range m.Meta[k] {`,
  5821  		//`			if swag.IsZero(m.Meta[k][kk]) {`,
  5822  		`			for kkk := range m.Meta[k][kk] {`,
  5823  		//`				if swag.IsZero(m.Meta[k][kk][kkk]) {`,
  5824  		`				if err := validate.MinimumInt("meta"+"."+k+"."+kk+"."+kkk, "body", int64(m.Meta[k][kk][kkk]), 3, false); err != nil {`,
  5825  		`				if err := validate.MaximumInt("meta"+"."+k+"."+kk+"."+kkk, "body", int64(m.Meta[k][kk][kkk]), 6, false); err != nil {`,
  5826  		`				if err := validate.MultipleOf("meta"+"."+k+"."+kk+"."+kkk, "body", float64(m.Meta[k][kk][kkk]), 1); err != nil {`,
  5827  	},
  5828  		// not expected
  5829  		todo,
  5830  		// output in log
  5831  		noLines,
  5832  		noLines)
  5833  
  5834  	expandRun.AddExpectations("nested_map_validations.go", flattenRun.ExpectedFor("NestedMapValidations").ExpectedLines, todo, noLines, noLines)
  5835  
  5836  	// load expectations for model: array_multi_validations_args.go
  5837  	flattenRun.AddExpectations("array_multi_validations_args.go", []string{
  5838  		`type ArrayMultiValidationsArgs struct {`,
  5839  		"	P0 *string `json:\"-\"`",
  5840  		"	P1 *float64 `json:\"-\"`",
  5841  		`func (m *ArrayMultiValidationsArgs) Validate(formats strfmt.Registry) error {`,
  5842  		`	if err := m.validateP0(formats); err != nil {`,
  5843  		`	if err := m.validateP1(formats); err != nil {`,
  5844  		`		return errors.CompositeValidationError(res...`,
  5845  		`func (m *ArrayMultiValidationsArgs) validateP0(formats strfmt.Registry) error {`,
  5846  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  5847  		`	if err := validate.MinLength("0", "body", string(*m.P0), 3); err != nil {`,
  5848  		`	if err := validate.MaxLength("0", "body", string(*m.P0), 10); err != nil {`,
  5849  		"	if err := validate.Pattern(\"0\", \"body\", string(*m.P0), `\\w+`); err != nil {",
  5850  		`func (m *ArrayMultiValidationsArgs) validateP1(formats strfmt.Registry) error {`,
  5851  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  5852  		`	if err := validate.Minimum("1", "body", float64(*m.P1), 3, false); err != nil {`,
  5853  		`	if err := validate.Maximum("1", "body", float64(*m.P1), 12, false); err != nil {`,
  5854  		`	if err := validate.MultipleOf("1", "body", float64(*m.P1), 1.5); err != nil {`,
  5855  	},
  5856  		// not expected
  5857  		todo,
  5858  		// output in log
  5859  		noLines,
  5860  		noLines)
  5861  
  5862  	// load expectations for model: named_map_complex_additional_properties.go
  5863  	flattenRun.AddExpectations("named_map_complex_additional_properties.go", []string{
  5864  		`type NamedMapComplexAdditionalProperties struct {`,
  5865  		"	Age int32 `json:\"age,omitempty\"`",
  5866  		"	Name string `json:\"name,omitempty\"`",
  5867  		`func (m *NamedMapComplexAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  5868  		`	if err := m.validateAge(formats); err != nil {`,
  5869  		`	if err := m.validateName(formats); err != nil {`,
  5870  		`		return errors.CompositeValidationError(res...`,
  5871  		`func (m *NamedMapComplexAdditionalProperties) validateAge(formats strfmt.Registry) error {`,
  5872  		`	if swag.IsZero(m.Age) {`,
  5873  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  5874  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  5875  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1); err != nil {`,
  5876  		`func (m *NamedMapComplexAdditionalProperties) validateName(formats strfmt.Registry) error {`,
  5877  		`	if swag.IsZero(m.Name) {`,
  5878  		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
  5879  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  5880  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
  5881  	},
  5882  		// not expected
  5883  		todo,
  5884  		// output in log
  5885  		noLines,
  5886  		noLines)
  5887  
  5888  	// load expectations for model: named_nested_map_complex.go
  5889  	flattenRun.AddExpectations("named_nested_map_complex.go", []string{
  5890  		// maps are now simple types
  5891  		//`type NamedNestedMapComplex map[string]NamedNestedMapComplexAdditionalProperties`,
  5892  		`type NamedNestedMapComplex map[string]map[string]map[string]NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties`,
  5893  		`func (m NamedNestedMapComplex) Validate(formats strfmt.Registry) error {`,
  5894  		`	for k := range m {`,
  5895  		//`		if swag.IsZero(m[k]) {`,
  5896  		`		for kk := range m[k] {`,
  5897  		//`			if swag.IsZero(m[k][kk]) {`,
  5898  		`			for kkk := range m[k][kk] {`,
  5899  		`				if err := validate.Required(k+"."+kk+"."+kkk, "body", m[k][kk][kkk]); err != nil {`,
  5900  		`				if val, ok := m[k][kk][kkk]; ok {`,
  5901  		`					if err := val.Validate(formats); err != nil {`,
  5902  		`		return errors.CompositeValidationError(res...`,
  5903  	},
  5904  		// not expected
  5905  		todo,
  5906  		// output in log
  5907  		noLines,
  5908  		noLines)
  5909  
  5910  	expandRun.AddExpectations("named_nested_map_complex.go", []string{
  5911  		`type NamedNestedMapComplex map[string]map[string]map[string]NamedNestedMapComplexAnon`,
  5912  		`func (m NamedNestedMapComplex) Validate(formats strfmt.Registry) error {`,
  5913  		`	for k := range m {`,
  5914  		//`		if swag.IsZero(m[k]) {`,
  5915  		`		for kk := range m[k] {`,
  5916  		//`			if swag.IsZero(m[k][kk]) {`,
  5917  		`			for kkk := range m[k][kk] {`,
  5918  		//`				if swag.IsZero(m[k][kk][kkk]) {`,
  5919  		`				if val, ok := m[k][kk][kkk]; ok {`,
  5920  		`					if err := val.Validate(formats); err != nil {`,
  5921  		`		return errors.CompositeValidationError(res...`,
  5922  		`type NamedNestedMapComplexAnon struct {`,
  5923  		"	Age int32 `json:\"age,omitempty\"`",
  5924  		"	Name string `json:\"name,omitempty\"`",
  5925  		`func (m *NamedNestedMapComplexAnon) Validate(formats strfmt.Registry) error {`,
  5926  		`	if err := m.validateAge(formats); err != nil {`,
  5927  		`	if err := m.validateName(formats); err != nil {`,
  5928  		`		return errors.CompositeValidationError(res...`,
  5929  		`func (m *NamedNestedMapComplexAnon) validateAge(formats strfmt.Registry) error {`,
  5930  		`	if swag.IsZero(m.Age) {`,
  5931  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  5932  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  5933  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1); err != nil {`,
  5934  		`func (m *NamedNestedMapComplexAnon) validateName(formats strfmt.Registry) error {`,
  5935  		`	if swag.IsZero(m.Name) {`,
  5936  		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
  5937  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  5938  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
  5939  	},
  5940  		// not expected
  5941  		todo,
  5942  		// output in log
  5943  		noLines,
  5944  		noLines)
  5945  
  5946  	// load expectations for model: all_of_validations_meta_all_of1.go
  5947  	flattenRun.AddExpectations("all_of_validations_meta_all_of1.go", []string{
  5948  		`type AllOfValidationsMetaAllOf1 struct {`,
  5949  		"	Age int32 `json:\"age,omitempty\"`",
  5950  		`func (m *AllOfValidationsMetaAllOf1) Validate(formats strfmt.Registry) error {`,
  5951  		`	if err := m.validateAge(formats); err != nil {`,
  5952  		`		return errors.CompositeValidationError(res...`,
  5953  		`func (m *AllOfValidationsMetaAllOf1) validateAge(formats strfmt.Registry) error {`,
  5954  		`	if swag.IsZero(m.Age) {`,
  5955  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`,
  5956  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 50, false); err != nil {`,
  5957  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`,
  5958  	},
  5959  		// not expected
  5960  		todo,
  5961  		// output in log
  5962  		noLines,
  5963  		noLines)
  5964  
  5965  	// load expectations for model: nested_map_complex_validations_meta_additional_properties_additional_properties.go
  5966  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  5967  
  5968  	// load expectations for model: tag.go
  5969  	flattenRun.AddExpectations("tag.go", []string{
  5970  		`type Tag struct {`,
  5971  		"	ID int64 `json:\"id,omitempty\"`",
  5972  		"	Name string `json:\"name,omitempty\"`",
  5973  		// empty validation
  5974  		"func (m *Tag) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  5975  	},
  5976  		// not expected
  5977  		todo,
  5978  		// output in log
  5979  		noLines,
  5980  		noLines)
  5981  
  5982  	expandRun.AddExpectations("tag.go", flattenRun.ExpectedFor("Tag").ExpectedLines, todo, noLines, noLines)
  5983  
  5984  	// load expectations for model: nested_object_validations_args.go
  5985  	flattenRun.AddExpectations("nested_object_validations_args.go", []string{
  5986  		`type NestedObjectValidationsArgs struct {`,
  5987  		"	Meta *NestedObjectValidationsArgsMeta `json:\"meta,omitempty\"`",
  5988  		`func (m *NestedObjectValidationsArgs) Validate(formats strfmt.Registry) error {`,
  5989  		`	if err := m.validateMeta(formats); err != nil {`,
  5990  		`		return errors.CompositeValidationError(res...`,
  5991  		`func (m *NestedObjectValidationsArgs) validateMeta(formats strfmt.Registry) error {`,
  5992  		`	if swag.IsZero(m.Meta) {`,
  5993  		`	if m.Meta != nil {`,
  5994  		`		if err := m.Meta.Validate(formats); err != nil {`,
  5995  		`			if ve, ok := err.(*errors.Validation); ok {`,
  5996  		`				return ve.ValidateName("meta"`,
  5997  	},
  5998  		// not expected
  5999  		todo,
  6000  		// output in log
  6001  		noLines,
  6002  		noLines)
  6003  
  6004  	// load expectations for model: named_all_of_all_of6_coords_all_of1.go
  6005  	flattenRun.AddExpectations("named_all_of_all_of6_coords_all_of1.go", []string{
  6006  		`type NamedAllOfAllOf6CoordsAllOf1 struct {`,
  6007  		"	Age int32 `json:\"age,omitempty\"`",
  6008  		`func (m *NamedAllOfAllOf6CoordsAllOf1) Validate(formats strfmt.Registry) error {`,
  6009  		`	if err := m.validateAge(formats); err != nil {`,
  6010  		`		return errors.CompositeValidationError(res...`,
  6011  		`func (m *NamedAllOfAllOf6CoordsAllOf1) validateAge(formats strfmt.Registry) error {`,
  6012  		`	if swag.IsZero(m.Age) {`,
  6013  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`,
  6014  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 50, false); err != nil {`,
  6015  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`,
  6016  	},
  6017  		// not expected
  6018  		todo,
  6019  		// output in log
  6020  		noLines,
  6021  		noLines)
  6022  
  6023  	// load expectations for model: named_all_of_all_of6_coords.go
  6024  	flattenRun.AddExpectations("named_all_of_all_of6_coords.go", []string{
  6025  		`type NamedAllOfAllOf6Coords struct {`,
  6026  		`	NamedAllOfAllOf6CoordsAllOf0`,
  6027  		`	NamedAllOfAllOf6CoordsAllOf1`,
  6028  		`func (m *NamedAllOfAllOf6Coords) Validate(formats strfmt.Registry) error {`,
  6029  		`	if err := m.NamedAllOfAllOf6CoordsAllOf0.Validate(formats); err != nil {`,
  6030  		`	if err := m.NamedAllOfAllOf6CoordsAllOf1.Validate(formats); err != nil {`,
  6031  		`		return errors.CompositeValidationError(res...`,
  6032  	},
  6033  		// not expected
  6034  		todo,
  6035  		// output in log
  6036  		noLines,
  6037  		noLines)
  6038  
  6039  	// load expectations for model: array_multi_validations.go
  6040  	flattenRun.AddExpectations("array_multi_validations.go", []string{
  6041  		`type ArrayMultiValidations struct {`,
  6042  		"	Args ArrayMultiValidationsArgs `json:\"args,omitempty\"`",
  6043  		`func (m *ArrayMultiValidations) Validate(formats strfmt.Registry) error {`,
  6044  		`		return errors.CompositeValidationError(res...`,
  6045  	},
  6046  		// not expected
  6047  		todo,
  6048  		// output in log
  6049  		noLines,
  6050  		noLines)
  6051  
  6052  	expandRun.AddExpectations("array_multi_validations.go", []string{
  6053  		`type ArrayMultiValidations struct {`,
  6054  		"	Args *ArrayMultiValidationsArgsTuple0 `json:\"args,omitempty\"`",
  6055  		`func (m *ArrayMultiValidations) Validate(formats strfmt.Registry) error {`,
  6056  		`	if err := m.validateArgs(formats); err != nil {`,
  6057  		`		return errors.CompositeValidationError(res...`,
  6058  		`func (m *ArrayMultiValidations) validateArgs(formats strfmt.Registry) error {`,
  6059  		`	if swag.IsZero(m.Args) {`,
  6060  		`	if m.Args != nil {`,
  6061  		`		if err := m.Args.Validate(formats); err != nil {`,
  6062  		`			if ve, ok := err.(*errors.Validation); ok {`,
  6063  		`				return ve.ValidateName("args"`,
  6064  		`type ArrayMultiValidationsArgsTuple0 struct {`,
  6065  		"	P0 *string `json:\"-\"`",
  6066  		"	P1 *float64 `json:\"-\"`",
  6067  		`func (m *ArrayMultiValidationsArgsTuple0) Validate(formats strfmt.Registry) error {`,
  6068  		`	if err := m.validateP0(formats); err != nil {`,
  6069  		`	if err := m.validateP1(formats); err != nil {`,
  6070  		`		return errors.CompositeValidationError(res...`,
  6071  		`func (m *ArrayMultiValidationsArgsTuple0) validateP0(formats strfmt.Registry) error {`,
  6072  		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
  6073  		`	if err := validate.MinLength("P0", "body", string(*m.P0), 3); err != nil {`,
  6074  		`	if err := validate.MaxLength("P0", "body", string(*m.P0), 10); err != nil {`,
  6075  		"	if err := validate.Pattern(\"P0\", \"body\", string(*m.P0), `\\w+`); err != nil {",
  6076  		`func (m *ArrayMultiValidationsArgsTuple0) validateP1(formats strfmt.Registry) error {`,
  6077  		`	if err := validate.Required("P1", "body", m.P1); err != nil {`,
  6078  		`	if err := validate.Minimum("P1", "body", float64(*m.P1), 3, false); err != nil {`,
  6079  		`	if err := validate.Maximum("P1", "body", float64(*m.P1), 12, false); err != nil {`,
  6080  		`	if err := validate.MultipleOf("P1", "body", float64(*m.P1), 1.5); err != nil {`,
  6081  	},
  6082  		// not expected
  6083  		todo,
  6084  		// output in log
  6085  		noLines,
  6086  		noLines)
  6087  
  6088  	// load expectations for model: string_validations.go
  6089  	flattenRun.AddExpectations("string_validations.go", []string{
  6090  		`type StringValidations struct {`,
  6091  		"	Name string `json:\"name,omitempty\"`",
  6092  		`func (m *StringValidations) Validate(formats strfmt.Registry) error {`,
  6093  		`	if err := m.validateName(formats); err != nil {`,
  6094  		`		return errors.CompositeValidationError(res...`,
  6095  		`func (m *StringValidations) validateName(formats strfmt.Registry) error {`,
  6096  		`	if swag.IsZero(m.Name) {`,
  6097  		`	if err := validate.MinLength("name", "body", string(m.Name), 2); err != nil {`,
  6098  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  6099  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  6100  	},
  6101  		// not expected
  6102  		todo,
  6103  		// output in log
  6104  		noLines,
  6105  		noLines)
  6106  
  6107  	expandRun.AddExpectations("string_validations.go", flattenRun.ExpectedFor("StringValidations").ExpectedLines, todo, noLines, noLines)
  6108  
  6109  	// load expectations for model: required_props.go
  6110  	flattenRun.AddExpectations("required_props.go", []string{
  6111  		`type RequiredProps struct {`,
  6112  		"	Age *int32 `json:\"age\"`",
  6113  		"	CreatedAt *strfmt.DateTime `json:\"createdAt\"`",
  6114  		"	ID *int64 `json:\"id\"`",
  6115  		"	Name *string `json:\"name\"`",
  6116  		"	Score *float32 `json:\"score\"`",
  6117  		"	Tags []string `json:\"tags\"`",
  6118  		`func (m *RequiredProps) Validate(formats strfmt.Registry) error {`,
  6119  		`	if err := m.validateAge(formats); err != nil {`,
  6120  		`	if err := m.validateCreatedAt(formats); err != nil {`,
  6121  		`	if err := m.validateID(formats); err != nil {`,
  6122  		`	if err := m.validateName(formats); err != nil {`,
  6123  		`	if err := m.validateScore(formats); err != nil {`,
  6124  		`	if err := m.validateTags(formats); err != nil {`,
  6125  		`		return errors.CompositeValidationError(res...`,
  6126  		`func (m *RequiredProps) validateAge(formats strfmt.Registry) error {`,
  6127  		`	if err := validate.Required("age", "body", m.Age); err != nil {`,
  6128  		`func (m *RequiredProps) validateCreatedAt(formats strfmt.Registry) error {`,
  6129  		`	if err := validate.Required("createdAt", "body", m.CreatedAt); err != nil {`,
  6130  		`	if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil {`,
  6131  		`func (m *RequiredProps) validateID(formats strfmt.Registry) error {`,
  6132  		`	if err := validate.Required("id", "body", m.ID); err != nil {`,
  6133  		`func (m *RequiredProps) validateName(formats strfmt.Registry) error {`,
  6134  		`	if err := validate.Required("name", "body", m.Name); err != nil {`,
  6135  		`func (m *RequiredProps) validateScore(formats strfmt.Registry) error {`,
  6136  		`	if err := validate.Required("score", "body", m.Score); err != nil {`,
  6137  		`func (m *RequiredProps) validateTags(formats strfmt.Registry) error {`,
  6138  		`	if err := validate.Required("tags", "body", m.Tags); err != nil {`,
  6139  	},
  6140  		// not expected
  6141  		todo,
  6142  		// output in log
  6143  		noLines,
  6144  		noLines)
  6145  
  6146  	expandRun.AddExpectations("required_props.go", flattenRun.ExpectedFor("RequiredProps").ExpectedLines, todo, noLines, noLines)
  6147  
  6148  	// load expectations for model: named_all_of_all_of5.go
  6149  	flattenRun.AddExpectations("named_all_of_all_of5.go", []string{
  6150  		`type NamedAllOfAllOf5 struct {`,
  6151  		"	ExtOpts map[string]map[string]map[string]int32 `json:\"extOpts,omitempty\"`",
  6152  		`func (m *NamedAllOfAllOf5) Validate(formats strfmt.Registry) error {`,
  6153  		`	if err := m.validateExtOpts(formats); err != nil {`,
  6154  		`		return errors.CompositeValidationError(res...`,
  6155  		`func (m *NamedAllOfAllOf5) validateExtOpts(formats strfmt.Registry) error {`,
  6156  		`	if swag.IsZero(m.ExtOpts) {`,
  6157  		`	for k := range m.ExtOpts {`,
  6158  		//`		if swag.IsZero(m.ExtOpts[k]) {`,
  6159  		`		for kk := range m.ExtOpts[k] {`,
  6160  		//`			if swag.IsZero(m.ExtOpts[k][kk]) {`,
  6161  		`			for kkk := range m.ExtOpts[k][kk] {`,
  6162  		//`				if swag.IsZero(m.ExtOpts[k][kk][kkk]) {`,
  6163  		`				if err := validate.MinimumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 2, false); err != nil {`,
  6164  		`				if err := validate.MaximumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 50, false); err != nil {`,
  6165  		`				if err := validate.MultipleOf("extOpts"+"."+k+"."+kk+"."+kkk, "body", float64(m.ExtOpts[k][kk][kkk]), 1.5); err != nil {`,
  6166  	},
  6167  		// not expected
  6168  		todo,
  6169  		// output in log
  6170  		noLines,
  6171  		noLines)
  6172  
  6173  	// load expectations for model: named_map.go
  6174  	flattenRun.AddExpectations("named_map.go", []string{
  6175  		`type NamedMap map[string]int64`,
  6176  		`func (m NamedMap) Validate(formats strfmt.Registry) error {`,
  6177  		`	for k := range m {`,
  6178  		//`		if swag.IsZero(m[k]) {`,
  6179  		`		if err := validate.MinimumInt(k, "body", int64(m[k]), 3, false); err != nil {`,
  6180  		`		if err := validate.MaximumInt(k, "body", int64(m[k]), 6, false); err != nil {`,
  6181  		`		if err := validate.MultipleOf(k, "body", float64(m[k]), 1); err != nil {`,
  6182  		`		return errors.CompositeValidationError(res...`,
  6183  	},
  6184  		// not expected
  6185  		todo,
  6186  		// output in log
  6187  		noLines,
  6188  		noLines)
  6189  
  6190  	expandRun.AddExpectations("named_map.go", flattenRun.ExpectedFor("NamedMap").ExpectedLines, todo, noLines, noLines)
  6191  
  6192  	// load expectations for model: named_string.go
  6193  	flattenRun.AddExpectations("named_string.go", []string{
  6194  		`type NamedString string`,
  6195  		`func (m NamedString) Validate(formats strfmt.Registry) error {`,
  6196  		`	if err := validate.MinLength("", "body", string(m), 2); err != nil {`,
  6197  		`	if err := validate.MaxLength("", "body", string(m), 50); err != nil {`,
  6198  		"	if err := validate.Pattern(\"\", \"body\", string(m), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  6199  		`		return errors.CompositeValidationError(res...`,
  6200  	},
  6201  		// not expected
  6202  		todo,
  6203  		// output in log
  6204  		noLines,
  6205  		noLines)
  6206  
  6207  	expandRun.AddExpectations("named_string.go", flattenRun.ExpectedFor("NamedString").ExpectedLines, todo, noLines, noLines)
  6208  
  6209  	// load expectations for model: named_all_of_all_of3.go
  6210  	flattenRun.AddExpectations("named_all_of_all_of3.go", []string{
  6211  		`type NamedAllOfAllOf3 struct {`,
  6212  		"	Assoc [][][]string `json:\"assoc\"`",
  6213  		`func (m *NamedAllOfAllOf3) Validate(formats strfmt.Registry) error {`,
  6214  		`	if err := m.validateAssoc(formats); err != nil {`,
  6215  		`		return errors.CompositeValidationError(res...`,
  6216  		`func (m *NamedAllOfAllOf3) validateAssoc(formats strfmt.Registry) error {`,
  6217  		`	if swag.IsZero(m.Assoc) {`,
  6218  		`	iAssocSize := int64(len(m.Assoc)`,
  6219  		`	if err := validate.MinItems("assoc", "body", iAssocSize, 5); err != nil {`,
  6220  		`	if err := validate.MaxItems("assoc", "body", iAssocSize, 20); err != nil {`,
  6221  		`	for i := 0; i < len(m.Assoc); i++ {`,
  6222  		`		iiAssocSize := int64(len(m.Assoc[i])`,
  6223  		`		if err := validate.MinItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 5); err != nil {`,
  6224  		`		if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 20); err != nil {`,
  6225  		`		for ii := 0; ii < len(m.Assoc[i]); ii++ {`,
  6226  		`			iiiAssocSize := int64(len(m.Assoc[i][ii])`,
  6227  		`			if err := validate.MinItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`,
  6228  		`			if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`,
  6229  		`			for iii := 0; iii < len(m.Assoc[i][ii]); iii++ {`,
  6230  		`				if err := validate.MinLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Assoc[i][ii][iii]), 2); err != nil {`,
  6231  		`				if err := validate.MaxLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Assoc[i][ii][iii]), 50); err != nil {`,
  6232  		"				if err := validate.Pattern(\"assoc\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", string(m.Assoc[i][ii][iii]), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  6233  	},
  6234  		// not expected
  6235  		todo,
  6236  		// output in log
  6237  		noLines,
  6238  		noLines)
  6239  
  6240  	// load expectations for model: map_complex_validations.go
  6241  	flattenRun.AddExpectations("map_complex_validations.go", []string{
  6242  		`type MapComplexValidations struct {`,
  6243  		// maps are now simple types
  6244  		//"	Meta MapComplexValidationsMeta `json:\"meta,omitempty\"`",
  6245  		"Meta map[string]MapComplexValidationsMetaAdditionalProperties `json:\"meta,omitempty\"`",
  6246  		`func (m *MapComplexValidations) Validate(formats strfmt.Registry) error {`,
  6247  		`	if err := m.validateMeta(formats); err != nil {`,
  6248  		`		return errors.CompositeValidationError(res...`,
  6249  		`func (m *MapComplexValidations) validateMeta(formats strfmt.Registry) error {`,
  6250  		`	if swag.IsZero(m.Meta) {`,
  6251  		//`	if err := m.Meta.Validate(formats); err != nil {`,
  6252  		//`		if ve, ok := err.(*errors.Validation); ok {`,
  6253  		//`			return ve.ValidateName("meta"`,
  6254  		`            		for k := range m.Meta {`,
  6255  		`            			if val, ok := m.Meta[k]; ok {`,
  6256  		`            				if err := val.Validate(formats); err != nil {`,
  6257  	},
  6258  		// not expected
  6259  		todo,
  6260  		// output in log
  6261  		noLines,
  6262  		noLines)
  6263  
  6264  	expandRun.AddExpectations("map_complex_validations.go", []string{
  6265  		`type MapComplexValidations struct {`,
  6266  		"	Meta map[string]MapComplexValidationsMetaAnon `json:\"meta,omitempty\"`",
  6267  		`func (m *MapComplexValidations) Validate(formats strfmt.Registry) error {`,
  6268  		`	if err := m.validateMeta(formats); err != nil {`,
  6269  		`		return errors.CompositeValidationError(res...`,
  6270  		`func (m *MapComplexValidations) validateMeta(formats strfmt.Registry) error {`,
  6271  		`	if swag.IsZero(m.Meta) {`,
  6272  		`	for k := range m.Meta {`,
  6273  		//`		if swag.IsZero(m.Meta[k]) {`,
  6274  		`		if val, ok := m.Meta[k]; ok {`,
  6275  		`			if err := val.Validate(formats); err != nil {`,
  6276  		`type MapComplexValidationsMetaAnon struct {`,
  6277  		"	Age int32 `json:\"age,omitempty\"`",
  6278  		"	Name string `json:\"name,omitempty\"`",
  6279  		`func (m *MapComplexValidationsMetaAnon) Validate(formats strfmt.Registry) error {`,
  6280  		`	if err := m.validateAge(formats); err != nil {`,
  6281  		`	if err := m.validateName(formats); err != nil {`,
  6282  		`		return errors.CompositeValidationError(res...`,
  6283  		`func (m *MapComplexValidationsMetaAnon) validateAge(formats strfmt.Registry) error {`,
  6284  		`	if swag.IsZero(m.Age) {`,
  6285  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  6286  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  6287  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1); err != nil {`,
  6288  		`func (m *MapComplexValidationsMetaAnon) validateName(formats strfmt.Registry) error {`,
  6289  		`	if swag.IsZero(m.Name) {`,
  6290  		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
  6291  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  6292  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
  6293  	},
  6294  		// not expected
  6295  		todo,
  6296  		// output in log
  6297  		noLines,
  6298  		noLines)
  6299  
  6300  	// load expectations for model: named_nested_map_complex_additional_properties_additional_properties_additional_properties.go
  6301  	flattenRun.AddExpectations("named_nested_map_complex_additional_properties_additional_properties_additional_properties.go", []string{
  6302  		`type NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties struct {`,
  6303  		"	Age int32 `json:\"age,omitempty\"`",
  6304  		"	Name string `json:\"name,omitempty\"`",
  6305  		`func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  6306  		`	if err := m.validateAge(formats); err != nil {`,
  6307  		`	if err := m.validateName(formats); err != nil {`,
  6308  		`		return errors.CompositeValidationError(res...`,
  6309  		`func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateAge(formats strfmt.Registry) error {`,
  6310  		`	if swag.IsZero(m.Age) {`,
  6311  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  6312  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  6313  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1); err != nil {`,
  6314  		`func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`,
  6315  		`	if swag.IsZero(m.Name) {`,
  6316  		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
  6317  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  6318  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
  6319  	},
  6320  		// not expected
  6321  		todo,
  6322  		// output in log
  6323  		noLines,
  6324  		noLines)
  6325  
  6326  	// load expectations for model: all_of_validations_meta_all_of6_coords.go
  6327  	flattenRun.AddExpectations("all_of_validations_meta_all_of6_coords.go", []string{
  6328  		`type AllOfValidationsMetaAllOf6Coords struct {`,
  6329  		`	AllOfValidationsMetaAllOf6CoordsAllOf0`,
  6330  		`	AllOfValidationsMetaAllOf6CoordsAllOf1`,
  6331  		`func (m *AllOfValidationsMetaAllOf6Coords) Validate(formats strfmt.Registry) error {`,
  6332  		`	if err := m.AllOfValidationsMetaAllOf6CoordsAllOf0.Validate(formats); err != nil {`,
  6333  		`	if err := m.AllOfValidationsMetaAllOf6CoordsAllOf1.Validate(formats); err != nil {`,
  6334  		`		return errors.CompositeValidationError(res...`,
  6335  	},
  6336  		// not expected
  6337  		todo,
  6338  		// output in log
  6339  		noLines,
  6340  		noLines)
  6341  
  6342  	// load expectations for model: array_validations.go
  6343  	flattenRun.AddExpectations("array_validations.go", []string{
  6344  		`type ArrayValidations struct {`,
  6345  		"	Tags []string `json:\"tags\"`",
  6346  		`func (m *ArrayValidations) Validate(formats strfmt.Registry) error {`,
  6347  		`	if err := m.validateTags(formats); err != nil {`,
  6348  		`		return errors.CompositeValidationError(res...`,
  6349  		`func (m *ArrayValidations) validateTags(formats strfmt.Registry) error {`,
  6350  		`	if swag.IsZero(m.Tags) {`,
  6351  		`	iTagsSize := int64(len(m.Tags)`,
  6352  		`	if err := validate.MinItems("tags", "body", iTagsSize, 3); err != nil {`,
  6353  		`	if err := validate.MaxItems("tags", "body", iTagsSize, 10); err != nil {`,
  6354  		`	for i := 0; i < len(m.Tags); i++ {`,
  6355  		`		if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 3); err != nil {`,
  6356  		`		if err := validate.MaxLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 10); err != nil {`,
  6357  		"		if err := validate.Pattern(\"tags\"+\".\"+strconv.Itoa(i), \"body\", string(m.Tags[i]), `\\w+`); err != nil {",
  6358  	},
  6359  		// not expected
  6360  		todo,
  6361  		// output in log
  6362  		noLines,
  6363  		noLines)
  6364  
  6365  	expandRun.AddExpectations("array_validations.go", flattenRun.ExpectedFor("ArrayValidations").ExpectedLines, todo, noLines, noLines)
  6366  
  6367  	// load expectations for model: all_of_validations_meta.go
  6368  	flattenRun.AddExpectations("all_of_validations_meta.go", []string{
  6369  		`type AllOfValidationsMeta struct {`,
  6370  		`	AllOfValidationsMetaAllOf0`,
  6371  		`	AllOfValidationsMetaAllOf1`,
  6372  		`	AllOfValidationsMetaAllOf2`,
  6373  		`	AllOfValidationsMetaAllOf3`,
  6374  		`	AllOfValidationsMetaAllOf4`,
  6375  		`	AllOfValidationsMetaAllOf5`,
  6376  		`	AllOfValidationsMetaAllOf6`,
  6377  		`func (m *AllOfValidationsMeta) Validate(formats strfmt.Registry) error {`,
  6378  		`	if err := m.AllOfValidationsMetaAllOf0.Validate(formats); err != nil {`,
  6379  		`	if err := m.AllOfValidationsMetaAllOf1.Validate(formats); err != nil {`,
  6380  		`	if err := m.AllOfValidationsMetaAllOf2.Validate(formats); err != nil {`,
  6381  		`	if err := m.AllOfValidationsMetaAllOf3.Validate(formats); err != nil {`,
  6382  		`	if err := m.AllOfValidationsMetaAllOf4.Validate(formats); err != nil {`,
  6383  		`	if err := m.AllOfValidationsMetaAllOf5.Validate(formats); err != nil {`,
  6384  		`	if err := m.AllOfValidationsMetaAllOf6.Validate(formats); err != nil {`,
  6385  		`		return errors.CompositeValidationError(res...`,
  6386  	},
  6387  		// not expected
  6388  		todo,
  6389  		// output in log
  6390  		noLines,
  6391  		noLines)
  6392  
  6393  	// load expectations for model: map_complex_validations_meta_additional_properties.go
  6394  	flattenRun.AddExpectations("map_complex_validations_meta_additional_properties.go", []string{
  6395  		`type MapComplexValidationsMetaAdditionalProperties struct {`,
  6396  		"	Age int32 `json:\"age,omitempty\"`",
  6397  		"	Name string `json:\"name,omitempty\"`",
  6398  		`func (m *MapComplexValidationsMetaAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  6399  		`	if err := m.validateAge(formats); err != nil {`,
  6400  		`	if err := m.validateName(formats); err != nil {`,
  6401  		`		return errors.CompositeValidationError(res...`,
  6402  		`func (m *MapComplexValidationsMetaAdditionalProperties) validateAge(formats strfmt.Registry) error {`,
  6403  		`	if swag.IsZero(m.Age) {`,
  6404  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  6405  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  6406  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1); err != nil {`,
  6407  		`func (m *MapComplexValidationsMetaAdditionalProperties) validateName(formats strfmt.Registry) error {`,
  6408  		`	if swag.IsZero(m.Name) {`,
  6409  		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
  6410  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  6411  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
  6412  	},
  6413  		// not expected
  6414  		todo,
  6415  		// output in log
  6416  		noLines,
  6417  		noLines)
  6418  
  6419  	// load expectations for model: nested_map_complex_validations_meta_additional_properties.go
  6420  	// NOTE(fredbi): maps are simple types and this definition is no more generated
  6421  
  6422  	// load expectations for model: all_of_validations_meta_all_of6_coords_all_of1.go
  6423  	flattenRun.AddExpectations("all_of_validations_meta_all_of6_coords_all_of1.go", []string{
  6424  		`type AllOfValidationsMetaAllOf6CoordsAllOf1 struct {`,
  6425  		"	Age int32 `json:\"age,omitempty\"`",
  6426  		`func (m *AllOfValidationsMetaAllOf6CoordsAllOf1) Validate(formats strfmt.Registry) error {`,
  6427  		`	if err := m.validateAge(formats); err != nil {`,
  6428  		`		return errors.CompositeValidationError(res...`,
  6429  		`func (m *AllOfValidationsMetaAllOf6CoordsAllOf1) validateAge(formats strfmt.Registry) error {`,
  6430  		`	if swag.IsZero(m.Age) {`,
  6431  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`,
  6432  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 50, false); err != nil {`,
  6433  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`,
  6434  	},
  6435  		// not expected
  6436  		todo,
  6437  		// output in log
  6438  		noLines,
  6439  		noLines)
  6440  
  6441  	// load expectations for model: all_of_validations_meta_all_of3.go
  6442  	flattenRun.AddExpectations("all_of_validations_meta_all_of3.go", []string{
  6443  		`type AllOfValidationsMetaAllOf3 struct {`,
  6444  		"	Assoc [][][]string `json:\"assoc\"`",
  6445  		`func (m *AllOfValidationsMetaAllOf3) Validate(formats strfmt.Registry) error {`,
  6446  		`	if err := m.validateAssoc(formats); err != nil {`,
  6447  		`		return errors.CompositeValidationError(res...`,
  6448  		`func (m *AllOfValidationsMetaAllOf3) validateAssoc(formats strfmt.Registry) error {`,
  6449  		`	if swag.IsZero(m.Assoc) {`,
  6450  		`	iAssocSize := int64(len(m.Assoc)`,
  6451  		`	if err := validate.MinItems("assoc", "body", iAssocSize, 5); err != nil {`,
  6452  		`	if err := validate.MaxItems("assoc", "body", iAssocSize, 20); err != nil {`,
  6453  		`	for i := 0; i < len(m.Assoc); i++ {`,
  6454  		`		iiAssocSize := int64(len(m.Assoc[i])`,
  6455  		`		if err := validate.MinItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 5); err != nil {`,
  6456  		`		if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 20); err != nil {`,
  6457  		`		for ii := 0; ii < len(m.Assoc[i]); ii++ {`,
  6458  		`			iiiAssocSize := int64(len(m.Assoc[i][ii])`,
  6459  		`			if err := validate.MinItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`,
  6460  		`			if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`,
  6461  		`			for iii := 0; iii < len(m.Assoc[i][ii]); iii++ {`,
  6462  		`				if err := validate.MinLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Assoc[i][ii][iii]), 2); err != nil {`,
  6463  		`				if err := validate.MaxLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Assoc[i][ii][iii]), 50); err != nil {`,
  6464  		"				if err := validate.Pattern(\"assoc\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", string(m.Assoc[i][ii][iii]), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  6465  	},
  6466  		// not expected
  6467  		todo,
  6468  		// output in log
  6469  		noLines,
  6470  		noLines)
  6471  
  6472  	// load expectations for model: nested_object_validations.go
  6473  	flattenRun.AddExpectations("nested_object_validations.go", []string{
  6474  		`type NestedObjectValidations struct {`,
  6475  		"	Args *NestedObjectValidationsArgs `json:\"args,omitempty\"`",
  6476  		`func (m *NestedObjectValidations) Validate(formats strfmt.Registry) error {`,
  6477  		`	if err := m.validateArgs(formats); err != nil {`,
  6478  		`		return errors.CompositeValidationError(res...`,
  6479  		`func (m *NestedObjectValidations) validateArgs(formats strfmt.Registry) error {`,
  6480  		`	if swag.IsZero(m.Args) {`,
  6481  		`	if m.Args != nil {`,
  6482  		`		if err := m.Args.Validate(formats); err != nil {`,
  6483  		`			if ve, ok := err.(*errors.Validation); ok {`,
  6484  		`				return ve.ValidateName("args"`,
  6485  	},
  6486  		// not expected
  6487  		todo,
  6488  		// output in log
  6489  		noLines,
  6490  		noLines)
  6491  
  6492  	expandRun.AddExpectations("nested_object_validations.go", []string{
  6493  		`type NestedObjectValidations struct {`,
  6494  		"	Args *NestedObjectValidationsArgs `json:\"args,omitempty\"`",
  6495  		`func (m *NestedObjectValidations) Validate(formats strfmt.Registry) error {`,
  6496  		`	if err := m.validateArgs(formats); err != nil {`,
  6497  		`		return errors.CompositeValidationError(res...`,
  6498  		`func (m *NestedObjectValidations) validateArgs(formats strfmt.Registry) error {`,
  6499  		`	if swag.IsZero(m.Args) {`,
  6500  		`	if m.Args != nil {`,
  6501  		`		if err := m.Args.Validate(formats); err != nil {`,
  6502  		`			if ve, ok := err.(*errors.Validation); ok {`,
  6503  		`				return ve.ValidateName("args"`,
  6504  		`type NestedObjectValidationsArgs struct {`,
  6505  		"	Meta *NestedObjectValidationsArgsMeta `json:\"meta,omitempty\"`",
  6506  		`func (m *NestedObjectValidationsArgs) Validate(formats strfmt.Registry) error {`,
  6507  		`	if err := m.validateMeta(formats); err != nil {`,
  6508  		`		return errors.CompositeValidationError(res...`,
  6509  		`func (m *NestedObjectValidationsArgs) validateMeta(formats strfmt.Registry) error {`,
  6510  		`	if swag.IsZero(m.Meta) {`,
  6511  		`	if m.Meta != nil {`,
  6512  		`		if err := m.Meta.Validate(formats); err != nil {`,
  6513  		`			if ve, ok := err.(*errors.Validation); ok {`,
  6514  		`				return ve.ValidateName("args" + "." + "meta"`,
  6515  		`type NestedObjectValidationsArgsMeta struct {`,
  6516  		"	First string `json:\"first,omitempty\"`",
  6517  		"	Fourth [][][]float32 `json:\"fourth\"`",
  6518  		"	Second float64 `json:\"second,omitempty\"`",
  6519  		"	Third []float32 `json:\"third\"`",
  6520  		`func (m *NestedObjectValidationsArgsMeta) Validate(formats strfmt.Registry) error {`,
  6521  		`	if err := m.validateFirst(formats); err != nil {`,
  6522  		`	if err := m.validateFourth(formats); err != nil {`,
  6523  		`	if err := m.validateSecond(formats); err != nil {`,
  6524  		`	if err := m.validateThird(formats); err != nil {`,
  6525  		`		return errors.CompositeValidationError(res...`,
  6526  		`func (m *NestedObjectValidationsArgsMeta) validateFirst(formats strfmt.Registry) error {`,
  6527  		`	if swag.IsZero(m.First) {`,
  6528  		`	if err := validate.MinLength("args"+"."+"meta"+"."+"first", "body", string(m.First), 2); err != nil {`,
  6529  		`	if err := validate.MaxLength("args"+"."+"meta"+"."+"first", "body", string(m.First), 50); err != nil {`,
  6530  		"	if err := validate.Pattern(\"args\"+\".\"+\"meta\"+\".\"+\"first\", \"body\", string(m.First), `^\\w+`); err != nil {",
  6531  		`func (m *NestedObjectValidationsArgsMeta) validateFourth(formats strfmt.Registry) error {`,
  6532  		`	if swag.IsZero(m.Fourth) {`,
  6533  		`	iFourthSize := int64(len(m.Fourth)`,
  6534  		`	if err := validate.MinItems("args"+"."+"meta"+"."+"fourth", "body", iFourthSize, 5); err != nil {`,
  6535  		`	if err := validate.MaxItems("args"+"."+"meta"+"."+"fourth", "body", iFourthSize, 93); err != nil {`,
  6536  		`	for i := 0; i < len(m.Fourth); i++ {`,
  6537  		`		iiFourthSize := int64(len(m.Fourth[i])`,
  6538  		`		if err := validate.MinItems("args"+"."+"meta"+"."+"fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 5); err != nil {`,
  6539  		`		if err := validate.MaxItems("args"+"."+"meta"+"."+"fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 93); err != nil {`,
  6540  		`		for ii := 0; ii < len(m.Fourth[i]); ii++ {`,
  6541  		`			iiiFourthSize := int64(len(m.Fourth[i][ii])`,
  6542  		`			if err := validate.MinItems("args"+"."+"meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 5); err != nil {`,
  6543  		`			if err := validate.MaxItems("args"+"."+"meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 93); err != nil {`,
  6544  		`			for iii := 0; iii < len(m.Fourth[i][ii]); iii++ {`,
  6545  		`				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 {`,
  6546  		`				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 {`,
  6547  		`				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 {`,
  6548  		`func (m *NestedObjectValidationsArgsMeta) validateSecond(formats strfmt.Registry) error {`,
  6549  		`	if swag.IsZero(m.Second) {`,
  6550  		`	if err := validate.Minimum("args"+"."+"meta"+"."+"second", "body", float64(m.Second), 3, false); err != nil {`,
  6551  		`	if err := validate.Maximum("args"+"."+"meta"+"."+"second", "body", float64(m.Second), 51, false); err != nil {`,
  6552  		`	if err := validate.MultipleOf("args"+"."+"meta"+"."+"second", "body", float64(m.Second), 1.5); err != nil {`,
  6553  		`func (m *NestedObjectValidationsArgsMeta) validateThird(formats strfmt.Registry) error {`,
  6554  		`	if swag.IsZero(m.Third) {`,
  6555  		`	iThirdSize := int64(len(m.Third)`,
  6556  		`	if err := validate.MinItems("args"+"."+"meta"+"."+"third", "body", iThirdSize, 5); err != nil {`,
  6557  		`	if err := validate.MaxItems("args"+"."+"meta"+"."+"third", "body", iThirdSize, 93); err != nil {`,
  6558  		`	for i := 0; i < len(m.Third); i++ {`,
  6559  		`		if err := validate.Minimum("args"+"."+"meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 3, false); err != nil {`,
  6560  		`		if err := validate.Maximum("args"+"."+"meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 6, false); err != nil {`,
  6561  		`		if err := validate.MultipleOf("args"+"."+"meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 0.5); err != nil {`,
  6562  	},
  6563  		// not expected
  6564  		todo,
  6565  		// output in log
  6566  		noLines,
  6567  		noLines)
  6568  
  6569  	// load expectations for model: named_array_additional.go
  6570  	flattenRun.AddExpectations("named_array_additional.go", []string{
  6571  		`type NamedArrayAdditional struct {`,
  6572  		"	P0 *string `json:\"-\"`",
  6573  		"	P1 *float64 `json:\"-\"`",
  6574  		"	NamedArrayAdditionalItems []int64 `json:\"-\"`",
  6575  		`func (m *NamedArrayAdditional) Validate(formats strfmt.Registry) error {`,
  6576  		`	if err := m.validateP0(formats); err != nil {`,
  6577  		`	if err := m.validateP1(formats); err != nil {`,
  6578  		`	if err := m.validateNamedArrayAdditionalItems(formats); err != nil {`,
  6579  		`		return errors.CompositeValidationError(res...`,
  6580  		`func (m *NamedArrayAdditional) validateP0(formats strfmt.Registry) error {`,
  6581  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  6582  		`	if err := validate.MinLength("0", "body", string(*m.P0), 3); err != nil {`,
  6583  		`	if err := validate.MaxLength("0", "body", string(*m.P0), 10); err != nil {`,
  6584  		"	if err := validate.Pattern(\"0\", \"body\", string(*m.P0), `\\w+`); err != nil {",
  6585  		`func (m *NamedArrayAdditional) validateP1(formats strfmt.Registry) error {`,
  6586  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  6587  		`	if err := validate.Minimum("1", "body", float64(*m.P1), 3, false); err != nil {`,
  6588  		`	if err := validate.Maximum("1", "body", float64(*m.P1), 12, false); err != nil {`,
  6589  		`	if err := validate.MultipleOf("1", "body", float64(*m.P1), 1.5); err != nil {`,
  6590  		`func (m *NamedArrayAdditional) validateNamedArrayAdditionalItems(formats strfmt.Registry) error {`,
  6591  		`	for i := range m.NamedArrayAdditionalItems {`,
  6592  		`		if err := validate.MinimumInt(strconv.Itoa(i+2), "body", int64(m.NamedArrayAdditionalItems[i]), 3, false); err != nil {`,
  6593  		`		if err := validate.MaximumInt(strconv.Itoa(i+2), "body", int64(m.NamedArrayAdditionalItems[i]), 6, false); err != nil {`,
  6594  		`		if err := validate.MultipleOf(strconv.Itoa(i+2), "body", float64(m.NamedArrayAdditionalItems[i]), 1); err != nil {`,
  6595  	},
  6596  		// not expected
  6597  		todo,
  6598  		// output in log
  6599  		noLines,
  6600  		noLines)
  6601  
  6602  	expandRun.AddExpectations("named_array_additional.go", flattenRun.ExpectedFor("NamedArrayAdditional").ExpectedLines, todo, noLines, noLines)
  6603  
  6604  	// load expectations for model: pet.go
  6605  	flattenRun.AddExpectations("pet.go", []string{
  6606  		`type Pet struct {`,
  6607  		"	Category *Category `json:\"category,omitempty\"`",
  6608  		"	ID int64 `json:\"id,omitempty\"`",
  6609  		"	Name *string `json:\"name\"`",
  6610  		"	PhotoUrls []string `json:\"photoUrls\" xml:\"photoUrl\"`",
  6611  		"	Status string `json:\"status,omitempty\"`",
  6612  		"	Tags []*Tag `json:\"tags\" xml:\"tag\"`",
  6613  		`func (m *Pet) Validate(formats strfmt.Registry) error {`,
  6614  		`	if err := m.validateCategory(formats); err != nil {`,
  6615  		`	if err := m.validateName(formats); err != nil {`,
  6616  		`	if err := m.validatePhotoUrls(formats); err != nil {`,
  6617  		`	if err := m.validateStatus(formats); err != nil {`,
  6618  		`	if err := m.validateTags(formats); err != nil {`,
  6619  		`		return errors.CompositeValidationError(res...`,
  6620  		`func (m *Pet) validateCategory(formats strfmt.Registry) error {`,
  6621  		`	if swag.IsZero(m.Category) {`,
  6622  		`	if m.Category != nil {`,
  6623  		`		if err := m.Category.Validate(formats); err != nil {`,
  6624  		`			if ve, ok := err.(*errors.Validation); ok {`,
  6625  		`				return ve.ValidateName("category"`,
  6626  		`func (m *Pet) validateName(formats strfmt.Registry) error {`,
  6627  		`	if err := validate.Required("name", "body", m.Name); err != nil {`,
  6628  		`func (m *Pet) validatePhotoUrls(formats strfmt.Registry) error {`,
  6629  		`	if err := validate.Required("photoUrls", "body", m.PhotoUrls); err != nil {`,
  6630  		`var petTypeStatusPropEnum []interface{`,
  6631  		`	var res []string`,
  6632  		"	if err := json.Unmarshal([]byte(`[\"available\",\"pending\",\"sold\"]`), &res); err != nil {",
  6633  		`	for _, v := range res {`,
  6634  		`		petTypeStatusPropEnum = append(petTypeStatusPropEnum, v`,
  6635  		`	PetStatusAvailable string = "available"`,
  6636  		`	PetStatusPending string = "pending"`,
  6637  		`	PetStatusSold string = "sold"`,
  6638  		`func (m *Pet) validateStatusEnum(path, location string, value string) error {`,
  6639  		`	if err := validate.Enum(path, location, value, petTypeStatusPropEnum); err != nil {`,
  6640  		`func (m *Pet) validateStatus(formats strfmt.Registry) error {`,
  6641  		`	if swag.IsZero(m.Status) {`,
  6642  		`	if err := m.validateStatusEnum("status", "body", m.Status); err != nil {`,
  6643  		`func (m *Pet) validateTags(formats strfmt.Registry) error {`,
  6644  		`	if swag.IsZero(m.Tags) {`,
  6645  		`	for i := 0; i < len(m.Tags); i++ {`,
  6646  		// do we need Required when item is nullable?
  6647  		// nullable not required:
  6648  		`		if swag.IsZero(m.Tags[i]) {`,
  6649  		// nullable required:
  6650  		//`if err := validate.Required("tags"+"."+strconv.Itoa(i), "body", m.Tags[i]); err != nil {`,
  6651  		`		if m.Tags[i] != nil {`,
  6652  		`			if err := m.Tags[i].Validate(formats); err != nil {`,
  6653  		`				if ve, ok := err.(*errors.Validation); ok {`,
  6654  		`					return ve.ValidateName("tags" + "." + strconv.Itoa(i)`,
  6655  	},
  6656  		// not expected
  6657  		todo,
  6658  		// output in log
  6659  		noLines,
  6660  		noLines)
  6661  
  6662  	expandRun.AddExpectations("pet.go", []string{
  6663  		`type Pet struct {`,
  6664  		"	Category *PetCategory `json:\"category,omitempty\"`",
  6665  		"	ID int64 `json:\"id,omitempty\"`",
  6666  		"	Name *string `json:\"name\"`",
  6667  		"	PhotoUrls []string `json:\"photoUrls\" xml:\"photoUrl\"`",
  6668  		"	Status string `json:\"status,omitempty\"`",
  6669  		"	Tags []*PetTagsItems0 `json:\"tags\" xml:\"tag\"`",
  6670  		`func (m *Pet) Validate(formats strfmt.Registry) error {`,
  6671  		`	if err := m.validateCategory(formats); err != nil {`,
  6672  		`	if err := m.validateName(formats); err != nil {`,
  6673  		`	if err := m.validatePhotoUrls(formats); err != nil {`,
  6674  		`	if err := m.validateStatus(formats); err != nil {`,
  6675  		`	if err := m.validateTags(formats); err != nil {`,
  6676  		`		return errors.CompositeValidationError(res...`,
  6677  		`func (m *Pet) validateCategory(formats strfmt.Registry) error {`,
  6678  		`	if swag.IsZero(m.Category) {`,
  6679  		`	if m.Category != nil {`,
  6680  		`		if err := m.Category.Validate(formats); err != nil {`,
  6681  		`			if ve, ok := err.(*errors.Validation); ok {`,
  6682  		`				return ve.ValidateName("category"`,
  6683  		`func (m *Pet) validateName(formats strfmt.Registry) error {`,
  6684  		`	if err := validate.Required("name", "body", m.Name); err != nil {`,
  6685  		`func (m *Pet) validatePhotoUrls(formats strfmt.Registry) error {`,
  6686  		`	if err := validate.Required("photoUrls", "body", m.PhotoUrls); err != nil {`,
  6687  		`var petTypeStatusPropEnum []interface{`,
  6688  		`	var res []string`,
  6689  		"	if err := json.Unmarshal([]byte(`[\"available\",\"pending\",\"sold\"]`), &res); err != nil {",
  6690  		`	for _, v := range res {`,
  6691  		`		petTypeStatusPropEnum = append(petTypeStatusPropEnum, v`,
  6692  		`	PetStatusAvailable string = "available"`,
  6693  		`	PetStatusPending string = "pending"`,
  6694  		`	PetStatusSold string = "sold"`,
  6695  		`func (m *Pet) validateStatusEnum(path, location string, value string) error {`,
  6696  		`	if err := validate.Enum(path, location, value, petTypeStatusPropEnum); err != nil {`,
  6697  		`func (m *Pet) validateStatus(formats strfmt.Registry) error {`,
  6698  		`	if swag.IsZero(m.Status) {`,
  6699  		`	if err := m.validateStatusEnum("status", "body", m.Status); err != nil {`,
  6700  		`func (m *Pet) validateTags(formats strfmt.Registry) error {`,
  6701  		`	if swag.IsZero(m.Tags) {`,
  6702  		`	for i := 0; i < len(m.Tags); i++ {`,
  6703  		// do we need Required when item is nullable?
  6704  		// nullable not required:
  6705  		`		if swag.IsZero(m.Tags[i]) {`,
  6706  		// nullable required:
  6707  		//`		if err := validate.Required("tags"+"."+strconv.Itoa(i), "body", m.Tags[i]); err != nil {`,
  6708  		`		if m.Tags[i] != nil {`,
  6709  		`			if err := m.Tags[i].Validate(formats); err != nil {`,
  6710  		`				if ve, ok := err.(*errors.Validation); ok {`,
  6711  		`					return ve.ValidateName("tags" + "." + strconv.Itoa(i)`,
  6712  		`type PetCategory struct {`,
  6713  		"	ID int64 `json:\"id,omitempty\"`",
  6714  		"	Name string `json:\"name,omitempty\"`",
  6715  		// empty validation
  6716  		"func (m *PetCategory) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  6717  		`type PetTagsItems0 struct {`,
  6718  		"	ID int64 `json:\"id,omitempty\"`",
  6719  		"	Name string `json:\"name,omitempty\"`",
  6720  		// empty validation
  6721  		"func (m *PetTagsItems0) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  6722  	},
  6723  		// not expected
  6724  		todo,
  6725  		// output in log
  6726  		noLines,
  6727  		noLines)
  6728  
  6729  	// load expectations for model: map_complex_validations_meta.go
  6730  	// NOTE(fredbi): maps are simple types and this definition is no more generated
  6731  
  6732  	// load expectations for model: array_additional_validations_args.go
  6733  	flattenRun.AddExpectations("array_additional_validations_args.go", []string{
  6734  		`type ArrayAdditionalValidationsArgs struct {`,
  6735  		"	P0 *string `json:\"-\"`",
  6736  		"	P1 *float64 `json:\"-\"`",
  6737  		"	ArrayAdditionalValidationsArgsItems []int64 `json:\"-\"`",
  6738  		`func (m *ArrayAdditionalValidationsArgs) Validate(formats strfmt.Registry) error {`,
  6739  		`	if err := m.validateP0(formats); err != nil {`,
  6740  		`	if err := m.validateP1(formats); err != nil {`,
  6741  		`	if err := m.validateArrayAdditionalValidationsArgsItems(formats); err != nil {`,
  6742  		`		return errors.CompositeValidationError(res...`,
  6743  		`func (m *ArrayAdditionalValidationsArgs) validateP0(formats strfmt.Registry) error {`,
  6744  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  6745  		`	if err := validate.MinLength("0", "body", string(*m.P0), 3); err != nil {`,
  6746  		`	if err := validate.MaxLength("0", "body", string(*m.P0), 10); err != nil {`,
  6747  		"	if err := validate.Pattern(\"0\", \"body\", string(*m.P0), `\\w+`); err != nil {",
  6748  		`func (m *ArrayAdditionalValidationsArgs) validateP1(formats strfmt.Registry) error {`,
  6749  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  6750  		`	if err := validate.Minimum("1", "body", float64(*m.P1), 3, false); err != nil {`,
  6751  		`	if err := validate.Maximum("1", "body", float64(*m.P1), 12, false); err != nil {`,
  6752  		`	if err := validate.MultipleOf("1", "body", float64(*m.P1), 1.5); err != nil {`,
  6753  		`func (m *ArrayAdditionalValidationsArgs) validateArrayAdditionalValidationsArgsItems(formats strfmt.Registry) error {`,
  6754  		`	for i := range m.ArrayAdditionalValidationsArgsItems {`,
  6755  		`		if err := validate.MinimumInt(strconv.Itoa(i+2), "body", int64(m.ArrayAdditionalValidationsArgsItems[i]), 3, false); err != nil {`,
  6756  		`		if err := validate.MaximumInt(strconv.Itoa(i+2), "body", int64(m.ArrayAdditionalValidationsArgsItems[i]), 6, false); err != nil {`,
  6757  		`		if err := validate.MultipleOf(strconv.Itoa(i+2), "body", float64(m.ArrayAdditionalValidationsArgsItems[i]), 1); err != nil {`,
  6758  	},
  6759  		// not expected
  6760  		todo,
  6761  		// output in log
  6762  		noLines,
  6763  		noLines)
  6764  
  6765  	// load expectations for model: all_of_validations_meta_all_of2.go
  6766  	flattenRun.AddExpectations("all_of_validations_meta_all_of2.go", []string{
  6767  		`type AllOfValidationsMetaAllOf2 struct {`,
  6768  		"	Args []string `json:\"args\"`",
  6769  		`func (m *AllOfValidationsMetaAllOf2) Validate(formats strfmt.Registry) error {`,
  6770  		`	if err := m.validateArgs(formats); err != nil {`,
  6771  		`		return errors.CompositeValidationError(res...`,
  6772  		`func (m *AllOfValidationsMetaAllOf2) validateArgs(formats strfmt.Registry) error {`,
  6773  		`	if swag.IsZero(m.Args) {`,
  6774  		`	iArgsSize := int64(len(m.Args)`,
  6775  		`	if err := validate.MinItems("args", "body", iArgsSize, 5); err != nil {`,
  6776  		`	if err := validate.MaxItems("args", "body", iArgsSize, 20); err != nil {`,
  6777  		`	for i := 0; i < len(m.Args); i++ {`,
  6778  		`		if err := validate.MinLength("args"+"."+strconv.Itoa(i), "body", string(m.Args[i]), 2); err != nil {`,
  6779  		`		if err := validate.MaxLength("args"+"."+strconv.Itoa(i), "body", string(m.Args[i]), 50); err != nil {`,
  6780  		"		if err := validate.Pattern(\"args\"+\".\"+strconv.Itoa(i), \"body\", string(m.Args[i]), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  6781  	},
  6782  		// not expected
  6783  		todo,
  6784  		// output in log
  6785  		noLines,
  6786  		noLines)
  6787  
  6788  	// load expectations for model: all_of_validations_meta_all_of0.go
  6789  	flattenRun.AddExpectations("all_of_validations_meta_all_of0.go", []string{
  6790  		`type AllOfValidationsMetaAllOf0 struct {`,
  6791  		"	Name string `json:\"name,omitempty\"`",
  6792  		`func (m *AllOfValidationsMetaAllOf0) Validate(formats strfmt.Registry) error {`,
  6793  		`	if err := m.validateName(formats); err != nil {`,
  6794  		`		return errors.CompositeValidationError(res...`,
  6795  		`func (m *AllOfValidationsMetaAllOf0) validateName(formats strfmt.Registry) error {`,
  6796  		`	if swag.IsZero(m.Name) {`,
  6797  		`	if err := validate.MinLength("name", "body", string(m.Name), 2); err != nil {`,
  6798  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  6799  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  6800  	},
  6801  		// not expected
  6802  		todo,
  6803  		// output in log
  6804  		noLines,
  6805  		noLines)
  6806  
  6807  	// load expectations for model: named_all_of_all_of4.go
  6808  	flattenRun.AddExpectations("named_all_of_all_of4.go", []string{
  6809  		`type NamedAllOfAllOf4 struct {`,
  6810  		"	Opts map[string]float64 `json:\"opts,omitempty\"`",
  6811  		`func (m *NamedAllOfAllOf4) Validate(formats strfmt.Registry) error {`,
  6812  		`	if err := m.validateOpts(formats); err != nil {`,
  6813  		`		return errors.CompositeValidationError(res...`,
  6814  		`func (m *NamedAllOfAllOf4) validateOpts(formats strfmt.Registry) error {`,
  6815  		`	if swag.IsZero(m.Opts) {`,
  6816  		`	for k := range m.Opts {`,
  6817  		//`		if swag.IsZero(m.Opts[k]) {`,
  6818  		`		if err := validate.Minimum("opts"+"."+k, "body", float64(m.Opts[k]), 2, false); err != nil {`,
  6819  		`		if err := validate.Maximum("opts"+"."+k, "body", float64(m.Opts[k]), 50, false); err != nil {`,
  6820  		`		if err := validate.MultipleOf("opts"+"."+k, "body", float64(m.Opts[k]), 1.5); err != nil {`,
  6821  	},
  6822  		// not expected
  6823  		todo,
  6824  		// output in log
  6825  		noLines,
  6826  		noLines)
  6827  
  6828  	// load expectations for model: named_all_of_all_of0.go
  6829  	flattenRun.AddExpectations("named_all_of_all_of0.go", []string{
  6830  		`type NamedAllOfAllOf0 struct {`,
  6831  		"	Name string `json:\"name,omitempty\"`",
  6832  		`func (m *NamedAllOfAllOf0) Validate(formats strfmt.Registry) error {`,
  6833  		`	if err := m.validateName(formats); err != nil {`,
  6834  		`		return errors.CompositeValidationError(res...`,
  6835  		`func (m *NamedAllOfAllOf0) validateName(formats strfmt.Registry) error {`,
  6836  		`	if swag.IsZero(m.Name) {`,
  6837  		`	if err := validate.MinLength("name", "body", string(m.Name), 2); err != nil {`,
  6838  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  6839  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  6840  	},
  6841  		// not expected
  6842  		todo,
  6843  		// output in log
  6844  		noLines,
  6845  		noLines)
  6846  
  6847  	// load expectations for model: nested_map_complex_validations_meta_additional_properties_additional_properties_additional_properties.go
  6848  	flattenRun.AddExpectations("nested_map_complex_validations_meta_additional_properties_additional_properties_additional_properties.go", []string{
  6849  		`type NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties struct {`,
  6850  		"	Age int32 `json:\"age,omitempty\"`",
  6851  		"	Name string `json:\"name,omitempty\"`",
  6852  		`func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  6853  		`	if err := m.validateAge(formats); err != nil {`,
  6854  		`	if err := m.validateName(formats); err != nil {`,
  6855  		`		return errors.CompositeValidationError(res...`,
  6856  		`func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateAge(formats strfmt.Registry) error {`,
  6857  		`	if swag.IsZero(m.Age) {`,
  6858  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  6859  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  6860  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1); err != nil {`,
  6861  		`func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`,
  6862  		`	if swag.IsZero(m.Name) {`,
  6863  		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
  6864  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  6865  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
  6866  	},
  6867  		// not expected
  6868  		todo,
  6869  		// output in log
  6870  		noLines,
  6871  		noLines)
  6872  
  6873  	// load expectations for model: refed_all_of_validations.go
  6874  	flattenRun.AddExpectations("refed_all_of_validations.go", []string{
  6875  		`type RefedAllOfValidations struct {`,
  6876  		`	NamedString`,
  6877  		`	NamedNumber`,
  6878  		`func (m *RefedAllOfValidations) Validate(formats strfmt.Registry) error {`,
  6879  		`	if err := m.NamedString.Validate(formats); err != nil {`,
  6880  		`	if err := m.NamedNumber.Validate(formats); err != nil {`,
  6881  		`		return errors.CompositeValidationError(res...`,
  6882  	},
  6883  		// not expected
  6884  		todo,
  6885  		// output in log
  6886  		noLines,
  6887  		noLines)
  6888  
  6889  	expandRun.AddExpectations("refed_all_of_validations.go", []string{
  6890  		`type RefedAllOfValidations struct {`,
  6891  		`	RefedAllOfValidationsAllOf0`,
  6892  		`	RefedAllOfValidationsAllOf1`,
  6893  		`func (m *RefedAllOfValidations) Validate(formats strfmt.Registry) error {`,
  6894  		`	if err := m.RefedAllOfValidationsAllOf0.Validate(formats); err != nil {`,
  6895  		`	if err := m.RefedAllOfValidationsAllOf1.Validate(formats); err != nil {`,
  6896  		`		return errors.CompositeValidationError(res...`,
  6897  		`type RefedAllOfValidationsAllOf0 string`,
  6898  		`func (m RefedAllOfValidationsAllOf0) Validate(formats strfmt.Registry) error {`,
  6899  		`	if err := validate.MinLength("", "body", string(m), 2); err != nil {`,
  6900  		`	if err := validate.MaxLength("", "body", string(m), 50); err != nil {`,
  6901  		"	if err := validate.Pattern(\"\", \"body\", string(m), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  6902  		`		return errors.CompositeValidationError(res...`,
  6903  		`type RefedAllOfValidationsAllOf1 int32`,
  6904  		`func (m RefedAllOfValidationsAllOf1) Validate(formats strfmt.Registry) error {`,
  6905  		`	if err := validate.MinimumInt("", "body", int64(m), 0, true); err != nil {`,
  6906  		`	if err := validate.MaximumInt("", "body", int64(m), 500, false); err != nil {`,
  6907  		`	if err := validate.MultipleOf("", "body", float64(m), 1.5); err != nil {`,
  6908  		`		return errors.CompositeValidationError(res...`,
  6909  	},
  6910  		// not expected
  6911  		todo,
  6912  		// output in log
  6913  		noLines,
  6914  		noLines)
  6915  
  6916  	// load expectations for model: update_org.go
  6917  	flattenRun.AddExpectations("update_org.go", []string{
  6918  		`type UpdateOrg struct {`,
  6919  		"	Email string `json:\"email,omitempty\"`",
  6920  		"	InvoiceEmail bool `json:\"invoice_email,omitempty\"`",
  6921  		"	TagExpiration *int64 `json:\"tag_expiration,omitempty\"`",
  6922  		`func (m *UpdateOrg) Validate(formats strfmt.Registry) error {`,
  6923  		`	if err := m.validateTagExpiration(formats); err != nil {`,
  6924  		`		return errors.CompositeValidationError(res...`,
  6925  		`func (m *UpdateOrg) validateTagExpiration(formats strfmt.Registry) error {`,
  6926  		`	if swag.IsZero(m.TagExpiration) {`,
  6927  		`	if err := validate.MinimumInt("tag_expiration", "body", int64(*m.TagExpiration), 0, false); err != nil {`,
  6928  		`	if err := validate.MaximumInt("tag_expiration", "body", int64(*m.TagExpiration), 2.592e+06, false); err != nil {`,
  6929  	},
  6930  		// not expected
  6931  		todo,
  6932  		// output in log
  6933  		noLines,
  6934  		noLines)
  6935  
  6936  	expandRun.AddExpectations("update_org.go", flattenRun.ExpectedFor("UpdateOrg").ExpectedLines, todo, noLines, noLines)
  6937  
  6938  	// load expectations for model: number_validations.go
  6939  	flattenRun.AddExpectations("number_validations.go", []string{
  6940  		`type NumberValidations struct {`,
  6941  		"	Age int32 `json:\"age,omitempty\"`",
  6942  		`func (m *NumberValidations) Validate(formats strfmt.Registry) error {`,
  6943  		`	if err := m.validateAge(formats); err != nil {`,
  6944  		`		return errors.CompositeValidationError(res...`,
  6945  		`func (m *NumberValidations) validateAge(formats strfmt.Registry) error {`,
  6946  		`	if swag.IsZero(m.Age) {`,
  6947  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 0, true); err != nil {`,
  6948  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 500, false); err != nil {`,
  6949  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`,
  6950  	},
  6951  		// not expected
  6952  		todo,
  6953  		// output in log
  6954  		noLines,
  6955  		noLines)
  6956  
  6957  	expandRun.AddExpectations("number_validations.go", flattenRun.ExpectedFor("NumberValidations").ExpectedLines, todo, noLines, noLines)
  6958  
  6959  	// load expectations for model: nested_map_complex_validations.go
  6960  	flattenRun.AddExpectations("nested_map_complex_validations.go", []string{
  6961  		`type NestedMapComplexValidations struct {`,
  6962  		// maps are now simple types
  6963  		//"	Meta NestedMapComplexValidationsMeta `json:\"meta,omitempty\"`",
  6964  		"	Meta map[string]map[string]map[string]NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties `json:\"meta,omitempty\"`",
  6965  		`func (m *NestedMapComplexValidations) Validate(formats strfmt.Registry) error {`,
  6966  		`	if err := m.validateMeta(formats); err != nil {`,
  6967  		`		return errors.CompositeValidationError(res...`,
  6968  		`func (m *NestedMapComplexValidations) validateMeta(formats strfmt.Registry) error {`,
  6969  		`	if swag.IsZero(m.Meta) {`,
  6970  		//`	if err := m.Meta.Validate(formats); err != nil {`,
  6971  		`            		for k := range m.Meta {`,
  6972  		//`            			if swag.IsZero(m.Meta[k]) { // not required`,
  6973  		`            			for kk := range m.Meta[k] {`,
  6974  		//`            				if swag.IsZero(m.Meta[k][kk]) { // not required`,
  6975  		`            				for kkk := range m.Meta[k][kk] {`,
  6976  		`	            				if err := validate.Required("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk]); err != nil {`,
  6977  		`            					if val, ok := m.Meta[k][kk][kkk]; ok {`,
  6978  		`            						if err := val.Validate(formats); err != nil {`,
  6979  	},
  6980  		// not expected
  6981  		todo,
  6982  		// output in log
  6983  		noLines,
  6984  		noLines)
  6985  
  6986  	expandRun.AddExpectations("nested_map_complex_validations.go", []string{
  6987  		`type NestedMapComplexValidations struct {`,
  6988  		"	Meta map[string]map[string]map[string]NestedMapComplexValidationsMetaAnon `json:\"meta,omitempty\"`",
  6989  		`func (m *NestedMapComplexValidations) Validate(formats strfmt.Registry) error {`,
  6990  		`	if err := m.validateMeta(formats); err != nil {`,
  6991  		`		return errors.CompositeValidationError(res...`,
  6992  		`func (m *NestedMapComplexValidations) validateMeta(formats strfmt.Registry) error {`,
  6993  		`	if swag.IsZero(m.Meta) {`,
  6994  		`	for k := range m.Meta {`,
  6995  		//`		if swag.IsZero(m.Meta[k]) {`,
  6996  		`		for kk := range m.Meta[k] {`,
  6997  		//`			if swag.IsZero(m.Meta[k][kk]) {`,
  6998  		`			for kkk := range m.Meta[k][kk] {`,
  6999  		//`				if swag.IsZero(m.Meta[k][kk][kkk]) {`,
  7000  		`				if val, ok := m.Meta[k][kk][kkk]; ok {`,
  7001  		`					if err := val.Validate(formats); err != nil {`,
  7002  		`type NestedMapComplexValidationsMetaAnon struct {`,
  7003  		"	Age int32 `json:\"age,omitempty\"`",
  7004  		"	Name string `json:\"name,omitempty\"`",
  7005  		`func (m *NestedMapComplexValidationsMetaAnon) Validate(formats strfmt.Registry) error {`,
  7006  		`	if err := m.validateAge(formats); err != nil {`,
  7007  		`	if err := m.validateName(formats); err != nil {`,
  7008  		`		return errors.CompositeValidationError(res...`,
  7009  		`func (m *NestedMapComplexValidationsMetaAnon) validateAge(formats strfmt.Registry) error {`,
  7010  		`	if swag.IsZero(m.Age) {`,
  7011  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  7012  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  7013  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1); err != nil {`,
  7014  		`func (m *NestedMapComplexValidationsMetaAnon) validateName(formats strfmt.Registry) error {`,
  7015  		`	if swag.IsZero(m.Name) {`,
  7016  		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
  7017  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  7018  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
  7019  	},
  7020  		// not expected
  7021  		todo,
  7022  		// output in log
  7023  		noLines,
  7024  		noLines)
  7025  
  7026  	// load expectations for model: category.go
  7027  	flattenRun.AddExpectations("category.go", []string{
  7028  		`type Category struct {`,
  7029  		"	ID int64 `json:\"id,omitempty\"`",
  7030  		"	Name string `json:\"name,omitempty\"`",
  7031  		// empty validation
  7032  		"func (m *Category) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  7033  	},
  7034  		// not expected
  7035  		todo,
  7036  		// output in log
  7037  		noLines,
  7038  		noLines)
  7039  
  7040  	expandRun.AddExpectations("category.go", flattenRun.ExpectedFor("Category").ExpectedLines, todo, noLines, noLines)
  7041  
  7042  	// load expectations for model: named_all_of_all_of2.go
  7043  	flattenRun.AddExpectations("named_all_of_all_of2.go", []string{
  7044  		`type NamedAllOfAllOf2 struct {`,
  7045  		"	Args []string `json:\"args\"`",
  7046  		`func (m *NamedAllOfAllOf2) Validate(formats strfmt.Registry) error {`,
  7047  		`	if err := m.validateArgs(formats); err != nil {`,
  7048  		`		return errors.CompositeValidationError(res...`,
  7049  		`func (m *NamedAllOfAllOf2) validateArgs(formats strfmt.Registry) error {`,
  7050  		`	if swag.IsZero(m.Args) {`,
  7051  		`	iArgsSize := int64(len(m.Args)`,
  7052  		`	if err := validate.MinItems("args", "body", iArgsSize, 5); err != nil {`,
  7053  		`	if err := validate.MaxItems("args", "body", iArgsSize, 20); err != nil {`,
  7054  		`	for i := 0; i < len(m.Args); i++ {`,
  7055  		`		if err := validate.MinLength("args"+"."+strconv.Itoa(i), "body", string(m.Args[i]), 2); err != nil {`,
  7056  		`		if err := validate.MaxLength("args"+"."+strconv.Itoa(i), "body", string(m.Args[i]), 50); err != nil {`,
  7057  		"		if err := validate.Pattern(\"args\"+\".\"+strconv.Itoa(i), \"body\", string(m.Args[i]), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7058  	},
  7059  		// not expected
  7060  		todo,
  7061  		// output in log
  7062  		noLines,
  7063  		noLines)
  7064  
  7065  	// load expectations for model: named_nested_map_complex_additional_properties_additional_properties.go
  7066  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  7067  
  7068  	// load expectations for model: named_nested_map_complex_additional_properties.go
  7069  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  7070  
  7071  	// load expectations for model: named_nested_array.go
  7072  	flattenRun.AddExpectations("named_nested_array.go", []string{
  7073  		`type NamedNestedArray [][][]string`,
  7074  		`func (m NamedNestedArray) Validate(formats strfmt.Registry) error {`,
  7075  		`	iNamedNestedArraySize := int64(len(m)`,
  7076  		`	if err := validate.MinItems("", "body", iNamedNestedArraySize, 3); err != nil {`,
  7077  		`	if err := validate.MaxItems("", "body", iNamedNestedArraySize, 10); err != nil {`,
  7078  		`	for i := 0; i < len(m); i++ {`,
  7079  		`		iiNamedNestedArraySize := int64(len(m[i])`,
  7080  		`		if err := validate.MinItems(strconv.Itoa(i), "body", iiNamedNestedArraySize, 3); err != nil {`,
  7081  		`		if err := validate.MaxItems(strconv.Itoa(i), "body", iiNamedNestedArraySize, 10); err != nil {`,
  7082  		`		for ii := 0; ii < len(m[i]); ii++ {`,
  7083  		`			iiiNamedNestedArraySize := int64(len(m[i][ii])`,
  7084  		`			if err := validate.MinItems(strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiNamedNestedArraySize, 3); err != nil {`,
  7085  		`			if err := validate.MaxItems(strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiNamedNestedArraySize, 10); err != nil {`,
  7086  		`			for iii := 0; iii < len(m[i][ii]); iii++ {`,
  7087  		`				if err := validate.MinLength(strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m[i][ii][iii]), 3); err != nil {`,
  7088  		`				if err := validate.MaxLength(strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m[i][ii][iii]), 10); err != nil {`,
  7089  		"				if err := validate.Pattern(strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", string(m[i][ii][iii]), `\\w+`); err != nil {",
  7090  		`		return errors.CompositeValidationError(res...`,
  7091  	},
  7092  		// not expected
  7093  		todo,
  7094  		// output in log
  7095  		noLines,
  7096  		noLines)
  7097  
  7098  	expandRun.AddExpectations("named_nested_array.go", flattenRun.ExpectedFor("NamedNestedArray").ExpectedLines, todo, noLines, noLines)
  7099  
  7100  	// load expectations for model: named_all_of.go
  7101  	flattenRun.AddExpectations("named_all_of.go", []string{
  7102  		`type NamedAllOf struct {`,
  7103  		`	NamedAllOfAllOf0`,
  7104  		`	NamedAllOfAllOf1`,
  7105  		`	NamedAllOfAllOf2`,
  7106  		`	NamedAllOfAllOf3`,
  7107  		`	NamedAllOfAllOf4`,
  7108  		`	NamedAllOfAllOf5`,
  7109  		`	NamedAllOfAllOf6`,
  7110  		`func (m *NamedAllOf) Validate(formats strfmt.Registry) error {`,
  7111  		`	if err := m.NamedAllOfAllOf0.Validate(formats); err != nil {`,
  7112  		`	if err := m.NamedAllOfAllOf1.Validate(formats); err != nil {`,
  7113  		`	if err := m.NamedAllOfAllOf2.Validate(formats); err != nil {`,
  7114  		`	if err := m.NamedAllOfAllOf3.Validate(formats); err != nil {`,
  7115  		`	if err := m.NamedAllOfAllOf4.Validate(formats); err != nil {`,
  7116  		`	if err := m.NamedAllOfAllOf5.Validate(formats); err != nil {`,
  7117  		`	if err := m.NamedAllOfAllOf6.Validate(formats); err != nil {`,
  7118  		`		return errors.CompositeValidationError(res...`,
  7119  	},
  7120  		// not expected
  7121  		todo,
  7122  		// output in log
  7123  		noLines,
  7124  		noLines)
  7125  
  7126  	expandRun.AddExpectations("named_all_of.go", []string{
  7127  		`type NamedAllOf struct {`,
  7128  		"	Name string `json:\"name,omitempty\"`",
  7129  		"	Age int32 `json:\"age,omitempty\"`",
  7130  		"	Args []string `json:\"args\"`",
  7131  		"	Assoc [][][]string `json:\"assoc\"`",
  7132  		"	Opts map[string]float64 `json:\"opts,omitempty\"`",
  7133  		"	ExtOpts map[string]map[string]map[string]int32 `json:\"extOpts,omitempty\"`",
  7134  		`	Coords struct {`,
  7135  		"		Name string `json:\"name,omitempty\"`",
  7136  		"		Age int32 `json:\"age,omitempty\"`",
  7137  		"	} `json:\"coords,omitempty\"`",
  7138  		`func (m *NamedAllOf) Validate(formats strfmt.Registry) error {`,
  7139  		`	if err := m.validateName(formats); err != nil {`,
  7140  		`	if err := m.validateAge(formats); err != nil {`,
  7141  		`	if err := m.validateArgs(formats); err != nil {`,
  7142  		`	if err := m.validateAssoc(formats); err != nil {`,
  7143  		`	if err := m.validateOpts(formats); err != nil {`,
  7144  		`	if err := m.validateExtOpts(formats); err != nil {`,
  7145  		`	if err := m.validateCoords(formats); err != nil {`,
  7146  		`		return errors.CompositeValidationError(res...`,
  7147  		`func (m *NamedAllOf) validateName(formats strfmt.Registry) error {`,
  7148  		`	if swag.IsZero(m.Name) {`,
  7149  		`	if err := validate.MinLength("name", "body", string(m.Name), 2); err != nil {`,
  7150  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  7151  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7152  		`func (m *NamedAllOf) validateAge(formats strfmt.Registry) error {`,
  7153  		`	if swag.IsZero(m.Age) {`,
  7154  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`,
  7155  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 50, false); err != nil {`,
  7156  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`,
  7157  		`func (m *NamedAllOf) validateArgs(formats strfmt.Registry) error {`,
  7158  		`	if swag.IsZero(m.Args) {`,
  7159  		`	iArgsSize := int64(len(m.Args)`,
  7160  		`	if err := validate.MinItems("args", "body", iArgsSize, 5); err != nil {`,
  7161  		`	if err := validate.MaxItems("args", "body", iArgsSize, 20); err != nil {`,
  7162  		`	for i := 0; i < len(m.Args); i++ {`,
  7163  		`		if err := validate.MinLength("args"+"."+strconv.Itoa(i), "body", string(m.Args[i]), 2); err != nil {`,
  7164  		`		if err := validate.MaxLength("args"+"."+strconv.Itoa(i), "body", string(m.Args[i]), 50); err != nil {`,
  7165  		"		if err := validate.Pattern(\"args\"+\".\"+strconv.Itoa(i), \"body\", string(m.Args[i]), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7166  		`func (m *NamedAllOf) validateAssoc(formats strfmt.Registry) error {`,
  7167  		`	if swag.IsZero(m.Assoc) {`,
  7168  		`	iAssocSize := int64(len(m.Assoc)`,
  7169  		`	if err := validate.MinItems("assoc", "body", iAssocSize, 5); err != nil {`,
  7170  		`	if err := validate.MaxItems("assoc", "body", iAssocSize, 20); err != nil {`,
  7171  		`	for i := 0; i < len(m.Assoc); i++ {`,
  7172  		`		iiAssocSize := int64(len(m.Assoc[i])`,
  7173  		`		if err := validate.MinItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 5); err != nil {`,
  7174  		`		if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 20); err != nil {`,
  7175  		`		for ii := 0; ii < len(m.Assoc[i]); ii++ {`,
  7176  		`			iiiAssocSize := int64(len(m.Assoc[i][ii])`,
  7177  		`			if err := validate.MinItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`,
  7178  		`			if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`,
  7179  		`			for iii := 0; iii < len(m.Assoc[i][ii]); iii++ {`,
  7180  		`				if err := validate.MinLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Assoc[i][ii][iii]), 2); err != nil {`,
  7181  		`				if err := validate.MaxLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Assoc[i][ii][iii]), 50); err != nil {`,
  7182  		"				if err := validate.Pattern(\"assoc\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", string(m.Assoc[i][ii][iii]), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7183  		`func (m *NamedAllOf) validateOpts(formats strfmt.Registry) error {`,
  7184  		`	if swag.IsZero(m.Opts) {`,
  7185  		`	for k := range m.Opts {`,
  7186  		//`		if swag.IsZero(m.Opts[k]) {`,
  7187  		`		if err := validate.Minimum("opts"+"."+k, "body", float64(m.Opts[k]), 2, false); err != nil {`,
  7188  		`		if err := validate.Maximum("opts"+"."+k, "body", float64(m.Opts[k]), 50, false); err != nil {`,
  7189  		`		if err := validate.MultipleOf("opts"+"."+k, "body", float64(m.Opts[k]), 1.5); err != nil {`,
  7190  		`func (m *NamedAllOf) validateExtOpts(formats strfmt.Registry) error {`,
  7191  		`	if swag.IsZero(m.ExtOpts) {`,
  7192  		`	for k := range m.ExtOpts {`,
  7193  		//`		if swag.IsZero(m.ExtOpts[k]) {`,
  7194  		`		for kk := range m.ExtOpts[k] {`,
  7195  		//`			if swag.IsZero(m.ExtOpts[k][kk]) {`,
  7196  		`			for kkk := range m.ExtOpts[k][kk] {`,
  7197  		//`				if swag.IsZero(m.ExtOpts[k][kk][kkk]) {`,
  7198  		`				if err := validate.MinimumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 2, false); err != nil {`,
  7199  		`				if err := validate.MaximumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 50, false); err != nil {`,
  7200  		`				if err := validate.MultipleOf("extOpts"+"."+k+"."+kk+"."+kkk, "body", float64(m.ExtOpts[k][kk][kkk]), 1.5); err != nil {`,
  7201  		`func (m *NamedAllOf) validateCoords(formats strfmt.Registry) error {`,
  7202  		`	if swag.IsZero(m.Coords) {`,
  7203  		`	if err := validate.MinLength("coords"+"."+"name", "body", string(m.Coords.Name), 2); err != nil {`,
  7204  		`	if err := validate.MaxLength("coords"+"."+"name", "body", string(m.Coords.Name), 50); err != nil {`,
  7205  		"	if err := validate.Pattern(\"coords\"+\".\"+\"name\", \"body\", string(m.Coords.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7206  		`	if err := validate.MinimumInt("coords"+"."+"age", "body", int64(m.Coords.Age), 2, false); err != nil {`,
  7207  		`	if err := validate.MaximumInt("coords"+"."+"age", "body", int64(m.Coords.Age), 50, false); err != nil {`,
  7208  		`	if err := validate.MultipleOf("coords"+"."+"age", "body", float64(m.Coords.Age), 1.5); err != nil {`,
  7209  	},
  7210  		// not expected
  7211  		todo,
  7212  		// output in log
  7213  		noLines,
  7214  		noLines)
  7215  
  7216  	// load expectations for model: named_map_complex.go
  7217  	flattenRun.AddExpectations("named_map_complex.go", []string{
  7218  		`type NamedMapComplex map[string]NamedMapComplexAdditionalProperties`,
  7219  		`func (m NamedMapComplex) Validate(formats strfmt.Registry) error {`,
  7220  		`	for k := range m {`,
  7221  		`		if err := validate.Required(k, "body", m[k]); err != nil {`,
  7222  		`		if val, ok := m[k]; ok {`,
  7223  		`			if err := val.Validate(formats); err != nil {`,
  7224  		`		return errors.CompositeValidationError(res...`,
  7225  	},
  7226  		// not expected
  7227  		todo,
  7228  		// output in log
  7229  		noLines,
  7230  		noLines)
  7231  
  7232  	expandRun.AddExpectations("named_map_complex.go", []string{
  7233  		`type NamedMapComplex map[string]NamedMapComplexAnon`,
  7234  		`func (m NamedMapComplex) Validate(formats strfmt.Registry) error {`,
  7235  		`	for k := range m {`,
  7236  		//`		if swag.IsZero(m[k]) {`,
  7237  		`		if val, ok := m[k]; ok {`,
  7238  		`			if err := val.Validate(formats); err != nil {`,
  7239  		`		return errors.CompositeValidationError(res...`,
  7240  		`type NamedMapComplexAnon struct {`,
  7241  		"	Age int32 `json:\"age,omitempty\"`",
  7242  		"	Name string `json:\"name,omitempty\"`",
  7243  		`func (m *NamedMapComplexAnon) Validate(formats strfmt.Registry) error {`,
  7244  		`	if err := m.validateAge(formats); err != nil {`,
  7245  		`	if err := m.validateName(formats); err != nil {`,
  7246  		`		return errors.CompositeValidationError(res...`,
  7247  		`func (m *NamedMapComplexAnon) validateAge(formats strfmt.Registry) error {`,
  7248  		`	if swag.IsZero(m.Age) {`,
  7249  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  7250  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  7251  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1); err != nil {`,
  7252  		`func (m *NamedMapComplexAnon) validateName(formats strfmt.Registry) error {`,
  7253  		`	if swag.IsZero(m.Name) {`,
  7254  		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
  7255  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  7256  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
  7257  	},
  7258  		// not expected
  7259  		todo,
  7260  		// output in log
  7261  		noLines,
  7262  		noLines)
  7263  
  7264  	// load expectations for model: nested_map_complex_validations_meta.go
  7265  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  7266  
  7267  	// load expectations for model: array_additional_validations.go
  7268  	flattenRun.AddExpectations("array_additional_validations.go", []string{
  7269  		`type ArrayAdditionalValidations struct {`,
  7270  		"	Args ArrayAdditionalValidationsArgs `json:\"args,omitempty\"`",
  7271  		`func (m *ArrayAdditionalValidations) Validate(formats strfmt.Registry) error {`,
  7272  		`	if err := m.validateArgs(formats); err != nil {`,
  7273  		`		return errors.CompositeValidationError(res...`,
  7274  		`func (m *ArrayAdditionalValidations) validateArgs(formats strfmt.Registry) error {`,
  7275  		`	if swag.IsZero(m.Args) {`,
  7276  		`	if err := m.Args.Validate(formats); err != nil {`,
  7277  		`		if ve, ok := err.(*errors.Validation); ok {`,
  7278  		`			return ve.ValidateName("args"`,
  7279  	},
  7280  		// not expected
  7281  		todo,
  7282  		// output in log
  7283  		noLines,
  7284  		noLines)
  7285  
  7286  	expandRun.AddExpectations("array_additional_validations.go", []string{
  7287  		`type ArrayAdditionalValidations struct {`,
  7288  		"	Args *ArrayAdditionalValidationsArgsTuple0 `json:\"args,omitempty\"`",
  7289  		`func (m *ArrayAdditionalValidations) Validate(formats strfmt.Registry) error {`,
  7290  		`	if err := m.validateArgs(formats); err != nil {`,
  7291  		`		return errors.CompositeValidationError(res...`,
  7292  		`func (m *ArrayAdditionalValidations) validateArgs(formats strfmt.Registry) error {`,
  7293  		`	if swag.IsZero(m.Args) {`,
  7294  		`	if m.Args != nil {`,
  7295  		`		if err := m.Args.Validate(formats); err != nil {`,
  7296  		`			if ve, ok := err.(*errors.Validation); ok {`,
  7297  		`				return ve.ValidateName("args"`,
  7298  		`type ArrayAdditionalValidationsArgsTuple0 struct {`,
  7299  		"	P0 *string `json:\"-\"`",
  7300  		"	P1 *float64 `json:\"-\"`",
  7301  		"	ArrayAdditionalValidationsArgsTuple0Items []int64 `json:\"-\"`",
  7302  		`func (m *ArrayAdditionalValidationsArgsTuple0) Validate(formats strfmt.Registry) error {`,
  7303  		`	if err := m.validateP0(formats); err != nil {`,
  7304  		`	if err := m.validateP1(formats); err != nil {`,
  7305  		`	if err := m.validateArrayAdditionalValidationsArgsTuple0Items(formats); err != nil {`,
  7306  		`		return errors.CompositeValidationError(res...`,
  7307  		`func (m *ArrayAdditionalValidationsArgsTuple0) validateP0(formats strfmt.Registry) error {`,
  7308  		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
  7309  		`	if err := validate.MinLength("P0", "body", string(*m.P0), 3); err != nil {`,
  7310  		`	if err := validate.MaxLength("P0", "body", string(*m.P0), 10); err != nil {`,
  7311  		"	if err := validate.Pattern(\"P0\", \"body\", string(*m.P0), `\\w+`); err != nil {",
  7312  		`func (m *ArrayAdditionalValidationsArgsTuple0) validateP1(formats strfmt.Registry) error {`,
  7313  		`	if err := validate.Required("P1", "body", m.P1); err != nil {`,
  7314  		`	if err := validate.Minimum("P1", "body", float64(*m.P1), 3, false); err != nil {`,
  7315  		`	if err := validate.Maximum("P1", "body", float64(*m.P1), 12, false); err != nil {`,
  7316  		`	if err := validate.MultipleOf("P1", "body", float64(*m.P1), 1.5); err != nil {`,
  7317  		`func (m *ArrayAdditionalValidationsArgsTuple0) validateArrayAdditionalValidationsArgsTuple0Items(formats strfmt.Registry) error {`,
  7318  		`	for i := range m.ArrayAdditionalValidationsArgsTuple0Items {`,
  7319  		`		if err := validate.MinimumInt(strconv.Itoa(i), "body", int64(m.ArrayAdditionalValidationsArgsTuple0Items[i]), 3, false); err != nil {`,
  7320  		`		if err := validate.MaximumInt(strconv.Itoa(i), "body", int64(m.ArrayAdditionalValidationsArgsTuple0Items[i]), 6, false); err != nil {`,
  7321  		`		if err := validate.MultipleOf(strconv.Itoa(i), "body", float64(m.ArrayAdditionalValidationsArgsTuple0Items[i]), 1); err != nil {`,
  7322  	},
  7323  		// not expected
  7324  		todo,
  7325  		// output in log
  7326  		noLines,
  7327  		noLines)
  7328  
  7329  	// load expectations for model: nested_object_validations_args_meta.go
  7330  	flattenRun.AddExpectations("nested_object_validations_args_meta.go", []string{
  7331  		`type NestedObjectValidationsArgsMeta struct {`,
  7332  		"	First string `json:\"first,omitempty\"`",
  7333  		"	Fourth [][][]float32 `json:\"fourth\"`",
  7334  		"	Second float64 `json:\"second,omitempty\"`",
  7335  		"	Third []float32 `json:\"third\"`",
  7336  		`func (m *NestedObjectValidationsArgsMeta) Validate(formats strfmt.Registry) error {`,
  7337  		`	if err := m.validateFirst(formats); err != nil {`,
  7338  		`	if err := m.validateFourth(formats); err != nil {`,
  7339  		`	if err := m.validateSecond(formats); err != nil {`,
  7340  		`	if err := m.validateThird(formats); err != nil {`,
  7341  		`		return errors.CompositeValidationError(res...`,
  7342  		`func (m *NestedObjectValidationsArgsMeta) validateFirst(formats strfmt.Registry) error {`,
  7343  		`	if swag.IsZero(m.First) {`,
  7344  		`	if err := validate.MinLength("first", "body", string(m.First), 2); err != nil {`,
  7345  		`	if err := validate.MaxLength("first", "body", string(m.First), 50); err != nil {`,
  7346  		"	if err := validate.Pattern(\"first\", \"body\", string(m.First), `^\\w+`); err != nil {",
  7347  		`func (m *NestedObjectValidationsArgsMeta) validateFourth(formats strfmt.Registry) error {`,
  7348  		`	if swag.IsZero(m.Fourth) {`,
  7349  		`	iFourthSize := int64(len(m.Fourth)`,
  7350  		`	if err := validate.MinItems("fourth", "body", iFourthSize, 5); err != nil {`,
  7351  		`	if err := validate.MaxItems("fourth", "body", iFourthSize, 93); err != nil {`,
  7352  		`	for i := 0; i < len(m.Fourth); i++ {`,
  7353  		`		iiFourthSize := int64(len(m.Fourth[i])`,
  7354  		`		if err := validate.MinItems("fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 5); err != nil {`,
  7355  		`		if err := validate.MaxItems("fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 93); err != nil {`,
  7356  		`		for ii := 0; ii < len(m.Fourth[i]); ii++ {`,
  7357  		`			iiiFourthSize := int64(len(m.Fourth[i][ii])`,
  7358  		`			if err := validate.MinItems("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 5); err != nil {`,
  7359  		`			if err := validate.MaxItems("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 93); err != nil {`,
  7360  		`			for iii := 0; iii < len(m.Fourth[i][ii]); iii++ {`,
  7361  		`				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 {`,
  7362  		`				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 {`,
  7363  		`				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 {`,
  7364  		`func (m *NestedObjectValidationsArgsMeta) validateSecond(formats strfmt.Registry) error {`,
  7365  		`	if swag.IsZero(m.Second) {`,
  7366  		`	if err := validate.Minimum("second", "body", float64(m.Second), 3, false); err != nil {`,
  7367  		`	if err := validate.Maximum("second", "body", float64(m.Second), 51, false); err != nil {`,
  7368  		`	if err := validate.MultipleOf("second", "body", float64(m.Second), 1.5); err != nil {`,
  7369  		`func (m *NestedObjectValidationsArgsMeta) validateThird(formats strfmt.Registry) error {`,
  7370  		`	if swag.IsZero(m.Third) {`,
  7371  		`	iThirdSize := int64(len(m.Third)`,
  7372  		`	if err := validate.MinItems("third", "body", iThirdSize, 5); err != nil {`,
  7373  		`	if err := validate.MaxItems("third", "body", iThirdSize, 93); err != nil {`,
  7374  		`	for i := 0; i < len(m.Third); i++ {`,
  7375  		`		if err := validate.Minimum("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 3, false); err != nil {`,
  7376  		`		if err := validate.Maximum("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 6, false); err != nil {`,
  7377  		`		if err := validate.MultipleOf("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 0.5); err != nil {`,
  7378  	},
  7379  		// not expected
  7380  		todo,
  7381  		// output in log
  7382  		noLines,
  7383  		noLines)
  7384  
  7385  	// load expectations for model: map_validations.go
  7386  	flattenRun.AddExpectations("map_validations.go", []string{
  7387  		`type MapValidations struct {`,
  7388  		"	Meta map[string]int64 `json:\"meta,omitempty\"`",
  7389  		`func (m *MapValidations) Validate(formats strfmt.Registry) error {`,
  7390  		`	if err := m.validateMeta(formats); err != nil {`,
  7391  		`		return errors.CompositeValidationError(res...`,
  7392  		`func (m *MapValidations) validateMeta(formats strfmt.Registry) error {`,
  7393  		`	if swag.IsZero(m.Meta) {`,
  7394  		`	for k := range m.Meta {`,
  7395  		//`		if swag.IsZero(m.Meta[k]) {`,
  7396  		`		if err := validate.MinimumInt("meta"+"."+k, "body", int64(m.Meta[k]), 3, false); err != nil {`,
  7397  		`		if err := validate.MaximumInt("meta"+"."+k, "body", int64(m.Meta[k]), 6, false); err != nil {`,
  7398  		`		if err := validate.MultipleOf("meta"+"."+k, "body", float64(m.Meta[k]), 1); err != nil {`,
  7399  	},
  7400  		// not expected
  7401  		todo,
  7402  		// output in log
  7403  		noLines,
  7404  		noLines)
  7405  
  7406  	expandRun.AddExpectations("map_validations.go", flattenRun.ExpectedFor("MapValidations").ExpectedLines, todo, noLines, noLines)
  7407  
  7408  	// load expectations for model: named_all_of_all_of1.go
  7409  	flattenRun.AddExpectations("named_all_of_all_of1.go", []string{
  7410  		`type NamedAllOfAllOf1 struct {`,
  7411  		"	Age int32 `json:\"age,omitempty\"`",
  7412  		`func (m *NamedAllOfAllOf1) Validate(formats strfmt.Registry) error {`,
  7413  		`	if err := m.validateAge(formats); err != nil {`,
  7414  		`		return errors.CompositeValidationError(res...`,
  7415  		`func (m *NamedAllOfAllOf1) validateAge(formats strfmt.Registry) error {`,
  7416  		`	if swag.IsZero(m.Age) {`,
  7417  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`,
  7418  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 50, false); err != nil {`,
  7419  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1.5); err != nil {`,
  7420  	},
  7421  		// not expected
  7422  		todo,
  7423  		// output in log
  7424  		noLines,
  7425  		noLines)
  7426  
  7427  	// load expectations for model: all_of_validations_meta_all_of5.go
  7428  	flattenRun.AddExpectations("all_of_validations_meta_all_of5.go", []string{
  7429  		`type AllOfValidationsMetaAllOf5 struct {`,
  7430  		"	ExtOpts map[string]map[string]map[string]int32 `json:\"extOpts,omitempty\"`",
  7431  		`func (m *AllOfValidationsMetaAllOf5) Validate(formats strfmt.Registry) error {`,
  7432  		`	if err := m.validateExtOpts(formats); err != nil {`,
  7433  		`		return errors.CompositeValidationError(res...`,
  7434  		`func (m *AllOfValidationsMetaAllOf5) validateExtOpts(formats strfmt.Registry) error {`,
  7435  		`	if swag.IsZero(m.ExtOpts) {`,
  7436  		`	for k := range m.ExtOpts {`,
  7437  		//`		if swag.IsZero(m.ExtOpts[k]) {`,
  7438  		`		for kk := range m.ExtOpts[k] {`,
  7439  		//`			if swag.IsZero(m.ExtOpts[k][kk]) {`,
  7440  		`			for kkk := range m.ExtOpts[k][kk] {`,
  7441  		//`				if swag.IsZero(m.ExtOpts[k][kk][kkk]) {`,
  7442  		`				if err := validate.MinimumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 2, false); err != nil {`,
  7443  		`				if err := validate.MaximumInt("extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.ExtOpts[k][kk][kkk]), 50, false); err != nil {`,
  7444  		`				if err := validate.MultipleOf("extOpts"+"."+k+"."+kk+"."+kkk, "body", float64(m.ExtOpts[k][kk][kkk]), 1.5); err != nil {`,
  7445  	},
  7446  		// not expected
  7447  		todo,
  7448  		// output in log
  7449  		noLines,
  7450  		noLines)
  7451  
  7452  	// load expectations for model: all_of_validations.go
  7453  	flattenRun.AddExpectations("all_of_validations.go", []string{
  7454  		`type AllOfValidations struct {`,
  7455  		"	Meta *AllOfValidationsMeta `json:\"meta,omitempty\"`",
  7456  		`func (m *AllOfValidations) Validate(formats strfmt.Registry) error {`,
  7457  		`	if err := m.validateMeta(formats); err != nil {`,
  7458  		`		return errors.CompositeValidationError(res...`,
  7459  		`func (m *AllOfValidations) validateMeta(formats strfmt.Registry) error {`,
  7460  		`	if swag.IsZero(m.Meta) {`,
  7461  		`	if m.Meta != nil {`,
  7462  		`		if err := m.Meta.Validate(formats); err != nil {`,
  7463  		`			if ve, ok := err.(*errors.Validation); ok {`,
  7464  		`				return ve.ValidateName("meta"`,
  7465  	},
  7466  		// not expected
  7467  		todo,
  7468  		// output in log
  7469  		noLines,
  7470  		noLines)
  7471  
  7472  	expandRun.AddExpectations("all_of_validations.go", []string{
  7473  		`type AllOfValidations struct {`,
  7474  		`	Meta struct {`,
  7475  		"		Name string `json:\"name,omitempty\"`",
  7476  		"		Age int32 `json:\"age,omitempty\"`",
  7477  		"		Args []string `json:\"args\"`",
  7478  		"		Assoc [][][]string `json:\"assoc\"`",
  7479  		"		Opts map[string]int32 `json:\"opts,omitempty\"`",
  7480  		"		ExtOpts map[string]map[string]map[string]int32 `json:\"extOpts,omitempty\"`",
  7481  		`		Coords struct {`,
  7482  		"			Name string `json:\"name,omitempty\"`",
  7483  		"			Age int32 `json:\"age,omitempty\"`",
  7484  		"		} `json:\"coords,omitempty\"`",
  7485  		"	} `json:\"meta,omitempty\"`",
  7486  		`func (m *AllOfValidations) Validate(formats strfmt.Registry) error {`,
  7487  		`	if err := m.validateMeta(formats); err != nil {`,
  7488  		`		return errors.CompositeValidationError(res...`,
  7489  		`func (m *AllOfValidations) validateMeta(formats strfmt.Registry) error {`,
  7490  		`	if swag.IsZero(m.Meta) {`,
  7491  		`	if err := validate.MinLength("meta"+"."+"name", "body", string(m.Meta.Name), 2); err != nil {`,
  7492  		`	if err := validate.MaxLength("meta"+"."+"name", "body", string(m.Meta.Name), 50); err != nil {`,
  7493  		"	if err := validate.Pattern(\"meta\"+\".\"+\"name\", \"body\", string(m.Meta.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7494  		`	if err := validate.MinimumInt("meta"+"."+"age", "body", int64(m.Meta.Age), 2, false); err != nil {`,
  7495  		`	if err := validate.MaximumInt("meta"+"."+"age", "body", int64(m.Meta.Age), 50, false); err != nil {`,
  7496  		`	if err := validate.MultipleOf("meta"+"."+"age", "body", float64(m.Meta.Age), 1.5); err != nil {`,
  7497  		`	iArgsSize := int64(len(m.Meta.Args)`,
  7498  		`	if err := validate.MinItems("meta"+"."+"args", "body", iArgsSize, 5); err != nil {`,
  7499  		`	if err := validate.MaxItems("meta"+"."+"args", "body", iArgsSize, 20); err != nil {`,
  7500  		`	for i := 0; i < len(m.Meta.Args); i++ {`,
  7501  		`		if err := validate.MinLength("meta"+"."+"args"+"."+strconv.Itoa(i), "body", string(m.Meta.Args[i]), 2); err != nil {`,
  7502  		`		if err := validate.MaxLength("meta"+"."+"args"+"."+strconv.Itoa(i), "body", string(m.Meta.Args[i]), 50); err != nil {`,
  7503  		"		if err := validate.Pattern(\"meta\"+\".\"+\"args\"+\".\"+strconv.Itoa(i), \"body\", string(m.Meta.Args[i]), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7504  		`	iAssocSize := int64(len(m.Meta.Assoc)`,
  7505  		`	if err := validate.MinItems("meta"+"."+"assoc", "body", iAssocSize, 5); err != nil {`,
  7506  		`	if err := validate.MaxItems("meta"+"."+"assoc", "body", iAssocSize, 20); err != nil {`,
  7507  		`	for i := 0; i < len(m.Meta.Assoc); i++ {`,
  7508  		`		iiAssocSize := int64(len(m.Meta.Assoc[i])`,
  7509  		`		if err := validate.MinItems("meta"+"."+"assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 5); err != nil {`,
  7510  		`		if err := validate.MaxItems("meta"+"."+"assoc"+"."+strconv.Itoa(i), "body", iiAssocSize, 20); err != nil {`,
  7511  		`		for ii := 0; ii < len(m.Meta.Assoc[i]); ii++ {`,
  7512  		`			iiiAssocSize := int64(len(m.Meta.Assoc[i][ii])`,
  7513  		`			if err := validate.MinItems("meta"+"."+"assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`,
  7514  		`			if err := validate.MaxItems("meta"+"."+"assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`,
  7515  		`			for iii := 0; iii < len(m.Meta.Assoc[i][ii]); iii++ {`,
  7516  		`				if err := validate.MinLength("meta"+"."+"assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Meta.Assoc[i][ii][iii]), 2); err != nil {`,
  7517  		`				if err := validate.MaxLength("meta"+"."+"assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Meta.Assoc[i][ii][iii]), 50); err != nil {`,
  7518  		"				if err := validate.Pattern(\"meta\"+\".\"+\"assoc\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", string(m.Meta.Assoc[i][ii][iii]), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7519  		`	for k := range m.Meta.Opts {`,
  7520  		//`		if swag.IsZero(m.Meta.Opts[k]) {`,
  7521  		`		if err := validate.MinimumInt("meta"+"."+"opts"+"."+k, "body", int64(m.Meta.Opts[k]), 2, false); err != nil {`,
  7522  		`		if err := validate.MaximumInt("meta"+"."+"opts"+"."+k, "body", int64(m.Meta.Opts[k]), 50, false); err != nil {`,
  7523  		`		if err := validate.MultipleOf("meta"+"."+"opts"+"."+k, "body", float64(m.Meta.Opts[k]), 1.5); err != nil {`,
  7524  		`	for k := range m.Meta.ExtOpts {`,
  7525  		//`		if swag.IsZero(m.Meta.ExtOpts[k]) {`,
  7526  		`		for kk := range m.Meta.ExtOpts[k] {`,
  7527  		//`			if swag.IsZero(m.Meta.ExtOpts[k][kk]) {`,
  7528  		`			for kkk := range m.Meta.ExtOpts[k][kk] {`,
  7529  		//`				if swag.IsZero(m.Meta.ExtOpts[k][kk][kkk]) {`,
  7530  		`				if err := validate.MinimumInt("meta"+"."+"extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.Meta.ExtOpts[k][kk][kkk]), 2, false); err != nil {`,
  7531  		`				if err := validate.MaximumInt("meta"+"."+"extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.Meta.ExtOpts[k][kk][kkk]), 50, false); err != nil {`,
  7532  		`				if err := validate.MultipleOf("meta"+"."+"extOpts"+"."+k+"."+kk+"."+kkk, "body", float64(m.Meta.ExtOpts[k][kk][kkk]), 1.5); err != nil {`,
  7533  		`	if err := validate.MinLength("meta"+"."+"coords"+"."+"name", "body", string(m.Meta.Coords.Name), 2); err != nil {`,
  7534  		`	if err := validate.MaxLength("meta"+"."+"coords"+"."+"name", "body", string(m.Meta.Coords.Name), 50); err != nil {`,
  7535  		"	if err := validate.Pattern(\"meta\"+\".\"+\"coords\"+\".\"+\"name\", \"body\", string(m.Meta.Coords.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7536  		`	if err := validate.MinimumInt("meta"+"."+"coords"+"."+"age", "body", int64(m.Meta.Coords.Age), 2, false); err != nil {`,
  7537  		`	if err := validate.MaximumInt("meta"+"."+"coords"+"."+"age", "body", int64(m.Meta.Coords.Age), 50, false); err != nil {`,
  7538  		`	if err := validate.MultipleOf("meta"+"."+"coords"+"."+"age", "body", float64(m.Meta.Coords.Age), 1.5); err != nil {`,
  7539  	},
  7540  		// not expected
  7541  		todo,
  7542  		// output in log
  7543  		noLines,
  7544  		noLines)
  7545  
  7546  	// load expectations for model: named_nested_object_meta.go
  7547  	flattenRun.AddExpectations("named_nested_object_meta.go", []string{
  7548  		`type NamedNestedObjectMeta struct {`,
  7549  		"	First string `json:\"first,omitempty\"`",
  7550  		"	Fourth [][][]float32 `json:\"fourth\"`",
  7551  		"	Second float64 `json:\"second,omitempty\"`",
  7552  		"	Third []float32 `json:\"third\"`",
  7553  		`func (m *NamedNestedObjectMeta) Validate(formats strfmt.Registry) error {`,
  7554  		`	if err := m.validateFirst(formats); err != nil {`,
  7555  		`	if err := m.validateFourth(formats); err != nil {`,
  7556  		`	if err := m.validateSecond(formats); err != nil {`,
  7557  		`	if err := m.validateThird(formats); err != nil {`,
  7558  		`		return errors.CompositeValidationError(res...`,
  7559  		`func (m *NamedNestedObjectMeta) validateFirst(formats strfmt.Registry) error {`,
  7560  		`	if swag.IsZero(m.First) {`,
  7561  		`	if err := validate.MinLength("first", "body", string(m.First), 2); err != nil {`,
  7562  		`	if err := validate.MaxLength("first", "body", string(m.First), 50); err != nil {`,
  7563  		"	if err := validate.Pattern(\"first\", \"body\", string(m.First), `^\\w+`); err != nil {",
  7564  		`func (m *NamedNestedObjectMeta) validateFourth(formats strfmt.Registry) error {`,
  7565  		`	if swag.IsZero(m.Fourth) {`,
  7566  		`	iFourthSize := int64(len(m.Fourth)`,
  7567  		`	if err := validate.MinItems("fourth", "body", iFourthSize, 5); err != nil {`,
  7568  		`	if err := validate.MaxItems("fourth", "body", iFourthSize, 93); err != nil {`,
  7569  		`	for i := 0; i < len(m.Fourth); i++ {`,
  7570  		`		iiFourthSize := int64(len(m.Fourth[i])`,
  7571  		`		if err := validate.MinItems("fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 5); err != nil {`,
  7572  		`		if err := validate.MaxItems("fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 93); err != nil {`,
  7573  		`		for ii := 0; ii < len(m.Fourth[i]); ii++ {`,
  7574  		`			iiiFourthSize := int64(len(m.Fourth[i][ii])`,
  7575  		`			if err := validate.MinItems("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 5); err != nil {`,
  7576  		`			if err := validate.MaxItems("fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 93); err != nil {`,
  7577  		`			for iii := 0; iii < len(m.Fourth[i][ii]); iii++ {`,
  7578  		`				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 {`,
  7579  		`				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 {`,
  7580  		`				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 {`,
  7581  		`func (m *NamedNestedObjectMeta) validateSecond(formats strfmt.Registry) error {`,
  7582  		`	if swag.IsZero(m.Second) {`,
  7583  		`	if err := validate.Minimum("second", "body", float64(m.Second), 3, false); err != nil {`,
  7584  		`	if err := validate.Maximum("second", "body", float64(m.Second), 51, false); err != nil {`,
  7585  		`	if err := validate.MultipleOf("second", "body", float64(m.Second), 1.5); err != nil {`,
  7586  		`func (m *NamedNestedObjectMeta) validateThird(formats strfmt.Registry) error {`,
  7587  		`	if swag.IsZero(m.Third) {`,
  7588  		`	iThirdSize := int64(len(m.Third)`,
  7589  		`	if err := validate.MinItems("third", "body", iThirdSize, 5); err != nil {`,
  7590  		`	if err := validate.MaxItems("third", "body", iThirdSize, 93); err != nil {`,
  7591  		`	for i := 0; i < len(m.Third); i++ {`,
  7592  		`		if err := validate.Minimum("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 3, false); err != nil {`,
  7593  		`		if err := validate.Maximum("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 6, false); err != nil {`,
  7594  		`		if err := validate.MultipleOf("third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 0.5); err != nil {`,
  7595  	},
  7596  		// not expected
  7597  		todo,
  7598  		// output in log
  7599  		noLines,
  7600  		noLines)
  7601  
  7602  	// load expectations for model: named_nested_object.go
  7603  	flattenRun.AddExpectations("named_nested_object.go", []string{
  7604  		`type NamedNestedObject struct {`,
  7605  		"	Meta *NamedNestedObjectMeta `json:\"meta,omitempty\"`",
  7606  		`func (m *NamedNestedObject) Validate(formats strfmt.Registry) error {`,
  7607  		`	if err := m.validateMeta(formats); err != nil {`,
  7608  		`		return errors.CompositeValidationError(res...`,
  7609  		`func (m *NamedNestedObject) validateMeta(formats strfmt.Registry) error {`,
  7610  		`	if swag.IsZero(m.Meta) {`,
  7611  		`	if m.Meta != nil {`,
  7612  		`		if err := m.Meta.Validate(formats); err != nil {`,
  7613  		`			if ve, ok := err.(*errors.Validation); ok {`,
  7614  		`				return ve.ValidateName("meta"`,
  7615  	},
  7616  		// not expected
  7617  		todo,
  7618  		// output in log
  7619  		noLines,
  7620  		noLines)
  7621  
  7622  	expandRun.AddExpectations("named_nested_object.go", []string{
  7623  		`type NamedNestedObject struct {`,
  7624  		"	Meta *NamedNestedObjectMeta `json:\"meta,omitempty\"`",
  7625  		`func (m *NamedNestedObject) Validate(formats strfmt.Registry) error {`,
  7626  		`	if err := m.validateMeta(formats); err != nil {`,
  7627  		`		return errors.CompositeValidationError(res...`,
  7628  		`func (m *NamedNestedObject) validateMeta(formats strfmt.Registry) error {`,
  7629  		`	if swag.IsZero(m.Meta) {`,
  7630  		`	if m.Meta != nil {`,
  7631  		`		if err := m.Meta.Validate(formats); err != nil {`,
  7632  		`			if ve, ok := err.(*errors.Validation); ok {`,
  7633  		`				return ve.ValidateName("meta"`,
  7634  		`type NamedNestedObjectMeta struct {`,
  7635  		"	First string `json:\"first,omitempty\"`",
  7636  		"	Fourth [][][]float32 `json:\"fourth\"`",
  7637  		"	Second float64 `json:\"second,omitempty\"`",
  7638  		"	Third []float32 `json:\"third\"`",
  7639  		`func (m *NamedNestedObjectMeta) Validate(formats strfmt.Registry) error {`,
  7640  		`	if err := m.validateFirst(formats); err != nil {`,
  7641  		`	if err := m.validateFourth(formats); err != nil {`,
  7642  		`	if err := m.validateSecond(formats); err != nil {`,
  7643  		`	if err := m.validateThird(formats); err != nil {`,
  7644  		`		return errors.CompositeValidationError(res...`,
  7645  		`func (m *NamedNestedObjectMeta) validateFirst(formats strfmt.Registry) error {`,
  7646  		`	if swag.IsZero(m.First) {`,
  7647  		`	if err := validate.MinLength("meta"+"."+"first", "body", string(m.First), 2); err != nil {`,
  7648  		`	if err := validate.MaxLength("meta"+"."+"first", "body", string(m.First), 50); err != nil {`,
  7649  		"	if err := validate.Pattern(\"meta\"+\".\"+\"first\", \"body\", string(m.First), `^\\w+`); err != nil {",
  7650  		`func (m *NamedNestedObjectMeta) validateFourth(formats strfmt.Registry) error {`,
  7651  		`	if swag.IsZero(m.Fourth) {`,
  7652  		`	iFourthSize := int64(len(m.Fourth)`,
  7653  		`	if err := validate.MinItems("meta"+"."+"fourth", "body", iFourthSize, 5); err != nil {`,
  7654  		`	if err := validate.MaxItems("meta"+"."+"fourth", "body", iFourthSize, 93); err != nil {`,
  7655  		`	for i := 0; i < len(m.Fourth); i++ {`,
  7656  		`		iiFourthSize := int64(len(m.Fourth[i])`,
  7657  		`		if err := validate.MinItems("meta"+"."+"fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 5); err != nil {`,
  7658  		`		if err := validate.MaxItems("meta"+"."+"fourth"+"."+strconv.Itoa(i), "body", iiFourthSize, 93); err != nil {`,
  7659  		`		for ii := 0; ii < len(m.Fourth[i]); ii++ {`,
  7660  		`			iiiFourthSize := int64(len(m.Fourth[i][ii])`,
  7661  		`			if err := validate.MinItems("meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 5); err != nil {`,
  7662  		`			if err := validate.MaxItems("meta"+"."+"fourth"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiFourthSize, 93); err != nil {`,
  7663  		`			for iii := 0; iii < len(m.Fourth[i][ii]); iii++ {`,
  7664  		`				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 {`,
  7665  		`				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 {`,
  7666  		`				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 {`,
  7667  		`func (m *NamedNestedObjectMeta) validateSecond(formats strfmt.Registry) error {`,
  7668  		`	if swag.IsZero(m.Second) {`,
  7669  		`	if err := validate.Minimum("meta"+"."+"second", "body", float64(m.Second), 3, false); err != nil {`,
  7670  		`	if err := validate.Maximum("meta"+"."+"second", "body", float64(m.Second), 51, false); err != nil {`,
  7671  		`	if err := validate.MultipleOf("meta"+"."+"second", "body", float64(m.Second), 1.5); err != nil {`,
  7672  		`func (m *NamedNestedObjectMeta) validateThird(formats strfmt.Registry) error {`,
  7673  		`	if swag.IsZero(m.Third) {`,
  7674  		`	iThirdSize := int64(len(m.Third)`,
  7675  		`	if err := validate.MinItems("meta"+"."+"third", "body", iThirdSize, 5); err != nil {`,
  7676  		`	if err := validate.MaxItems("meta"+"."+"third", "body", iThirdSize, 93); err != nil {`,
  7677  		`	for i := 0; i < len(m.Third); i++ {`,
  7678  		`		if err := validate.Minimum("meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 3, false); err != nil {`,
  7679  		`		if err := validate.Maximum("meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 6, false); err != nil {`,
  7680  		`		if err := validate.MultipleOf("meta"+"."+"third"+"."+strconv.Itoa(i), "body", float64(m.Third[i]), 0.5); err != nil {`,
  7681  	},
  7682  		// not expected
  7683  		todo,
  7684  		// output in log
  7685  		noLines,
  7686  		noLines)
  7687  
  7688  	// load expectations for model: all_of_validations_meta_all_of6_coords_all_of0.go
  7689  	flattenRun.AddExpectations("all_of_validations_meta_all_of6_coords_all_of0.go", []string{
  7690  		`type AllOfValidationsMetaAllOf6CoordsAllOf0 struct {`,
  7691  		"	Name string `json:\"name,omitempty\"`",
  7692  		`func (m *AllOfValidationsMetaAllOf6CoordsAllOf0) Validate(formats strfmt.Registry) error {`,
  7693  		`	if err := m.validateName(formats); err != nil {`,
  7694  		`		return errors.CompositeValidationError(res...`,
  7695  		`func (m *AllOfValidationsMetaAllOf6CoordsAllOf0) validateName(formats strfmt.Registry) error {`,
  7696  		`	if swag.IsZero(m.Name) {`,
  7697  		`	if err := validate.MinLength("name", "body", string(m.Name), 2); err != nil {`,
  7698  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  7699  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
  7700  	},
  7701  		// not expected
  7702  		todo,
  7703  		// output in log
  7704  		noLines,
  7705  		noLines)
  7706  
  7707  	// load expectations for model: named_nested_map.go
  7708  	flattenRun.AddExpectations("named_nested_map.go", []string{
  7709  		`type NamedNestedMap map[string]map[string]map[string]int64`,
  7710  		`func (m NamedNestedMap) Validate(formats strfmt.Registry) error {`,
  7711  		`	for k := range m {`,
  7712  		//`		if swag.IsZero(m[k]) {`,
  7713  		`		for kk := range m[k] {`,
  7714  		//`			if swag.IsZero(m[k][kk]) {`,
  7715  		`			for kkk := range m[k][kk] {`,
  7716  		//`				if swag.IsZero(m[k][kk][kkk]) {`,
  7717  		`				if err := validate.MinimumInt(k+"."+kk+"."+kkk, "body", int64(m[k][kk][kkk]), 3, false); err != nil {`,
  7718  		`				if err := validate.MaximumInt(k+"."+kk+"."+kkk, "body", int64(m[k][kk][kkk]), 6, false); err != nil {`,
  7719  		`				if err := validate.MultipleOf(k+"."+kk+"."+kkk, "body", float64(m[k][kk][kkk]), 1); err != nil {`,
  7720  		`		return errors.CompositeValidationError(res...`,
  7721  	},
  7722  		// not expected
  7723  		todo,
  7724  		// output in log
  7725  		noLines,
  7726  		noLines)
  7727  
  7728  	expandRun.AddExpectations("named_nested_map.go", flattenRun.ExpectedFor("NamedNestedMap").ExpectedLines, todo, noLines, noLines)
  7729  }
  7730  
  7731  func initFixtureNestedMaps() {
  7732  	// testing fixture-nested-maps.yaml with flatten and expand (--skip-flatten)
  7733  
  7734  	/*
  7735  	   Test specifically focused on nested maps (e.g.nested additionalProperties)
  7736  
  7737  	*/
  7738  
  7739  	f := newModelFixture("../fixtures/bugs/1487/fixture-nested-maps.yaml", "Nested maps")
  7740  	flattenRun := f.AddRun(false)
  7741  	expandRun := f.AddRun(true)
  7742  
  7743  	// load expectations for model: alias_interface.go
  7744  	flattenRun.AddExpectations("alias_interface.go", []string{
  7745  		`type AliasInterface interface{`,
  7746  	},
  7747  		// not expected
  7748  		validatable,
  7749  		// output in log
  7750  		noLines,
  7751  		noLines)
  7752  
  7753  	expandRun.AddExpectations("alias_interface.go", flattenRun.ExpectedFor("AliasInterface").ExpectedLines, validatable, noLines, noLines)
  7754  
  7755  	// load expectations for model: test_nested_aliased_interface.go
  7756  	flattenRun.AddExpectations("test_nested_aliased_interface.go", []string{
  7757  		`type TestNestedAliasedInterface struct {`,
  7758  		"	Meta map[string]map[string]map[string]AliasInterface `json:\"meta,omitempty\"`",
  7759  		// empty validation
  7760  		"func (m *TestNestedAliasedInterface) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  7761  	},
  7762  		// not expected
  7763  		todo,
  7764  		// output in log
  7765  		noLines,
  7766  		noLines)
  7767  
  7768  	expandRun.AddExpectations("test_nested_aliased_interface.go", []string{
  7769  		`type TestNestedAliasedInterface struct {`,
  7770  		"	Meta map[string]map[string]map[string]interface{} `json:\"meta,omitempty\"`",
  7771  		// empty validation
  7772  		"func (m *TestNestedAliasedInterface) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  7773  	},
  7774  		// not expected
  7775  		todo,
  7776  		// output in log
  7777  		noLines,
  7778  		noLines)
  7779  
  7780  	// load expectations for model: nested_map_validations.go
  7781  	flattenRun.AddExpectations("nested_map_validations.go", []string{
  7782  		`type NestedMapValidations struct {`,
  7783  		"	Meta map[string]map[string]map[string]int64 `json:\"meta,omitempty\"`",
  7784  		`func (m *NestedMapValidations) Validate(formats strfmt.Registry) error {`,
  7785  		`	if err := m.validateMeta(formats); err != nil {`,
  7786  		`		return errors.CompositeValidationError(res...`,
  7787  		`func (m *NestedMapValidations) validateMeta(formats strfmt.Registry) error {`,
  7788  		`	if swag.IsZero(m.Meta) {`,
  7789  		`	for k := range m.Meta {`,
  7790  		//`		if swag.IsZero(m.Meta[k]) {`,
  7791  		`		for kk := range m.Meta[k] {`,
  7792  		//`			if swag.IsZero(m.Meta[k][kk]) {`,
  7793  		`			for kkk := range m.Meta[k][kk] {`,
  7794  		//`				if swag.IsZero(m.Meta[k][kk][kkk]) {`,
  7795  		`				if err := validate.MinimumInt("meta"+"."+k+"."+kk+"."+kkk, "body", int64(m.Meta[k][kk][kkk]), 3, false); err != nil {`,
  7796  		`				if err := validate.MaximumInt("meta"+"."+k+"."+kk+"."+kkk, "body", int64(m.Meta[k][kk][kkk]), 6, false); err != nil {`,
  7797  		`				if err := validate.MultipleOf("meta"+"."+k+"."+kk+"."+kkk, "body", float64(m.Meta[k][kk][kkk]), 1); err != nil {`,
  7798  	},
  7799  		// not expected
  7800  		todo,
  7801  		// output in log
  7802  		noLines,
  7803  		noLines)
  7804  
  7805  	expandRun.AddExpectations("nested_map_validations.go", flattenRun.ExpectedFor("NestedMapValidations").ExpectedLines, todo, noLines, noLines)
  7806  
  7807  	// load expectations for model: named_nested_map_complex.go
  7808  	flattenRun.AddExpectations("named_nested_map_complex.go", []string{
  7809  		//`type NamedNestedMapComplex map[string]NamedNestedMapComplexAdditionalProperties`,
  7810  		`type NamedNestedMapComplex map[string]map[string]map[string]NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties`,
  7811  		`func (m NamedNestedMapComplex) Validate(formats strfmt.Registry) error {`,
  7812  		`	for k := range m {`,
  7813  		//`		if swag.IsZero(m[k]) {`,
  7814  		`		for kk := range m[k] {`,
  7815  		//`			if swag.IsZero(m[k][kk]) {`,
  7816  		`			for kkk := range m[k][kk] {`,
  7817  		`				if err := validate.Required(k+"."+kk+"."+kkk, "body", m[k][kk][kkk]); err != nil {`,
  7818  		`				if val, ok := m[k][kk][kkk]; ok {`,
  7819  		`					if err := val.Validate(formats); err != nil {`,
  7820  		`		return errors.CompositeValidationError(res...`,
  7821  	},
  7822  		// not expected
  7823  		todo,
  7824  		// output in log
  7825  		noLines,
  7826  		noLines)
  7827  
  7828  	expandRun.AddExpectations("named_nested_map_complex.go", []string{
  7829  		`type NamedNestedMapComplex map[string]map[string]map[string]NamedNestedMapComplexAnon`,
  7830  		`func (m NamedNestedMapComplex) Validate(formats strfmt.Registry) error {`,
  7831  		`	for k := range m {`,
  7832  		//`		if swag.IsZero(m[k]) {`,
  7833  		`		for kk := range m[k] {`,
  7834  		//`			if swag.IsZero(m[k][kk]) {`,
  7835  		`			for kkk := range m[k][kk] {`,
  7836  		//`				if swag.IsZero(m[k][kk][kkk]) {`,
  7837  		`				if val, ok := m[k][kk][kkk]; ok {`,
  7838  		`					if err := val.Validate(formats); err != nil {`,
  7839  		`		return errors.CompositeValidationError(res...`,
  7840  		`type NamedNestedMapComplexAnon struct {`,
  7841  		"	Age int32 `json:\"age,omitempty\"`",
  7842  		"	Name string `json:\"name,omitempty\"`",
  7843  		`func (m *NamedNestedMapComplexAnon) Validate(formats strfmt.Registry) error {`,
  7844  		`	if err := m.validateAge(formats); err != nil {`,
  7845  		`	if err := m.validateName(formats); err != nil {`,
  7846  		`		return errors.CompositeValidationError(res...`,
  7847  		`func (m *NamedNestedMapComplexAnon) validateAge(formats strfmt.Registry) error {`,
  7848  		`	if swag.IsZero(m.Age) {`,
  7849  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  7850  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  7851  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1); err != nil {`,
  7852  		`func (m *NamedNestedMapComplexAnon) validateName(formats strfmt.Registry) error {`,
  7853  		`	if swag.IsZero(m.Name) {`,
  7854  		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
  7855  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  7856  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
  7857  	},
  7858  		// not expected
  7859  		todo,
  7860  		// output in log
  7861  		noLines,
  7862  		noLines)
  7863  
  7864  	// load expectations for model: nested_map_complex_validations_meta_additional_properties_additional_properties.go
  7865  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  7866  
  7867  	// load expectations for model: nested_map_no_validations_additional_properties_additional_properties.go
  7868  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  7869  
  7870  	// load expectations for model: test_nested_interface.go
  7871  	flattenRun.AddExpectations("test_nested_interface.go", []string{
  7872  		`type TestNestedInterface struct {`,
  7873  		"	Meta map[string]map[string]map[string]interface{} `json:\"meta,omitempty\"`",
  7874  		// empty validation
  7875  		"func (m *TestNestedInterface) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  7876  	},
  7877  		// not expected
  7878  		todo,
  7879  		// output in log
  7880  		noLines,
  7881  		noLines)
  7882  
  7883  	expandRun.AddExpectations("test_nested_interface.go", flattenRun.ExpectedFor("TestNestedInterface").ExpectedLines, todo, noLines, noLines)
  7884  
  7885  	// load expectations for model: named_nested_map_complex_additional_properties_additional_properties_additional_properties.go
  7886  	flattenRun.AddExpectations("named_nested_map_complex_additional_properties_additional_properties_additional_properties.go", []string{
  7887  		`type NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties struct {`,
  7888  		"	Age int32 `json:\"age,omitempty\"`",
  7889  		"	Name string `json:\"name,omitempty\"`",
  7890  		`func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  7891  		`	if err := m.validateAge(formats); err != nil {`,
  7892  		`	if err := m.validateName(formats); err != nil {`,
  7893  		`		return errors.CompositeValidationError(res...`,
  7894  		`func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateAge(formats strfmt.Registry) error {`,
  7895  		`	if swag.IsZero(m.Age) {`,
  7896  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  7897  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  7898  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1); err != nil {`,
  7899  		`func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`,
  7900  		`	if swag.IsZero(m.Name) {`,
  7901  		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
  7902  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  7903  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
  7904  	},
  7905  		// not expected
  7906  		todo,
  7907  		// output in log
  7908  		noLines,
  7909  		noLines)
  7910  
  7911  	// load expectations for model: nested_map_no_validations_additional_properties.go
  7912  	// NOTE(fredbi): maps are simple types and this definition is no more generated
  7913  
  7914  	expandRun.AddExpectations("nested_map_no_validations.go", []string{
  7915  		`type NestedMapNoValidations map[string]map[string]map[string]NestedMapNoValidationsAnon`,
  7916  		`func (m NestedMapNoValidations) Validate(formats strfmt.Registry) error {`,
  7917  		`	for k := range m {`,
  7918  		//`		if swag.IsZero(m[k]) {`,
  7919  		`		for kk := range m[k] {`,
  7920  		//`			if swag.IsZero(m[k][kk]) {`,
  7921  		`			for kkk := range m[k][kk] {`,
  7922  		//`				if swag.IsZero(m[k][kk][kkk]) {`,
  7923  		`				if val, ok := m[k][kk][kkk]; ok {`,
  7924  		`					if err := val.Validate(formats); err != nil {`,
  7925  		`		return errors.CompositeValidationError(res...`,
  7926  		`type NestedMapNoValidationsAnon struct {`,
  7927  		"	Age int64 `json:\"age,omitempty\"`",
  7928  		"	Name string `json:\"name,omitempty\"`",
  7929  		// empty validation
  7930  		"func (m *NestedMapNoValidationsAnon) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  7931  	},
  7932  		// not expected
  7933  		todo,
  7934  		// output in log
  7935  		noLines,
  7936  		noLines)
  7937  
  7938  	// load expectations for model: nested_map_complex_validations_meta_additional_properties.go
  7939  	// NOTE(fredbi): maps are simple types and this definition is no more generated
  7940  
  7941  	// load expectations for model: nested_map_no_validations_additional_properties_additional_properties_additional_properties.go
  7942  	// NOTE: maps are now simple types - this definition is no more generated
  7943  
  7944  	// load expectations for model: nested_map_no_validations.go
  7945  	flattenRun.AddExpectations("nested_map_no_validations.go", []string{
  7946  		//`type NestedMapNoValidations map[string]NestedMapNoValidationsAdditionalProperties`,
  7947  		`type NestedMapNoValidations map[string]map[string]map[string]NestedMapNoValidationsAdditionalPropertiesAdditionalPropertiesAdditionalProperties`,
  7948  		`func (m NestedMapNoValidations) Validate(formats strfmt.Registry) error {`,
  7949  		`	for k := range m {`,
  7950  		//`		if swag.IsZero(m[k]) {`,
  7951  		`       	for kk := range m[k] {`,
  7952  		//`        		if swag.IsZero(m[k][kk]) { // not required`,
  7953  		`            		for kkk := range m[k][kk] {`,
  7954  		`            			if val, ok := m[k][kk][kkk]; ok {`,
  7955  		`            			if err := validate.Required(k+"."+kk+"."+kkk, "body", m[k][kk][kkk]); err != nil {`,
  7956  		`            				if err := val.Validate(formats); err != nil {`,
  7957  		`		return errors.CompositeValidationError(res...`,
  7958  	},
  7959  		// not expected
  7960  		todo,
  7961  		// output in log
  7962  		noLines,
  7963  		noLines)
  7964  
  7965  	// load expectations for model: nested_map_complex_validations_meta_additional_properties_additional_properties_additional_properties.go
  7966  	flattenRun.AddExpectations("nested_map_complex_validations_meta_additional_properties_additional_properties_additional_properties.go", []string{
  7967  		`type NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties struct {`,
  7968  		"	Age int32 `json:\"age,omitempty\"`",
  7969  		"	Name string `json:\"name,omitempty\"`",
  7970  		`func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  7971  		`	if err := m.validateAge(formats); err != nil {`,
  7972  		`	if err := m.validateName(formats); err != nil {`,
  7973  		`		return errors.CompositeValidationError(res...`,
  7974  		`func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateAge(formats strfmt.Registry) error {`,
  7975  		`	if swag.IsZero(m.Age) {`,
  7976  		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 1, true); err != nil {`,
  7977  		`	if err := validate.MaximumInt("age", "body", int64(m.Age), 200, true); err != nil {`,
  7978  		`	if err := validate.MultipleOf("age", "body", float64(m.Age), 1); err != nil {`,
  7979  		`func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`,
  7980  		`	if swag.IsZero(m.Name) {`,
  7981  		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
  7982  		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
  7983  		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
  7984  	},
  7985  		// not expected
  7986  		todo,
  7987  		// output in log
  7988  		noLines,
  7989  		noLines)
  7990  
  7991  	// load expectations for model: nested_map_complex_validations.go
  7992  	flattenRun.AddExpectations("nested_map_complex_validations.go", []string{
  7993  		`type NestedMapComplexValidations struct {`,
  7994  		// maps are now simple types
  7995  		//"	Meta NestedMapComplexValidationsMeta `json:\"meta,omitempty\"`",
  7996  		"	Meta map[string]map[string]map[string]NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties `json:\"meta,omitempty\"`",
  7997  		`func (m *NestedMapComplexValidations) Validate(formats strfmt.Registry) error {`,
  7998  		`	if err := m.validateMeta(formats); err != nil {`,
  7999  		`		return errors.CompositeValidationError(res...`,
  8000  		`func (m *NestedMapComplexValidations) validateMeta(formats strfmt.Registry) error {`,
  8001  		`	if swag.IsZero(m.Meta) {`,
  8002  		`          		for k := range m.Meta {`,
  8003  		//`          			if swag.IsZero(m.Meta[k]) { // not required`,
  8004  		`          			for kk := range m.Meta[k] {`,
  8005  		//`          				if swag.IsZero(m.Meta[k][kk]) { // not required`,
  8006  		`          				for kkk := range m.Meta[k][kk] {`,
  8007  		`          				if err := validate.Required("meta"+"."+k+"."+kk+"."+kkk, "body", m.Meta[k][kk][kkk]); err != nil {`,
  8008  		`          					if val, ok := m.Meta[k][kk][kkk]; ok {`,
  8009  		`          						if err := val.Validate(formats); err != nil {`,
  8010  	},
  8011  		// not expected
  8012  		todo,
  8013  		// output in log
  8014  		noLines,
  8015  		noLines)
  8016  
  8017  	// load expectations for model: named_nested_map_complex_additional_properties_additional_properties.go
  8018  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  8019  
  8020  	// load expectations for model: named_nested_map_complex_additional_properties.go
  8021  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  8022  
  8023  	// load expectations for model: nested_map_complex_validations_meta.go
  8024  	// NOTE(fredbi): maps are now simple types - this definition is no more generated
  8025  }
  8026  
  8027  func initFixture844Variations() {
  8028  	// testing fixture-844-variations.yaml with flatten and expand (--skip-flatten)
  8029  
  8030  	/*
  8031  	   repro
  8032  	*/
  8033  
  8034  	f := newModelFixture("../fixtures/bugs/1487/fixture-844-variations.yaml", "allOf bugs with empty objects")
  8035  	flattenRun := f.AddRun(false)
  8036  	expandRun := f.AddRun(true)
  8037  
  8038  	// load expectations for model: foo.go
  8039  	flattenRun.AddExpectations("foo.go", []string{
  8040  		`type Foo interface{`,
  8041  	},
  8042  		// not expected
  8043  		validatable,
  8044  		// output in log
  8045  		noLines,
  8046  		noLines)
  8047  
  8048  	expandRun.AddExpectations("foo.go", flattenRun.ExpectedFor("Foo").ExpectedLines, validatable, noLines, noLines)
  8049  
  8050  	// load expectations for model: variation2.go
  8051  	flattenRun.AddExpectations("variation2.go", []string{
  8052  		`type Variation2 struct {`,
  8053  		"	Prop1 EmptyEnum `json:\"prop1,omitempty\"`",
  8054  		// empty validation
  8055  		"func (m *Variation2) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8056  	},
  8057  		// not expected
  8058  		todo,
  8059  		// output in log
  8060  		noLines,
  8061  		noLines)
  8062  
  8063  	expandRun.AddExpectations("variation2.go", []string{
  8064  		`type Variation2 struct {`,
  8065  		"	Prop1 interface{} `json:\"prop1,omitempty\"`",
  8066  		// empty validation
  8067  		"func (m *Variation2) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8068  	},
  8069  		// not expected
  8070  		todo,
  8071  		// output in log
  8072  		noLines,
  8073  		noLines)
  8074  
  8075  	// load expectations for model: bar.go
  8076  	flattenRun.AddExpectations("bar.go", []string{
  8077  		`type Bar interface{`,
  8078  	},
  8079  		// not expected
  8080  		validatable,
  8081  		// output in log
  8082  		noLines,
  8083  		noLines)
  8084  
  8085  	expandRun.AddExpectations("bar.go", flattenRun.ExpectedFor("Bar").ExpectedLines, validatable, noLines, noLines)
  8086  
  8087  	// load expectations for model: variation3.go
  8088  	flattenRun.AddExpectations("variation3.go", []string{
  8089  		`type Variation3 struct {`,
  8090  		"	Prop1 []EmptyEnum `json:\"prop1\"`",
  8091  		`func (m *Variation3) Validate(formats strfmt.Registry) error {`,
  8092  		`	if err := m.validateProp1(formats); err != nil {`,
  8093  		`		return errors.CompositeValidationError(res...`,
  8094  		`func (m *Variation3) validateProp1(formats strfmt.Registry) error {`,
  8095  		`	if swag.IsZero(m.Prop1) {`,
  8096  		`	iProp1Size := int64(len(m.Prop1)`,
  8097  		`	if err := validate.MinItems("prop1", "body", iProp1Size, 10); err != nil {`,
  8098  	},
  8099  		// not expected
  8100  		todo,
  8101  		// output in log
  8102  		noLines,
  8103  		noLines)
  8104  
  8105  	expandRun.AddExpectations("variation3.go", []string{
  8106  		`type Variation3 struct {`,
  8107  		"	Prop1 []interface{} `json:\"prop1\"`",
  8108  		`func (m *Variation3) Validate(formats strfmt.Registry) error {`,
  8109  		`	if err := m.validateProp1(formats); err != nil {`,
  8110  		`		return errors.CompositeValidationError(res...`,
  8111  		`var variation3Prop1ItemsEnum []interface{`,
  8112  		`	var res []interface{`,
  8113  		"	if err := json.Unmarshal([]byte(`[\"abc\",\"def\"]`), &res); err != nil {",
  8114  		`	for _, v := range res {`,
  8115  		`		variation3Prop1ItemsEnum = append(variation3Prop1ItemsEnum, v`,
  8116  		`func (m *Variation3) validateProp1ItemsEnum(path, location string, value interface{}) error {`,
  8117  		`	if err := validate.Enum(path, location, value, variation3Prop1ItemsEnum); err != nil {`,
  8118  		`func (m *Variation3) validateProp1(formats strfmt.Registry) error {`,
  8119  		`	if swag.IsZero(m.Prop1) {`,
  8120  		`	iProp1Size := int64(len(m.Prop1)`,
  8121  		`	if err := validate.MinItems("prop1", "body", iProp1Size, 10); err != nil {`,
  8122  	},
  8123  		// not expected
  8124  		todo,
  8125  		// output in log
  8126  		noLines,
  8127  		noLines)
  8128  
  8129  	// load expectations for model: tuple_variation.go
  8130  	flattenRun.AddExpectations("tuple_variation.go", []string{
  8131  		`type TupleVariation struct {`,
  8132  		"	P0 *int64 `json:\"-\"`",
  8133  		"	P1 Bar `json:\"-\"`",
  8134  		"	P2 NonInterface `json:\"-\"`",
  8135  		"	P3 []Bar `json:\"-\"`",
  8136  		"	TupleVariationItems []interface{} `json:\"-\"`",
  8137  		`func (m *TupleVariation) Validate(formats strfmt.Registry) error {`,
  8138  		`	if err := m.validateP0(formats); err != nil {`,
  8139  		`	if err := m.validateP1(formats); err != nil {`,
  8140  		`	if err := m.validateP2(formats); err != nil {`,
  8141  		`	if err := m.validateP3(formats); err != nil {`,
  8142  		`	if err := m.validateTupleVariationItems(formats); err != nil {`,
  8143  		`		return errors.CompositeValidationError(res...`,
  8144  		`func (m *TupleVariation) validateP0(formats strfmt.Registry) error {`,
  8145  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  8146  		`	if err := validate.MaximumInt("0", "body", int64(*m.P0), 10, false); err != nil {`,
  8147  		`func (m *TupleVariation) validateP1(formats strfmt.Registry) error {`,
  8148  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  8149  		`func (m *TupleVariation) validateP2(formats strfmt.Registry) error {`,
  8150  		`	if err := m.P2.Validate(formats); err != nil {`,
  8151  		`		if ve, ok := err.(*errors.Validation); ok {`,
  8152  		`			return ve.ValidateName("2"`,
  8153  		`func (m *TupleVariation) validateP3(formats strfmt.Registry) error {`,
  8154  		`	if err := validate.Required("3", "body", m.P3); err != nil {`,
  8155  		`	iP3Size := int64(len(m.P3)`,
  8156  		`	if err := validate.MaxItems("3", "body", iP3Size, 10); err != nil {`,
  8157  		// empty validation
  8158  		"func (m *TupleVariation) validateTupleVariationItems(formats strfmt.Registry) error {\n\n	return nil\n}",
  8159  	},
  8160  		// not expected
  8161  		todo,
  8162  		// output in log
  8163  		noLines,
  8164  		noLines)
  8165  
  8166  	expandRun.AddExpectations("tuple_variation.go", []string{
  8167  		`type TupleVariation struct {`,
  8168  		"	P0 *int64 `json:\"-\"`",
  8169  		"	P1 interface{} `json:\"-\"`",
  8170  		"	P2 map[string]strfmt.Date `json:\"-\"`",
  8171  		"	P3 []interface{} `json:\"-\"`",
  8172  		"	TupleVariationItems []interface{} `json:\"-\"`",
  8173  		`func (m *TupleVariation) Validate(formats strfmt.Registry) error {`,
  8174  		`	if err := m.validateP0(formats); err != nil {`,
  8175  		`	if err := m.validateP1(formats); err != nil {`,
  8176  		`	if err := m.validateP2(formats); err != nil {`,
  8177  		`	if err := m.validateP3(formats); err != nil {`,
  8178  		`	if err := m.validateTupleVariationItems(formats); err != nil {`,
  8179  		`		return errors.CompositeValidationError(res...`,
  8180  		`func (m *TupleVariation) validateP0(formats strfmt.Registry) error {`,
  8181  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  8182  		`	if err := validate.MaximumInt("0", "body", int64(*m.P0), 10, false); err != nil {`,
  8183  		`func (m *TupleVariation) validateP1(formats strfmt.Registry) error {`,
  8184  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  8185  		`func (m *TupleVariation) validateP2(formats strfmt.Registry) error {`,
  8186  		`	for k := range m.P2 {`,
  8187  		//`		if swag.IsZero(m.P2[k]) {`,
  8188  		`		if err := validate.FormatOf("2"+"."+k, "body", "date", m.P2[k].String(), formats); err != nil {`,
  8189  		`func (m *TupleVariation) validateP3(formats strfmt.Registry) error {`,
  8190  		`	if err := validate.Required("3", "body", m.P3); err != nil {`,
  8191  		`	iP3Size := int64(len(m.P3)`,
  8192  		`	if err := validate.MaxItems("3", "body", iP3Size, 10); err != nil {`,
  8193  		// empty validation
  8194  		"func (m *TupleVariation) validateTupleVariationItems(formats strfmt.Registry) error {\n\n	return nil\n}",
  8195  	},
  8196  		// not expected
  8197  		todo,
  8198  		// output in log
  8199  		noLines,
  8200  		noLines)
  8201  
  8202  	// load expectations for model: add_items_variation.go
  8203  	flattenRun.AddExpectations("add_items_variation.go", []string{
  8204  		`type AddItemsVariation struct {`,
  8205  		"	P0 *int64 `json:\"-\"`",
  8206  		"	P1 Bar `json:\"-\"`",
  8207  		"	AddItemsVariationItems [][]Foo `json:\"-\"`",
  8208  		`func (m *AddItemsVariation) Validate(formats strfmt.Registry) error {`,
  8209  		`	if err := m.validateP0(formats); err != nil {`,
  8210  		`	if err := m.validateP1(formats); err != nil {`,
  8211  		`	if err := m.validateAddItemsVariationItems(formats); err != nil {`,
  8212  		`		return errors.CompositeValidationError(res...`,
  8213  		`func (m *AddItemsVariation) validateP0(formats strfmt.Registry) error {`,
  8214  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  8215  		`	if err := validate.MaximumInt("0", "body", int64(*m.P0), 10, false); err != nil {`,
  8216  		`func (m *AddItemsVariation) validateP1(formats strfmt.Registry) error {`,
  8217  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  8218  		`func (m *AddItemsVariation) validateAddItemsVariationItems(formats strfmt.Registry) error {`,
  8219  		`	for i := range m.AddItemsVariationItems {`,
  8220  		`		if err := validate.UniqueItems(strconv.Itoa(i+2), "body", m.AddItemsVariationItems[i]); err != nil {`,
  8221  	},
  8222  		// not expected
  8223  		todo,
  8224  		// output in log
  8225  		noLines,
  8226  		noLines)
  8227  
  8228  	expandRun.AddExpectations("add_items_variation.go", []string{
  8229  		`type AddItemsVariation struct {`,
  8230  		"	P0 *int64 `json:\"-\"`",
  8231  		"	P1 interface{} `json:\"-\"`",
  8232  		"	AddItemsVariationItems [][]interface{} `json:\"-\"`",
  8233  		`func (m *AddItemsVariation) Validate(formats strfmt.Registry) error {`,
  8234  		`	if err := m.validateP0(formats); err != nil {`,
  8235  		`	if err := m.validateP1(formats); err != nil {`,
  8236  		`	if err := m.validateAddItemsVariationItems(formats); err != nil {`,
  8237  		`		return errors.CompositeValidationError(res...`,
  8238  		`func (m *AddItemsVariation) validateP0(formats strfmt.Registry) error {`,
  8239  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  8240  		`	if err := validate.MaximumInt("0", "body", int64(*m.P0), 10, false); err != nil {`,
  8241  		`func (m *AddItemsVariation) validateP1(formats strfmt.Registry) error {`,
  8242  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  8243  		`func (m *AddItemsVariation) validateAddItemsVariationItems(formats strfmt.Registry) error {`,
  8244  		`	for i := range m.AddItemsVariationItems {`,
  8245  		`		if err := validate.UniqueItems(strconv.Itoa(i+2), "body", m.AddItemsVariationItems[i]); err != nil {`,
  8246  	},
  8247  		// not expected
  8248  		todo,
  8249  		// output in log
  8250  		noLines,
  8251  		noLines)
  8252  
  8253  	// load expectations for model: non_interface.go
  8254  	flattenRun.AddExpectations("non_interface.go", []string{
  8255  		`type NonInterface map[string]strfmt.Date`,
  8256  		`func (m NonInterface) Validate(formats strfmt.Registry) error {`,
  8257  		`	for k := range m {`,
  8258  		//`		if swag.IsZero(m[k]) {`,
  8259  		`		if err := validate.FormatOf(k, "body", "date", m[k].String(), formats); err != nil {`,
  8260  		`		return errors.CompositeValidationError(res...`,
  8261  	},
  8262  		// not expected
  8263  		todo,
  8264  		// output in log
  8265  		noLines,
  8266  		noLines)
  8267  
  8268  	expandRun.AddExpectations("non_interface.go", flattenRun.ExpectedFor("NonInterface").ExpectedLines, todo, noLines, noLines)
  8269  
  8270  	// load expectations for model: variation0.go
  8271  	flattenRun.AddExpectations("variation0.go", []string{
  8272  		`type Variation0 struct {`,
  8273  		`	Foo`,
  8274  		`	Bar`,
  8275  		// empty validation
  8276  		"func (m *Variation0) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8277  	},
  8278  		// not expected
  8279  		todo,
  8280  		// output in log
  8281  		noLines,
  8282  		noLines)
  8283  
  8284  	expandRun.AddExpectations("variation0.go", []string{
  8285  		`type Variation0 struct {`,
  8286  		`	Variation0AllOf0`,
  8287  		`	Variation0AllOf1`,
  8288  		`type Variation0AllOf0 interface{}`,
  8289  		`type Variation0AllOf1 interface{}`,
  8290  		// empty validation
  8291  		"func (m *Variation0) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8292  	},
  8293  		// not expected
  8294  		todo,
  8295  		// output in log
  8296  		noLines,
  8297  		noLines)
  8298  
  8299  	// load expectations for model: variation1.go
  8300  	flattenRun.AddExpectations("variation1.go", []string{
  8301  		`type Variation1 struct {`,
  8302  		`	Foo`,
  8303  		`	NonInterface`,
  8304  		`func (m *Variation1) Validate(formats strfmt.Registry) error {`,
  8305  		`	if err := m.NonInterface.Validate(formats); err != nil {`,
  8306  		`		return errors.CompositeValidationError(res...`,
  8307  	},
  8308  		// not expected
  8309  		todo,
  8310  		// output in log
  8311  		noLines,
  8312  		noLines)
  8313  
  8314  	expandRun.AddExpectations("variation1.go", []string{
  8315  		`type Variation1 struct {`,
  8316  		`	Variation1AllOf0`,
  8317  		"	AO1 map[string]strfmt.Date `json:\"-\"`",
  8318  		`func (m *Variation1) Validate(formats strfmt.Registry) error {`,
  8319  		`	for k := range m.AO1 {`,
  8320  		//`		if swag.IsZero(m.AO1[k]) {`,
  8321  		`		if err := validate.FormatOf(k, "body", "date", m.AO1[k].String(), formats); err != nil {`,
  8322  		`		return errors.CompositeValidationError(res...`,
  8323  		`type Variation1AllOf0 interface{}`,
  8324  	},
  8325  		// not expected
  8326  		todo,
  8327  		// output in log
  8328  		noLines,
  8329  		noLines)
  8330  
  8331  	// load expectations for model: empty_enum.go
  8332  	flattenRun.AddExpectations("empty_enum.go", []string{
  8333  		`type EmptyEnum interface{}`,
  8334  	},
  8335  		// not expected
  8336  		validatable,
  8337  		// output in log
  8338  		noLines,
  8339  		noLines)
  8340  
  8341  	expandRun.AddExpectations("empty_enum.go", flattenRun.ExpectedFor("EmptyEnum").ExpectedLines, validatable, noLines, noLines)
  8342  
  8343  	// load expectations for model: get_o_k_body.go
  8344  	flattenRun.AddExpectations("get_o_k_body.go", []string{
  8345  		`type GetOKBody struct {`,
  8346  		`	Foo`,
  8347  		`	Bar`,
  8348  		// empty validation
  8349  		"func (m *GetOKBody) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8350  	},
  8351  		// not expected
  8352  		todo,
  8353  		// output in log
  8354  		noLines,
  8355  		noLines)
  8356  
  8357  }
  8358  
  8359  func initFixtureMoreAddProps() {
  8360  	// testing fixture-moreAddProps.yaml with flatten and expand (--skip-flatten)
  8361  
  8362  	/*
  8363  	   various patterns of additionalProperties
  8364  	*/
  8365  
  8366  	f := newModelFixture("../fixtures/bugs/1487/fixture-moreAddProps.yaml", "fixture for additionalProperties")
  8367  	flattenRun := f.AddRun(false)
  8368  	expandRun := f.AddRun(true)
  8369  
  8370  	// load expectations for model: trial.go
  8371  	flattenRun.AddExpectations("trial.go", []string{
  8372  		`type Trial struct {`,
  8373  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  8374  		"	AdditionalProperties *TrialAdditionalProperties `json:\"additionalProperties,omitempty\"`",
  8375  		`func (m *Trial) Validate(formats strfmt.Registry) error {`,
  8376  		`	if err := m.validateA1(formats); err != nil {`,
  8377  		`	if err := m.validateAdditionalProperties(formats); err != nil {`,
  8378  		`		return errors.CompositeValidationError(res...`,
  8379  		`func (m *Trial) validateA1(formats strfmt.Registry) error {`,
  8380  		`	if swag.IsZero(m.A1) {`,
  8381  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  8382  		`func (m *Trial) validateAdditionalProperties(formats strfmt.Registry) error {`,
  8383  		`	if swag.IsZero(m.AdditionalProperties) {`,
  8384  		`	if m.AdditionalProperties != nil {`,
  8385  		`		if err := m.AdditionalProperties.Validate(formats); err != nil {`,
  8386  		`			if ve, ok := err.(*errors.Validation); ok {`,
  8387  		`				return ve.ValidateName("additionalProperties"`,
  8388  	},
  8389  		// not expected
  8390  		todo,
  8391  		// output in log
  8392  		noLines,
  8393  		noLines)
  8394  
  8395  	// load expectations for model: trial_additional_properties.go
  8396  	flattenRun.AddExpectations("trial_additional_properties.go", []string{
  8397  		`type TrialAdditionalProperties struct {`,
  8398  		"	Discourse string `json:\"discourse,omitempty\"`",
  8399  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  8400  		"	TrialAdditionalPropertiesAdditionalProperties map[string]interface{} `json:\"-\"`",
  8401  		// empty validation
  8402  		"func (m *TrialAdditionalProperties) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8403  	},
  8404  		// not expected
  8405  		todo,
  8406  		// output in log
  8407  		noLines,
  8408  		noLines)
  8409  
  8410  	// load expectations for model: additional_transitive_refed_object_thing_additional_properties.go
  8411  	flattenRun.AddExpectations("additional_transitive_refed_object_thing_additional_properties.go", []string{
  8412  		`type AdditionalTransitiveRefedObjectThingAdditionalProperties struct {`,
  8413  		"	Prop1 *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1 `json:\"prop1,omitempty\"`",
  8414  		"	AdditionalTransitiveRefedObjectThingAdditionalProperties map[string]*AdditionalTransitiveRefedObjectThingAdditionalPropertiesAdditionalProperties `json:\"-\"`",
  8415  		`func (m *AdditionalTransitiveRefedObjectThingAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  8416  		`	if err := m.validateProp1(formats); err != nil {`,
  8417  		`	for k := range m.AdditionalTransitiveRefedObjectThingAdditionalProperties {`,
  8418  		`		if val, ok := m.AdditionalTransitiveRefedObjectThingAdditionalProperties[k]; ok {`,
  8419  		`			if val != nil {`,
  8420  		`				if err := val.Validate(formats); err != nil {`,
  8421  		`		return errors.CompositeValidationError(res...`,
  8422  		`func (m *AdditionalTransitiveRefedObjectThingAdditionalProperties) validateProp1(formats strfmt.Registry) error {`,
  8423  		`	if swag.IsZero(m.Prop1) {`,
  8424  		`	if m.Prop1 != nil {`,
  8425  		`		if err := m.Prop1.Validate(formats); err != nil {`,
  8426  		`			if ve, ok := err.(*errors.Validation); ok {`,
  8427  		`				return ve.ValidateName("prop1"`,
  8428  	},
  8429  		// not expected
  8430  		todo,
  8431  		// output in log
  8432  		noLines,
  8433  		noLines)
  8434  
  8435  	// load expectations for model: additional_transitive_refed_object_thing_additional_properties_prop1.go
  8436  	flattenRun.AddExpectations("additional_transitive_refed_object_thing_additional_properties_prop1.go", []string{
  8437  		`type AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1 struct {`,
  8438  		"	ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`",
  8439  		"	AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1 map[string]*AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalProperties `json:\"-\"`",
  8440  		`func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1) Validate(formats strfmt.Registry) error {`,
  8441  		`	if err := m.validateThisOneNotRequiredEither(formats); err != nil {`,
  8442  		`	for k := range m.AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1 {`,
  8443  		`		if val, ok := m.AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1[k]; ok {`,
  8444  		`			if val != nil {`,
  8445  		`				if err := val.Validate(formats); err != nil {`,
  8446  		`		return errors.CompositeValidationError(res...`,
  8447  		`func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`,
  8448  		`	if swag.IsZero(m.ThisOneNotRequiredEither) {`,
  8449  		`	if err := validate.MaximumInt("thisOneNotRequiredEither", "body", int64(m.ThisOneNotRequiredEither), 20, false); err != nil {`,
  8450  	},
  8451  		// not expected
  8452  		todo,
  8453  		// output in log
  8454  		noLines,
  8455  		noLines)
  8456  
  8457  	// load expectations for model: additional_transitive_refed_thing.go
  8458  	flattenRun.AddExpectations("additional_transitive_refed_thing.go", []string{
  8459  		`type AdditionalTransitiveRefedThing struct {`,
  8460  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  8461  		"	AdditionalTransitiveRefedThing map[string][]*AdditionalTransitiveRefedThingAdditionalPropertiesItems `json:\"-\"`",
  8462  		`func (m *AdditionalTransitiveRefedThing) Validate(formats strfmt.Registry) error {`,
  8463  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  8464  		`	for k := range m.AdditionalTransitiveRefedThing {`,
  8465  		`		if err := validate.Required(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  8466  		`		if err := validate.UniqueItems(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  8467  		`		for i := 0; i < len(m.AdditionalTransitiveRefedThing[k]); i++ {`,
  8468  		// do we need Required when item is nullable?
  8469  		// nullable not required:
  8470  		`			if swag.IsZero(m.AdditionalTransitiveRefedThing[k][i]) {`,
  8471  		// nullable not required:
  8472  		//`			if err := validate.Required(k+"."+strconv.Itoa(i), "body", m.AdditionalTransitiveRefedThing[k][i]); err != nil {`,
  8473  		`			if m.AdditionalTransitiveRefedThing[k][i] != nil {`,
  8474  		`				if err := m.AdditionalTransitiveRefedThing[k][i].Validate(formats); err != nil {`,
  8475  		`					if ve, ok := err.(*errors.Validation); ok {`,
  8476  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  8477  		`		return errors.CompositeValidationError(res...`,
  8478  		`func (m *AdditionalTransitiveRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  8479  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  8480  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", int64(m.ThisOneNotRequired), 10, false); err != nil {`,
  8481  	},
  8482  		// not expected
  8483  		todo,
  8484  		// output in log
  8485  		noLines,
  8486  		noLines)
  8487  
  8488  	// load expectations for model: additional_transitive_refed_thing_additional_properties_items_additional_properties_additional_properties.go
  8489  	flattenRun.AddExpectations("additional_transitive_refed_thing_additional_properties_items_additional_properties_additional_properties.go", []string{
  8490  		`type AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalPropertiesAdditionalProperties struct {`,
  8491  		"	Discourse string `json:\"discourse,omitempty\"`",
  8492  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  8493  		"	AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalPropertiesAdditionalPropertiesAdditionalProperties map[string]interface{} `json:\"-\"`",
  8494  		// empty validation
  8495  		"func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8496  	},
  8497  		// not expected
  8498  		todo,
  8499  		// output in log
  8500  		noLines,
  8501  		noLines)
  8502  
  8503  	// load expectations for model: additional_transitive_refed_object_thing.go
  8504  	flattenRun.AddExpectations("additional_transitive_refed_object_thing.go", []string{
  8505  		`type AdditionalTransitiveRefedObjectThing struct {`,
  8506  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  8507  		"	AdditionalTransitiveRefedObjectThing map[string]*AdditionalTransitiveRefedObjectThingAdditionalProperties `json:\"-\"`",
  8508  		`func (m *AdditionalTransitiveRefedObjectThing) Validate(formats strfmt.Registry) error {`,
  8509  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  8510  		`	for k := range m.AdditionalTransitiveRefedObjectThing {`,
  8511  		`		if val, ok := m.AdditionalTransitiveRefedObjectThing[k]; ok {`,
  8512  		`			if val != nil {`,
  8513  		`				if err := val.Validate(formats); err != nil {`,
  8514  		`		return errors.CompositeValidationError(res...`,
  8515  		`func (m *AdditionalTransitiveRefedObjectThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  8516  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  8517  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", int64(m.ThisOneNotRequired), 10, false); err != nil {`,
  8518  	},
  8519  		// not expected
  8520  		todo,
  8521  		// output in log
  8522  		noLines,
  8523  		noLines)
  8524  
  8525  	// load expectations for model: additional_transitive_refed_object_thing_additional_properties_additional_properties.go
  8526  	flattenRun.AddExpectations("additional_transitive_refed_object_thing_additional_properties_additional_properties.go", []string{
  8527  		`type AdditionalTransitiveRefedObjectThingAdditionalPropertiesAdditionalProperties struct {`,
  8528  		"	Discourse string `json:\"discourse,omitempty\"`",
  8529  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  8530  		"	AdditionalTransitiveRefedObjectThingAdditionalPropertiesAdditionalPropertiesAdditionalProperties map[string]interface{} `json:\"-\"`",
  8531  		// empty validation
  8532  		"func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesAdditionalProperties) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8533  	},
  8534  		// not expected
  8535  		todo,
  8536  		// output in log
  8537  		noLines,
  8538  		noLines)
  8539  
  8540  	// load expectations for model: additional_transitive_refed_object_thing_additional_properties_prop1_additional_properties.go
  8541  	flattenRun.AddExpectations("additional_transitive_refed_object_thing_additional_properties_prop1_additional_properties.go", []string{
  8542  		`type AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalProperties struct {`,
  8543  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  8544  		"	B1 strfmt.Date `json:\"b1,omitempty\"`",
  8545  		"	AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalPropertiesAdditionalProperties map[string]interface{} `json:\"-\"`",
  8546  		`func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalProperties) Validate(formats strfmt.Registry) error {`,
  8547  		`	if err := m.validateA1(formats); err != nil {`,
  8548  		`	if err := m.validateB1(formats); err != nil {`,
  8549  		`		return errors.CompositeValidationError(res...`,
  8550  		`func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalProperties) validateA1(formats strfmt.Registry) error {`,
  8551  		`	if swag.IsZero(m.A1) {`,
  8552  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  8553  		`func (m *AdditionalTransitiveRefedObjectThingAdditionalPropertiesProp1AdditionalProperties) validateB1(formats strfmt.Registry) error {`,
  8554  		`	if swag.IsZero(m.B1) {`,
  8555  		`	if err := validate.FormatOf("b1", "body", "date", m.B1.String(), formats); err != nil {`,
  8556  	},
  8557  		// not expected
  8558  		todo,
  8559  		// output in log
  8560  		noLines,
  8561  		noLines)
  8562  
  8563  	// load expectations for model: additional_transitive_refed_thing_additional_properties_items.go
  8564  	flattenRun.AddExpectations("additional_transitive_refed_thing_additional_properties_items.go", []string{
  8565  		`type AdditionalTransitiveRefedThingAdditionalPropertiesItems struct {`,
  8566  		"	ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`",
  8567  		"	AdditionalTransitiveRefedThingAdditionalPropertiesItems map[string]*AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties `json:\"-\"`",
  8568  		`func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItems) Validate(formats strfmt.Registry) error {`,
  8569  		`	if err := m.validateThisOneNotRequiredEither(formats); err != nil {`,
  8570  		`	for k := range m.AdditionalTransitiveRefedThingAdditionalPropertiesItems {`,
  8571  		`		if val, ok := m.AdditionalTransitiveRefedThingAdditionalPropertiesItems[k]; ok {`,
  8572  		`			if val != nil {`,
  8573  		`				if err := val.Validate(formats); err != nil {`,
  8574  		`		return errors.CompositeValidationError(res...`,
  8575  		`func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItems) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`,
  8576  		`	if swag.IsZero(m.ThisOneNotRequiredEither) {`,
  8577  		`	if err := validate.MaximumInt("thisOneNotRequiredEither", "body", int64(m.ThisOneNotRequiredEither), 20, false); err != nil {`,
  8578  	},
  8579  		// not expected
  8580  		todo,
  8581  		// output in log
  8582  		noLines,
  8583  		noLines)
  8584  
  8585  	// load expectations for model: additional_transitive_refed_thing_additional_properties_items_additional_properties.go
  8586  	flattenRun.AddExpectations("additional_transitive_refed_thing_additional_properties_items_additional_properties.go", []string{
  8587  		`type AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties struct {`,
  8588  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  8589  		"	B1 strfmt.DateTime `json:\"b1,omitempty\"`",
  8590  		"	AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties map[string]*AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalPropertiesAdditionalProperties `json:\"-\"`",
  8591  		`func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties) Validate(formats strfmt.Registry) error {`,
  8592  		`	if err := m.validateA1(formats); err != nil {`,
  8593  		`	if err := m.validateB1(formats); err != nil {`,
  8594  		`	for k := range m.AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties {`,
  8595  		`		if val, ok := m.AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties[k]; ok {`,
  8596  		`			if val != nil {`,
  8597  		`				if err := val.Validate(formats); err != nil {`,
  8598  		`		return errors.CompositeValidationError(res...`,
  8599  		`func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties) validateA1(formats strfmt.Registry) error {`,
  8600  		`	if swag.IsZero(m.A1) {`,
  8601  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  8602  		`func (m *AdditionalTransitiveRefedThingAdditionalPropertiesItemsAdditionalProperties) validateB1(formats strfmt.Registry) error {`,
  8603  		`	if swag.IsZero(m.B1) {`,
  8604  		`	if err := validate.FormatOf("b1", "body", "date-time", m.B1.String(), formats); err != nil {`,
  8605  	},
  8606  		// not expected
  8607  		todo,
  8608  		// output in log
  8609  		noLines,
  8610  		noLines)
  8611  
  8612  	// load expectations for model: trial.go
  8613  	expandRun.AddExpectations("trial.go", []string{
  8614  		`type Trial struct {`,
  8615  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  8616  		"	AdditionalProperties *TrialAdditionalProperties `json:\"additionalProperties,omitempty\"`",
  8617  		`func (m *Trial) Validate(formats strfmt.Registry) error {`,
  8618  		`	if err := m.validateA1(formats); err != nil {`,
  8619  		`	if err := m.validateAdditionalProperties(formats); err != nil {`,
  8620  		`		return errors.CompositeValidationError(res...`,
  8621  		`func (m *Trial) validateA1(formats strfmt.Registry) error {`,
  8622  		`	if swag.IsZero(m.A1) {`,
  8623  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  8624  		`func (m *Trial) validateAdditionalProperties(formats strfmt.Registry) error {`,
  8625  		`	if swag.IsZero(m.AdditionalProperties) {`,
  8626  		`	if m.AdditionalProperties != nil {`,
  8627  		`		if err := m.AdditionalProperties.Validate(formats); err != nil {`,
  8628  		`			if ve, ok := err.(*errors.Validation); ok {`,
  8629  		`				return ve.ValidateName("additionalProperties"`,
  8630  		`type TrialAdditionalProperties struct {`,
  8631  		"	Discourse string `json:\"discourse,omitempty\"`",
  8632  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  8633  		"	TrialAdditionalPropertiesAdditionalProperties map[string]interface{} `json:\"-\"`",
  8634  		// empty validation
  8635  		"func (m *TrialAdditionalProperties) 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  	// load expectations for model: additional_transitive_refed_thing.go
  8644  	expandRun.AddExpectations("additional_transitive_refed_thing.go", []string{
  8645  		`type AdditionalTransitiveRefedThing struct {`,
  8646  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  8647  		"	AdditionalTransitiveRefedThing map[string][]*AdditionalTransitiveRefedThingItems0 `json:\"-\"`",
  8648  		`func (m *AdditionalTransitiveRefedThing) Validate(formats strfmt.Registry) error {`,
  8649  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  8650  		`	for k := range m.AdditionalTransitiveRefedThing {`,
  8651  		`		if err := validate.Required(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  8652  		`		if err := validate.UniqueItems(k, "body", m.AdditionalTransitiveRefedThing[k]); err != nil {`,
  8653  		`		for i := 0; i < len(m.AdditionalTransitiveRefedThing[k]); i++ {`,
  8654  		// do we need Required when item is nullable?
  8655  		// nullable not required:
  8656  		`			if swag.IsZero(m.AdditionalTransitiveRefedThing[k][i]) {`,
  8657  		// nullable required:
  8658  		//`			if err := validate.Required(k+"."+strconv.Itoa(i), "body", m.AdditionalTransitiveRefedThing[k][i]); err != nil {`,
  8659  		`			if m.AdditionalTransitiveRefedThing[k][i] != nil {`,
  8660  		`				if err := m.AdditionalTransitiveRefedThing[k][i].Validate(formats); err != nil {`,
  8661  		`					if ve, ok := err.(*errors.Validation); ok {`,
  8662  		`						return ve.ValidateName(k + "." + strconv.Itoa(i)`,
  8663  		`		return errors.CompositeValidationError(res...`,
  8664  		`func (m *AdditionalTransitiveRefedThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  8665  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  8666  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", int64(m.ThisOneNotRequired), 10, false); err != nil {`,
  8667  		`type AdditionalTransitiveRefedThingItems0 struct {`,
  8668  		"	ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`",
  8669  		"	AdditionalTransitiveRefedThingItems0 map[string]*AdditionalTransitiveRefedThingItems0Anon `json:\"-\"`",
  8670  		`func (m *AdditionalTransitiveRefedThingItems0) Validate(formats strfmt.Registry) error {`,
  8671  		`	if err := m.validateThisOneNotRequiredEither(formats); err != nil {`,
  8672  		`	for k := range m.AdditionalTransitiveRefedThingItems0 {`,
  8673  		`		if val, ok := m.AdditionalTransitiveRefedThingItems0[k]; ok {`,
  8674  		`			if val != nil {`,
  8675  		`				if err := val.Validate(formats); err != nil {`,
  8676  		`		return errors.CompositeValidationError(res...`,
  8677  		`func (m *AdditionalTransitiveRefedThingItems0) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`,
  8678  		`	if swag.IsZero(m.ThisOneNotRequiredEither) {`,
  8679  		`	if err := validate.MaximumInt("thisOneNotRequiredEither", "body", int64(m.ThisOneNotRequiredEither), 20, false); err != nil {`,
  8680  		`type AdditionalTransitiveRefedThingItems0Anon struct {`,
  8681  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  8682  		"	B1 strfmt.DateTime `json:\"b1,omitempty\"`",
  8683  		"	AdditionalTransitiveRefedThingItems0Anon map[string]*AdditionalTransitiveRefedThingItems0AnonAnon `json:\"-\"`",
  8684  		`func (m *AdditionalTransitiveRefedThingItems0Anon) Validate(formats strfmt.Registry) error {`,
  8685  		`	if err := m.validateA1(formats); err != nil {`,
  8686  		`	if err := m.validateB1(formats); err != nil {`,
  8687  		`	for k := range m.AdditionalTransitiveRefedThingItems0Anon {`,
  8688  		`		if val, ok := m.AdditionalTransitiveRefedThingItems0Anon[k]; ok {`,
  8689  		`			if val != nil {`,
  8690  		`				if err := val.Validate(formats); err != nil {`,
  8691  		`		return errors.CompositeValidationError(res...`,
  8692  		`func (m *AdditionalTransitiveRefedThingItems0Anon) validateA1(formats strfmt.Registry) error {`,
  8693  		`	if swag.IsZero(m.A1) {`,
  8694  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  8695  		`func (m *AdditionalTransitiveRefedThingItems0Anon) validateB1(formats strfmt.Registry) error {`,
  8696  		`	if swag.IsZero(m.B1) {`,
  8697  		`	if err := validate.FormatOf("b1", "body", "date-time", m.B1.String(), formats); err != nil {`,
  8698  		`type AdditionalTransitiveRefedThingItems0AnonAnon struct {`,
  8699  		"	Discourse string `json:\"discourse,omitempty\"`",
  8700  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  8701  		"	AdditionalTransitiveRefedThingItems0AnonAnonAdditionalProperties map[string]interface{} `json:\"-\"`",
  8702  		// empty validation
  8703  		"func (m *AdditionalTransitiveRefedThingItems0AnonAnon) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8704  	},
  8705  		// not expected
  8706  		todo,
  8707  		// output in log
  8708  		noLines,
  8709  		noLines)
  8710  
  8711  	// load expectations for model: additional_transitive_refed_object_thing.go
  8712  	expandRun.AddExpectations("additional_transitive_refed_object_thing.go", []string{
  8713  		`type AdditionalTransitiveRefedObjectThing struct {`,
  8714  		"	ThisOneNotRequired int64 `json:\"thisOneNotRequired,omitempty\"`",
  8715  		"	AdditionalTransitiveRefedObjectThing map[string]*AdditionalTransitiveRefedObjectThingAnon `json:\"-\"`",
  8716  		`func (m *AdditionalTransitiveRefedObjectThing) Validate(formats strfmt.Registry) error {`,
  8717  		`	if err := m.validateThisOneNotRequired(formats); err != nil {`,
  8718  		`	for k := range m.AdditionalTransitiveRefedObjectThing {`,
  8719  		`		if val, ok := m.AdditionalTransitiveRefedObjectThing[k]; ok {`,
  8720  		`			if val != nil {`,
  8721  		`				if err := val.Validate(formats); err != nil {`,
  8722  		`		return errors.CompositeValidationError(res...`,
  8723  		`func (m *AdditionalTransitiveRefedObjectThing) validateThisOneNotRequired(formats strfmt.Registry) error {`,
  8724  		`	if swag.IsZero(m.ThisOneNotRequired) {`,
  8725  		`	if err := validate.MaximumInt("thisOneNotRequired", "body", int64(m.ThisOneNotRequired), 10, false); err != nil {`,
  8726  		`type AdditionalTransitiveRefedObjectThingAnon struct {`,
  8727  		"	Prop1 *AdditionalTransitiveRefedObjectThingAnonProp1 `json:\"prop1,omitempty\"`",
  8728  		"	AdditionalTransitiveRefedObjectThingAnon map[string]*AdditionalTransitiveRefedObjectThingAnonAnon `json:\"-\"`",
  8729  		`func (m *AdditionalTransitiveRefedObjectThingAnon) Validate(formats strfmt.Registry) error {`,
  8730  		`	if err := m.validateProp1(formats); err != nil {`,
  8731  		`	for k := range m.AdditionalTransitiveRefedObjectThingAnon {`,
  8732  		`		if val, ok := m.AdditionalTransitiveRefedObjectThingAnon[k]; ok {`,
  8733  		`			if val != nil {`,
  8734  		`				if err := val.Validate(formats); err != nil {`,
  8735  		`		return errors.CompositeValidationError(res...`,
  8736  		`func (m *AdditionalTransitiveRefedObjectThingAnon) validateProp1(formats strfmt.Registry) error {`,
  8737  		`	if swag.IsZero(m.Prop1) {`,
  8738  		`	if m.Prop1 != nil {`,
  8739  		`		if err := m.Prop1.Validate(formats); err != nil {`,
  8740  		`			if ve, ok := err.(*errors.Validation); ok {`,
  8741  		`				return ve.ValidateName("prop1"`,
  8742  		`type AdditionalTransitiveRefedObjectThingAnonAnon struct {`,
  8743  		"	Discourse string `json:\"discourse,omitempty\"`",
  8744  		"	HoursSpent float64 `json:\"hoursSpent,omitempty\"`",
  8745  		"	AdditionalTransitiveRefedObjectThingAnonAnonAdditionalProperties map[string]interface{} `json:\"-\"`",
  8746  		`type AdditionalTransitiveRefedObjectThingAnonProp1 struct {`,
  8747  		"	ThisOneNotRequiredEither int64 `json:\"thisOneNotRequiredEither,omitempty\"`",
  8748  		"	AdditionalTransitiveRefedObjectThingAnonProp1 map[string]*AdditionalTransitiveRefedObjectThingAnonProp1Anon `json:\"-\"`",
  8749  		`func (m *AdditionalTransitiveRefedObjectThingAnonProp1) Validate(formats strfmt.Registry) error {`,
  8750  		`	if err := m.validateThisOneNotRequiredEither(formats); err != nil {`,
  8751  		`	for k := range m.AdditionalTransitiveRefedObjectThingAnonProp1 {`,
  8752  		`		if val, ok := m.AdditionalTransitiveRefedObjectThingAnonProp1[k]; ok {`,
  8753  		`			if val != nil {`,
  8754  		`				if err := val.Validate(formats); err != nil {`,
  8755  		`		return errors.CompositeValidationError(res...`,
  8756  		`func (m *AdditionalTransitiveRefedObjectThingAnonProp1) validateThisOneNotRequiredEither(formats strfmt.Registry) error {`,
  8757  		`	if swag.IsZero(m.ThisOneNotRequiredEither) {`,
  8758  		`	if err := validate.MaximumInt("prop1"+"."+"thisOneNotRequiredEither", "body", int64(m.ThisOneNotRequiredEither), 20, false); err != nil {`,
  8759  		`type AdditionalTransitiveRefedObjectThingAnonProp1Anon struct {`,
  8760  		"	A1 strfmt.DateTime `json:\"a1,omitempty\"`",
  8761  		"	B1 strfmt.Date `json:\"b1,omitempty\"`",
  8762  		"	AdditionalTransitiveRefedObjectThingAnonProp1AnonAdditionalProperties map[string]interface{} `json:\"-\"`",
  8763  		`func (m *AdditionalTransitiveRefedObjectThingAnonProp1Anon) Validate(formats strfmt.Registry) error {`,
  8764  		`	if err := m.validateA1(formats); err != nil {`,
  8765  		`	if err := m.validateB1(formats); err != nil {`,
  8766  		`		return errors.CompositeValidationError(res...`,
  8767  		`func (m *AdditionalTransitiveRefedObjectThingAnonProp1Anon) validateA1(formats strfmt.Registry) error {`,
  8768  		`	if swag.IsZero(m.A1) {`,
  8769  		`	if err := validate.FormatOf("a1", "body", "date-time", m.A1.String(), formats); err != nil {`,
  8770  		`func (m *AdditionalTransitiveRefedObjectThingAnonProp1Anon) validateB1(formats strfmt.Registry) error {`,
  8771  		`	if swag.IsZero(m.B1) {`,
  8772  		`	if err := validate.FormatOf("b1", "body", "date", m.B1.String(), formats); err != nil {`,
  8773  		// empty validation
  8774  		"func (m *AdditionalTransitiveRefedObjectThingAnonAnon) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8775  	},
  8776  		// not expected
  8777  		todo,
  8778  		// output in log
  8779  		noLines,
  8780  		noLines)
  8781  
  8782  }
  8783  
  8784  func initFixture1537() {
  8785  	// testing fixture-1537.yaml with flatten and expand (--skip-flatten)
  8786  	// TODO: expand
  8787  
  8788  	/*
  8789  	   repro issue 1537
  8790  	*/
  8791  
  8792  	f := newModelFixture("../fixtures/bugs/1537/fixture-1537.yaml", "param body required with array of objects")
  8793  	thisRun := f.AddRun(false)
  8794  
  8795  	// load expectations for model: profile_array.go
  8796  	thisRun.AddExpectations("profile_array.go", []string{
  8797  		`type ProfileArray struct {`,
  8798  		"	ProfileCfg []*ProfileCfg `json:\"profileCfg\"`",
  8799  		`func (m *ProfileArray) Validate(formats strfmt.Registry) error {`,
  8800  		`	if err := m.validateProfileCfg(formats); err != nil {`,
  8801  		`		return errors.CompositeValidationError(res...`,
  8802  		`func (m *ProfileArray) validateProfileCfg(formats strfmt.Registry) error {`,
  8803  		`	if err := validate.Required("profileCfg", "body", m.ProfileCfg); err != nil {`,
  8804  		`	for i := 0; i < len(m.ProfileCfg); i++ {`,
  8805  		// do we need Required when item is nullable?
  8806  		// nullable not required:
  8807  		`		if swag.IsZero(m.ProfileCfg[i]) {`,
  8808  		// nullable required:
  8809  		//`if err := validate.Required("profileCfg"+"."+strconv.Itoa(i), "body", m.ProfileCfg[i]); err != nil {`,
  8810  		`		if m.ProfileCfg[i] != nil {`,
  8811  		`			if err := m.ProfileCfg[i].Validate(formats); err != nil {`,
  8812  		`				if ve, ok := err.(*errors.Validation); ok {`,
  8813  		`					return ve.ValidateName("profileCfg" + "." + strconv.Itoa(i)`,
  8814  	},
  8815  		// not expected
  8816  		todo,
  8817  		// output in log
  8818  		noLines,
  8819  		noLines)
  8820  
  8821  	// load expectations for model: profile.go
  8822  	thisRun.AddExpectations("profile.go", []string{
  8823  		`type Profile struct {`,
  8824  		"	ProfileCfg ProfileCfgs `json:\"profileCfg,omitempty\"`",
  8825  		`func (m *Profile) Validate(formats strfmt.Registry) error {`,
  8826  		`	if err := m.validateProfileCfg(formats); err != nil {`,
  8827  		`		return errors.CompositeValidationError(res...`,
  8828  		`func (m *Profile) validateProfileCfg(formats strfmt.Registry) error {`,
  8829  		`	if swag.IsZero(m.ProfileCfg) {`,
  8830  		`	if err := m.ProfileCfg.Validate(formats); err != nil {`,
  8831  		`		if ve, ok := err.(*errors.Validation); ok {`,
  8832  		`			return ve.ValidateName("profileCfg"`,
  8833  	},
  8834  		// not expected
  8835  		todo,
  8836  		// output in log
  8837  		noLines,
  8838  		noLines)
  8839  
  8840  	// load expectations for model: profile_cfgs.go
  8841  	thisRun.AddExpectations("profile_cfgs.go", []string{
  8842  		`type ProfileCfgs []*ProfileCfg`,
  8843  		`func (m ProfileCfgs) Validate(formats strfmt.Registry) error {`,
  8844  		`	for i := 0; i < len(m); i++ {`,
  8845  		// do we need Required when item is nullable?
  8846  		// nullable not required:
  8847  		`		if swag.IsZero(m[i]) {`,
  8848  		// nullable required:
  8849  		//`if err := validate.Required(strconv.Itoa(i), "body", m[i]); err != nil {`,
  8850  		`		if m[i] != nil {`,
  8851  		`			if err := m[i].Validate(formats); err != nil {`,
  8852  		`				if ve, ok := err.(*errors.Validation); ok {`,
  8853  		`					return ve.ValidateName(strconv.Itoa(i)`,
  8854  		`		return errors.CompositeValidationError(res...`,
  8855  	},
  8856  		// not expected
  8857  		todo,
  8858  		// output in log
  8859  		noLines,
  8860  		noLines)
  8861  
  8862  	// load expectations for model: profile_cfg.go
  8863  	thisRun.AddExpectations("profile_cfg.go", []string{
  8864  		`type ProfileCfg struct {`,
  8865  		"	Value1 int32 `json:\"value1,omitempty\"`",
  8866  		"	Value2 int32 `json:\"value2,omitempty\"`",
  8867  		// empty validation
  8868  		"func (m *ProfileCfg) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8869  	},
  8870  		// not expected
  8871  		todo,
  8872  		// output in log
  8873  		noLines,
  8874  		noLines)
  8875  
  8876  	// load expectations for model: profile_required.go
  8877  	thisRun.AddExpectations("profile_required.go", []string{
  8878  		`type ProfileRequired struct {`,
  8879  		"	ProfileCfg ProfileCfgs `json:\"profileCfg\"`",
  8880  		`func (m *ProfileRequired) Validate(formats strfmt.Registry) error {`,
  8881  		`	if err := m.validateProfileCfg(formats); err != nil {`,
  8882  		`		return errors.CompositeValidationError(res...`,
  8883  		`func (m *ProfileRequired) validateProfileCfg(formats strfmt.Registry) error {`,
  8884  		`	if err := validate.Required("profileCfg", "body", m.ProfileCfg); err != nil {`,
  8885  		`	if err := m.ProfileCfg.Validate(formats); err != nil {`,
  8886  		`		if ve, ok := err.(*errors.Validation); ok {`,
  8887  		`			return ve.ValidateName("profileCfg"`,
  8888  	},
  8889  		// not expected
  8890  		todo,
  8891  		// output in log
  8892  		noLines,
  8893  		noLines)
  8894  
  8895  }
  8896  
  8897  func initFixture1537v2() {
  8898  	// testing fixture-1537-2.yaml with flatten and expand (--skip-flatten)
  8899  	// TODO: expand
  8900  
  8901  	/*
  8902  	   repro issue 1537, with aliased items
  8903  	*/
  8904  
  8905  	f := newModelFixture("../fixtures/bugs/1537/fixture-1537-2.yaml", "param body required with array of aliased items")
  8906  	thisRun := f.AddRun(false)
  8907  
  8908  	// load expectations for model: profiles.go
  8909  	thisRun.AddExpectations("profiles.go", []string{
  8910  		`type Profiles []ProfileCfgs`,
  8911  		`func (m Profiles) Validate(formats strfmt.Registry) error {`,
  8912  		`	for i := 0; i < len(m); i++ {`,
  8913  		`		if err := m[i].Validate(formats); err != nil {`,
  8914  		`			if ve, ok := err.(*errors.Validation); ok {`,
  8915  		`				return ve.ValidateName(strconv.Itoa(i)`,
  8916  		`		return errors.CompositeValidationError(res...`,
  8917  	},
  8918  		// not expected
  8919  		todo,
  8920  		// output in log
  8921  		noLines,
  8922  		noLines)
  8923  
  8924  	// load expectations for model: profile_cfgs_no_validation.go
  8925  	thisRun.AddExpectations("profile_cfgs_no_validation.go", []string{
  8926  		`type ProfileCfgsNoValidation []*ProfileCfg`,
  8927  		`func (m ProfileCfgsNoValidation) Validate(formats strfmt.Registry) error {`,
  8928  		`	for i := 0; i < len(m); i++ {`,
  8929  		// do we need Required when item is nullable?
  8930  		// nullable not required:
  8931  		`		if swag.IsZero(m[i]) {`,
  8932  		// nullable required:
  8933  		//`		if err := validate.Required(strconv.Itoa(i), "body", m[i]); err != nil {`,
  8934  		`		if m[i] != nil {`,
  8935  		`			if err := m[i].Validate(formats); err != nil {`,
  8936  		`				if ve, ok := err.(*errors.Validation); ok {`,
  8937  		`					return ve.ValidateName(strconv.Itoa(i)`,
  8938  		`		return errors.CompositeValidationError(res...`,
  8939  	},
  8940  		// not expected
  8941  		todo,
  8942  		// output in log
  8943  		noLines,
  8944  		noLines)
  8945  
  8946  	// load expectations for model: profile_cfgs.go
  8947  	thisRun.AddExpectations("profile_cfgs.go", []string{
  8948  		`type ProfileCfgs []*ProfileCfg`,
  8949  		`func (m ProfileCfgs) Validate(formats strfmt.Registry) error {`,
  8950  		`	iProfileCfgsSize := int64(len(m)`,
  8951  		`	if err := validate.MaxItems("", "body", iProfileCfgsSize, 10); err != nil {`,
  8952  		`	for i := 0; i < len(m); i++ {`,
  8953  		// do we need Required when item is nullable?
  8954  		// nullable not required:
  8955  		`		if swag.IsZero(m[i]) {`,
  8956  		// nullable required:
  8957  		//`		if err := validate.Required(strconv.Itoa(i), "body", m[i]); err != nil {`,
  8958  		`		if m[i] != nil {`,
  8959  		`			if err := m[i].Validate(formats); err != nil {`,
  8960  		`				if ve, ok := err.(*errors.Validation); ok {`,
  8961  		`					return ve.ValidateName(strconv.Itoa(i)`,
  8962  		`		return errors.CompositeValidationError(res...`,
  8963  	},
  8964  		// not expected
  8965  		todo,
  8966  		// output in log
  8967  		noLines,
  8968  		noLines)
  8969  
  8970  	// load expectations for model: profile_cfg.go
  8971  	thisRun.AddExpectations("profile_cfg.go", []string{
  8972  		`type ProfileCfg struct {`,
  8973  		"	Value1 int32 `json:\"value1,omitempty\"`",
  8974  		"	Value2 int32 `json:\"value2,omitempty\"`",
  8975  		// empty validation
  8976  		"func (m *ProfileCfg) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  8977  	},
  8978  		// not expected
  8979  		todo,
  8980  		// output in log
  8981  		noLines,
  8982  		noLines)
  8983  
  8984  	// load expectations for model: profiles_no_validation.go
  8985  	thisRun.AddExpectations("profiles_no_validation.go", []string{
  8986  		`type ProfilesNoValidation []ProfileCfgsNoValidation`,
  8987  		`func (m ProfilesNoValidation) Validate(formats strfmt.Registry) error {`,
  8988  		`	for i := 0; i < len(m); i++ {`,
  8989  		`		if err := m[i].Validate(formats); err != nil {`,
  8990  		`			if ve, ok := err.(*errors.Validation); ok {`,
  8991  		`				return ve.ValidateName(strconv.Itoa(i)`,
  8992  		`		return errors.CompositeValidationError(res...`,
  8993  	},
  8994  		// not expected
  8995  		todo,
  8996  		// output in log
  8997  		noLines,
  8998  		noLines)
  8999  
  9000  }
  9001  
  9002  func initFixture15365() {
  9003  	// testing fixture-1536-5.yaml with flatten but NOT expand (--skip-flatten)
  9004  
  9005  	f := newModelFixture("../fixtures/bugs/1536/fixture-1536-5.yaml", "param body with maps")
  9006  	thisRun := f.AddRun(false)
  9007  
  9008  	// load expectations for model: model_array_of_nullable.go
  9009  	thisRun.AddExpectations("model_array_of_nullable.go", []string{
  9010  		`type ModelArrayOfNullable []*int64`,
  9011  		`func (m ModelArrayOfNullable) Validate(formats strfmt.Registry) error {`,
  9012  		`	for i := 0; i < len(m); i++ {`,
  9013  		// do we need Required when item is nullable?
  9014  		// nullable not required:
  9015  		`		if swag.IsZero(m[i]) {`,
  9016  		// nullable required:
  9017  		//`		if err := validate.Required(strconv.Itoa(i), "body", m[i]); err != nil {`,
  9018  		`		if err := validate.MinimumInt(strconv.Itoa(i), "body", int64(*m[i]), 0, false); err != nil {`,
  9019  		`		return errors.CompositeValidationError(res...`,
  9020  	},
  9021  		// not expected
  9022  		todo,
  9023  		// output in log
  9024  		noLines,
  9025  		noLines)
  9026  
  9027  	// load expectations for model: model_map_of_nullable_primitive.go
  9028  	thisRun.AddExpectations("model_map_of_nullable_primitive.go", []string{
  9029  		`type ModelMapOfNullablePrimitive map[string]*int64`,
  9030  		`func (m ModelMapOfNullablePrimitive) Validate(formats strfmt.Registry) error {`,
  9031  		`	for k := range m {`,
  9032  		// do we need Required when element is nullable?
  9033  		// nullable not required:
  9034  		`		if swag.IsZero(m[k]) {`,
  9035  		`		if err := validate.MinimumInt(k, "body", int64(*m[k]), 0, false); err != nil {`,
  9036  		`		return errors.CompositeValidationError(res...`,
  9037  	},
  9038  		// not expected
  9039  		todo,
  9040  		// output in log
  9041  		noLines,
  9042  		noLines)
  9043  
  9044  	// load expectations for model: model_array_with_max.go
  9045  	thisRun.AddExpectations("model_array_with_max.go", []string{
  9046  		`type ModelArrayWithMax []interface{`,
  9047  		`func (m ModelArrayWithMax) Validate(formats strfmt.Registry) error {`,
  9048  		`	iModelArrayWithMaxSize := int64(len(m)`,
  9049  		`	if err := validate.MaxItems("", "body", iModelArrayWithMaxSize, 10); err != nil {`,
  9050  		`		return errors.CompositeValidationError(res...`,
  9051  	},
  9052  		// not expected
  9053  		todo,
  9054  		// output in log
  9055  		noLines,
  9056  		noLines)
  9057  
  9058  	// load expectations for model: model_array_of_x_nullable.go
  9059  	thisRun.AddExpectations("model_array_of_x_nullable.go", []string{
  9060  		`type ModelArrayOfXNullable []*int64`,
  9061  		// do we need Required when item is nullable?
  9062  		// nullable not required:
  9063  		"func (m ModelArrayOfXNullable) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  9064  		// nullable required:
  9065  		//`func (m ModelArrayOfXNullable) Validate(formats strfmt.Registry) error {`,
  9066  		//`func (m ModelArrayOfXNullable) Validate(formats strfmt.Registry) error {`,
  9067  		//`for i := 0; i < len(m); i++ {`,
  9068  		//`	if swag.IsZero(m[k]) {`,
  9069  		//`	if err := validate.Required(strconv.Itoa(i), "body", m[i]); err != nil {`,
  9070  	},
  9071  		// not expected
  9072  		todo,
  9073  		// output in log
  9074  		noLines,
  9075  		noLines)
  9076  
  9077  	// load expectations for model: model_array_of_nullable_format.go
  9078  	thisRun.AddExpectations("model_array_of_nullable_format.go", []string{
  9079  		`type ModelArrayOfNullableFormat []*strfmt.UUID`,
  9080  		`func (m ModelArrayOfNullableFormat) Validate(formats strfmt.Registry) error {`,
  9081  		`	for i := 0; i < len(m); i++ {`,
  9082  		// do we need Required when item is nullable?
  9083  		// nullable not required:
  9084  		`		if swag.IsZero(m[i]) {`,
  9085  		// nullable required:
  9086  		//`		if err := validate.Required(strconv.Itoa(i), "body", m[i]); err != nil {`,
  9087  		`		if err := validate.FormatOf(strconv.Itoa(i), "body", "uuid", m[i].String(), formats); err != nil {`,
  9088  		`		return errors.CompositeValidationError(res...`,
  9089  	},
  9090  		// not expected
  9091  		todo,
  9092  		// output in log
  9093  		noLines,
  9094  		noLines)
  9095  
  9096  	// load expectations for model: model_map_of_of_slice_of_nullable_primitive.go
  9097  	thisRun.AddExpectations("model_map_of_of_slice_of_nullable_primitive.go", []string{
  9098  		`type ModelMapOfOfSliceOfNullablePrimitive map[string][]*int64`,
  9099  		`func (m ModelMapOfOfSliceOfNullablePrimitive) Validate(formats strfmt.Registry) error {`,
  9100  		`	for k := range m {`,
  9101  		// do we need Required when element is nullable?
  9102  		// nullable not required:
  9103  		//`		if swag.IsZero(m[k]) {`,
  9104  		`		for i := 0; i < len(m[k]); i++ {`,
  9105  		// do we need Required when item is nullable?
  9106  		// nullable not required:
  9107  		//`			if swag.IsZero(m[k][i]) {`,
  9108  		`			if err := validate.MinimumInt(k+"."+strconv.Itoa(i), "body", int64(*m[k][i]), 0, false); err != nil {`,
  9109  		`		return errors.CompositeValidationError(res...`,
  9110  	},
  9111  		// not expected
  9112  		todo,
  9113  		// output in log
  9114  		noLines,
  9115  		noLines)
  9116  
  9117  	// load expectations for model: model_map_of_ref.go
  9118  	thisRun.AddExpectations("model_map_of_ref.go", []string{
  9119  		`type ModelMapOfRef map[string]ModelArrayWithMax`,
  9120  		`func (m ModelMapOfRef) Validate(formats strfmt.Registry) error {`,
  9121  		`	for k := range m {`,
  9122  		//`		if swag.IsZero(m[k]) {`,
  9123  		`		if err := m[k].Validate(formats); err != nil {`,
  9124  		`			if ve, ok := err.(*errors.Validation); ok {`,
  9125  		`				return ve.ValidateName(k`,
  9126  		`		return errors.CompositeValidationError(res...`,
  9127  	},
  9128  		// not expected
  9129  		todo,
  9130  		// output in log
  9131  		noLines,
  9132  		noLines)
  9133  
  9134  	// load expectations for model: model_array_of_format.go
  9135  	thisRun.AddExpectations("model_array_of_format.go", []string{
  9136  		`type ModelArrayOfFormat []strfmt.UUID`,
  9137  		`func (m ModelArrayOfFormat) Validate(formats strfmt.Registry) error {`,
  9138  		`	for i := 0; i < len(m); i++ {`,
  9139  		`		if err := validate.FormatOf(strconv.Itoa(i), "body", "uuid", m[i].String(), formats); err != nil {`,
  9140  		`		return errors.CompositeValidationError(res...`,
  9141  	},
  9142  		// not expected
  9143  		todo,
  9144  		// output in log
  9145  		noLines,
  9146  		noLines)
  9147  
  9148  	// load expectations for model: model_array_of_ref_no_validations.go
  9149  	thisRun.AddExpectations("model_array_of_ref_no_validations.go", []string{
  9150  		`type ModelArrayOfRefNoValidations []ModelInterface`,
  9151  		// empty validation
  9152  		"func (m ModelArrayOfRefNoValidations) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  9153  	},
  9154  		// not expected
  9155  		todo,
  9156  		// output in log
  9157  		noLines,
  9158  		noLines)
  9159  
  9160  	// load expectations for model: model_array_of_not_nullable.go
  9161  	thisRun.AddExpectations("model_array_of_not_nullable.go", []string{
  9162  		`type ModelArrayOfNotNullable []int64`,
  9163  		`func (m ModelArrayOfNotNullable) Validate(formats strfmt.Registry) error {`,
  9164  		`	for i := 0; i < len(m); i++ {`,
  9165  		`		if err := validate.MinimumInt(strconv.Itoa(i), "body", int64(m[i]), 10, false); err != nil {`,
  9166  		`		return errors.CompositeValidationError(res...`,
  9167  	},
  9168  		// not expected
  9169  		todo,
  9170  		// output in log
  9171  		noLines,
  9172  		noLines)
  9173  
  9174  	// load expectations for model: model_array_of_nullable_string.go
  9175  	thisRun.AddExpectations("model_array_of_nullable_string.go", []string{
  9176  		`type ModelArrayOfNullableString []*string`,
  9177  		// do we need Required when item is nullable?
  9178  		// nullable not required:
  9179  		// empty validation
  9180  		"func (m ModelArrayOfNullableString) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  9181  		// nullable required:
  9182  		//`func (m ModelArrayOfNullableString) Validate(formats strfmt.Registry) error {`,
  9183  		//`for i := 0; i < len(m); i++ {`,
  9184  		//`	if err := validate.Required(strconv.Itoa(i), "body", m[i]); err != nil {`,
  9185  	},
  9186  		// not expected
  9187  		todo,
  9188  		// output in log
  9189  		noLines,
  9190  		noLines)
  9191  
  9192  	// load expectations for model: model_map_of_x_nullable_primitive.go
  9193  	thisRun.AddExpectations("model_map_of_x_nullable_primitive.go", []string{
  9194  		`type ModelMapOfXNullablePrimitive map[string]*int64`,
  9195  		`func (m ModelMapOfXNullablePrimitive) Validate(formats strfmt.Registry) error {`,
  9196  		`	for k := range m {`,
  9197  		// do we need...?
  9198  		`		if swag.IsZero(m[k]) {`,
  9199  		`		if err := validate.MinimumInt(k, "body", int64(*m[k]), 100, false); err != nil {`,
  9200  		`		return errors.CompositeValidationError(res...`,
  9201  	},
  9202  		// not expected
  9203  		todo,
  9204  		// output in log
  9205  		noLines,
  9206  		noLines)
  9207  
  9208  	// load expectations for model: model_array_of_not_nullable_string.go
  9209  	thisRun.AddExpectations("model_array_of_not_nullable_string.go", []string{
  9210  		`type ModelArrayOfNotNullableString []string`,
  9211  		// empty validation
  9212  		"func (m ModelArrayOfNotNullableString) Validate(formats strfmt.Registry) error {\n	return nil\n}",
  9213  	},
  9214  		// not expected
  9215  		todo,
  9216  		// output in log
  9217  		noLines,
  9218  		noLines)
  9219  
  9220  	// load expectations for model: model_array_of_ref_slice_validations.go
  9221  	thisRun.AddExpectations("model_array_of_ref_slice_validations.go", []string{
  9222  		`type ModelArrayOfRefSliceValidations []ModelInterface`,
  9223  		`func (m ModelArrayOfRefSliceValidations) Validate(formats strfmt.Registry) error {`,
  9224  		`	iModelArrayOfRefSliceValidationsSize := int64(len(m)`,
  9225  		`	if err := validate.MaxItems("", "body", iModelArrayOfRefSliceValidationsSize, 10); err != nil {`,
  9226  		`		return errors.CompositeValidationError(res...`,
  9227  	},
  9228  		// not expected
  9229  		todo,
  9230  		// output in log
  9231  		noLines,
  9232  		noLines)
  9233  
  9234  	// load expectations for model: model_interface.go
  9235  	thisRun.AddExpectations("model_interface.go", []string{
  9236  		`type ModelInterface interface{`,
  9237  	},
  9238  		// not expected
  9239  		todo,
  9240  		// output in log
  9241  		noLines,
  9242  		noLines)
  9243  
  9244  	// load expectations for model: model_array_of_ref.go
  9245  	thisRun.AddExpectations("model_array_of_ref.go", []string{
  9246  		`type ModelArrayOfRef []ModelArrayOfXNullable`,
  9247  		`func (m ModelArrayOfRef) Validate(formats strfmt.Registry) error {`,
  9248  		`	for i := 0; i < len(m); i++ {`,
  9249  		`		if err := m[i].Validate(formats); err != nil {`,
  9250  		`			if ve, ok := err.(*errors.Validation); ok {`,
  9251  		`				return ve.ValidateName(strconv.Itoa(i)`,
  9252  		`		return errors.CompositeValidationError(res...`,
  9253  	},
  9254  		// not expected
  9255  		todo,
  9256  		// output in log
  9257  		noLines,
  9258  		noLines)
  9259  }
  9260  
  9261  func initFixture1548() {
  9262  	// testing fixture-1548.yaml with flatten
  9263  
  9264  	/*
  9265  		My App API: check that there is no format validation on Base64 types
  9266  	*/
  9267  
  9268  	f := newModelFixture("../fixtures/bugs/1548/fixture-1548.yaml", "My App API")
  9269  	thisRun := f.AddRun(false)
  9270  
  9271  	// load expectations for model: base64_alias.go
  9272  	thisRun.AddExpectations("base64_alias.go", []string{
  9273  		`type Base64Alias strfmt.Base64`,
  9274  		`func (m *Base64Alias) UnmarshalJSON(b []byte) error {`,
  9275  		`	return ((*strfmt.Base64)(m)).UnmarshalJSON(b`,
  9276  		`func (m Base64Alias) MarshalJSON() ([]byte, error) {`,
  9277  		`	return (strfmt.Base64(m)).MarshalJSON(`,
  9278  		`func (m Base64Alias) Validate(formats strfmt.Registry) error {`,
  9279  		`		return errors.CompositeValidationError(res...`,
  9280  	},
  9281  		// not expected
  9282  		[]string{"TODO", "validate.FormatOf("},
  9283  		// output in log
  9284  		noLines,
  9285  		noLines)
  9286  
  9287  	// load expectations for model: base64_map.go
  9288  	thisRun.AddExpectations("base64_map.go", []string{
  9289  		`type Base64Map map[string]strfmt.Base64`,
  9290  		`func (m Base64Map) Validate(formats strfmt.Registry) error {`,
  9291  		`	for k := range m {`,
  9292  		`		if err := validate.MaxLength(k, "body", string(m[k]), 100); err != nil {`,
  9293  		`		return errors.CompositeValidationError(res...`,
  9294  	},
  9295  		// not expected
  9296  		[]string{"TODO", "validate.FormatOf("},
  9297  		// output in log
  9298  		noLines,
  9299  		noLines)
  9300  
  9301  	// load expectations for model: base64_array.go
  9302  	thisRun.AddExpectations("base64_array.go", []string{
  9303  		`type Base64Array []strfmt.Base64`,
  9304  		`func (m Base64Array) Validate(formats strfmt.Registry) error {`,
  9305  		`	for i := 0; i < len(m); i++ {`,
  9306  		`		return errors.CompositeValidationError(res...`,
  9307  	},
  9308  		// not expected
  9309  		[]string{"TODO", "validate.FormatOf("},
  9310  		// output in log
  9311  		noLines,
  9312  		noLines)
  9313  
  9314  	// load expectations for model: base64_model.go
  9315  	thisRun.AddExpectations("base64_model.go", []string{
  9316  		`type Base64Model struct {`,
  9317  		"	Prop1 strfmt.Base64 `json:\"prop1,omitempty\"`",
  9318  		`func (m *Base64Model) Validate(formats strfmt.Registry) error {`,
  9319  		`	if err := m.validateProp1(formats); err != nil {`,
  9320  		`		return errors.CompositeValidationError(res...`,
  9321  		`func (m *Base64Model) validateProp1(formats strfmt.Registry) error {`,
  9322  		`	if swag.IsZero(m.Prop1) {`,
  9323  	},
  9324  		// not expected
  9325  		[]string{"TODO", "validate.FormatOf("},
  9326  		// output in log
  9327  		noLines,
  9328  		noLines)
  9329  }
  9330  
  9331  func initFixtureSimpleTuple() {
  9332  	// testing fixture-simple-tuple.yaml with flatten
  9333  
  9334  	/*
  9335  	   A basic test of for serialization generation for tuples and additionalItems.
  9336  
  9337  	*/
  9338  	f := newModelFixture("../fixtures/bugs/1571/fixture-simple-tuple.yaml", "fixture for serializing tuples")
  9339  	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
  9340  	expandRun := f.AddRun(true)
  9341  
  9342  	// load expectations for model: tuple_thing_with_map_element.go
  9343  	flattenRun.AddExpectations("tuple_thing_with_map_element.go", []string{
  9344  		`type TupleThingWithMapElement struct {`,
  9345  		"	P0 map[string]string `json:\"-\"`",
  9346  		"	P1 map[string]int64 `json:\"-\"`",
  9347  		"	TupleThingWithMapElementItems []map[string]strfmt.Date `json:\"-\"`",
  9348  		`func (m *TupleThingWithMapElement) UnmarshalJSON(raw []byte) error {`,
  9349  		`	var stage1 []json.RawMessage`,
  9350  		`	buf := bytes.NewBuffer(raw`,
  9351  		`	dec := json.NewDecoder(buf`,
  9352  		`	dec.UseNumber(`,
  9353  		`	if err := dec.Decode(&stage1); err != nil {`,
  9354  		`	var lastIndex int`,
  9355  		`	if len(stage1) > 0 {`,
  9356  		`		var dataP0 map[string]string`,
  9357  		`		buf = bytes.NewBuffer(stage1[0]`,
  9358  		`		dec := json.NewDecoder(buf`,
  9359  		`		dec.UseNumber(`,
  9360  		`		if err := dec.Decode(&dataP0); err != nil {`,
  9361  		`		m.P0 = dataP0`,
  9362  		`		lastIndex = 0`,
  9363  		`	if len(stage1) > 1 {`,
  9364  		`		var dataP1 map[string]int64`,
  9365  		`		buf = bytes.NewBuffer(stage1[1]`,
  9366  		`		dec := json.NewDecoder(buf`,
  9367  		`		dec.UseNumber(`,
  9368  		`		if err := dec.Decode(&dataP1); err != nil {`,
  9369  		`		m.P1 = dataP1`,
  9370  		`		lastIndex = 1`,
  9371  		`	if len(stage1) > lastIndex+1 {`,
  9372  		`		for _, val := range stage1[lastIndex+1:] {`,
  9373  		`			var toadd map[string]strfmt.Date`,
  9374  		`			buf = bytes.NewBuffer(val`,
  9375  		`			dec := json.NewDecoder(buf`,
  9376  		`			dec.UseNumber(`,
  9377  		`			if err := dec.Decode(&toadd); err != nil {`,
  9378  		`			m.TupleThingWithMapElementItems = append(m.TupleThingWithMapElementItems, toadd`,
  9379  		`func (m TupleThingWithMapElement) MarshalJSON() ([]byte, error) {`,
  9380  		`	data := []interface{}{`,
  9381  		`		m.P0,`,
  9382  		`		m.P1,`,
  9383  		`	for _, v := range m.TupleThingWithMapElementItems {`,
  9384  		`		data = append(data, v`,
  9385  		`	return json.Marshal(data`,
  9386  		`func (m *TupleThingWithMapElement) Validate(formats strfmt.Registry) error {`,
  9387  		`	if err := m.validateP0(formats); err != nil {`,
  9388  		`	if err := m.validateP1(formats); err != nil {`,
  9389  		`	if err := m.validateTupleThingWithMapElementItems(formats); err != nil {`,
  9390  		`		return errors.CompositeValidationError(res...`,
  9391  		`func (m *TupleThingWithMapElement) validateP0(formats strfmt.Registry) error {`,
  9392  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  9393  		`	for k := range m.P0 {`,
  9394  		`		if err := validate.MaxLength("0"+"."+k, "body", string(m.P0[k]), 10); err != nil {`,
  9395  		`func (m *TupleThingWithMapElement) validateP1(formats strfmt.Registry) error {`,
  9396  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  9397  		`	for k := range m.P1 {`,
  9398  		`		if err := validate.MinimumInt("1"+"."+k, "body", int64(m.P1[k]), 10, false); err != nil {`,
  9399  		`func (m *TupleThingWithMapElement) validateTupleThingWithMapElementItems(formats strfmt.Registry) error {`,
  9400  		`	for i := range m.TupleThingWithMapElementItems {`,
  9401  		`		for k := range m.TupleThingWithMapElementItems[i] {`,
  9402  		`			if err := validate.FormatOf(strconv.Itoa(i+2)+"."+k, "body", "date", ` +
  9403  			`m.TupleThingWithMapElementItems[i][k].String(), formats); err != nil {`,
  9404  	},
  9405  		// not expected
  9406  		todo,
  9407  		// output in log
  9408  		noLines,
  9409  		noLines)
  9410  
  9411  	expandRun.AddExpectations("tuple_thing_with_map_element.go",
  9412  		flattenRun.ExpectedFor("TupleThingWithMapElement").ExpectedLines, todo, noLines, noLines)
  9413  
  9414  	// load expectations for model: true_tuple_thing.go
  9415  	flattenRun.AddExpectations("true_tuple_thing.go", []string{
  9416  		`type TrueTupleThing struct {`,
  9417  		"	P0 *float64 `json:\"-\"`",
  9418  		"	P1 *string `json:\"-\"`",
  9419  		"	TrueTupleThingItems []interface{} `json:\"-\"`",
  9420  		`func (m *TrueTupleThing) UnmarshalJSON(raw []byte) error {`,
  9421  		`	var stage1 []json.RawMessage`,
  9422  		`	buf := bytes.NewBuffer(raw`,
  9423  		`	dec := json.NewDecoder(buf`,
  9424  		`	dec.UseNumber(`,
  9425  		`	if err := dec.Decode(&stage1); err != nil {`,
  9426  		`	var lastIndex int`,
  9427  		`	if len(stage1) > 0 {`,
  9428  		`		var dataP0 float64`,
  9429  		`		buf = bytes.NewBuffer(stage1[0]`,
  9430  		`		dec := json.NewDecoder(buf`,
  9431  		`		dec.UseNumber(`,
  9432  		`		if err := dec.Decode(&dataP0); err != nil {`,
  9433  		`		m.P0 = &dataP0`,
  9434  		`		lastIndex = 0`,
  9435  		`	if len(stage1) > 1 {`,
  9436  		`		var dataP1 string`,
  9437  		`		buf = bytes.NewBuffer(stage1[1]`,
  9438  		`		dec := json.NewDecoder(buf`,
  9439  		`		dec.UseNumber(`,
  9440  		`		if err := dec.Decode(&dataP1); err != nil {`,
  9441  		`		m.P1 = &dataP1`,
  9442  		`		lastIndex = 1`,
  9443  		`	if len(stage1) > lastIndex+1 {`,
  9444  		`		for _, val := range stage1[lastIndex+1:] {`,
  9445  		`			var toadd interface{`,
  9446  		`			buf = bytes.NewBuffer(val`,
  9447  		`			dec := json.NewDecoder(buf`,
  9448  		`			dec.UseNumber(`,
  9449  		`			if err := dec.Decode(&toadd); err != nil {`,
  9450  		`			m.TrueTupleThingItems = append(m.TrueTupleThingItems, toadd`,
  9451  		`func (m TrueTupleThing) MarshalJSON() ([]byte, error) {`,
  9452  		`	data := []interface{}{`,
  9453  		`		m.P0,`,
  9454  		`		m.P1,`,
  9455  		`	for _, v := range m.TrueTupleThingItems {`,
  9456  		`		data = append(data, v`,
  9457  		`	return json.Marshal(data`,
  9458  		`func (m *TrueTupleThing) Validate(formats strfmt.Registry) error {`,
  9459  		`	if err := m.validateP0(formats); err != nil {`,
  9460  		`	if err := m.validateP1(formats); err != nil {`,
  9461  		`	if err := m.validateTrueTupleThingItems(formats); err != nil {`,
  9462  		`		return errors.CompositeValidationError(res...`,
  9463  		`func (m *TrueTupleThing) validateP0(formats strfmt.Registry) error {`,
  9464  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  9465  		`func (m *TrueTupleThing) validateP1(formats strfmt.Registry) error {`,
  9466  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  9467  		`func (m *TrueTupleThing) validateTrueTupleThingItems(formats strfmt.Registry) error {`,
  9468  	},
  9469  		// not expected
  9470  		todo,
  9471  		// output in log
  9472  		noLines,
  9473  		noLines)
  9474  
  9475  	expandRun.AddExpectations("true_tuple_thing.go",
  9476  		flattenRun.ExpectedFor("TrueTupleThing").ExpectedLines, todo, noLines, noLines)
  9477  
  9478  	// load expectations for model: false_tuple_thing.go
  9479  	flattenRun.AddExpectations("false_tuple_thing.go", []string{
  9480  		`type FalseTupleThing struct {`,
  9481  		"	P0 *float64 `json:\"-\"`",
  9482  		"	P1 *string `json:\"-\"`",
  9483  		`func (m *FalseTupleThing) UnmarshalJSON(raw []byte) error {`,
  9484  		`	var stage1 []json.RawMessage`,
  9485  		`	buf := bytes.NewBuffer(raw`,
  9486  		`	dec := json.NewDecoder(buf`,
  9487  		`	dec.UseNumber(`,
  9488  		`	if err := dec.Decode(&stage1); err != nil {`,
  9489  		`	if len(stage1) > 0 {`,
  9490  		`		var dataP0 float64`,
  9491  		`		buf = bytes.NewBuffer(stage1[0]`,
  9492  		`		dec := json.NewDecoder(buf`,
  9493  		`		dec.UseNumber(`,
  9494  		`		if err := dec.Decode(&dataP0); err != nil {`,
  9495  		`		m.P0 = &dataP0`,
  9496  		`	if len(stage1) > 1 {`,
  9497  		`		var dataP1 string`,
  9498  		`		buf = bytes.NewBuffer(stage1[1]`,
  9499  		`		dec := json.NewDecoder(buf`,
  9500  		`		dec.UseNumber(`,
  9501  		`		if err := dec.Decode(&dataP1); err != nil {`,
  9502  		`		m.P1 = &dataP1`,
  9503  		`func (m FalseTupleThing) MarshalJSON() ([]byte, error) {`,
  9504  		`	data := []interface{}{`,
  9505  		`		m.P0,`,
  9506  		`		m.P1,`,
  9507  		`	return json.Marshal(data`,
  9508  		`func (m *FalseTupleThing) Validate(formats strfmt.Registry) error {`,
  9509  		`	if err := m.validateP0(formats); err != nil {`,
  9510  		`	if err := m.validateP1(formats); err != nil {`,
  9511  		`		return errors.CompositeValidationError(res...`,
  9512  		`func (m *FalseTupleThing) validateP0(formats strfmt.Registry) error {`,
  9513  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  9514  		`func (m *FalseTupleThing) validateP1(formats strfmt.Registry) error {`,
  9515  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  9516  	},
  9517  		// not expected
  9518  		todo,
  9519  		// output in log
  9520  		noLines,
  9521  		noLines)
  9522  
  9523  	expandRun.AddExpectations("false_tuple_thing.go",
  9524  		flattenRun.ExpectedFor("FalseTupleThing").ExpectedLines, todo, noLines, noLines)
  9525  
  9526  	// load expectations for model: tuple_thing_with_not_nullable.go
  9527  	flattenRun.AddExpectations("tuple_thing_with_not_nullable.go", []string{
  9528  		`type TupleThingWithNotNullable struct {`,
  9529  		"	P0 string `json:\"-\"`",
  9530  		"	P1 *int64 `json:\"-\"`",
  9531  		"	TupleThingWithNotNullableItems []interface{} `json:\"-\"`",
  9532  		`func (m *TupleThingWithNotNullable) UnmarshalJSON(raw []byte) error {`,
  9533  		`	var stage1 []json.RawMessage`,
  9534  		`	buf := bytes.NewBuffer(raw`,
  9535  		`	dec := json.NewDecoder(buf`,
  9536  		`	dec.UseNumber(`,
  9537  		`	if err := dec.Decode(&stage1); err != nil {`,
  9538  		`	var lastIndex int`,
  9539  		`	if len(stage1) > 0 {`,
  9540  		`		var dataP0 string`,
  9541  		`		buf = bytes.NewBuffer(stage1[0]`,
  9542  		`		dec := json.NewDecoder(buf`,
  9543  		`		dec.UseNumber(`,
  9544  		`		if err := dec.Decode(&dataP0); err != nil {`,
  9545  		`		m.P0 = dataP0`,
  9546  		`		lastIndex = 0`,
  9547  		`	if len(stage1) > 1 {`,
  9548  		`		var dataP1 int64`,
  9549  		`		buf = bytes.NewBuffer(stage1[1]`,
  9550  		`		dec := json.NewDecoder(buf`,
  9551  		`		dec.UseNumber(`,
  9552  		`		if err := dec.Decode(&dataP1); err != nil {`,
  9553  		`		m.P1 = &dataP1`,
  9554  		`		lastIndex = 1`,
  9555  		`	if len(stage1) > lastIndex+1 {`,
  9556  		`		for _, val := range stage1[lastIndex+1:] {`,
  9557  		`			var toadd interface{`,
  9558  		`			buf = bytes.NewBuffer(val`,
  9559  		`			dec := json.NewDecoder(buf`,
  9560  		`			dec.UseNumber(`,
  9561  		`			if err := dec.Decode(&toadd); err != nil {`,
  9562  		`			m.TupleThingWithNotNullableItems = append(m.TupleThingWithNotNullableItems, toadd`,
  9563  		`func (m TupleThingWithNotNullable) MarshalJSON() ([]byte, error) {`,
  9564  		`	data := []interface{}{`,
  9565  		`		m.P0,`,
  9566  		`		m.P1,`,
  9567  		`	for _, v := range m.TupleThingWithNotNullableItems {`,
  9568  		`		data = append(data, v`,
  9569  		`	return json.Marshal(data`,
  9570  		`func (m *TupleThingWithNotNullable) Validate(formats strfmt.Registry) error {`,
  9571  		`	if err := m.validateP0(formats); err != nil {`,
  9572  		`	if err := m.validateP1(formats); err != nil {`,
  9573  		`	if err := m.validateTupleThingWithNotNullableItems(formats); err != nil {`,
  9574  		`		return errors.CompositeValidationError(res...`,
  9575  		`func (m *TupleThingWithNotNullable) validateP0(formats strfmt.Registry) error {`,
  9576  		`	if err := validate.RequiredString("0", "body", string(m.P0)); err != nil {`,
  9577  		`	if err := validate.MaxLength("0", "body", string(m.P0), 10); err != nil {`,
  9578  		`func (m *TupleThingWithNotNullable) validateP1(formats strfmt.Registry) error {`,
  9579  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  9580  		`	if err := validate.MaximumInt("1", "body", int64(*m.P1), 10, false); err != nil {`,
  9581  		`func (m *TupleThingWithNotNullable) validateTupleThingWithNotNullableItems(formats strfmt.Registry) error {`,
  9582  	},
  9583  		// not expected
  9584  		todo,
  9585  		// output in log
  9586  		noLines,
  9587  		noLines)
  9588  
  9589  	expandRun.AddExpectations("tuple_thing_with_not_nullable.go",
  9590  		flattenRun.ExpectedFor("TupleThingWithNotNullable").ExpectedLines, todo, noLines, noLines)
  9591  
  9592  	// load expectations for model: tuple_thing.go
  9593  	flattenRun.AddExpectations("tuple_thing.go", []string{
  9594  		`type TupleThing struct {`,
  9595  		"	P0 *string `json:\"-\"`",
  9596  		"	P1 *string `json:\"-\"`",
  9597  		`func (m *TupleThing) UnmarshalJSON(raw []byte) error {`,
  9598  		`	var stage1 []json.RawMessage`,
  9599  		`	buf := bytes.NewBuffer(raw`,
  9600  		`	dec := json.NewDecoder(buf`,
  9601  		`	dec.UseNumber(`,
  9602  		`	if err := dec.Decode(&stage1); err != nil {`,
  9603  		`	if len(stage1) > 0 {`,
  9604  		`		var dataP0 string`,
  9605  		`		buf = bytes.NewBuffer(stage1[0]`,
  9606  		`		dec := json.NewDecoder(buf`,
  9607  		`		dec.UseNumber(`,
  9608  		`		if err := dec.Decode(&dataP0); err != nil {`,
  9609  		`		m.P0 = &dataP0`,
  9610  		`	if len(stage1) > 1 {`,
  9611  		`		var dataP1 string`,
  9612  		`		buf = bytes.NewBuffer(stage1[1]`,
  9613  		`		dec := json.NewDecoder(buf`,
  9614  		`		dec.UseNumber(`,
  9615  		`		if err := dec.Decode(&dataP1); err != nil {`,
  9616  		`		m.P1 = &dataP1`,
  9617  		`func (m TupleThing) MarshalJSON() ([]byte, error) {`,
  9618  		`	data := []interface{}{`,
  9619  		`		m.P0,`,
  9620  		`		m.P1,`,
  9621  		`	return json.Marshal(data`,
  9622  		`func (m *TupleThing) Validate(formats strfmt.Registry) error {`,
  9623  		`	if err := m.validateP0(formats); err != nil {`,
  9624  		`	if err := m.validateP1(formats); err != nil {`,
  9625  		`		return errors.CompositeValidationError(res...`,
  9626  		`var tupleThingTypeP0PropEnum []interface{`,
  9627  		`	var res []string`,
  9628  		"	if err := json.Unmarshal([]byte(`[\"CONST1\",\"CONST2\"]`), &res); err != nil {",
  9629  		`	for _, v := range res {`,
  9630  		`		tupleThingTypeP0PropEnum = append(tupleThingTypeP0PropEnum, v`,
  9631  		`	TupleThingP0CONST1 string = "CONST1"`,
  9632  		`	TupleThingP0CONST2 string = "CONST2"`,
  9633  		`func (m *TupleThing) validateP0Enum(path, location string, value string) error {`,
  9634  		`	if err := validate.Enum(path, location, value, tupleThingTypeP0PropEnum); err != nil {`,
  9635  		`func (m *TupleThing) validateP0(formats strfmt.Registry) error {`,
  9636  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  9637  		`	if err := m.validateP0Enum("0", "body", *m.P0); err != nil {`,
  9638  		`var tupleThingTypeP1PropEnum []interface{`,
  9639  		`	var res []string`,
  9640  		"	if err := json.Unmarshal([]byte(`[\"CONST3\",\"CONST4\"]`), &res); err != nil {",
  9641  		`	for _, v := range res {`,
  9642  		`		tupleThingTypeP1PropEnum = append(tupleThingTypeP1PropEnum, v`,
  9643  		`	TupleThingP1CONST3 string = "CONST3"`,
  9644  		`	TupleThingP1CONST4 string = "CONST4"`,
  9645  		`func (m *TupleThing) validateP1Enum(path, location string, value string) error {`,
  9646  		`	if err := validate.Enum(path, location, value, tupleThingTypeP1PropEnum); err != nil {`,
  9647  		`func (m *TupleThing) validateP1(formats strfmt.Registry) error {`,
  9648  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  9649  		`	if err := m.validateP1Enum("1", "body", *m.P1); err != nil {`,
  9650  	},
  9651  		// not expected
  9652  		todo,
  9653  		// output in log
  9654  		noLines,
  9655  		noLines)
  9656  
  9657  	expandRun.AddExpectations("tuple_thing.go",
  9658  		flattenRun.ExpectedFor("TupleThing").ExpectedLines, todo, noLines, noLines)
  9659  
  9660  	// load expectations for model: tuple_thing_with_additional_items.go
  9661  	flattenRun.AddExpectations("tuple_thing_with_additional_items.go", []string{
  9662  		`type TupleThingWithAdditionalItems struct {`,
  9663  		"	P0 *string `json:\"-\"`",
  9664  		"	P1 *int64 `json:\"-\"`",
  9665  		"	TupleThingWithAdditionalItemsItems []int64 `json:\"-\"`",
  9666  		`func (m *TupleThingWithAdditionalItems) UnmarshalJSON(raw []byte) error {`,
  9667  		`	var stage1 []json.RawMessage`,
  9668  		`	buf := bytes.NewBuffer(raw`,
  9669  		`	dec := json.NewDecoder(buf`,
  9670  		`	dec.UseNumber(`,
  9671  		`	if err := dec.Decode(&stage1); err != nil {`,
  9672  		`	var lastIndex int`,
  9673  		`	if len(stage1) > 0 {`,
  9674  		`		var dataP0 string`,
  9675  		`		buf = bytes.NewBuffer(stage1[0]`,
  9676  		`		dec := json.NewDecoder(buf`,
  9677  		`		dec.UseNumber(`,
  9678  		`		if err := dec.Decode(&dataP0); err != nil {`,
  9679  		`		m.P0 = &dataP0`,
  9680  		`		lastIndex = 0`,
  9681  		`	if len(stage1) > 1 {`,
  9682  		`		var dataP1 int64`,
  9683  		`		buf = bytes.NewBuffer(stage1[1]`,
  9684  		`		dec := json.NewDecoder(buf`,
  9685  		`		dec.UseNumber(`,
  9686  		`		if err := dec.Decode(&dataP1); err != nil {`,
  9687  		`		m.P1 = &dataP1`,
  9688  		`		lastIndex = 1`,
  9689  		`	if len(stage1) > lastIndex+1 {`,
  9690  		`		for _, val := range stage1[lastIndex+1:] {`,
  9691  		`			var toadd int64`,
  9692  		`			buf = bytes.NewBuffer(val`,
  9693  		`			dec := json.NewDecoder(buf`,
  9694  		`			dec.UseNumber(`,
  9695  		`			if err := dec.Decode(&toadd); err != nil {`,
  9696  		`			m.TupleThingWithAdditionalItemsItems = append(m.TupleThingWithAdditionalItemsItems, toadd`,
  9697  		`func (m TupleThingWithAdditionalItems) MarshalJSON() ([]byte, error) {`,
  9698  		`	data := []interface{}{`,
  9699  		`		m.P0,`,
  9700  		`		m.P1,`,
  9701  		`	for _, v := range m.TupleThingWithAdditionalItemsItems {`,
  9702  		`		data = append(data, v`,
  9703  		`	return json.Marshal(data`,
  9704  		`func (m *TupleThingWithAdditionalItems) Validate(formats strfmt.Registry) error {`,
  9705  		`	if err := m.validateP0(formats); err != nil {`,
  9706  		`	if err := m.validateP1(formats); err != nil {`,
  9707  		`	if err := m.validateTupleThingWithAdditionalItemsItems(formats); err != nil {`,
  9708  		`		return errors.CompositeValidationError(res...`,
  9709  		`func (m *TupleThingWithAdditionalItems) validateP0(formats strfmt.Registry) error {`,
  9710  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  9711  		`func (m *TupleThingWithAdditionalItems) validateP1(formats strfmt.Registry) error {`,
  9712  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  9713  		`	if err := validate.MaximumInt("1", "body", int64(*m.P1), 10, false); err != nil {`,
  9714  		`var tupleThingWithAdditionalItemsItemsEnum []interface{`,
  9715  		`	var res []int64`,
  9716  		"	if err := json.Unmarshal([]byte(`[1,2]`), &res); err != nil {",
  9717  		`	for _, v := range res {`,
  9718  		`		tupleThingWithAdditionalItemsItemsEnum = append(tupleThingWithAdditionalItemsItemsEnum, v`,
  9719  		`func (m *TupleThingWithAdditionalItems) validateTupleThingWithAdditionalItemsItemsEnum(path,` +
  9720  			` location string, value int64) error {`,
  9721  		`	if err := validate.Enum(path, location, value, tupleThingWithAdditionalItemsItemsEnum); err != nil {`,
  9722  		`func (m *TupleThingWithAdditionalItems) validateTupleThingWithAdditionalItemsItems(formats strfmt.Registry)` +
  9723  			` error {`,
  9724  		`	for i := range m.TupleThingWithAdditionalItemsItems {`,
  9725  		`		if err := m.validateTupleThingWithAdditionalItemsItemsEnum(strconv.Itoa(i+2), "body", ` +
  9726  			`m.TupleThingWithAdditionalItemsItems[i]); err != nil {`,
  9727  	},
  9728  		// not expected
  9729  		todo,
  9730  		// output in log
  9731  		noLines,
  9732  		noLines)
  9733  
  9734  	expandRun.AddExpectations("tuple_thing_with_additional_items.go",
  9735  		flattenRun.ExpectedFor("TupleThingWithAdditionalItems").ExpectedLines, todo, noLines, noLines)
  9736  
  9737  	// load expectations for model: tuple_thing_with_array_element.go
  9738  	flattenRun.AddExpectations("tuple_thing_with_array_element.go", []string{
  9739  		`type TupleThingWithArrayElement struct {`,
  9740  		"	P0 []string `json:\"-\"`",
  9741  		"	P1 []int64 `json:\"-\"`",
  9742  		"	TupleThingWithArrayElementItems [][]strfmt.Date `json:\"-\"`",
  9743  		`func (m *TupleThingWithArrayElement) UnmarshalJSON(raw []byte) error {`,
  9744  		`	var stage1 []json.RawMessage`,
  9745  		`	buf := bytes.NewBuffer(raw`,
  9746  		`	dec := json.NewDecoder(buf`,
  9747  		`	dec.UseNumber(`,
  9748  		`	if err := dec.Decode(&stage1); err != nil {`,
  9749  		`	var lastIndex int`,
  9750  		`	if len(stage1) > 0 {`,
  9751  		`		var dataP0 []string`,
  9752  		`		buf = bytes.NewBuffer(stage1[0]`,
  9753  		`		dec := json.NewDecoder(buf`,
  9754  		`		dec.UseNumber(`,
  9755  		`		if err := dec.Decode(&dataP0); err != nil {`,
  9756  		`		m.P0 = dataP0`,
  9757  		`		lastIndex = 0`,
  9758  		`	if len(stage1) > 1 {`,
  9759  		`		var dataP1 []int64`,
  9760  		`		buf = bytes.NewBuffer(stage1[1]`,
  9761  		`		dec := json.NewDecoder(buf`,
  9762  		`		dec.UseNumber(`,
  9763  		`		if err := dec.Decode(&dataP1); err != nil {`,
  9764  		`		m.P1 = dataP1`,
  9765  		`		lastIndex = 1`,
  9766  		`	if len(stage1) > lastIndex+1 {`,
  9767  		`		for _, val := range stage1[lastIndex+1:] {`,
  9768  		`			var toadd []strfmt.Date`,
  9769  		`			buf = bytes.NewBuffer(val`,
  9770  		`			dec := json.NewDecoder(buf`,
  9771  		`			dec.UseNumber(`,
  9772  		`			if err := dec.Decode(&toadd); err != nil {`,
  9773  		`			m.TupleThingWithArrayElementItems = append(m.TupleThingWithArrayElementItems, toadd`,
  9774  		`func (m TupleThingWithArrayElement) MarshalJSON() ([]byte, error) {`,
  9775  		`	data := []interface{}{`,
  9776  		`		m.P0,`,
  9777  		`		m.P1,`,
  9778  		`	for _, v := range m.TupleThingWithArrayElementItems {`,
  9779  		`		data = append(data, v`,
  9780  		`	return json.Marshal(data`,
  9781  		`func (m *TupleThingWithArrayElement) Validate(formats strfmt.Registry) error {`,
  9782  		`	if err := m.validateP0(formats); err != nil {`,
  9783  		`	if err := m.validateP1(formats); err != nil {`,
  9784  		`	if err := m.validateTupleThingWithArrayElementItems(formats); err != nil {`,
  9785  		`		return errors.CompositeValidationError(res...`,
  9786  		`func (m *TupleThingWithArrayElement) validateP0(formats strfmt.Registry) error {`,
  9787  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  9788  		`	iP0Size := int64(len(m.P0)`,
  9789  		`	if err := validate.MaxItems("0", "body", iP0Size, 10); err != nil {`,
  9790  		`	for i := 0; i < len(m.P0); i++ {`,
  9791  		`		if err := validate.MaxLength("0"+"."+strconv.Itoa(i), "body", string(m.P0[i]), 10); err != nil {`,
  9792  		`func (m *TupleThingWithArrayElement) validateP1(formats strfmt.Registry) error {`,
  9793  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  9794  		`	iP1Size := int64(len(m.P1)`,
  9795  		`	if err := validate.MinItems("1", "body", iP1Size, 20); err != nil {`,
  9796  		`	for i := 0; i < len(m.P1); i++ {`,
  9797  		`		if err := validate.MinimumInt("1"+"."+strconv.Itoa(i), "body", int64(m.P1[i]), 10, false); err != nil {`,
  9798  		`func (m *TupleThingWithArrayElement) validateTupleThingWithArrayElementItems(formats strfmt.Registry) error {`,
  9799  		`	for i := range m.TupleThingWithArrayElementItems {`,
  9800  		`		for ii := 0; ii < len(m.TupleThingWithArrayElementItems[i]); ii++ {`,
  9801  		`			if err := validate.FormatOf(strconv.Itoa(i+2)+"."+strconv.Itoa(ii), "body", ` +
  9802  			`"date", m.TupleThingWithArrayElementItems[i][ii].String(), formats); err != nil {`,
  9803  	},
  9804  		// not expected
  9805  		todo,
  9806  		// output in log
  9807  		noLines,
  9808  		noLines)
  9809  
  9810  	expandRun.AddExpectations("tuple_thing_with_array_element.go",
  9811  		flattenRun.ExpectedFor("TupleThingWithArrayElement").ExpectedLines, todo, noLines, noLines)
  9812  
  9813  	// load expectations for model: array_of_tuples.go
  9814  	flattenRun.AddExpectations("array_of_tuples.go", []string{
  9815  		`type ArrayOfTuples []ArrayOfTuplesTuple0`,
  9816  		`func (m ArrayOfTuples) Validate(formats strfmt.Registry) error {`,
  9817  		`	iArrayOfTuplesSize := int64(len(m)`,
  9818  		`	if err := validate.MinItems("", "body", iArrayOfTuplesSize, 1); err != nil {`,
  9819  		`	for i := 0; i < len(m); i++ {`,
  9820  		`		if err := m[i].Validate(formats); err != nil {`,
  9821  		`			if ve, ok := err.(*errors.Validation); ok {`,
  9822  		`				return ve.ValidateName(strconv.Itoa(i)`,
  9823  		`		return errors.CompositeValidationError(res...`,
  9824  		`type ArrayOfTuplesTuple0 struct {`,
  9825  		"	P0 []string `json:\"-\"`",
  9826  		"	P1 []int64 `json:\"-\"`",
  9827  		"	ArrayOfTuplesTuple0Items [][]strfmt.Date `json:\"-\"`",
  9828  		`func (m *ArrayOfTuplesTuple0) UnmarshalJSON(raw []byte) error {`,
  9829  		`	var stage1 []json.RawMessage`,
  9830  		`	buf := bytes.NewBuffer(raw`,
  9831  		`	dec := json.NewDecoder(buf`,
  9832  		`	dec.UseNumber(`,
  9833  		`	if err := dec.Decode(&stage1); err != nil {`,
  9834  		`	var lastIndex int`,
  9835  		`	if len(stage1) > 0 {`,
  9836  		`		var dataP0 []string`,
  9837  		`		buf = bytes.NewBuffer(stage1[0]`,
  9838  		`		dec := json.NewDecoder(buf`,
  9839  		`		dec.UseNumber(`,
  9840  		`		if err := dec.Decode(&dataP0); err != nil {`,
  9841  		`		m.P0 = dataP0`,
  9842  		`		lastIndex = 0`,
  9843  		`	if len(stage1) > 1 {`,
  9844  		`		var dataP1 []int64`,
  9845  		`		buf = bytes.NewBuffer(stage1[1]`,
  9846  		`		dec := json.NewDecoder(buf`,
  9847  		`		dec.UseNumber(`,
  9848  		`		if err := dec.Decode(&dataP1); err != nil {`,
  9849  		`		m.P1 = dataP1`,
  9850  		`		lastIndex = 1`,
  9851  		`	if len(stage1) > lastIndex+1 {`,
  9852  		`		for _, val := range stage1[lastIndex+1:] {`,
  9853  		`			var toadd []strfmt.Date`,
  9854  		`			buf = bytes.NewBuffer(val`,
  9855  		`			dec := json.NewDecoder(buf`,
  9856  		`			dec.UseNumber(`,
  9857  		`			if err := dec.Decode(&toadd); err != nil {`,
  9858  		`			m.ArrayOfTuplesTuple0Items = append(m.ArrayOfTuplesTuple0Items, toadd`,
  9859  		`func (m ArrayOfTuplesTuple0) MarshalJSON() ([]byte, error) {`,
  9860  		`	data := []interface{}{`,
  9861  		`		m.P0,`,
  9862  		`		m.P1,`,
  9863  		`	for _, v := range m.ArrayOfTuplesTuple0Items {`,
  9864  		`		data = append(data, v`,
  9865  		`	return json.Marshal(data`,
  9866  		`func (m *ArrayOfTuplesTuple0) Validate(formats strfmt.Registry) error {`,
  9867  		`	if err := m.validateP0(formats); err != nil {`,
  9868  		`	if err := m.validateP1(formats); err != nil {`,
  9869  		`	if err := m.validateArrayOfTuplesTuple0Items(formats); err != nil {`,
  9870  		`		return errors.CompositeValidationError(res...`,
  9871  		`func (m *ArrayOfTuplesTuple0) validateP0(formats strfmt.Registry) error {`,
  9872  		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
  9873  		`	iP0Size := int64(len(m.P0)`,
  9874  		`	if err := validate.MaxItems("P0", "body", iP0Size, 10); err != nil {`,
  9875  		`	for i := 0; i < len(m.P0); i++ {`,
  9876  		`		if err := validate.MaxLength("P0"+"."+strconv.Itoa(i), "body", string(m.P0[i]), 10); err != nil {`,
  9877  		`func (m *ArrayOfTuplesTuple0) validateP1(formats strfmt.Registry) error {`,
  9878  		`	if err := validate.Required("P1", "body", m.P1); err != nil {`,
  9879  		`	iP1Size := int64(len(m.P1)`,
  9880  		`	if err := validate.MinItems("P1", "body", iP1Size, 20); err != nil {`,
  9881  		`	for i := 0; i < len(m.P1); i++ {`,
  9882  		`		if err := validate.MinimumInt("P1"+"."+strconv.Itoa(i), ` +
  9883  			`"body", int64(m.P1[i]), 10, false); err != nil {`,
  9884  		`func (m *ArrayOfTuplesTuple0) validateArrayOfTuplesTuple0Items(formats strfmt.Registry) error {`,
  9885  		`	for i := range m.ArrayOfTuplesTuple0Items {`,
  9886  		`		for ii := 0; ii < len(m.ArrayOfTuplesTuple0Items[i]); ii++ {`,
  9887  		`			if err := validate.FormatOf(strconv.Itoa(i)+"."+strconv.Itoa(ii), ` +
  9888  			`"body", "date", m.ArrayOfTuplesTuple0Items[i][ii].String(), formats); err != nil {`,
  9889  	},
  9890  		// not expected
  9891  		todo,
  9892  		// output in log
  9893  		noLines,
  9894  		noLines)
  9895  
  9896  	expandRun.AddExpectations("array_of_tuples.go",
  9897  		flattenRun.ExpectedFor("ArrayOfTuples").ExpectedLines, todo, noLines, noLines)
  9898  
  9899  	// load expectations for model: tuple_thing_with_object_element.go
  9900  	flattenRun.AddExpectations("tuple_thing_with_object_element.go", []string{
  9901  		`type TupleThingWithObjectElement struct {`,
  9902  		"	P0 *TupleThingWithObjectElementItems0 `json:\"-\"`",
  9903  		"	P1 map[string]int64 `json:\"-\"`",
  9904  		"	TupleThingWithObjectElementItems []map[string]strfmt.Date `json:\"-\"`",
  9905  		`func (m *TupleThingWithObjectElement) UnmarshalJSON(raw []byte) error {`,
  9906  		`	var stage1 []json.RawMessage`,
  9907  		`	buf := bytes.NewBuffer(raw`,
  9908  		`	dec := json.NewDecoder(buf`,
  9909  		`	dec.UseNumber(`,
  9910  		`	if err := dec.Decode(&stage1); err != nil {`,
  9911  		`	var lastIndex int`,
  9912  		`	if len(stage1) > 0 {`,
  9913  		`		var dataP0 TupleThingWithObjectElementItems0`,
  9914  		`		buf = bytes.NewBuffer(stage1[0]`,
  9915  		`		dec := json.NewDecoder(buf`,
  9916  		`		dec.UseNumber(`,
  9917  		`		if err := dec.Decode(&dataP0); err != nil {`,
  9918  		`		m.P0 = &dataP0`,
  9919  		`		lastIndex = 0`,
  9920  		`	if len(stage1) > 1 {`,
  9921  		`		var dataP1 map[string]int64`,
  9922  		`		buf = bytes.NewBuffer(stage1[1]`,
  9923  		`		dec := json.NewDecoder(buf`,
  9924  		`		dec.UseNumber(`,
  9925  		`		if err := dec.Decode(&dataP1); err != nil {`,
  9926  		`		m.P1 = dataP1`,
  9927  		`		lastIndex = 1`,
  9928  		`	if len(stage1) > lastIndex+1 {`,
  9929  		`		for _, val := range stage1[lastIndex+1:] {`,
  9930  		`			var toadd map[string]strfmt.Date`,
  9931  		`			buf = bytes.NewBuffer(val`,
  9932  		`			dec := json.NewDecoder(buf`,
  9933  		`			dec.UseNumber(`,
  9934  		`			if err := dec.Decode(&toadd); err != nil {`,
  9935  		`			m.TupleThingWithObjectElementItems = append(m.TupleThingWithObjectElementItems, toadd`,
  9936  		`func (m TupleThingWithObjectElement) MarshalJSON() ([]byte, error) {`,
  9937  		`	data := []interface{}{`,
  9938  		`		m.P0,`,
  9939  		`		m.P1,`,
  9940  		`	for _, v := range m.TupleThingWithObjectElementItems {`,
  9941  		`		data = append(data, v`,
  9942  		`	return json.Marshal(data`,
  9943  		`func (m *TupleThingWithObjectElement) Validate(formats strfmt.Registry) error {`,
  9944  		`	if err := m.validateP0(formats); err != nil {`,
  9945  		`	if err := m.validateP1(formats); err != nil {`,
  9946  		`	if err := m.validateTupleThingWithObjectElementItems(formats); err != nil {`,
  9947  		`		return errors.CompositeValidationError(res...`,
  9948  		`func (m *TupleThingWithObjectElement) validateP0(formats strfmt.Registry) error {`,
  9949  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
  9950  		`	if m.P0 != nil {`,
  9951  		`		if err := m.P0.Validate(formats); err != nil {`,
  9952  		`			if ve, ok := err.(*errors.Validation); ok {`,
  9953  		`				return ve.ValidateName("0"`,
  9954  		`func (m *TupleThingWithObjectElement) validateP1(formats strfmt.Registry) error {`,
  9955  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
  9956  		`	for k := range m.P1 {`,
  9957  		`		if err := validate.MinimumInt("1"+"."+k, "body", int64(m.P1[k]), 10, false); err != nil {`,
  9958  		`func (m *TupleThingWithObjectElement) validateTupleThingWithObjectElementItems(formats strfmt.Registry)` +
  9959  			` error {`,
  9960  		`	for i := range m.TupleThingWithObjectElementItems {`,
  9961  		`		for k := range m.TupleThingWithObjectElementItems[i] {`,
  9962  		`			if err := validate.FormatOf(strconv.Itoa(i+2)+"."+k, "body", "date", ` +
  9963  			`m.TupleThingWithObjectElementItems[i][k].String(), formats); err != nil {`,
  9964  		`type TupleThingWithObjectElementItems0 struct {`,
  9965  		"	Prop1 string `json:\"prop1,omitempty\"`",
  9966  		`func (m *TupleThingWithObjectElementItems0) Validate(formats strfmt.Registry) error {`,
  9967  		`	if err := m.validateProp1(formats); err != nil {`,
  9968  		`		return errors.CompositeValidationError(res...`,
  9969  		`func (m *TupleThingWithObjectElementItems0) validateProp1(formats strfmt.Registry) error {`,
  9970  		`	if swag.IsZero(m.Prop1) {`,
  9971  		`	if err := validate.MaxLength("prop1", "body", string(m.Prop1), 10); err != nil {`,
  9972  	},
  9973  		// not expected
  9974  		todo,
  9975  		// output in log
  9976  		noLines,
  9977  		noLines)
  9978  
  9979  	expandRun.AddExpectations("tuple_thing_with_object_element.go",
  9980  		flattenRun.ExpectedFor("TupleThingWithObjectElement").ExpectedLines, todo, noLines, noLines)
  9981  
  9982  	// load expectations for model: tuple_thing_with_no_additional_items.go
  9983  	flattenRun.AddExpectations("tuple_thing_with_no_additional_items.go", []string{
  9984  		`type TupleThingWithNoAdditionalItems struct {`,
  9985  		"	P0 *string `json:\"-\"`",
  9986  		"	P1 *int64 `json:\"-\"`",
  9987  		`func (m *TupleThingWithNoAdditionalItems) UnmarshalJSON(raw []byte) error {`,
  9988  		`	var stage1 []json.RawMessage`,
  9989  		`	buf := bytes.NewBuffer(raw`,
  9990  		`	dec := json.NewDecoder(buf`,
  9991  		`	dec.UseNumber(`,
  9992  		`	if err := dec.Decode(&stage1); err != nil {`,
  9993  		`	if len(stage1) > 0 {`,
  9994  		`		var dataP0 string`,
  9995  		`		buf = bytes.NewBuffer(stage1[0]`,
  9996  		`		dec := json.NewDecoder(buf`,
  9997  		`		dec.UseNumber(`,
  9998  		`		if err := dec.Decode(&dataP0); err != nil {`,
  9999  		`		m.P0 = &dataP0`,
 10000  		`	if len(stage1) > 1 {`,
 10001  		`		var dataP1 int64`,
 10002  		`		buf = bytes.NewBuffer(stage1[1]`,
 10003  		`		dec := json.NewDecoder(buf`,
 10004  		`		dec.UseNumber(`,
 10005  		`		if err := dec.Decode(&dataP1); err != nil {`,
 10006  		`		m.P1 = &dataP1`,
 10007  		`func (m TupleThingWithNoAdditionalItems) MarshalJSON() ([]byte, error) {`,
 10008  		`	data := []interface{}{`,
 10009  		`		m.P0,`,
 10010  		`		m.P1,`,
 10011  		`	return json.Marshal(data`,
 10012  		`func (m *TupleThingWithNoAdditionalItems) Validate(formats strfmt.Registry) error {`,
 10013  		`	if err := m.validateP0(formats); err != nil {`,
 10014  		`	if err := m.validateP1(formats); err != nil {`,
 10015  		`		return errors.CompositeValidationError(res...`,
 10016  		`func (m *TupleThingWithNoAdditionalItems) validateP0(formats strfmt.Registry) error {`,
 10017  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 10018  		`func (m *TupleThingWithNoAdditionalItems) validateP1(formats strfmt.Registry) error {`,
 10019  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
 10020  		`	if err := validate.MaximumInt("1", "body", int64(*m.P1), 10, false); err != nil {`,
 10021  	},
 10022  		// not expected
 10023  		todo,
 10024  		// output in log
 10025  		noLines,
 10026  		noLines)
 10027  
 10028  	expandRun.AddExpectations("tuple_thing_with_no_additional_items.go",
 10029  		flattenRun.ExpectedFor("TupleThingWithNoAdditionalItems").ExpectedLines, todo, noLines, noLines)
 10030  
 10031  	// load expectations for model: tuple_thing_with_any_additional_items.go
 10032  	flattenRun.AddExpectations("tuple_thing_with_any_additional_items.go", []string{
 10033  		`type TupleThingWithAnyAdditionalItems struct {`,
 10034  		"	P0 *string `json:\"-\"`",
 10035  		"	P1 *int64 `json:\"-\"`",
 10036  		"	TupleThingWithAnyAdditionalItemsItems []interface{} `json:\"-\"`",
 10037  		`func (m *TupleThingWithAnyAdditionalItems) UnmarshalJSON(raw []byte) error {`,
 10038  		`	var stage1 []json.RawMessage`,
 10039  		`	buf := bytes.NewBuffer(raw`,
 10040  		`	dec := json.NewDecoder(buf`,
 10041  		`	dec.UseNumber(`,
 10042  		`	if err := dec.Decode(&stage1); err != nil {`,
 10043  		`	var lastIndex int`,
 10044  		`	if len(stage1) > 0 {`,
 10045  		`		var dataP0 string`,
 10046  		`		buf = bytes.NewBuffer(stage1[0]`,
 10047  		`		dec := json.NewDecoder(buf`,
 10048  		`		dec.UseNumber(`,
 10049  		`		if err := dec.Decode(&dataP0); err != nil {`,
 10050  		`		m.P0 = &dataP0`,
 10051  		`		lastIndex = 0`,
 10052  		`	if len(stage1) > 1 {`,
 10053  		`		var dataP1 int64`,
 10054  		`		buf = bytes.NewBuffer(stage1[1]`,
 10055  		`		dec := json.NewDecoder(buf`,
 10056  		`		dec.UseNumber(`,
 10057  		`		if err := dec.Decode(&dataP1); err != nil {`,
 10058  		`		m.P1 = &dataP1`,
 10059  		`		lastIndex = 1`,
 10060  		`	if len(stage1) > lastIndex+1 {`,
 10061  		`		for _, val := range stage1[lastIndex+1:] {`,
 10062  		`			var toadd interface{`,
 10063  		`			buf = bytes.NewBuffer(val`,
 10064  		`			dec := json.NewDecoder(buf`,
 10065  		`			dec.UseNumber(`,
 10066  		`			if err := dec.Decode(&toadd); err != nil {`,
 10067  		`			m.TupleThingWithAnyAdditionalItemsItems = append(m.TupleThingWithAnyAdditionalItemsItems, toadd`,
 10068  		`func (m TupleThingWithAnyAdditionalItems) MarshalJSON() ([]byte, error) {`,
 10069  		`	data := []interface{}{`,
 10070  		`		m.P0,`,
 10071  		`		m.P1,`,
 10072  		`	for _, v := range m.TupleThingWithAnyAdditionalItemsItems {`,
 10073  		`		data = append(data, v`,
 10074  		`	return json.Marshal(data`,
 10075  		`func (m *TupleThingWithAnyAdditionalItems) Validate(formats strfmt.Registry) error {`,
 10076  		`	if err := m.validateP0(formats); err != nil {`,
 10077  		`	if err := m.validateP1(formats); err != nil {`,
 10078  		`	if err := m.validateTupleThingWithAnyAdditionalItemsItems(formats); err != nil {`,
 10079  		`		return errors.CompositeValidationError(res...`,
 10080  		`func (m *TupleThingWithAnyAdditionalItems) validateP0(formats strfmt.Registry) error {`,
 10081  		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 10082  		`	if err := validate.MaxLength("0", "body", string(*m.P0), 10); err != nil {`,
 10083  		`func (m *TupleThingWithAnyAdditionalItems) validateP1(formats strfmt.Registry) error {`,
 10084  		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
 10085  		`	if err := validate.MaximumInt("1", "body", int64(*m.P1), 10, false); err != nil {`,
 10086  		`func (m *TupleThingWithAnyAdditionalItems) ` +
 10087  			`validateTupleThingWithAnyAdditionalItemsItems(formats strfmt.Registry) error {`,
 10088  	},
 10089  		// not expected
 10090  		todo,
 10091  		// output in log
 10092  		noLines,
 10093  		noLines)
 10094  
 10095  	expandRun.AddExpectations("tuple_thing_with_any_additional_items.go",
 10096  		flattenRun.ExpectedFor("TupleThingWithAnyAdditionalItems").ExpectedLines, todo, noLines, noLines)
 10097  }
 10098  
 10099  func initFixtureDeepMaps() {
 10100  	// testing fixture-deepMaps.yaml with minimal flatten
 10101  
 10102  	f := newModelFixture("../fixtures/enhancements/1572/fixture-deepMaps.yaml", "issue 1572 - deep maps")
 10103  	thisRun := f.AddRun(false).WithMinimalFlatten(true)
 10104  
 10105  	// load expectations for model: model_object_vanilla.go
 10106  	thisRun.AddExpectations("model_object_vanilla.go", []string{
 10107  		`type ModelObjectVanilla struct {`,
 10108  		"	Prop0 *ModelSanity `json:\"prop0,omitempty\"`",
 10109  		"	Prop1 *ModelSanity `json:\"prop1\"`",
 10110  		"	Prop2 []*ModelSanity `json:\"prop2\"`",
 10111  		"	Prop3 *ModelSanity `json:\"prop3,omitempty\"`",
 10112  		"	Prop4 map[string]ModelSanity `json:\"prop4,omitempty\"`",
 10113  		"	Prop5 int64 `json:\"prop5,omitempty\"`",
 10114  		"	ModelObjectVanilla map[string]map[string]map[string]ModelSanity `json:\"-\"`",
 10115  		`func (m *ModelObjectVanilla) Validate(formats strfmt.Registry) error {`,
 10116  		`	if err := m.validateProp0(formats); err != nil {`,
 10117  		`	if err := m.validateProp1(formats); err != nil {`,
 10118  		`	if err := m.validateProp2(formats); err != nil {`,
 10119  		`	if err := m.validateProp3(formats); err != nil {`,
 10120  		`	if err := m.validateProp4(formats); err != nil {`,
 10121  		`	for k := range m.ModelObjectVanilla {`,
 10122  		`		for kk := range m.ModelObjectVanilla[k] {`,
 10123  		`			for kkk := range m.ModelObjectVanilla[k][kk] {`,
 10124  		`				if err := validate.Required(k+"."+kk+"."+kkk, "body",` +
 10125  			` m.ModelObjectVanilla[k][kk][kkk]); err != nil {`,
 10126  		`				if val, ok := m.ModelObjectVanilla[k][kk][kkk]; ok {`,
 10127  		`					if err := val.Validate(formats); err != nil {`,
 10128  		`		return errors.CompositeValidationError(res...`,
 10129  		`func (m *ModelObjectVanilla) validateProp0(formats strfmt.Registry) error {`,
 10130  		`	if swag.IsZero(m.Prop0) {`,
 10131  		`	if m.Prop0 != nil {`,
 10132  		`		if err := m.Prop0.Validate(formats); err != nil {`,
 10133  		`			if ve, ok := err.(*errors.Validation); ok {`,
 10134  		`				return ve.ValidateName("prop0"`,
 10135  		`func (m *ModelObjectVanilla) validateProp1(formats strfmt.Registry) error {`,
 10136  		`	if err := validate.Required("prop1", "body", m.Prop1); err != nil {`,
 10137  		`	if m.Prop1 != nil {`,
 10138  		`		if err := m.Prop1.Validate(formats); err != nil {`,
 10139  		`			if ve, ok := err.(*errors.Validation); ok {`,
 10140  		`				return ve.ValidateName("prop1"`,
 10141  		`func (m *ModelObjectVanilla) validateProp2(formats strfmt.Registry) error {`,
 10142  		`	if swag.IsZero(m.Prop2) {`,
 10143  		`	for i := 0; i < len(m.Prop2); i++ {`,
 10144  		`		if swag.IsZero(m.Prop2[i]) {`,
 10145  		`		if m.Prop2[i] != nil {`,
 10146  		`			if err := m.Prop2[i].Validate(formats); err != nil {`,
 10147  		`				if ve, ok := err.(*errors.Validation); ok {`,
 10148  		`					return ve.ValidateName("prop2" + "." + strconv.Itoa(i)`,
 10149  		`func (m *ModelObjectVanilla) validateProp3(formats strfmt.Registry) error {`,
 10150  		`	if swag.IsZero(m.Prop3) {`,
 10151  		`	if m.Prop3 != nil {`,
 10152  		`		if err := m.Prop3.Validate(formats); err != nil {`,
 10153  		`			if ve, ok := err.(*errors.Validation); ok {`,
 10154  		`				return ve.ValidateName("prop3"`,
 10155  		`func (m *ModelObjectVanilla) validateProp4(formats strfmt.Registry) error {`,
 10156  		`	if swag.IsZero(m.Prop4) {`,
 10157  		`	for k := range m.Prop4 {`,
 10158  		`		if err := validate.Required("prop4"+"."+k, "body", m.Prop4[k]); err != nil {`,
 10159  		`		if val, ok := m.Prop4[k]; ok {`,
 10160  		`			if err := val.Validate(formats); err != nil {`,
 10161  	},
 10162  		// not expected
 10163  		todo,
 10164  		// output in log
 10165  		noLines,
 10166  		noLines)
 10167  
 10168  	// load expectations for model: model_sanity.go
 10169  	thisRun.AddExpectations("model_sanity.go", []string{
 10170  		`type ModelSanity struct {`,
 10171  		"	PropA string `json:\"propA,omitempty\"`",
 10172  		"	PropB *string `json:\"propB\"`",
 10173  		`func (m *ModelSanity) Validate(formats strfmt.Registry) error {`,
 10174  		`	if err := m.validatePropB(formats); err != nil {`,
 10175  		`		return errors.CompositeValidationError(res...`,
 10176  		`func (m *ModelSanity) validatePropB(formats strfmt.Registry) error {`,
 10177  		`	if err := validate.Required("propB", "body", m.PropB); err != nil {`,
 10178  	},
 10179  		// not expected
 10180  		todo,
 10181  		// output in log
 10182  		noLines,
 10183  		noLines)
 10184  }
 10185  
 10186  func initFixture1617() {
 10187  	// testing fixture-1617.yaml with flatten and expand (--skip-flatten)
 10188  
 10189  	f := newModelFixture("../fixtures/bugs/1617/fixture-1617.yaml", "aaa")
 10190  	thisRun := f.AddRun(false).WithMinimalFlatten(true)
 10191  
 10192  	// load expectations for model: artifact_info.go
 10193  	thisRun.AddExpectations("artifact_info.go", []string{
 10194  		`type ArtifactInfo struct {`,
 10195  		`	ArtifactDescription`,
 10196  		"	Path ArtifactPath `json:\"Path,omitempty\"`",
 10197  		"	Status ArtifactStatus `json:\"Status,omitempty\"`",
 10198  		"	Timestamp strfmt.DateTime `json:\"Timestamp,omitempty\"`",
 10199  		`func (m *ArtifactInfo) UnmarshalJSON(raw []byte) error {`,
 10200  		`	var aO0 ArtifactDescription`,
 10201  		`	if err := swag.ReadJSON(raw, &aO0); err != nil {`,
 10202  		`	m.ArtifactDescription = aO0`,
 10203  		`	var propsArtifactInfo struct {`,
 10204  		"		Path ArtifactPath `json:\"Path,omitempty\"`",
 10205  		"		Status ArtifactStatus `json:\"Status,omitempty\"`",
 10206  		"		Timestamp strfmt.DateTime `json:\"Timestamp,omitempty\"`",
 10207  		`	if err := swag.ReadJSON(raw, &propsArtifactInfo); err != nil {`,
 10208  		`	m.Path = propsArtifactInfo.Path`,
 10209  		`	m.Status = propsArtifactInfo.Status`,
 10210  		`	m.Timestamp = propsArtifactInfo.Timestamp`,
 10211  		`func (m ArtifactInfo) MarshalJSON() ([]byte, error) {`,
 10212  		`	_parts := make([][]byte, 0, 1`,
 10213  		`	aO0, err := swag.WriteJSON(m.ArtifactDescription`,
 10214  		`	if err != nil {`,
 10215  		`		return nil, err`,
 10216  		`	_parts = append(_parts, aO0`,
 10217  		`	var propsArtifactInfo struct {`,
 10218  		"		Path ArtifactPath `json:\"Path,omitempty\"`",
 10219  		"		Status ArtifactStatus `json:\"Status,omitempty\"`",
 10220  		"		Timestamp strfmt.DateTime `json:\"Timestamp,omitempty\"`",
 10221  		`	propsArtifactInfo.Path = m.Path`,
 10222  		`	propsArtifactInfo.Status = m.Status`,
 10223  		`	propsArtifactInfo.Timestamp = m.Timestamp`,
 10224  		`	jsonDataPropsArtifactInfo, errArtifactInfo := swag.WriteJSON(propsArtifactInfo`,
 10225  		`	if errArtifactInfo != nil {`,
 10226  		`		return nil, errArtifactInfo`,
 10227  		`	_parts = append(_parts, jsonDataPropsArtifactInfo`,
 10228  		`	return swag.ConcatJSON(_parts...), nil`,
 10229  		`func (m *ArtifactInfo) Validate(formats strfmt.Registry) error {`,
 10230  		`	if err := m.ArtifactDescription.Validate(formats); err != nil {`,
 10231  		`	if err := m.validatePath(formats); err != nil {`,
 10232  		`	if err := m.validateStatus(formats); err != nil {`,
 10233  		`	if err := m.validateTimestamp(formats); err != nil {`,
 10234  		`		return errors.CompositeValidationError(res...`,
 10235  		`func (m *ArtifactInfo) validatePath(formats strfmt.Registry) error {`,
 10236  		`	if swag.IsZero(m.Path) {`,
 10237  		`	if err := m.Path.Validate(formats); err != nil {`,
 10238  		`		if ve, ok := err.(*errors.Validation); ok {`,
 10239  		`			return ve.ValidateName("Path"`,
 10240  		`func (m *ArtifactInfo) validateStatus(formats strfmt.Registry) error {`,
 10241  		`	if swag.IsZero(m.Status) {`,
 10242  		`	if err := m.Status.Validate(formats); err != nil {`,
 10243  		`		if ve, ok := err.(*errors.Validation); ok {`,
 10244  		`			return ve.ValidateName("Status"`,
 10245  		`func (m *ArtifactInfo) validateTimestamp(formats strfmt.Registry) error {`,
 10246  		`	if swag.IsZero(m.Timestamp) {`,
 10247  		`	if err := validate.FormatOf("Timestamp", "body", "date-time", m.Timestamp.String(), formats); err != nil {`,
 10248  		`func (m *ArtifactInfo) MarshalBinary() ([]byte, error) {`,
 10249  		`	if m == nil {`,
 10250  		`		return nil, nil`,
 10251  		`	return swag.WriteJSON(m`,
 10252  		`func (m *ArtifactInfo) UnmarshalBinary(b []byte) error {`,
 10253  		`	var res ArtifactInfo`,
 10254  		`	if err := swag.ReadJSON(b, &res); err != nil {`,
 10255  		`	*m = res`,
 10256  	},
 10257  		// not expected
 10258  		todo,
 10259  		// output in log
 10260  		noLines,
 10261  		noLines)
 10262  }
 10263  
 10264  func initFixtureRealiasedTypes() {
 10265  	/*
 10266  	   realiased types
 10267  	*/
 10268  
 10269  	f := newModelFixture("../fixtures/bugs/1260/fixture-realiased-types.yaml", "test type realiasing")
 10270  	thisRun := f.AddRun(false).WithMinimalFlatten(true)
 10271  
 10272  	// load expectations for model: g1.go
 10273  	thisRun.AddExpectations("g1.go", []string{
 10274  		`type G1 struct {`,
 10275  		"	Prop1 int64 `json:\"prop1,omitempty\"`",
 10276  		// empty validation
 10277  		"func (m *G1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
 10278  	},
 10279  		// not expected
 10280  		todo,
 10281  		// output in log
 10282  		noLines,
 10283  		noLines)
 10284  
 10285  	// load expectations for model: e2v.go
 10286  	thisRun.AddExpectations("e2v.go", []string{
 10287  		`type E2v = E0v`,
 10288  	},
 10289  		// not expected
 10290  		todo,
 10291  		// output in log
 10292  		noLines,
 10293  		noLines)
 10294  
 10295  	// load expectations for model: a1v.go
 10296  	thisRun.AddExpectations("a1v.go", []string{
 10297  		`type A1v []int64`,
 10298  		`func (m A1v) Validate(formats strfmt.Registry) error {`,
 10299  		`	iA1vSize := int64(len(m)`,
 10300  		`	if err := validate.MaxItems("", "body", iA1vSize, 100); err != nil {`,
 10301  		`	for i := 0; i < len(m); i++ {`,
 10302  		`		if err := validate.MaximumInt(strconv.Itoa(i), "body", int64(m[i]), 100, false); err != nil {`,
 10303  		`		return errors.CompositeValidationError(res...`,
 10304  	},
 10305  		// not expected
 10306  		todo,
 10307  		// output in log
 10308  		noLines,
 10309  		noLines)
 10310  
 10311  	// load expectations for model: f2v.go
 10312  	thisRun.AddExpectations("f2v.go", []string{
 10313  		`type F2v = F0v`,
 10314  	},
 10315  		// not expected
 10316  		todo,
 10317  		// output in log
 10318  		noLines,
 10319  		noLines)
 10320  
 10321  	// load expectations for model: hsubtype1.go
 10322  	thisRun.AddExpectations("hsubtype1.go", []string{
 10323  		`type Hsubtype1 struct {`,
 10324  		`	h1p1Field string`,
 10325  		`	h1p2Field strfmt.Date`,
 10326  		"	Hsp1 uint32 `json:\"hsp1,omitempty\"`",
 10327  		`func (m *Hsubtype1) H1p1() string {`,
 10328  		`	return m.h1p1Field`,
 10329  		`func (m *Hsubtype1) SetH1p1(val string) {`,
 10330  		`	m.h1p1Field = val`,
 10331  		`func (m *Hsubtype1) H1p2() strfmt.Date {`,
 10332  		`	return m.h1p2Field`,
 10333  		`func (m *Hsubtype1) SetH1p2(val strfmt.Date) {`,
 10334  		`	m.h1p2Field = val`,
 10335  		`func (m *Hsubtype1) Validate(formats strfmt.Registry) error {`,
 10336  		`	if err := m.validateH1p2(formats); err != nil {`,
 10337  		`		return errors.CompositeValidationError(res...`,
 10338  		`func (m *Hsubtype1) validateH1p2(formats strfmt.Registry) error {`,
 10339  		`	if swag.IsZero(m.H1p2()) {`,
 10340  		`	if err := validate.FormatOf("h1p2", "body", "date", m.H1p2().String(), formats); err != nil {`,
 10341  	},
 10342  		// not expected
 10343  		todo,
 10344  		// output in log
 10345  		noLines,
 10346  		noLines)
 10347  
 10348  	// load expectations for model: f2.go
 10349  	thisRun.AddExpectations("f2.go", []string{
 10350  		`type F2 = F0`,
 10351  	},
 10352  		// not expected
 10353  		todo,
 10354  		// output in log
 10355  		noLines,
 10356  		noLines)
 10357  
 10358  	// load expectations for model: h0.go
 10359  	thisRun.AddExpectations("h0.go", []string{
 10360  		`type H0 = H1`,
 10361  		`func UnmarshalH0(reader io.Reader, consumer runtime.Consumer) (H0, error) {`,
 10362  		`	return UnmarshalH1(reader, consumer`,
 10363  		`func UnmarshalH0Slice(reader io.Reader, consumer runtime.Consumer) ([]H0, error) {`,
 10364  		`	return UnmarshalH1Slice(reader, consumer`,
 10365  	},
 10366  		// not expected
 10367  		todo,
 10368  		// output in log
 10369  		noLines,
 10370  		noLines)
 10371  
 10372  	// load expectations for model: c1v.go
 10373  	thisRun.AddExpectations("c1v.go", []string{
 10374  		`type C1v interface{`,
 10375  	},
 10376  		// not expected
 10377  		todo,
 10378  		// output in log
 10379  		noLines,
 10380  		noLines)
 10381  
 10382  	// load expectations for model: d0v.go
 10383  	thisRun.AddExpectations("d0v.go", []string{
 10384  		`type D0v = D1v`,
 10385  	},
 10386  		// not expected
 10387  		todo,
 10388  		// output in log
 10389  		noLines,
 10390  		noLines)
 10391  
 10392  	// load expectations for model: e2.go
 10393  	thisRun.AddExpectations("e2.go", []string{
 10394  		`type E2 = E0`,
 10395  	},
 10396  		// not expected
 10397  		todo,
 10398  		// output in log
 10399  		noLines,
 10400  		noLines)
 10401  
 10402  	// load expectations for model: d2v.go
 10403  	thisRun.AddExpectations("d2v.go", []string{
 10404  		`type D2v = D0v`,
 10405  	},
 10406  		// not expected
 10407  		todo,
 10408  		// output in log
 10409  		noLines,
 10410  		noLines)
 10411  
 10412  	// load expectations for model: b2v.go
 10413  	thisRun.AddExpectations("b2v.go", []string{
 10414  		`type B2v = B0v`,
 10415  	},
 10416  		// not expected
 10417  		todo,
 10418  		// output in log
 10419  		noLines,
 10420  		noLines)
 10421  
 10422  	// load expectations for model: a1.go
 10423  	thisRun.AddExpectations("a1.go", []string{
 10424  		`type A1 []int64`,
 10425  		// empty validation
 10426  		"func (m A1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
 10427  	},
 10428  		// not expected
 10429  		todo,
 10430  		// output in log
 10431  		noLines,
 10432  		noLines)
 10433  
 10434  	// load expectations for model: hsubtype2.go
 10435  	thisRun.AddExpectations("hsubtype2.go", []string{
 10436  		`type Hsubtype2 struct {`,
 10437  		`	h1p1Field string`,
 10438  		`	h1p2Field strfmt.Date`,
 10439  		"	Hsp2 strfmt.DateTime `json:\"hsp2,omitempty\"`",
 10440  		`func (m *Hsubtype2) H1p1() string {`,
 10441  		`	return m.h1p1Field`,
 10442  		`func (m *Hsubtype2) SetH1p1(val string) {`,
 10443  		`	m.h1p1Field = val`,
 10444  		`func (m *Hsubtype2) H1p2() strfmt.Date {`,
 10445  		`	return m.h1p2Field`,
 10446  		`func (m *Hsubtype2) SetH1p2(val strfmt.Date) {`,
 10447  		`	m.h1p2Field = val`,
 10448  		`func (m *Hsubtype2) Validate(formats strfmt.Registry) error {`,
 10449  		`	if err := m.validateH1p2(formats); err != nil {`,
 10450  		`	if err := m.validateHsp2(formats); err != nil {`,
 10451  		`		return errors.CompositeValidationError(res...`,
 10452  		`func (m *Hsubtype2) validateH1p2(formats strfmt.Registry) error {`,
 10453  		`	if swag.IsZero(m.H1p2()) {`,
 10454  		`	if err := validate.FormatOf("h1p2", "body", "date", m.H1p2().String(), formats); err != nil {`,
 10455  		`func (m *Hsubtype2) validateHsp2(formats strfmt.Registry) error {`,
 10456  		`	if swag.IsZero(m.Hsp2) {`,
 10457  		`	if err := validate.FormatOf("hsp2", "body", "date-time", m.Hsp2.String(), formats); err != nil {`,
 10458  	},
 10459  		// not expected
 10460  		todo,
 10461  		// output in log
 10462  		noLines,
 10463  		noLines)
 10464  
 10465  	// load expectations for model: b2.go
 10466  	thisRun.AddExpectations("b2.go", []string{
 10467  		`type B2 = B0`,
 10468  	},
 10469  		// not expected
 10470  		todo,
 10471  		// output in log
 10472  		noLines,
 10473  		noLines)
 10474  
 10475  	// load expectations for model: b1.go
 10476  	thisRun.AddExpectations("b1.go", []string{
 10477  		`type B1 map[string]int64`,
 10478  		// empty validation
 10479  		"func (m B1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
 10480  	},
 10481  		// not expected
 10482  		todo,
 10483  		// output in log
 10484  		noLines,
 10485  		noLines)
 10486  
 10487  	// load expectations for model: d0.go
 10488  	thisRun.AddExpectations("d0.go", []string{
 10489  		`type D0 = D1`,
 10490  	},
 10491  		// not expected
 10492  		todo,
 10493  		// output in log
 10494  		noLines,
 10495  		noLines)
 10496  
 10497  	// load expectations for model: g1v.go
 10498  	thisRun.AddExpectations("g1v.go", []string{
 10499  		`type G1v struct {`,
 10500  		"	Prop1v int64 `json:\"prop1v,omitempty\"`",
 10501  		"	Prop2v *int64 `json:\"prop2v\"`",
 10502  		`func (m *G1v) Validate(formats strfmt.Registry) error {`,
 10503  		`	if err := m.validateProp1v(formats); err != nil {`,
 10504  		`	if err := m.validateProp2v(formats); err != nil {`,
 10505  		`		return errors.CompositeValidationError(res...`,
 10506  		`func (m *G1v) validateProp1v(formats strfmt.Registry) error {`,
 10507  		`	if swag.IsZero(m.Prop1v) {`,
 10508  		`	if err := validate.MaximumInt("prop1v", "body", int64(m.Prop1v), 100, false); err != nil {`,
 10509  		`func (m *G1v) validateProp2v(formats strfmt.Registry) error {`,
 10510  		`	if err := validate.Required("prop2v", "body", m.Prop2v); err != nil {`,
 10511  	},
 10512  		// not expected
 10513  		todo,
 10514  		// output in log
 10515  		noLines,
 10516  		noLines)
 10517  
 10518  	// load expectations for model: e0.go
 10519  	thisRun.AddExpectations("e0.go", []string{
 10520  		`type E0 = E1`,
 10521  	},
 10522  		// not expected
 10523  		todo,
 10524  		// output in log
 10525  		noLines,
 10526  		noLines)
 10527  
 10528  	// load expectations for model: f0v.go
 10529  	thisRun.AddExpectations("f0v.go", []string{
 10530  		`type F0v = F1v`,
 10531  	},
 10532  		// not expected
 10533  		todo,
 10534  		// output in log
 10535  		noLines,
 10536  		noLines)
 10537  
 10538  	// load expectations for model: h2.go
 10539  	thisRun.AddExpectations("h2.go", []string{
 10540  		`type H2 = H0`,
 10541  		`func UnmarshalH2(reader io.Reader, consumer runtime.Consumer) (H2, error) {`,
 10542  		`	return UnmarshalH0(reader, consumer`,
 10543  		`func UnmarshalH2Slice(reader io.Reader, consumer runtime.Consumer) ([]H2, error) {`,
 10544  		`	return UnmarshalH0Slice(reader, consumer`,
 10545  	},
 10546  		// not expected
 10547  		todo,
 10548  		// output in log
 10549  		noLines,
 10550  		noLines)
 10551  
 10552  	// load expectations for model: b1v.go
 10553  	thisRun.AddExpectations("b1v.go", []string{
 10554  		`type B1v map[string]int64`,
 10555  		`func (m B1v) Validate(formats strfmt.Registry) error {`,
 10556  		`	for k := range m {`,
 10557  		`		if err := validate.MaximumInt(k, "body", int64(m[k]), 100, false); err != nil {`,
 10558  		`		return errors.CompositeValidationError(res...`,
 10559  	},
 10560  		// not expected
 10561  		todo,
 10562  		// output in log
 10563  		noLines,
 10564  		noLines)
 10565  
 10566  	// load expectations for model: f0.go
 10567  	thisRun.AddExpectations("f0.go", []string{
 10568  		`type F0 = F1`,
 10569  	},
 10570  		// not expected
 10571  		todo,
 10572  		// output in log
 10573  		noLines,
 10574  		noLines)
 10575  
 10576  	// load expectations for model: a2v.go
 10577  	thisRun.AddExpectations("a2v.go", []string{
 10578  		`type A2v = A0v`,
 10579  	},
 10580  		// not expected
 10581  		todo,
 10582  		// output in log
 10583  		noLines,
 10584  		noLines)
 10585  
 10586  	// load expectations for model: hs2.go
 10587  	thisRun.AddExpectations("hs2.go", []string{
 10588  		`type Hs2 struct {`,
 10589  		`	Hs0`,
 10590  		// empty validation
 10591  		"func (m *Hs2) Validate(formats strfmt.Registry) error {\n	return nil\n}",
 10592  	},
 10593  		// not expected
 10594  		todo,
 10595  		// output in log
 10596  		noLines,
 10597  		noLines)
 10598  
 10599  	// load expectations for model: d1v.go
 10600  	thisRun.AddExpectations("d1v.go", []string{
 10601  		`type D1v int64`,
 10602  		`func (m D1v) Validate(formats strfmt.Registry) error {`,
 10603  		`	if err := validate.MaximumInt("", "body", int64(m), 100, false); err != nil {`,
 10604  		`		return errors.CompositeValidationError(res...`,
 10605  	},
 10606  		// not expected
 10607  		todo,
 10608  		// output in log
 10609  		noLines,
 10610  		noLines)
 10611  
 10612  	// load expectations for model: c1.go
 10613  	thisRun.AddExpectations("c1.go", []string{
 10614  		`type C1 interface{`,
 10615  	},
 10616  		// not expected
 10617  		todo,
 10618  		// output in log
 10619  		noLines,
 10620  		noLines)
 10621  
 10622  	// load expectations for model: c2.go
 10623  	thisRun.AddExpectations("c2.go", []string{
 10624  		`type C2 = C0`,
 10625  	},
 10626  		// not expected
 10627  		todo,
 10628  		// output in log
 10629  		noLines,
 10630  		noLines)
 10631  
 10632  	// load expectations for model: e0v.go
 10633  	thisRun.AddExpectations("e0v.go", []string{
 10634  		`type E0v = E1v`,
 10635  	},
 10636  		// not expected
 10637  		todo,
 10638  		// output in log
 10639  		noLines,
 10640  		noLines)
 10641  
 10642  	// load expectations for model: d1.go
 10643  	thisRun.AddExpectations("d1.go", []string{
 10644  		`type D1 int64`,
 10645  		// empty validation
 10646  		"func (m D1) Validate(formats strfmt.Registry) error {\n	return nil\n}",
 10647  	},
 10648  		// not expected
 10649  		todo,
 10650  		// output in log
 10651  		noLines,
 10652  		noLines)
 10653  
 10654  	// load expectations for model: g2.go
 10655  	thisRun.AddExpectations("g2.go", []string{
 10656  		`type G2 struct {`,
 10657  		`	G0`,
 10658  		// empty validation
 10659  		"func (m *G2) Validate(formats strfmt.Registry) error {\n	return nil\n}",
 10660  	},
 10661  		// not expected
 10662  		todo,
 10663  		// output in log
 10664  		noLines,
 10665  		noLines)
 10666  
 10667  	// load expectations for model: d2.go
 10668  	thisRun.AddExpectations("d2.go", []string{
 10669  		`type D2 = D0`,
 10670  	},
 10671  		// not expected
 10672  		todo,
 10673  		// output in log
 10674  		noLines,
 10675  		noLines)
 10676  
 10677  	// load expectations for model: b0.go
 10678  	thisRun.AddExpectations("b0.go", []string{
 10679  		`type B0 = B1`,
 10680  	},
 10681  		// not expected
 10682  		todo,
 10683  		// output in log
 10684  		noLines,
 10685  		noLines)
 10686  
 10687  	// load expectations for model: c2v.go
 10688  	thisRun.AddExpectations("c2v.go", []string{
 10689  		`type C2v = C0v`,
 10690  	},
 10691  		// not expected
 10692  		todo,
 10693  		// output in log
 10694  		noLines,
 10695  		noLines)
 10696  
 10697  	// load expectations for model: g0.go
 10698  	thisRun.AddExpectations("g0.go", []string{
 10699  		`type G0 struct {`,
 10700  		`	G1`,
 10701  		// empty validation
 10702  		"func (m *G0) Validate(formats strfmt.Registry) error {\n	return nil\n}",
 10703  	},
 10704  		// not expected
 10705  		todo,
 10706  		// output in log
 10707  		noLines,
 10708  		noLines)
 10709  
 10710  	// load expectations for model: a0.go
 10711  	thisRun.AddExpectations("a0.go", []string{
 10712  		`type A0 = A1`,
 10713  	},
 10714  		// not expected
 10715  		todo,
 10716  		// output in log
 10717  		noLines,
 10718  		noLines)
 10719  
 10720  	// load expectations for model: a2.go
 10721  	thisRun.AddExpectations("a2.go", []string{
 10722  		`type A2 = A0`,
 10723  	},
 10724  		// not expected
 10725  		todo,
 10726  		// output in log
 10727  		noLines,
 10728  		noLines)
 10729  
 10730  	// load expectations for model: h1.go
 10731  	thisRun.AddExpectations("h1.go", []string{
 10732  		`type H1 interface {`,
 10733  		`	runtime.Validatable`,
 10734  		`	H1p1() string`,
 10735  		`	SetH1p1(string`,
 10736  		`	H1p2() strfmt.Date`,
 10737  		`	SetH1p2(strfmt.Date`,
 10738  		`type h1 struct {`,
 10739  		`	h1p1Field string`,
 10740  		`	h1p2Field strfmt.Date`,
 10741  		`func (m *h1) H1p1() string {`,
 10742  		`	return m.h1p1Field`,
 10743  		`func (m *h1) SetH1p1(val string) {`,
 10744  		`	m.h1p1Field = val`,
 10745  		`func (m *h1) H1p2() strfmt.Date {`,
 10746  		`	return m.h1p2Field`,
 10747  		`func (m *h1) SetH1p2(val strfmt.Date) {`,
 10748  		`	m.h1p2Field = val`,
 10749  		`func UnmarshalH1Slice(reader io.Reader, consumer runtime.Consumer) ([]H1, error) {`,
 10750  		`	var elements []json.RawMessage`,
 10751  		`	if err := consumer.Consume(reader, &elements); err != nil {`,
 10752  		`		return nil, err`,
 10753  		`	var result []H1`,
 10754  		`	for _, element := range elements {`,
 10755  		`		obj, err := unmarshalH1(element, consumer`,
 10756  		`		if err != nil {`,
 10757  		`			return nil, err`,
 10758  		`		result = append(result, obj`,
 10759  		`	return result, nil`,
 10760  		`func UnmarshalH1(reader io.Reader, consumer runtime.Consumer) (H1, error) {`,
 10761  		`	data, err := ioutil.ReadAll(reader`,
 10762  		`	if err != nil {`,
 10763  		`		return nil, err`,
 10764  		`	return unmarshalH1(data, consumer`,
 10765  		`func unmarshalH1(data []byte, consumer runtime.Consumer) (H1, error) {`,
 10766  		`	buf := bytes.NewBuffer(data`,
 10767  		`	buf2 := bytes.NewBuffer(data`,
 10768  		`	var getType struct {`,
 10769  		"		Htype string `json:\"htype\"`",
 10770  		`	if err := consumer.Consume(buf, &getType); err != nil {`,
 10771  		`		return nil, err`,
 10772  		`	if err := validate.RequiredString("htype", "body", getType.Htype); err != nil {`,
 10773  		`		return nil, err`,
 10774  		`	switch getType.Htype {`,
 10775  		`	case "h1":`,
 10776  		`		var result h1`,
 10777  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
 10778  		`			return nil, err`,
 10779  		`		return &result, nil`,
 10780  		`	case "hsubtype1":`,
 10781  		`		var result Hsubtype1`,
 10782  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
 10783  		`			return nil, err`,
 10784  		`		return &result, nil`,
 10785  		`	case "hsubtype2":`,
 10786  		`		var result Hsubtype2`,
 10787  		`		if err := consumer.Consume(buf2, &result); err != nil {`,
 10788  		`			return nil, err`,
 10789  		`		return &result, nil`,
 10790  		`	return nil, errors.New(422, "invalid htype value: %q", getType.Htype`,
 10791  		`func (m *h1) Validate(formats strfmt.Registry) error {`,
 10792  		`	if err := m.validateH1p2(formats); err != nil {`,
 10793  		`		return errors.CompositeValidationError(res...`,
 10794  		`func (m *h1) validateH1p2(formats strfmt.Registry) error {`,
 10795  		`	if swag.IsZero(m.H1p2()) {`,
 10796  		`	if err := validate.FormatOf("h1p2", "body", "date", m.H1p2().String(), formats); err != nil {`,
 10797  	},
 10798  		// not expected
 10799  		todo,
 10800  		// output in log
 10801  		noLines,
 10802  		noLines)
 10803  
 10804  	// load expectations for model: c0v.go
 10805  	thisRun.AddExpectations("c0v.go", []string{
 10806  		`type C0v = C1v`,
 10807  	},
 10808  		// not expected
 10809  		todo,
 10810  		// output in log
 10811  		noLines,
 10812  		noLines)
 10813  
 10814  	// load expectations for model: g2v.go
 10815  	thisRun.AddExpectations("g2v.go", []string{
 10816  		`type G2v struct {`,
 10817  		`	G0v`,
 10818  		// empty validation
 10819  		"func (m *G2v) Validate(formats strfmt.Registry) error {\n	return nil\n}",
 10820  	},
 10821  		// not expected
 10822  		todo,
 10823  		// output in log
 10824  		noLines,
 10825  		noLines)
 10826  
 10827  	// load expectations for model: f1.go
 10828  	thisRun.AddExpectations("f1.go", []string{
 10829  		`type F1 strfmt.UUID`,
 10830  		`func (m F1) Validate(formats strfmt.Registry) error {`,
 10831  		`	if err := validate.FormatOf("", "body", "uuid", strfmt.UUID(m).String(), formats); err != nil {`,
 10832  		`		return errors.CompositeValidationError(res...`,
 10833  	},
 10834  		// not expected
 10835  		todo,
 10836  		// output in log
 10837  		noLines,
 10838  		noLines)
 10839  
 10840  	// load expectations for model: e1.go
 10841  	thisRun.AddExpectations("e1.go", []string{
 10842  		`type E1 strfmt.Date`,
 10843  		`func (m E1) Validate(formats strfmt.Registry) error {`,
 10844  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
 10845  		`		return errors.CompositeValidationError(res...`,
 10846  	},
 10847  		// not expected
 10848  		todo,
 10849  		// output in log
 10850  		noLines,
 10851  		noLines)
 10852  
 10853  	// load expectations for model: a0v.go
 10854  	thisRun.AddExpectations("a0v.go", []string{
 10855  		`type A0v = A1v`,
 10856  	},
 10857  		// not expected
 10858  		todo,
 10859  		// output in log
 10860  		noLines,
 10861  		noLines)
 10862  
 10863  	// load expectations for model: c0.go
 10864  	thisRun.AddExpectations("c0.go", []string{
 10865  		`type C0 = C1`,
 10866  	},
 10867  		// not expected
 10868  		todo,
 10869  		// output in log
 10870  		noLines,
 10871  		noLines)
 10872  
 10873  	// load expectations for model: f1v.go
 10874  	thisRun.AddExpectations("f1v.go", []string{
 10875  		`type F1v strfmt.UUID`,
 10876  		`func (m F1v) Validate(formats strfmt.Registry) error {`,
 10877  		`	if err := validate.FormatOf("", "body", "uuid", strfmt.UUID(m).String(), formats); err != nil {`,
 10878  		`		return errors.CompositeValidationError(res...`,
 10879  	},
 10880  		// not expected
 10881  		todo,
 10882  		// output in log
 10883  		noLines,
 10884  		noLines)
 10885  
 10886  	// load expectations for model: e1v.go
 10887  	thisRun.AddExpectations("e1v.go", []string{
 10888  		`type E1v strfmt.Date`,
 10889  		`func (m E1v) Validate(formats strfmt.Registry) error {`,
 10890  		`	if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
 10891  		`		return errors.CompositeValidationError(res...`,
 10892  	},
 10893  		// not expected
 10894  		todo,
 10895  		// output in log
 10896  		noLines,
 10897  		noLines)
 10898  
 10899  	// load expectations for model: b0v.go
 10900  	thisRun.AddExpectations("b0v.go", []string{
 10901  		`type B0v = B1v`,
 10902  	},
 10903  		// not expected
 10904  		todo,
 10905  		// output in log
 10906  		noLines,
 10907  		noLines)
 10908  
 10909  	// load expectations for model: g0v.go
 10910  	thisRun.AddExpectations("g0v.go", []string{
 10911  		`type G0v struct {`,
 10912  		`	G1v`,
 10913  		// empty validation
 10914  		"func (m *G0v) Validate(formats strfmt.Registry) error {\n	return nil\n}",
 10915  	},
 10916  		// not expected
 10917  		todo,
 10918  		// output in log
 10919  		noLines,
 10920  		noLines)
 10921  
 10922  	// load expectations for model: hs0.go
 10923  	thisRun.AddExpectations("hs0.go", []string{
 10924  		`type Hs0 struct {`,
 10925  		`	Hsubtype1`,
 10926  		// empty validation
 10927  		"func (m *Hs0) Validate(formats strfmt.Registry) error {\n	return nil\n}",
 10928  	},
 10929  		// not expected
 10930  		todo,
 10931  		// output in log
 10932  		noLines,
 10933  		noLines)
 10934  }