Repository: go-swagger/go-swagger
Pull request #2476 (2021-01-10 13:21:09)

refactored validations handling in models and type resolver
* improved the readbility of the generated validation code for formatted types:
  * reduced unnecessary type conversions and pointer indirections in generated code
  * generalized usage of strfmt types
    as fmt.Stringer: myString.String() rather than string(*myString)

* used newly exposed helpers from go-openapi/spec to
  factorize validations handling for both schemas and simple types

* refactored validations guards
  * previously unsupported validations on formatted typs (excluded as "conflicting")
    are now tolerated - so it is now possible to combine the use of formatted strings
    with other validations such as MinLength, Pattern etc
  * refactored validation guards using go-openapi/spec Validations

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>

codegen improvement: better generated code for string validations (less type conversions and pointer indirections)

Signed-off-by: Frederic BIDON <fredbi@yahoo.com>

codecov[bot]: # [Codecov](https://codecov.io/gh/go-swagger/go-swagger/pull/2476?src=pr&el=h1) Report
> Merging [#2476](https://codecov.io/gh/go-swagger/go-swagger/pull/2476?src=pr&el=desc) (ffdd987) into [master](https://codecov.io/gh/go-swagger/go-swagger/commit/71b519b857389051ce728e4a413307d3201f8757?el=desc) (71b519b) will **increase** coverage by `0.56%`.
> The diff coverage is `97.41%`.

[![Impacted file tree graph](https://codecov.io/gh/go-swagger/go-swagger/pull/2476/graphs/tree.svg?width=650&height=150&src=pr&token=aQS1DepR8C)](https://codecov.io/gh/go-swagger/go-swagger/pull/2476?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #2476      +/-   ##
==========================================
+ Coverage   81.33%   81.90%   +0.56%     
==========================================
  Files          53       53              
  Lines        8434     8332     -102     
==========================================
- Hits         6860     6824      -36     
+ Misses       1061     1017      -44     
+ Partials      513      491      -22     
```


| [Impacted Files](https://codecov.io/gh/go-swagger/go-swagger/pull/2476?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [generator/shared.go](https://codecov.io/gh/go-swagger/go-swagger/pull/2476/diff?src=pr&el=tree#diff-Z2VuZXJhdG9yL3NoYXJlZC5nbw==) | `88.77% <ø> (-0.62%)` | :arrow_down: |
| [generator/structs.go](https://codecov.io/gh/go-swagger/go-swagger/pull/2476/diff?src=pr&el=tree#diff-Z2VuZXJhdG9yL3N0cnVjdHMuZ28=) | `82.97% <75.00%> (-0.24%)` | :arrow_down: |
| [generator/types.go](https://codecov.io/gh/go-swagger/go-swagger/pull/2476/diff?src=pr&el=tree#diff-Z2VuZXJhdG9yL3R5cGVzLmdv) | `92.23% <96.36%> (+8.66%)` | :arrow_up: |
| [generator/model.go](https://codecov.io/gh/go-swagger/go-swagger/pull/2476/diff?src=pr&el=tree#diff-Z2VuZXJhdG9yL21vZGVsLmdv) | `84.83% <100.00%> (-0.11%)` | :arrow_down: |
| [generator/operation.go](https://codecov.io/gh/go-swagger/go-swagger/pull/2476/diff?src=pr&el=tree#diff-Z2VuZXJhdG9yL29wZXJhdGlvbi5nbw==) | `94.34% <100.00%> (+0.04%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/go-swagger/go-swagger/pull/2476?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/go-swagger/go-swagger/pull/2476?src=pr&el=footer). Last update [71b519b...ffdd987](https://codecov.io/gh/go-swagger/go-swagger/pull/2476?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/fixtures/enhancements/guard-formats/.gitignore b/fixtures/enhancements/guard-formats/.gitignore
new file mode 100644
index 00000000..1e16265b
--- /dev/null
+++ b/fixtures/enhancements/guard-formats/.gitignore
@@ -0,0 +1,3 @@
+gen-*
+!gen-fixtures.sh
+*.log
diff --git a/fixtures/enhancements/guard-formats/fixture-guard-formats.yaml b/fixtures/enhancements/guard-formats/fixture-guard-formats.yaml
new file mode 100644
index 00000000..30b72f4a
--- /dev/null
+++ b/fixtures/enhancements/guard-formats/fixture-guard-formats.yaml
@@ -0,0 +1,183 @@
+swagger: '2.0'
+basePath: /
+host: localhost
+info:
+  version: 0.1.0
+  title: Check format validations
+  termsOfService: |
+    There are actually none.
+  license:
+    name: 'Apache 2.0'
+    url: https://www.apache.org/licenses/LICENSE-2.0
+
+consumes:
+  - application/json
+produces:
+  - application/json
+paths:
+  /{p0}/{p1}:
+    get:
+      parameters:
+        - name: body
+          in: body
+          schema:
+            $ref: '#/definitions/object'
+        - name: p0
+          in: path
+          required: true
+          type: string
+          pattern: '(\d+)-(\d+)'
+          minLength: 12
+          maxLength: 16
+        - name: p1
+          required: true
+          in: path
+          type: string
+          format: date
+          pattern: '(\d+)/(\d+)'
+          minLength: 12
+          maxLength: 16
+        - name: p2
+          in: query
+          type: string
+          format: uuid
+          pattern: '(\d+)-(\d+)'
+          minLength: 12
+          maxLength: 16
+        - name: p3
+          in: query
+          type: string
+          format: datetime
+          pattern: '(\d+)-(\d+)'
+          minLength: 12
+          maxLength: 16
+        - name: p4
+          in: query
+          type: string
+          format: bsonobjectid
+          pattern: '(\d+)-(\d+)'
+          minLength: 12
+          maxLength: 16
+        - name: p5
+          in: query
+          type: string
+          format: duration
+          pattern: '(\d+)-(\d+)'
+          minLength: 12
+          maxLength: 16
+        - name: p6
+          in: query
+          type: string
+          format: byte
+          pattern: '(\d+)-(\d+)'
+          minLength: 12
+          maxLength: 16
+      responses:
+        default:
+          description: error
+
+  /:
+    post:
+      consumes:
+      - multipart/form-data
+      parameters:
+        - name: upload
+          required: true
+          in: formData
+          type: file
+          pattern: '(\d+)-(\d+)'
+          minLength: 12
+          maxLength: 16
+      responses:
+        default:
+          description: error
+
+definitions:
+  object:
+    required: [ p0, p1, p7, p8, p9, p10, p11 ]
+    properties:
+      p0:
+        type: string
+        pattern: '(\d+)-(\d+)'
+        minLength: 12
+        maxLength: 16
+      p1:
+        type: string
+        format: date
+        pattern: '(\d+)/(\d+)'
+        minLength: 12
+        maxLength: 16
+      p1Nullable:
+        type: string
+        format: date
+        pattern: '(\d+)/(\d+)'
+        minLength: 12
+        maxLength: 16
+        x-nullable: true
+      p2:
+        type: string
+        format: uuid
+        pattern: '(\d+)-(\d+)'
+        minLength: 12
+        maxLength: 16
+      p3:
+        type: string
+        format: datetime
+        pattern: '(\d+)-(\d+)'
+        minLength: 12
+        maxLength: 16
+      p4:
+        type: string
+        format: bsonobjectid
+        pattern: '(\d+)-(\d+)'
+        minLength: 12
+        maxLength: 16
+      p5:
+        type: string
+        format: duration
+        pattern: '(\d+)-(\d+)'
+        minLength: 12
+        maxLength: 16
+      p6:
+        type: string
+        format: byte
+        pattern: '(\d+)-(\d+)'
+        minLength: 12
+        maxLength: 16
+      p7:
+        type: string
+        format: binary
+        pattern: '(\d+)-(\d+)'
+        minLength: 12
+        maxLength: 16
+      p8:
+        $ref: '#/definitions/aliasedDate'
+      p9:
+        $ref: '#/definitions/aliasedReader'
+      p10:
+        type: string
+        pattern: '(\d+)-(\d+)'
+        minLength: 12
+        maxLength: 16
+        x-nullable: false
+      p11:
+        $ref: '#/definitions/aliasedString'
+
+  aliasedDate:
+        type: string
+        format: date
+        pattern: '(\d+)/(\d+)'
+        minLength: 16
+        maxLength: 20
+
+  aliasedReader:
+        type: string
+        format: binary
+        pattern: '(\d+)/(\d+)'
+        minLength: 16
+        maxLength: 20
+  aliasedString:
+        type: string
+        pattern: '(\d+)/(\d+)'
+        minLength: 16
+        maxLength: 20
diff --git a/fixtures/enhancements/guard-formats/gen-fixtures.sh b/fixtures/enhancements/guard-formats/gen-fixtures.sh
new file mode 100755
index 00000000..2b876a3b
--- /dev/null
+++ b/fixtures/enhancements/guard-formats/gen-fixtures.sh
@@ -0,0 +1,74 @@
+#! /bin/bash
+if [[ ${1} == "--clean" ]] ; then
+    clean=1
+fi
+continueOnError=
+# A small utility to build fixture servers
+# Fixtures with models only
+testcases="fixture-guard-formats.yaml"
+for opts in  "" "--with-expand" ; do
+for testcase in ${testcases} ; do
+    grep -q discriminator ${testcase}
+    discriminated=$?
+    if [[ ${discriminated} -eq 0 && ${opts} == "--with-expand" ]] ; then
+        echo "Skipped ${testcase} with ${opts}: discriminator not supported with ${opts}"
+        continue
+    fi
+    if [[ ${testcase} == "../1479/fixture-1479-part.yaml" && ${opts} == "--with-expand" ]] ; then
+        echo "Skipped ${testcase} with ${opts}: known issue with enum in anonymous allOf not validated. See you next PR"
+        continue
+    fi
+
+    spec=${testcase}
+    testcase=`basename ${testcase}`
+    if [[ -z ${opts} ]]; then
+        target=./gen-${testcase%.*}-flatten
+    else
+        target=./gen-${testcase%.*}-expand
+    fi
+    serverName="codegensrv"
+    rm -rf ${target}
+    mkdir ${target}
+    echo "Model generation for ${spec} with opts=${opts}"
+    serverName="nrcodegen"
+    swagger generate server --skip-validation ${opts} --spec ${spec} --target ${target} --name=${serverName} 1>${testcase%.*}.log 2>&1
+    # 1>x.log 2>&1
+    #
+    if [[ $? != 0 ]] ; then
+        echo "Generation failed for ${spec}"
+        if [[ ! -z ${continueOnError} ]] ; then
+            failures="${failures} codegen:${spec}"
+            continue
+        else
+            exit 1
+        fi
+    fi
+    echo "${spec}: Generation OK"
+    if [[ ! -d ${target}/models ]] ; then
+        echo "No model in this spec! Continue building server"
+    fi
+    if [[ -d ${target}/cmd/${serverName}"-server" ]] ; then
+        (cd ${target}/cmd/${serverName}"-server"; go build)
+        #(cd ${target}/models; go build)
+        if [[ $? != 0 ]] ; then
+            echo "Build failed for ${spec}"
+            if [[ ! -z ${continueOnError} ]] ; then
+                failures="${failures} build:${spec}"
+                continue
+            else
+                exit 1
+            fi
+        fi
+        echo "${spec}: Build OK"
+        if [[ -n ${clean} ]] ; then
+             rm -rf ${target}
+        fi
+    fi
+done
+done
+if [[ ! -z ${failures} ]] ; then
+    echo ${failures}|tr ' ' '\n'
+else
+    echo "No failures"
+fi
+exit
diff --git a/generator/bindata.go b/generator/bindata.go
index cc8ee9e1..489566a3 100644
--- a/generator/bindata.go
+++ b/generator/bindata.go
@@ -17,7 +17,7 @@
 // templates/schemaembedded.gotmpl (1.006kB)
 // templates/schemapolymorphic.gotmpl (2.125kB)
 // templates/schematype.gotmpl (965B)
-// templates/schemavalidator.gotmpl (49.841kB)
+// templates/schemavalidator.gotmpl (49.954kB)
 // templates/serializers/additionalpropertiesserializer.gotmpl (2.824kB)
 // templates/serializers/aliasedserializer.gotmpl (480B)
 // templates/serializers/allofserializer.gotmpl (7.467kB)
@@ -37,11 +37,11 @@
 // templates/server/urlbuilder.gotmpl (7.641kB)
 // templates/structfield.gotmpl (1.291kB)
 // templates/swagger_json_embed.gotmpl (759B)
-// templates/validation/customformat.gotmpl (473B)
+// templates/validation/customformat.gotmpl (194B)
 // templates/validation/maximum.gotmpl (1.751kB)
 // templates/validation/minimum.gotmpl (1.746kB)
 // templates/validation/multipleOf.gotmpl (1.816kB)
-// templates/validation/primitive.gotmpl (1.495kB)
+// templates/validation/primitive.gotmpl (1.16kB)
 // templates/validation/structfield.gotmpl (909B)
 
 package generator
@@ -451,7 +451,7 @@ func templatesSchematypeGotmpl() (*asset, error) {
 	return a, nil
 }
 
-var _templatesSchemavalidatorGotmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5d\x5b\x73\xe3\x38\x76\x7e\x8e\x7e\xc5\x89\xcb\x49\x24\xaf\x47\xda\x87\xad\x7d\xf0\xa4\x53\x35\xd3\xdd\xbb\xeb\xca\xf6\x76\xd7\xf4\x4c\x3f\x64\x6a\x2a\x03\x93\x90\x8c\x6d\x0a\x64\x03\xa4\x6c\x45\xa5\xff\x9e\x02\xc0\x0b\x00\x02\xbc\x48\xa2\x25\xdb\xf2\x93\x4c\x82\x20\x2e\xe7\xf2\x9d\xef\x00\xe0\x66\x03\x21\x9e\x13\x8a\xe1\x22\x61\x64\x49\x52\xb2\xc2\x73\x82\xa3\x30\x88\x69\x8a\x1f\xd3\x15\x8a\x48\x88\xd2\x98\x5d\xc0\x76\x3b\x02\xd8\x6c\x80\xcc\x61\xfa\x13\x46\xe1\x47\x1a\xad\xd5\x45\x10\xd7\x30\x63\x70\xf3\x06\xf2\x07\x70\x59\x64\x1c\xa4\x8f\xd7\xc5\x73\x9f\x50\x7a\x0f\xdb\xed\x66\xa3\xff\xc4\x11\xc7\xb0\xdd\x5e\x5c\x88\xdf\x34\x84\xed\x56\x96\x4f\x18\xa1\xe9\x1c\x2e\xfe\xed\xdb\x05\x4c\xff\x1e\x07\x28\x25\x31\x2d\x6e\x92\x39\xd0\x38\x85\x71\xcc\x60\x7a\xcb\x7f\xa0\x31\x5d\x2f\xe3\x8c\x8b\x7f\xfe\x91\x45\x11\xba\x8b\xf0\x24\x7f\xd1\x5f\xe3\x9f\xd7\x89\x78\xc1\xb8\xac\x7f\xb3\x99\x7e\x41\x51\x86\xdf\x3f\x26\x0c\x73\xae\xea\xed\x5e\xeb\xa4\xac\x68\xf2\xbd\xec\xf7\xbf\xbe\x01\x4a\xa2\x8d\x1c\x0a\x00\x86\xd3\x8c\x51\x71\x43\x5e\xc8\x87\x4d\x3d\x30\x32\x7e\xb9\x87\xde\x3b\xe6\xdf\x32\xc2\x70\xa8\x2e\x3a\x47\x5c\x15\x50\xe5\x11\x0d\x61\x8c\xbf\x95\xfd\xbf\xe0\x29\x23\x74\x71\x31\x81\xb1\xe8\xa3\xd5\xa5\xcf\xf2\x66\xd9\xb8\xf1\x6b\x98\x2f\x50\x13\x66\x4c\x97\x39\x59\xe5\xd8\x7f\x20\xf4\xef\x98\x2e\xe4\x08\xb8\x07\xbf\x2c\x71\xd8\xa1\x53\x93\x56\xd4\x59\x75\x0b\xb6\xdb\xab\xe6\xe1\x99\x88\x9a\x8d\x86\xef\xdc\x79\xf4\xd8\xd6\xf9\xa2\xc4\x89\x75\x5e\x6b\xf8\xae\x9d\xff\x84\xd2\x14\x33\xea\xed\x7a\x7e\xff\x84\x3a\xfe\xbb\x28\xc1\x03\x94\xe0\x1f\x51\xf0\x35\x25\xc1\x57\xae\x77\xe3\xf7\x3d\x74\x80\x2c\xb3\x65\x61\xf2\x37\x1b\x48\xf1\x32\x89\x50\x8a\xe1\x22\x1f\x0e\x12\xd3\xbc\xd4\x05\x4c\xcb\x87\x1d\xf2\xd4\xa5\x22\x55\xaa\xb1\xa2\x2c\x4a\x49\x12\xe1\x8f\xf3\xb6\xba\xca\x82\x4d\xd5\xbd\xa7\x45\xa3\x66\x33\x31\xc1\x19\x06\x4c\xb3\xa5\x31\xef\x9b\xcd\xf4\x27\x1c\x60\xb2\xc2\xec\x1f\x68\x29\x26\x64\x5a\x88\x82\x98\x51\xc4\x03\x14\x91\xff\xc3\x30\xcd\xef\x0a\x41\xf8\x9c\xcd\xe7\xe4\x11\xb6\x5b\xf1\x82\x21\x2c\x6b\x3f\x09\xe9\x3f\xfd\xdf\x15\xfe\x64\x7a\xcb\xdf\x66\x3c\x8d\x97\x7f\x89\xd9\x52\x4a\x54\xe9\x4c\x3e\xa7\x0c\xa3\x65\xe5\x5c\x7e\x44\x1c\xff\xf9\x4f\x93\x96\x89\x51\xb5\xcd\x65\x6d\x8e\xa9\xa9\x7e\xe9\xde\x92\x47\x24\xc0\x67\x7c\x32\x0c\x3e\x29\x87\xf0\x36\xc5\x4b\x5e\x4d\x5f\x29\x03\xea\xe5\xe2\x66\x35\xca\xf9\xff\x7f\x43\xfc\xad\x9a\x96\x2f\xe5\x0c\xf3\x52\x24\x64\x91\x5b\x7e\x4b\x53\xcc\xe6\x28\xc0\xf6\x8d\x42\x82\xf2\x57\x02\xcc\x63\x26\xf4\xed\x96\x86\xf8\xf1\x0b\x62\xb0\xdd\x8a\x09\xfc\xe3\xf7\xf6\xc5\xff\x84\x08\x0b\x03\xec\x16\x76\xb3\xf0\x1f\xfe\x00\xc5\x30\x88\x3e\x3d\x90\xf4\xde\xea\x6a\x4d\x5a\x13\x16\x27\x98\xa5\xeb\xba\xc4\x4d\xab\x67\x44\x65\xe5\x08\x16\xa3\x6a\x5d\x96\xff\x28\x59\xd2\x07\x35\x9f\xcc\x88\x20\x8e\x43\x18\x53\x0c\xb5\x8e\x18\x36\x47\xc9\xcd\xec\x0a\x12\x86\x57\x98\xa6\x1c\x16\x98\x62\x86\x52\x1c\x42\x10\x87\x18\xd2\x18\x02\x14\x45\x40\x52\x8e\xa3\xf9\x0d\xa4\xf7\x84\x03\xe1\xc0\x30\xc7\x6c\x85\x43\x39\xb0\x28\x7f\x5f\xba\x4e\x30\x87\xab\x99\xd1\x93\x4a\xdd\x4b\xbb\x52\xe8\xf5\x07\x94\x88\x6b\x1f\x57\x98\x31\x12\xe2\x89\xa6\x61\x42\x98\xeb\x53\x60\x5a\x1a\xc7\x48\x19\xc6\xb5\xfe\xfc\xd4\x14\x29\xac\xf4\x55\x99\x0c\xee\x32\x66\x79\x9d\x2b\x7c\x0d\xf1\x57\x51\x2d\x66\x6c\x3a\xbe\xc2\x8c\xc5\x8c\x4f\x2b\xc9\x9c\x7c\x2f\xee\x57\xcf\x94\x8a\xb1\xc2\x45\x29\x2c\xc6\xbb\xa7\xc5\x9e\x94\x15\x56\xf2\x64\x69\x5c\x75\x6b\xc7\xc1\xf6\x48\x5d\x5d\xda\x1c\x66\xd4\xb0\xa2\x9d\x42\x8d\xc6\x60\xe3\xe0\xfe\xac\xa3\xcb\xea\x68\xc6\x84\x72\x7d\x20\x54\x69\xb8\x40\x1e\x96\x59\x03\xdd\x38\x38\x3d\xf8\x67\xf1\xcf\xcd\x1b\x20\x34\xfd\xf3\x9f\xc6\x7e\x4b\x33\xf1\xa2\x26\xe3\x95\xee\xd0\x41\x16\x39\xfc\x50\x76\xe9\x5b\x11\x26\x14\xad\xdc\x63\xb0\x6b\xe3\xeb\x0e\x15\x8e\xde\xd9\xaa\x95\xfb\x74\xf6\x17\x4a\xbe\x65\xb8\xad\xbf\x5a\xa9\x43\x77\xf9\xb0\x9a\xa2\xc1\x5f\x09\x80\x85\x93\x90\x36\x62\x54\x33\xd2\xbd\x10\xf0\x10\xa0\xf7\xc0\x3d\xef\x04\x75\x72\x8b\x58\x41\x1d\x0d\xe3\x54\x20\x46\xc0\x5e\x09\xe7\xca\x2b\xb9\x63\xef\x0d\x83\xf4\xab\x9f\xbf\x92\xe4\xfd\xa3\x08\xe0\x50\xa4\x39\xb0\xd3\x80\x4a\x0d\x1e\xac\x18\xb5\x49\xab\x47\x33\x2a\xd3\x87\xc7\x2c\xe0\x47\x19\x6f\xf2\x89\x17\xa2\x2b\xde\xc5\xf2\x57\x5b\xb5\xeb\xf8\xab\xac\x92\x3f\xa0\xc5\xf4\x96\xff\x0f\x66\xf1\xd8\xe3\x81\xda\x2b\xd6\x21\x8d\xfa\x13\x80\x91\xd0\x0c\x6b\x17\xcd\x71\xb3\x9e\x71\xa2\xce\x83\xc3\xcd\x4a\xb0\x7b\x61\x4e\x35\x81\x1e\x41\x7c\x6d\x90\xb4\xc4\xa2\x67\x18\xea\x18\xbf\x76\x18\xaa\x05\xf3\x4b\x94\x78\x43\xf9\xaa\x51\x36\x20\x35\x42\xa7\xb2\xbd\x2e\xbb\x91\x0b\x81\xed\xb2\x9c\xae\xaa\x34\x22\x35\xef\x21\xa6\x6c\x18\xc4\x4b\x49\x34\x19\x59\x1a\xac\x29\xed\x2b\xa3\xf9\x3b\x4e\xd4\xa1\xa8\x7f\x27\x40\xf0\x0b\x70\x09\x18\xfe\x86\xf8\x0f\x61\x48\x44\xcf\x51\xf4\x49\x59\x6a\x82\x6d\x08\x01\x53\x57\x21\x37\x4b\xa2\x3f\x7a\x59\x4c\x75\x28\x4d\x0f\x17\xb3\xef\xe6\x83\x2e\xbf\xe2\xb5\x70\xd6\xa2\x80\xf3\x5d\xff\xad\xee\xe7\x95\x2b\x94\xd0\x56\x54\xd4\xc6\x10\x5d\x60\x9f\xf5\xac\xcc\x66\x0e\x0a\x9a\xc6\x42\x15\x9c\x5d\xbd\x8b\xe9\x7f\xa4\x40\xb1\xb0\xef\x31\xa0\x30\x84\x5c\xed\x4b\xc1\x86\x90\x30\x1c\xa4\xd1\x1a\xee\x31\xc3\xc0\x09\x0d\x30\x3c\x60\x40\x0c\x03\xc3\x41\xc6\x38\xa1\x0b\xcd\x2b\xe8\x70\xe1\x53\x91\x40\xf3\xe1\x89\xc2\xd5\x59\x2e\x3a\x2f\x90\x6b\x4a\x25\x45\xba\x27\x58\xa1\xa8\x30\xe1\x62\xc8\xed\xc9\xd9\x6e\x7f\xd5\x66\x62\xbb\xfd\xad\x66\xcf\xf7\xb0\xb0\x55\x13\xea\xce\xc5\xe3\xbb\x6a\x56\x63\x27\x02\xc5\xe3\x30\x4c\x7f\xb2\x77\xd7\x5c\x55\x39\x60\x8d\x71\x5b\x59\x25\x89\x36\x2a\x1e\x19\x62\xd1\x80\x62\xf6\xe2\xbb\x7f\xe2\x20\x35\x20\x44\x55\x45\x2e\xdb\xd3\x1f\xa2\xa8\xca\x1b\xb8\x8b\xb8\xa5\xd9\x28\xd9\x93\x26\x34\x9e\x75\x40\x46\x2f\x96\xec\xde\xac\xdd\x1b\xe5\x6e\x92\xa7\x41\x95\xf7\x99\xde\xf2\x9f\xb3\x44\xb8\xdf\xca\x0e\x58\x61\xc2\x6c\x06\x3f\x7f\x7c\xf7\xf1\xc6\xd6\x79\x42\x17\xc2\x14\xe4\x0f\x01\x91\x4f\xf1\xfb\x38\x8b\x42\x58\xc4\xd2\x0e\x5c\x8b\xd7\xac\xe3\x0c\x38\xc6\x0a\x36\x32\x44\x38\x06\x44\x81\x70\x9e\x61\x29\x08\xa2\xf2\xf1\x5c\x04\x1a\x37\x40\xe8\x0a\xf3\x94\x2c\x44\xff\xd3\x7b\x0c\x01\xe2\x12\x7f\x32\xbc\x8c\x57\xe2\x12\x4a\x21\x88\x97\x4b\x4c\xd3\x1b\xb0\x5b\xac\xde\x2d\x2c\x55\x10\x2f\x31\x10\x0a\x4b\x94\xf0\x29\xfc\x92\x70\x19\x96\xe9\x22\x47\xb8\x34\x67\xca\xa0\x2d\x32\xc4\x42\x40\x0b\x44\x28\x4f\x55\x3b\x35\xe9\x9b\xcd\x00\xa5\x70\x9f\xa6\x09\xbf\x99\xcd\x16\x24\xbd\xcf\xee\xa6\x41\xbc\x9c\x2d\xe2\xef\x44\xf0\xb1\xc0\x4c\xff\x29\x3b\xc6\xed\xe1\xae\x4d\x42\xe5\xa3\xed\xa2\xba\x00\x34\x2f\xea\x98\xd6\xab\xb4\x83\x92\x5c\xe7\x1a\x52\x40\xc2\x07\xdb\x01\x71\x15\xfa\xe5\xca\x1a\xc8\xa7\x72\xbb\x23\x2d\x6e\x80\x92\x34\x13\xa0\x0e\x71\x28\xdb\x69\x2b\xad\x1e\xb5\xb4\xa6\x9a\x4a\x61\xb8\x81\xa2\x98\x7c\xd2\x6a\x71\x2e\x61\x77\x18\x96\x59\x9a\xa1\x28\x5a\x03\x7e\x0c\xa2\x8c\x8b\xf7\x13\x2a\x03\x10\x11\x9a\xc4\xd1\x0a\x33\x6b\x1e\xbd\x72\x6c\xf4\x4f\x0c\xcb\x2e\xd2\x7c\x40\x79\x99\x5d\xf9\xa5\xa2\x25\x01\x57\xfd\x39\x26\xa3\x41\x3e\x84\x0b\x65\x0c\xad\x6b\x32\x55\xbd\xd9\x93\xbb\x9b\xb6\x88\xdc\x07\x94\x94\xd3\xad\x31\x27\xfe\xf7\x38\xc3\x8a\x2e\x6f\xf1\x73\x0f\x0e\x9a\xcc\x8c\x14\xeb\xe0\xb5\x91\x18\x53\xc8\x6a\x88\x94\x70\x3b\x46\xf1\xb9\x7d\x6f\x84\xd8\x61\xf6\x15\x12\x7f\x1b\x2f\x93\x08\x3f\x7e\x94\x2e\x58\xf3\x0d\xb7\x6e\xc4\xec\x83\x66\x4f\x04\xcc\x06\x82\x65\xc7\x06\x65\x07\x83\x64\x8d\x80\xcc\xcd\xa7\x75\xc0\x58\xa7\x07\x65\x3a\x34\x67\xd7\xc6\x38\x5f\xea\xb9\x78\x1a\x90\xea\x40\x4e\xc8\x83\x25\xaa\x4b\x15\x7d\x64\xb2\x47\x0e\x0a\xd3\x19\xc4\x99\x52\x2e\x8d\xb7\x85\x42\xdc\x71\x42\x5e\x8b\x40\x76\x70\x97\xa5\x10\xc6\x98\x4b\x4b\xf3\x95\xc6\x0f\x80\xee\xe2\x2c\x05\x97\xb1\xba\x01\x3c\x5d\x4c\x81\x28\x70\xc8\x61\xce\xe2\x25\x20\xb8\x64\x78\xee\x60\x2b\xfd\xa6\xab\x2c\x72\x99\x37\x3b\x6f\xe6\x03\x56\xa8\x33\xaf\x77\x89\x92\x5c\x2e\xb5\xca\x6b\x66\xcf\x11\xa0\x5b\x76\xce\x63\xb6\x77\xb4\x0f\x8e\xc6\x77\x30\x89\x2e\x53\xd1\x99\x9e\x6d\xe8\x44\x83\x91\x55\xda\x54\xb5\x72\x85\xa2\xca\x9d\xba\x5f\x5c\x8a\xde\x70\xd6\xf9\x20\x96\xd9\x3f\xa3\x31\xab\xcd\x4b\xc3\x63\x7d\x79\x5b\x89\x2a\x1d\xc8\x4a\xca\xa7\xc9\xe9\x1a\x64\xae\xae\x84\x98\x6b\xe6\x49\xb3\xb7\xb9\x8c\x9f\x49\xdf\x33\xe9\xfb\xbc\x49\x5f\x29\xba\x3e\xe2\x57\x77\x4e\x6a\xaa\x9c\x25\x5b\xf2\xbd\x2f\x94\x24\xb6\x02\xfd\x8a\x41\x30\xd7\xb7\x4a\x6b\xc2\xbf\x92\x04\x1e\xee\x31\x05\x9a\x45\x2a\x60\x27\x1c\x50\x10\xe0\x24\xc5\xa1\x87\x44\x70\xc7\x76\xca\x58\xb4\x87\x0f\xbb\xa5\x98\xeb\xe9\xe5\x0e\xd1\x59\xdf\x6c\xb3\x95\x69\xf6\x07\xb9\x63\x47\x4a\x5e\x86\xec\x25\x7b\x52\x1a\x5d\x19\xa9\x8b\x41\x4d\x58\x1c\x60\x2e\x10\xd3\x1d\x8e\xe2\x07\x0b\x8d\x3c\xd9\xba\xb0\x41\x82\xda\x66\x6c\x64\x66\x16\x9a\x32\xe0\xe0\x5d\xc8\xf0\x9a\x13\x0f\x5d\xd3\xe4\x9e\x69\x82\x73\xb2\xc1\x2c\xd9\x75\x75\x88\xf1\xd0\x13\x66\x19\x8e\x9e\x5e\x38\xa7\x15\x0e\x92\x56\xf0\xd2\x3a\xbe\xbc\x42\x53\x42\xa1\x91\x33\x3c\x62\x46\xa1\x16\x5e\xbc\x3a\xdc\x3d\xe0\x9e\x4a\xd8\x81\x4b\xee\x95\xeb\x69\x5c\x8e\xf6\x04\x99\x20\x87\x4a\x74\x4c\xaa\x1c\x28\x87\x32\x70\xf2\xa4\x31\x45\x78\x4e\x83\xb4\x9b\xb4\x73\x2e\xe9\xd4\x72\x49\xba\x59\x29\xcd\x5a\xbb\x25\x29\x18\x99\x63\x66\x9b\xf6\xcc\x35\x1d\x1c\x87\xef\xdc\x91\x46\xec\x77\xfc\xdc\xd2\x69\x24\x95\x8e\x99\x4d\x7a\x16\x59\x24\x77\x12\xe9\x3b\x5f\x16\xc9\x69\x6e\x67\x33\x95\x67\x59\xa2\xc4\xe2\x5c\x7b\x1b\xdf\x41\xec\xee\x3e\x5b\x5c\x0e\x9b\x44\xeb\x04\xb5\xce\x29\xb6\x73\x8a\xad\x5f\x8a\xed\xa0\x4e\xe9\x59\xa7\xd5\xf4\x5d\xb9\x8a\x4d\xf2\xee\x88\x98\x5d\xc1\x3b\x7c\x97\x2d\xd4\x19\x15\xd2\x00\xdd\xc8\x29\xce\x4d\x51\x7e\xbd\xd4\x72\x75\xd3\x52\xfa\xbc\x44\xa1\x35\x65\x19\x53\x8d\x54\xa9\x62\x28\x8b\x42\x1a\x0f\x9f\x97\x29\x22\xe4\x9b\xdc\x70\xea\x41\xb5\xba\xaf\x0e\x09\x28\xee\xeb\x07\x33\x88\xfb\xee\xe5\xf0\xa2\x6c\xc3\x42\x79\xd5\xb8\x62\xb3\x5d\xd1\xb8\x72\xf3\x5d\x59\xc6\x12\xc0\x1b\x8f\x3a\x94\x4d\xad\xac\xfe\x8d\xcb\x0f\x8c\xc0\xca\x53\xfa\x2c\xd0\xe6\x89\xb6\xf6\x4b\x16\x4a\x33\xb8\x87\xda\x3a\x75\xde\xcf\x7f\x9a\x1b\xa9\x8c\xed\x7c\x1e\x24\xdc\x86\x3c\x77\x39\xdc\xa2\x11\x5a\x35\xbc\xad\xef\xbb\x6a\xb8\x45\xff\xa7\x2b\x9c\x1d\x7a\x69\xd4\xae\x90\xb6\x9b\xed\xaf\xaf\x9c\x98\xcd\xe0\xdd\xfb\x1f\x7f\xf9\xeb\xcb\x32\xfa\x0e\x6b\xef\x34\xf3\xcf\xcc\x3f\xe4\xe3\xec\xc4\xb6\xf9\x90\x7b\x13\xe1\xea\xd9\x92\x32\x2a\x1e\xb0\x38\x24\x55\xea\x03\x4a\x8a\xfb\x25\x2c\xc9\xdf\xcd\x18\x5a\x97\x2f\xab\xb8\xc4\xf2\x39\xdd\x04\x69\x75\xe8\x97\x77\xf0\x75\xe6\x92\x9d\x71\x7d\x95\x8e\xb6\x35\x5e\xbc\x6e\xd2\x89\x77\x3f\xda\xc9\x01\xdd\x8c\xbc\x63\xa5\x82\x29\x64\xcd\xae\xf4\x8d\xe7\x9d\x94\x44\x8e\x77\x36\xd8\xe0\x3d\x76\x76\x77\xe4\xd2\x0f\x8d\x48\x62\x06\x63\xad\xc1\x55\x6a\xc1\xe7\x2b\x27\x1a\xab\x6a\x31\xe4\xe7\x8d\xde\x3d\xf1\xc9\xe1\x06\xff\xf8\xc8\xe5\x49\x20\xcb\xf0\x58\xe5\x99\x60\x14\x2f\x86\xd3\x7b\xee\xda\x90\xdb\xb0\x22\xc6\x18\x71\x5f\x00\x3c\x35\x44\xcb\xe0\x39\x76\xdb\xf0\xe6\x92\xd8\xa3\x64\xa5\x9b\xe0\x6a\x55\x5c\x2e\xa2\xab\xed\x31\x7b\x42\xc9\xd0\x13\xe7\x15\x9c\xf3\x9d\x44\xac\x4a\x9c\xb3\xe6\xfb\x9d\x44\xec\x94\xd2\xce\xbb\x21\x47\x6d\xb2\x55\x1a\xbf\x03\x09\xd7\x3e\xa2\x35\xbb\xea\x9c\x4c\x2f\x35\xc7\xed\x65\x1c\x49\xf4\x1e\x5b\x10\x7d\xf9\xf3\xb8\x3a\xea\xb4\x3a\xd1\x29\x2f\x50\x58\x34\x23\xbf\x5e\x1a\x04\xfc\x18\xe0\x24\x95\xeb\x6a\x49\x71\xf7\x5a\xae\x21\x62\x98\x86\x98\x11\x3a\x37\x8e\xbf\x91\xa4\x39\xe1\x90\x60\x26\x7a\x8d\x43\xb8\x5b\x83\x15\x1b\x82\x36\x06\x1d\x77\x3d\x0e\x90\x5e\xed\x63\xb8\xb5\xb9\x1a\x6d\x36\x98\x86\x6e\xbf\xe2\x39\x04\xa6\xb7\x47\x71\x85\x24\xf5\xdc\xaf\x7c\xe0\xbc\xea\x67\x40\xfb\xe5\xa4\xc7\x6b\x52\xb3\xb7\x9f\x6f\x75\xf0\xc7\x73\xef\xee\xe5\x66\x67\xa1\x3b\x5d\xa7\x59\x93\xb5\xd6\x95\x5d\xe6\x0b\xfb\x79\xa2\x81\x5d\x90\xd3\x49\x3c\x91\x77\xd0\xc3\x20\xf7\x43\x75\xe3\x5c\x74\xcc\xc1\x17\xb4\xed\xfa\xda\x85\x69\x19\x74\x9b\x97\x27\x8d\xef\xa2\x76\xec\x3d\x23\x67\xe3\x30\xfc\x3a\xd4\x26\xce\xa2\xa3\x9b\x72\xa8\x6a\xc1\xa1\xed\xb3\x7f\xf1\x59\x4a\xf2\x59\x8e\x8f\x22\xc7\xbd\x96\x17\x34\x7f\xda\xa9\x01\x6a\xf7\x67\x58\x8e\x8e\xb8\x7a\xf9\xfb\xa7\x0d\x94\xf7\xe3\x61\x40\x3f\xdd\xa7\xef\x12\xf4\x27\x0b\x9e\xcd\xf5\x32\xfd\xc2\xd4\x52\x6e\xf5\x9f\x86\x0c\xf7\x21\x1e\x7b\x44\x0d\x47\x17\xda\x73\x98\xf0\x5a\xc2\x84\x43\x46\x09\xcd\xba\xd6\xa8\x64\xee\x6f\x43\x04\xf7\x78\x89\x9c\x7e\x62\x36\x03\x6b\x01\x4f\x75\x80\xa7\x34\x76\x9b\x0d\xdc\x67\x4b\x44\x8d\x33\x16\xee\x64\x60\x10\x53\xb5\x75\x2e\x37\xb1\x24\x05\xc2\x21\xe3\x38\x1c\xcd\x33\x1a\xc0\xb8\x7e\xb4\x3c\x54\x5f\x71\xd0\x02\x90\x5a\x68\xe2\x49\xa9\xeb\x5f\x42\x92\xc3\xf4\x8e\xf0\x40\xa8\x1e\x95\xe7\x50\xc8\xcb\x01\x5a\x62\xfb\x98\x01\x6d\x58\xdf\x3f\x26\x31\x4b\x71\xe8\xfb\xa8\x80\xb9\xde\x51\xbb\xa8\x04\xd1\x1e\xab\x71\x90\x3e\x16\xfd\x2f\x16\x42\x95\x8b\x9f\x80\xa7\x6c\xbe\x4c\xa7\x3f\xe1\x05\xe1\x29\x5b\x4f\x14\xa6\x93\x02\xbc\x42\x0c\x18\xe6\xf0\xeb\x6f\xf2\xda\xc8\x9b\x45\xd3\x93\xf5\xae\xf4\x96\xfa\xb4\x55\xb1\x56\x57\xf2\x8e\x6a\x97\x53\x10\x2f\x93\x98\xcb\x61\x54\x6e\xce\xd0\xd2\x36\x85\x51\x33\x54\x01\x59\x5b\x51\x8b\xac\xf8\xa4\xb4\x9f\xae\x2f\x05\xb9\xf5\xaa\xfd\xe8\xc2\x0e\x89\xc3\x52\xb3\x31\x5c\xea\x72\x10\xb3\xbf\x88\xea\xd5\xdc\x75\x6c\x1d\xb4\x7d\x10\x21\x30\x67\xdd\x29\x39\x9d\xcf\x94\x11\xd3\xfe\x06\x50\x92\x60\x1a\x8e\x19\xe6\xd7\xa2\xe8\x44\x2b\xa2\xf7\xb3\x79\x29\xaa\x19\x94\xfb\x0e\xb4\xd0\x92\xc0\xf6\xfa\x6e\xdf\xe9\x2d\x84\x0a\x78\xa3\xa2\x24\x78\xb8\x27\xc1\xbd\xdc\xc7\x1a\xa7\xf9\xba\x80\x7c\xad\xb5\x75\x7a\x6f\x8f\xf3\xfa\x5c\x2c\xe2\x4b\x39\x2c\x4b\x43\x73\x7b\xec\x42\x50\x9f\x18\x69\x91\xa7\x46\x59\xaa\x41\x44\xd7\x3a\x93\xc2\x36\x76\x52\x94\xe6\xee\x18\xdd\x18\x87\x2c\x4e\x3e\xa1\xe0\x2b\x12\x6a\xac\xec\xce\x64\xd7\xe5\xa2\x1d\xba\xe9\x09\x9b\xe4\x64\x88\x9f\xd2\xa8\x96\x0b\xa0\x3a\x5b\xa3\x26\x4b\x54\x9d\x23\xe3\x5c\xb6\xa6\x96\x77\x07\xca\xb7\x09\x5d\x02\x14\x3d\xa0\x35\x87\x7b\xc4\x21\x58\x39\x8f\xdd\x18\xd2\xf6\x74\x1a\x44\xe3\x94\x1c\xe7\x0a\x88\x23\x5a\x99\x5d\x82\x0e\x39\xba\x11\xa6\xa2\xc7\x13\xf8\x2f\xf8\x63\x0d\x3f\xc6\x8c\x4f\xdf\xe6\xce\x12\x57\x53\xf8\x5e\xdc\x11\x4f\x4d\xa7\xd3\x49\x8e\x31\xb5\xe5\x5c\xdb\xd1\x68\x3f\xf1\xf0\x63\xa4\xab\x62\x1f\x46\x13\xbc\xb9\x74\xe0\x9b\xcb\x06\x80\x53\x2b\xaf\xce\x12\x72\x40\x9c\xae\x02\xb7\x13\xee\xc9\xad\x50\x8f\x45\xc4\xc6\x98\x7b\x85\x54\x2a\x5b\x35\x07\x95\xa2\xbb\x31\x55\xcb\x82\xa1\xf3\xbc\x0d\x30\x6f\x4d\x8b\xb8\xcc\x79\xac\x6c\x75\x9e\x59\x96\x57\xdd\x41\x8c\x2c\x56\x0b\x75\x3c\xdf\xc1\xd3\x37\x0c\xaa\x4b\x32\xd6\xfe\xac\xbc\xb8\x15\x70\xeb\x02\x71\xb9\x88\x25\xa8\xbe\x79\xa3\x63\xe8\x20\xa6\x3c\x85\x71\x0d\xb4\x9a\xdb\xc0\x37\xea\x74\x2f\x46\x10\x4d\x45\x05\x32\xe2\x2e\x6b\x1c\x6b\x2e\x33\x88\x30\xa2\x59\x22\x1e\xff\x92\x97\x9f\x4e\xaa\x95\x1f\x6a\x9b\xb2\xba\xbe\xdd\x16\x04\x04\x97\x1f\xb5\xcd\xbf\x6f\x6b\x07\xf4\xe2\xd9\x7f\xb1\x9e\xd3\xba\xb3\xdd\xc2\x1b\xe7\x33\xf6\x7c\x4d\xac\x19\x1b\x15\x1f\x14\x93\xa3\x3d\x12\xd1\x8c\x2b\xf6\x92\x03\xf1\xeb\x6f\xe5\x32\x89\x4d\xae\x3d\x84\x92\x74\x3c\xb1\x02\x21\xc3\xba\x87\x98\xe1\xf9\x1c\x87\x9f\xe5\x0b\xc4\x80\x97\x2d\xab\xbc\xe5\x3f\x79\x4c\xa7\xbf\xd0\x25\x62\xfc\x1e\x45\xe3\x5f\x7f\xbb\x5b\xa7\x78\xfc\xfb\x66\x23\xef\x94\xf3\xf0\xfb\xe4\x1a\xfe\x5d\x98\x7f\x87\x63\x4c\x10\x25\xc1\x38\x77\x84\xa2\x76\xd1\xab\xff\xbd\x86\x55\x75\x20\x9a\x68\xdd\xa6\xe8\xbf\xbb\x8b\xa5\x5b\xf5\x95\xb8\x86\x95\x7a\xc1\x76\x54\xda\x8f\x1a\x80\xd2\x18\x17\x8b\xf8\xaa\x05\xbe\xfb\x07\xb2\xed\x3b\x60\x13\x94\xde\x5f\x43\x54\x50\x42\x4a\x2f\xae\x2b\x41\x3b\x50\x1c\xdf\x3e\xe7\xba\x1d\x72\x10\x68\xa2\xb1\x6f\x11\xc7\x56\x83\xf3\x96\x5e\x7b\x67\x4d\xfb\xda\xb2\xac\xe2\x16\xb6\xdb\x39\x8a\x38\xae\x86\x2e\x65\x19\xee\xc7\x42\x59\x56\x6f\xe3\xf9\x38\x5d\x61\x21\x7c\x8a\x53\x15\x32\xb5\x67\x2f\xf5\xd1\x82\xa8\xee\x3a\xa4\x37\x77\x50\x45\xaa\x5e\xd4\xa8\x4d\x65\xb1\x6e\x2a\x75\x55\xed\x69\xed\xe7\x61\x9d\x2e\xb6\x3d\x60\x3b\x21\xcd\x29\xbf\x89\x79\x78\xf5\xd1\x26\xe1\xc9\x75\xa8\xfd\xf4\x49\xcb\xd9\xe7\xae\x4a\xe3\x05\x04\x76\xe1\x5e\xdd\x2b\xcf\x5e\x39\xa4\xee\x9d\xa2\xeb\xaa\x3a\xda\xa8\x71\x65\xb1\x5e\x1a\x37\xb4\x8b\xaa\x4e\xc8\x39\x0d\x6d\x1b\x46\xd1\xb4\xb1\x1f\x5e\xd1\x6a\x24\x4a\xf1\x7b\x36\x83\x5a\x72\x80\xfb\xb3\x03\x2f\x97\xfd\xb7\xb7\x0f\xf5\x61\xf8\x9f\x3b\xc5\x5f\x7d\x31\xd7\x4c\x96\x36\xb2\xfc\x76\x58\x38\x0c\xbf\xdf\xa1\x69\xad\x34\x5b\xa3\xb1\xe9\x72\xa6\xc5\x6b\xa1\xf5\x87\xe0\xf3\x4f\x82\x26\x6f\xe1\xc6\x3b\x08\xd9\x21\xe8\xf1\xae\x3b\x14\x77\xa7\xc4\x9d\x04\xf8\x2e\xcc\xf7\x21\xf5\x73\x38\xdd\x7c\x79\xb4\x77\x0b\xdf\xdd\x4d\xf3\xbc\x0d\x55\x05\x44\x1b\x21\x95\x0f\x97\xed\x18\x56\x4b\x1b\xe6\xc9\x1d\x49\xcb\x1e\x4a\xf8\x3a\xb6\x29\x93\x89\x3d\x2d\xa3\xca\x8f\x66\x58\x12\x66\xfb\xf6\x48\x42\xcf\x8b\x8b\x6b\xb8\xb8\x8b\xc3\xf5\xc5\xb5\xab\x86\x3d\x3b\x3a\x64\xee\xa2\x8b\x7e\x37\xa9\x6e\x8d\x2e\xf7\x31\x1a\x65\x18\x2d\x2c\x9c\x73\x24\xc5\xeb\x5f\x72\xb8\xd5\x63\x04\x9c\x71\x58\xf7\xe7\xf5\x00\xcd\x84\x52\x5d\x68\x6e\x68\xa2\xba\xcd\x22\x22\x80\xa6\xe2\xdd\xa2\x50\x81\xfa\x4d\x36\x1c\x1a\x18\x71\xf0\xb2\xe2\x63\x9b\x96\x99\x18\x97\x8a\xf7\x4e\x4e\x9a\x36\x07\x07\x75\x0e\x35\xfa\x5c\xf4\x45\xb7\x47\x1d\x38\xac\xe3\xe4\x95\x5e\x27\x53\xdc\x47\xeb\x9e\x22\x34\xb7\xf1\x69\x37\x3e\x59\x9f\xcf\x06\xc6\xf2\x80\x39\x9a\xd3\x24\x99\xbb\x8e\x43\xb3\x01\x6e\x7e\xb8\x27\x21\x7d\x82\xca\xdc\x9f\xc1\x16\x0f\x68\x7a\x9d\xff\x6b\x6b\x77\x7e\xf9\x34\x39\xed\xce\xb3\x7b\x54\x2d\xf7\x86\xce\xbe\x12\x27\x06\xc8\x9c\xed\xef\x6e\x20\x3c\x9d\x7b\x41\x78\xed\x79\x5a\x8c\x3e\xc6\xc2\x9e\x43\x5f\x70\x5a\x37\x20\xf5\x02\x07\x30\x25\x75\x89\x7c\xd1\xe8\xc1\x69\x59\xec\xff\xbb\x7e\xd9\xcd\xce\xaf\x59\xb9\xb5\xfc\x11\x0d\xdc\xf6\xc3\x25\x2f\x3e\x03\xd7\xb5\xfb\x3b\xc0\x91\xdd\xb2\x75\x27\x69\x5c\x5e\x76\x8a\xaf\xf3\x34\x1e\xdf\x3e\xd4\x28\xfd\xfd\x59\xdf\x53\x5d\x44\xd9\x89\x6a\x6e\x5d\x28\x69\xa4\xf4\xea\xdf\xa5\x02\xe3\xb4\x1b\x6b\xb7\xb8\xb8\x68\x6f\x9b\xeb\xfd\xa5\xca\xfa\x57\x2a\x5d\xdb\xbd\xfb\x7c\x96\xd2\x38\xc9\xb2\x21\x95\x65\xb0\xe6\x97\xba\x4a\xca\xe3\x06\xfb\x0f\x46\x97\x6d\xf3\xc7\xdd\x32\x6f\xf7\xc4\x98\x86\x21\xb7\x7b\x1a\xf9\xc7\x62\x0c\x0f\xd2\x5b\x57\xcd\x2d\x6d\x6d\xdc\xce\xd9\xb0\x4b\xb4\xf6\x2a\xf7\x79\xbd\x07\x6f\xce\x0e\x47\x1f\x35\x08\x7c\xed\x52\xfb\x99\x93\x3b\xaf\x91\xde\x6f\x61\xfb\x61\xb3\xea\x67\xf6\xff\x24\xa3\xc9\x9c\x5f\x16\x62\x77\x66\x97\x4f\x19\xfc\x9d\x70\x7c\x38\x24\xc3\x7c\xa6\x98\xcf\x14\xf3\x99\x62\x3e\x12\xc5\xdc\xa0\xea\x0d\x34\xf3\x99\x68\x7e\x19\xd0\xe0\x79\xda\x8d\x33\xd1\xfc\x7c\x80\x84\xc7\xbe\xd4\xaf\x74\xa3\x9b\xbb\x07\x19\xbd\xc8\xe4\x17\x17\x60\x3c\x11\x97\xdc\x85\xee\x7f\x9e\x36\xe6\xcc\x37\x9f\x90\x99\x18\xbd\x7c\x8a\x78\x0f\x86\xb8\x85\x14\x3d\x45\x9e\xf8\x69\x29\xb2\x91\x7e\x8e\x83\x07\xd5\xf6\xc4\xb3\x83\xc6\xb4\xcf\x08\xb6\x76\x0c\x69\xcf\xc1\xeb\xeb\x42\xa2\x47\x0a\x67\x2b\x95\x6f\xf4\x17\xf5\xc9\xec\x32\xd7\xdd\xac\xb9\xc6\xab\xbb\x26\xbd\xe2\xd1\xed\x3b\x36\xaf\xae\x72\x3e\x76\x29\xff\x87\xdc\x72\xa5\x95\x5f\xfc\xa3\x21\x7e\xfc\x82\x98\xe8\x6f\xa9\xbf\x6e\x73\x3e\xf5\xf7\x57\xfb\xb0\x5a\xb3\x71\x76\x9a\xab\xba\x3d\xf6\xee\xe4\xae\x7e\xfd\x7f\x00\x00\x00\xff\xff\xb2\xaa\xcd\x27\xb1\xc2\x00\x00")
+var _templatesSchemavalidatorGotmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5d\x5b\x73\xe3\x38\x76\x7e\x8e\x7e\xc5\x89\xcb\x49\x24\xaf\x87\xda\x87\xad\x7d\xf0\xa4\x53\x35\x33\xdd\xbb\xeb\xca\xf6\x76\xd7\xf4\x4c\x3f\x64\x6a\x2a\x03\x93\x90\x8c\x6d\x0a\xe4\x00\xa4\x6c\x47\xa5\xff\x9e\x02\xc0\x0b\x00\x02\xbc\x48\xa2\x25\xbb\xe5\x27\x99\xc4\xfd\xdc\xbe\x73\x0e\x00\x6e\x36\x10\xe1\x05\xa1\x18\x2e\x52\x46\x56\x24\x23\x6b\xbc\x20\x38\x8e\xc2\x84\x66\xf8\x31\x5b\xa3\x98\x44\x28\x4b\xd8\x05\x6c\xb7\x13\x80\xcd\x06\xc8\x02\x82\x1f\x31\x8a\x3e\xd0\xf8\x49\x3d\x04\xf1\x0c\x33\x06\x37\x6f\xa0\xa8\x80\xab\x22\xd3\x30\x7b\xbc\x2e\xeb\x7d\x44\xd9\x3d\x6c\xb7\x9b\x8d\xfe\x13\xc7\x1c\xc3\x76\x7b\x71\x21\x7e\xd3\x08\xb6\x5b\x59\x3e\x65\x84\x66\x0b\xb8\xf8\xb7\xdf\x2f\x20\xf8\x7b\x12\xa2\x8c\x24\xb4\x7c\x49\x16\x40\x93\x0c\xa6\x09\x83\xe0\x96\x7f\x47\x13\xfa\xb4\x4a\x72\x2e\xfe\xf9\x47\x1e\xc7\xe8\x2e\xc6\xb3\xa2\xa3\xbf\x26\x3f\x3d\xa5\xa2\x83\x69\xd5\xfe\x66\x13\x7c\x46\x71\x8e\xdf\x3d\xa6\x0c\x73\xae\xda\xed\xdf\xea\xac\x6a\x68\xf6\xad\x9c\xf7\xbf\xbe\x01\x4a\xe2\x8d\x5c\x0a\x00\x86\xb3\x9c\x51\xf1\x42\x3e\x28\x96\x4d\x55\x98\x18\xbf\xdc\x4b\xef\x5d\xf3\xdf\x73\xc2\x70\x54\xae\xf9\x66\xf3\x8d\x78\x8e\x68\x04\x53\xfc\x7b\x35\xcf\x0b\x9e\x31\x42\x97\x17\x33\x98\x8a\xb9\x58\x43\x9f\x78\x68\xa5\x9a\xfe\x24\xab\x4e\x47\x20\x96\x58\xce\x98\x20\x8e\xa3\x9d\xa8\x62\x54\xf7\x2c\x3f\x6c\xaa\x65\x29\x06\xd9\x3e\xd9\x31\xa6\x79\x72\x3c\xa9\x2f\x0a\xad\x58\xc7\xe0\x50\x93\x3f\x2b\x76\x7b\x4f\xe8\xdf\x31\x5d\xca\x05\xf1\xc9\x78\x55\xe6\xe0\x6b\x19\xfc\x94\x28\x66\x2c\x1e\x18\xc3\x71\xcd\xb0\xd7\x94\xd0\xa3\x3e\x25\xd7\x84\xca\x12\xcf\x30\x21\x6d\x30\xbb\x4e\xe8\x23\xca\x32\xcc\xa8\x77\x3a\xc5\xfb\x91\x27\xf3\x9b\xa8\xc9\x43\x94\xe2\xef\x51\xf8\x25\x23\xe1\x17\xae\x0f\xed\xb7\x9d\xc9\x45\x28\x59\xe5\xab\x5a\xdf\x41\x86\x57\x69\x8c\x32\x0c\x17\xc5\x14\x49\x42\x8b\x52\x17\x10\x54\x95\x1d\x74\xef\xd3\x90\x2a\xd5\xda\x50\x1e\x67\x24\x8d\xf1\x87\x45\x57\x5b\x55\xc1\xb6\xe6\xde\xd1\x72\x50\xf3\xb9\x20\x5a\x8e\x01\xd3\x7c\x65\xd0\x72\xb3\x09\x7e\xc4\x21\x26\x6b\xcc\xfe\x81\x56\x82\x52\x41\x49\x5e\x41\x25\xc4\x43\x14\x93\xff\xc3\x10\x14\x6f\x05\x75\x3e\xe5\x8b\x05\x79\x84\xed\x56\x74\x30\x92\x36\x2f\x75\x0f\x6c\xb7\x57\xed\x3a\x6c\x07\xf2\x57\x86\x2d\xb8\xe5\x3f\xe4\x3c\x4b\x56\x7f\x49\xd8\x4a\x72\x54\x65\xd5\x3e\x65\x0c\xa3\x55\x6d\xe5\xbe\x47\x1c\xff\xf9\x4f\xb3\x0e\xc2\xa8\xd6\x16\xb2\x35\x07\x69\xea\x5f\xba\x79\xe6\x31\x09\xf1\x19\x10\x8d\x03\x88\xaa\x25\xbc\xcd\xf0\x8a\xbb\xc0\x8d\xec\x5c\xbc\xac\x57\xb9\xf8\xff\x6f\x88\xff\xa0\xc8\xf2\xb9\xa2\x30\xaf\x58\x42\x16\xb9\xe5\xb7\x34\xc3\x6c\x81\x42\x6c\xbf\x28\x39\xa8\xe8\x12\x60\x91\x30\x21\x6f\xb7\x34\xc2\x8f\x9f\x11\x83\xed\x56\x10\xf0\x8f\xdf\xda\x0f\xff\x13\x62\x2c\x94\xaa\x9b\xd9\xcd\xc2\x7f\xf8\x03\x94\xcb\x20\xe6\xf4\x40\xb2\x7b\x6b\xaa\x0d\x6e\x4d\x59\x92\x62\x96\x3d\x35\x39\x2e\xa8\xeb\x58\x16\x5d\xad\xaa\xf5\xd8\x84\x42\xd5\xa2\x16\xc4\x2c\xf0\xd4\x94\x62\x68\x4c\xc4\xd0\x39\x8a\x6f\xe6\x57\x90\x32\xbc\xc6\x34\xe3\xb0\xc4\x14\x33\x94\xe1\x08\xc2\x24\xc2\x90\x25\x10\xa2\x38\x06\x92\x71\x1c\x2f\x6e\x20\xbb\x27\x1c\x08\x07\x86\x39\x66\x6b\x1c\xc9\x85\x45\x45\x7f\xd9\x53\x8a\x39\x5c\xcd\x8d\x99\xd4\xe2\x5e\xe9\x95\x52\xae\xdf\xa3\x54\x3c\xfb\xb0\xc6\x8c\x91\x08\xcf\x34\x09\x13\xcc\xdc\x24\x81\xa9\x69\x1c\x2b\x65\x28\xd7\x66\xfd\xc0\x64\x29\xac\xe4\x55\xa9\x0c\xee\x52\x66\x45\x9b\x6b\x7c\x0d\xc9\x17\xd1\x2c\x66\x2c\x98\x5e\x61\xc6\x12\xc6\x83\x9a\x33\x67\xdf\x8a\xf7\x75\x9d\x4a\x30\xd6\xb8\x2c\x85\xc5\x7a\x0f\xd4\xd8\xb3\xaa\xc1\x9a\x9f\x2c\x89\xab\x5f\xed\xb8\xd8\x1e\xae\x6b\x72\x9b\x43\x8d\x1a\x5a\xb4\xa7\x6f\xf3\x9c\xb0\xbd\xa7\xc9\xea\xa9\xc6\x84\x70\xbd\x27\x54\x49\xb8\x40\x1e\x96\x5a\x03\x5d\x39\x38\x2d\xf8\x27\xf1\xcf\xcd\x1b\x20\x34\xfb\xf3\x9f\xa6\x7e\x4d\x33\xf3\xa2\x26\xa3\x4b\x37\x6c\x97\x45\x0e\xbf\x94\x7d\xe6\x56\xc2\xf9\x72\x94\x7b\x2c\x76\x63\x7d\xdd\x90\xfe\xe8\x93\xad\x47\xb9\xcf\x64\x7f\xa6\xe4\xf7\x1c\x77\xcd\x57\x2b\x75\xe8\x29\x1f\x56\x52\x34\xf8\x2b\x01\xb0\x30\x12\x52\x47\x4c\x1a\x4a\x7a\x10\x02\x1e\x03\xf4\x1e\x78\xe6\xbd\xa0\x4e\xa1\x11\x6b\xa8\xa3\x61\x9c\x1a\xc4\x08\xd8\x2b\xe1\x5c\xf5\xa4\x30\xec\x83\x61\x90\xfe\xf4\xd3\x17\x92\xbe\x7b\x14\x0e\x1c\x8a\x35\x03\x76\x1a\x50\xa9\xc5\x82\x95\xab\x36\xeb\xb4\x68\x46\x63\xfa\xf2\x98\x05\xfc\x28\xe3\x4d\x41\x78\xc1\xba\xa2\x2f\x56\x74\x6d\xb5\xae\xe3\xaf\xaa\x49\xfe\x80\x96\xc1\x2d\xff\x1f\xcc\x92\xa9\xc7\x02\x75\x37\xac\x43\x1a\xf5\x27\x00\x23\xa1\x39\xd6\x1e\x9a\xeb\x66\xd5\x71\xa2\xce\x83\xc3\xcd\x9a\xb1\x07\x61\x4e\x45\x40\x0f\x23\x7e\x6d\x90\xb4\xc2\xa2\x67\x18\xea\x58\xbf\x6e\x18\xaa\x39\xf3\x2b\x94\x7a\x5d\xf9\x7a\x50\x9e\x60\xbb\x62\xe3\x6a\xbc\x2e\xbd\x51\x30\x81\x6d\xb2\x9c\xa6\xaa\x52\x22\x0d\xeb\x21\x48\x36\x0e\xe2\xa5\x24\x9e\x4d\x2c\x09\xd6\x84\xb6\x05\x79\xab\x61\x0c\xcb\x37\xa8\x30\x61\x35\xb6\x93\x8b\xb9\xf7\x24\xd4\xa1\xe2\xf0\x4e\x80\xe0\x67\xe0\x0a\x30\xfc\x0d\xf1\xef\xa2\x88\x88\x99\xa3\xf8\xa3\xd2\xd4\x04\xdb\x10\x02\x02\x57\x21\x77\x94\x44\xaf\x7a\x59\x92\x3a\x92\xaa\x87\x0b\xea\xbb\xe3\x41\x97\x5f\xf0\x93\x30\xd6\xa2\x80\xb3\xaf\xff\x56\xef\x8b\xc6\x15\x4a\xe8\x2a\x2a\x5a\x63\x88\x2e\xb1\x4f\x7b\xd6\x6a\xb3\x00\x05\x6d\x6b\xa1\x0a\xce\xaf\xde\x26\xf4\x3f\x32\xa0\x58\xe8\xf7\x04\x50\x14\x41\x21\xf6\x15\x63\x43\x44\x18\x0e\xb3\xf8\x09\xee\x31\xc3\xc0\x09\x0d\x31\x3c\x60\x40\x0c\x03\xc3\x61\xce\x38\xa1\x4b\xcd\x2a\xe8\x70\xe1\x63\x99\xb1\xf3\xe1\x89\x3a\x5d\x65\x98\xe8\xa2\x40\x21\x29\x35\x17\xe9\x96\x60\x8d\xe2\x52\x85\x8b\x25\xb7\x89\xb3\xdd\xfe\xa2\x51\x62\xbb\xfd\xb5\xa1\xcf\xf7\xd0\xb0\xf5\x10\x9a\xc6\xc5\x63\xbb\x1a\x5a\x63\xa7\x00\x8a\xc7\x60\x98\xf6\x64\xef\xa9\xb9\x9a\x72\xc0\x1a\xe3\xb5\xd2\x4a\x12\x6d\xd4\x71\x64\x48\xc4\x00\x4a\xea\x25\x77\xff\xc4\x61\x66\x40\x88\xba\x89\x82\xb7\x83\xef\xe2\xb8\xce\x1b\xb8\x8b\xb8\xb9\xd9\x28\x39\x30\x4c\x68\xd4\x75\x40\x46\x2f\x96\xec\x3f\xac\xdd\x07\xe5\x1e\x92\x67\x40\xb5\xf5\x09\x6e\xf9\x4f\x79\x2a\xcc\x6f\xad\x07\x2c\x37\x61\x3e\x87\x9f\x3e\xbc\xfd\x70\x63\xcb\x3c\xa1\x4b\xa1\x0a\x8a\x4a\x40\x64\x2d\x7e\x9f\xe4\x71\x04\xcb\x44\xea\x81\x6b\xd1\xcd\x53\x92\x03\xc7\x58\xc1\x46\x86\x08\xc7\x80\x28\x10\xce\x73\x2c\x19\x41\x34\x3e\x5d\x08\x47\xe3\x06\x08\x5d\x63\x9e\x91\xa5\x98\x7f\x76\x8f\x21\x44\x5c\xe2\x4f\x86\x57\xc9\x5a\x3c\x42\x19\x84\xc9\x6a\x85\x69\x76\x03\xf6\x88\x55\xdf\x42\x53\x85\xc9\x0a\x03\xa1\xb0\x42\x29\x0f\xe0\xe7\x94\x4b\xb7\x4c\x67\x39\xc2\xa5\x3a\x53\x0a\x6d\x99\x23\x16\x01\x5a\x22\x42\x79\xa6\xc6\xa9\x71\xdf\x7c\x0e\x28\x83\xfb\x2c\x4b\xf9\xcd\x7c\xbe\x24\xd9\x7d\x7e\x17\x84\xc9\x6a\xbe\x4c\xbe\x11\xce\xc7\x12\x33\xfd\xa7\x9c\x18\xb7\x97\xbb\x41\x84\xda\x46\xdb\x45\x75\x06\x68\xdf\x45\x12\x34\x9b\xb4\x9d\x92\x42\xe6\x5a\x52\x40\xc2\x06\xdb\x0e\x71\xed\xfa\x15\xc2\x1a\xca\x5a\x85\xde\x91\x1a\x37\x44\x69\x96\x0b\x50\x87\x38\x54\xe3\xb4\x85\x56\xf7\x5a\x3a\x53\x4d\x15\x33\xdc\x40\x59\x4c\xd6\xb4\x46\x5c\x70\xd8\x1d\x86\x55\x9e\xe5\x28\x8e\x9f\x00\x3f\x86\x71\xce\x45\xff\x84\x4a\x07\x44\xb8\x26\x49\xbc\xc6\xcc\xa2\xa3\x97\x8f\x8d\xf9\x89\x65\xd9\x85\x9b\x0f\xc8\x2f\xf3\x2b\x3f\x57\x74\x24\xe0\xea\x3f\x07\x31\x5a\xf8\x43\x98\x50\xc6\xd0\x53\x83\xa7\xea\x9e\x3d\xb9\xbb\xa0\x83\xe5\xde\xa3\xb4\x22\xb7\x16\x39\xf1\xf7\xe3\x74\x2b\xfa\xf4\xe2\x8f\x3d\x38\xc2\x64\xa6\xa7\xd8\x04\xaf\xad\x81\x31\x85\xac\xc6\x48\x09\x77\x63\x14\x9f\xd9\xf7\x7a\x88\x3d\xa8\xaf\x90\xf8\x0f\xc9\x2a\x8d\xf1\xe3\x07\x69\x82\x35\xdb\x70\xeb\x46\xcc\x3e\x68\xf6\x4c\xc0\x6c\x24\x58\x76\x6c\x50\x76\x30\x48\xd6\x0a\xc8\xdc\xf1\xb4\x1e\x18\xeb\xf4\xa0\x4c\x8f\xe1\xec\x3a\x18\x67\xa7\x9e\x87\xa7\x01\xa9\x0e\x64\x84\x3c\x58\xa2\x7e\x54\x87\x8f\xcc\xe8\x91\x23\x84\xe9\x74\xe2\x4c\x2e\x97\xca\xdb\x42\x21\x6e\x3f\xa1\x68\x45\x20\x3b\xb8\xcb\x33\x88\x12\xcc\xa5\xa6\xf9\x42\x93\x07\x40\x77\x49\x9e\x81\x4b\x59\xdd\x00\x0e\x96\x01\x10\x05\x0e\x39\x2c\x58\xb2\x02\x04\x97\x0c\x2f\x1c\xd1\x4a\xbf\xea\xaa\x8a\x5c\x16\xc3\x2e\x86\xf9\x80\x15\xea\x2c\xda\x5d\xa1\xb4\xe0\x4b\xad\xf1\x86\xda\x73\x38\xe8\x96\x9e\xf3\xa8\xed\x1d\xf5\x83\x63\xf0\x3d\x54\xa2\x4b\x55\xf4\x0e\xcf\xb6\x4c\xa2\x45\xc9\x2a\x69\xaa\x47\xb9\x46\x71\x6d\x4e\xdd\x1d\x57\xac\x37\x9e\x76\x3e\x88\x66\xf6\x53\x34\x61\x0d\xba\xb4\x54\x1b\x1a\xb7\x95\xa8\xd2\x81\xac\x24\x7f\x9a\x31\x5d\x23\x98\xab\x0b\x21\xe6\x9a\x7a\xd2\xf4\x6d\xc1\xe3\xe7\xa0\xef\x39\xe8\xfb\xb2\x83\xbe\x92\x75\x7d\x81\x5f\xdd\x38\x29\x52\x39\x4b\x76\xe4\x7b\x5f\x69\x90\xd8\x72\xf4\xeb\x08\x82\xb9\xbf\x55\x6a\x13\xfe\x85\xa4\xf0\x70\x8f\x29\xd0\x3c\x56\x0e\x3b\xe1\x80\xc2\x10\xa7\x19\x8e\x3c\x41\x04\xb7\x6f\xa7\x94\x45\xb7\xfb\xb0\x5b\x8a\xb9\x99\x5e\xee\xe1\x9d\x0d\xcd\x36\x5b\x99\x66\xbf\x93\x3b\x75\xa4\xe4\xa5\xcb\x5e\x45\x4f\x2a\xa5\x2b\x3d\x75\xb1\xa8\x29\x4b\x42\xcc\x05\x62\xba\xc3\x71\xf2\x60\xa1\x91\x67\xdb\x17\x36\x8a\x53\xdb\x8e\x8d\xcc\xcc\x42\x5b\x06\x1c\xbc\x1b\x19\xbe\xe6\xc4\x43\xdf\x34\xb9\x87\x4c\x70\x4e\x36\x98\x25\xfb\xee\x0e\x31\x2a\x3d\x63\x96\xe1\xe8\xe9\x85\x73\x5a\xe1\x20\x69\x05\x6f\x58\xc7\x97\x57\x68\x4b\x28\xb4\xc6\x0c\x8f\x98\x51\x68\xb8\x17\x5f\x1d\xee\x1e\xf1\x80\x23\xec\x10\x4b\x1e\x94\xeb\x69\xdd\x8e\xf6\x0c\x99\x20\x87\x48\xf4\x4c\xaa\x1c\x28\x87\x32\x72\xf2\xa4\x35\x45\x78\x4e\x83\x74\xab\xb4\x73\x2e\xe9\xd4\x72\x49\xba\x5a\xa9\xd4\x5a\xb7\x26\x29\x23\x32\xc7\xcc\x36\xed\x99\x6b\x3a\x38\x0e\xdf\x79\x22\xad\xd8\xef\xf8\xb9\xa5\xd3\x48\x2a\x1d\x33\x9b\xf4\x22\xb2\x48\xee\x24\xd2\x37\xbe\x2c\x92\x53\xdd\xce\xe7\x2a\xcf\xb2\x42\xa9\x15\x73\x1d\xac\x7c\x47\xd1\xbb\xfb\x1c\x71\x39\x6c\x12\xad\x17\xd4\x3a\xa7\xd8\xce\x29\xb6\x61\x29\xb6\x83\x1a\xa5\x17\x9d\x56\xd3\x4f\xe5\xaa\x68\x92\xf7\x44\xc4\xfc\x0a\xde\xe2\xbb\x7c\xa9\xee\xa8\x90\x0a\xe8\x46\x92\xb8\x50\x45\xc5\xf3\x4a\xca\xd5\x4b\x4b\xe8\x8b\x12\xa5\xd4\x54\x65\x4c\x31\x52\xa5\xca\xa5\x2c\x0b\x69\x71\xf8\xa2\x4c\xe9\x21\xdf\x14\x8a\x53\x77\xaa\xd5\x7b\x75\x49\x40\xf9\x5e\xbf\x98\x41\xbc\x77\x6f\x87\x17\x65\x5b\x36\xca\xab\xc1\x95\x87\xed\xca\xc1\x55\x87\xef\xaa\x32\x16\x03\xde\x78\xc4\xa1\x1a\x6a\xad\xf5\x6f\x5c\x76\x60\x02\x56\x9e\xd2\xa7\x81\x36\xcf\x74\xb4\x5f\x46\xa1\x34\x85\x7b\xa8\xa3\x53\xe7\xf3\xfc\xa7\x79\x90\xca\x38\xce\xe7\x41\xc2\x5d\xc8\x73\x97\xcb\x2d\x5a\xa1\x55\x4b\x6f\x43\xfb\x6a\xe0\x16\xfd\x9f\xbe\x70\x76\xec\xad\x51\xbb\x42\xda\x7e\xba\xbf\xb9\x73\x62\x3e\x87\xb7\xef\xbe\xff\xf9\xaf\xaf\x4b\xe9\x3b\xb4\xbd\x53\xcd\xbf\x30\xfb\x50\xac\xb3\x13\xdb\x16\x4b\xee\x4d\x84\xab\xba\x55\xc8\xa8\xac\x60\xc5\x90\x54\xa9\xf7\x28\x2d\xdf\x57\xb0\xa4\xe8\x9b\x31\xf4\x54\x75\x56\xc7\x12\xab\x7a\xba\x0a\xd2\xda\xd0\x1f\xef\x60\xeb\xcc\x2d\x3b\xd3\xe6\x2e\x1d\xed\x68\xbc\xe8\x6e\xd6\x2b\xee\x7e\xb4\x9b\x03\xfa\x29\x79\xc7\x4e\x05\x93\xc9\xda\x4d\xe9\x1b\x4f\x9f\x94\xc4\x8e\x3e\x5b\x74\xf0\x1e\x27\xbb\x7b\xc6\xd2\x0f\x8d\x48\x12\x06\x53\x6d\xc0\x75\x6a\xc1\x67\x2b\x67\x5a\x54\xd5\x8a\x90\x9f\x0f\x7a\x0f\xc4\x27\x87\x5b\xfc\xe3\x23\x97\x67\x81\x2c\xe3\x63\x95\x17\x82\x51\xbc\x18\x4e\x9f\xb9\xeb\x40\x6e\xcb\x8e\x18\x63\xc5\x7d\x0e\x70\x60\xb0\x96\x11\xe7\xd8\xed\xc0\x9b\x8b\x63\x8f\x92\x95\x6e\x83\xab\x75\x71\xb9\x89\xae\x71\xc6\xec\x19\x39\x43\x4f\x9c\xd7\x70\xce\x77\xa7\xaf\x2a\x71\xce\x9a\x0f\xca\x9a\x37\xae\xe1\x74\x72\x69\xef\xd3\x90\x93\x2e\xde\xaa\x94\xdf\x81\x98\x6b\x1f\xd6\x9a\x5f\xf5\x4e\xa6\x57\x92\xe3\xb6\x32\x8e\x24\xfa\x80\x23\x88\xbe\xfc\x79\x52\x5f\x75\x5a\xdf\xe8\x54\x14\x28\x35\x9a\x91\x5f\xaf\x14\x02\x7e\x0c\x71\x9a\xc9\x7d\xb5\xa4\x7c\x7b\x2d\xf7\x10\x31\x4c\x23\xcc\x08\x5d\x18\xd7\xdf\xc8\xa0\x39\xe1\x90\x62\x26\x66\x8d\x23\xb8\x7b\x02\xcb\x37\x04\x6d\x0d\x7a\x9e\x7a\x1c\x21\xbd\x3a\x44\x71\x6b\xb4\x9a\x6c\x36\x98\x46\x6e\xbb\xe2\xb9\x04\x66\xb0\x45\x71\xb9\x24\xcd\xdc\xaf\xac\x70\xde\xf5\x33\xa2\xfe\x72\x86\xc7\x1b\x5c\xb3\xb7\x9d\xef\x34\xf0\xc7\x33\xef\xee\xed\x66\x67\xa6\x3b\x5d\xa3\xd9\xe0\xb5\xce\x9d\x5d\x66\x87\xc3\x2c\xd1\xc8\x26\xc8\x69\x24\x9e\xc9\x3a\xe8\x6e\x90\xbb\x52\x53\x39\x97\x13\x73\xc4\x0b\xba\x4e\x7d\xed\x12\x69\x19\xf5\x98\x97\x27\x8d\xef\x0a\xed\xd8\x67\x46\xce\xca\x61\xfc\x7d\xa8\x6d\x31\x8b\x9e\x66\xca\x21\xaa\x65\x0c\x6d\x9f\xf3\x8b\x2f\x92\x93\xcf\x7c\x7c\x14\x3e\x1e\xb4\xbd\xa0\xfd\x5b\x52\x2d\x50\x7b\x78\x84\xe5\xe8\x88\x6b\x90\xbd\x7f\x5e\x47\x79\xbf\x38\x0c\xe8\xb7\xfb\x0c\xdd\x82\xfe\x6c\xce\xb3\xb9\x5f\x66\x98\x9b\x5a\xf1\xad\xfe\xd3\xe0\xe1\x21\x81\xc7\x01\x5e\xc3\xd1\x99\xf6\xec\x26\x7c\x2d\x6e\xc2\x21\xbd\x84\x76\x59\x6b\x15\x32\xf7\xb7\x21\xc2\x7b\xbc\x42\x4e\x3b\x31\x9f\x83\xb5\x81\xa7\xbe\xc0\x53\x2a\xbb\xcd\x06\xee\xf3\x15\xa2\xc6\x1d\x0b\x77\xd2\x31\x48\xa8\x3a\x3a\x57\xa8\x58\x92\x01\xe1\x90\x73\x1c\x4d\x16\x39\x0d\x61\xda\xbc\x5a\x1e\xea\xaf\x38\x68\x0e\x48\xc3\x35\xf1\xa4\xd4\xf5\x2f\x21\xc9\x65\x7a\x4b\x78\x28\x44\x8f\xca\x7b\x28\xe4\xe3\x10\xad\xb0\x7d\xcd\x80\xb6\xac\xef\x1e\xd3\x84\x65\xe5\x67\xf2\x9c\x97\x12\x68\xfb\x1d\xb5\x87\x8a\x11\xed\xb5\x9a\x86\xd9\x63\x39\xff\x72\x23\x54\xb5\xf9\x09\x78\xc6\x16\xab\x2c\xf8\x11\x2f\x09\xcf\xd8\xd3\x4c\x61\x3a\xc9\xc0\x6b\xc4\x80\x61\x0e\xbf\xfc\x2a\x9f\x4d\xbc\x59\x34\x3d\x59\xef\x4a\x6f\xa9\x4f\x5b\x95\x7b\x75\x65\xdc\x51\x9d\x72\x0a\x93\x55\x9a\x70\xb9\x8c\xca\xcc\x19\x52\xda\x25\x30\x8a\x42\x35\x90\xb5\x05\xb5\xcc\x8a\xcf\x2a\xfd\xe9\xfa\x52\x90\x5b\xae\xba\xaf\x2e\xec\x91\x38\xac\x24\x1b\xc3\xa5\xce\x07\x09\xfb\x8b\x68\x5e\xd1\xae\xe7\xe8\xa0\xeb\x83\x08\xa1\x49\x75\x27\xe7\xf4\xbe\x53\x46\x90\xfd\x0d\xa0\x34\xc5\x34\x9a\x32\xcc\xaf\x45\xd1\x99\x56\x44\x9f\x67\xfb\x56\x54\xd3\x29\xf7\x5d\x68\xa1\x25\x81\xed\xfd\xdd\xbe\xdb\x5b\x08\x15\xf0\x46\x79\x49\xf0\x70\x4f\xc2\x7b\x79\x8e\x35\xc9\x8a\x7d\x01\xc5\x5e\x6b\xeb\xf6\xde\x01\xf7\xf5\xb9\xa2\x88\xaf\xe5\xb2\x2c\x0d\xcd\xed\x71\x0a\x41\x7d\x62\xa4\x83\x9f\x5a\x79\xa9\x01\x11\x5d\xfb\x4c\x4a\xdd\xd8\x4b\x50\xda\xa7\x63\x4c\x63\x1a\xb1\x24\xfd\x88\xc2\x2f\x48\x88\xb1\xd2\x3b\xb3\x5d\xb7\x8b\xf6\x98\xa6\xc7\x6d\x92\xc4\x10\x3f\xa5\x52\xad\x36\x40\xf5\xd6\x46\x6d\x9a\xa8\xbe\x47\xc6\xb9\x6d\x4d\x6d\xef\x0e\x95\x6d\x13\xb2\x04\x28\x7e\x40\x4f\x1c\xee\x11\x87\x70\xed\xbc\x76\x63\x4c\xdd\xd3\x6b\x11\x8d\x5b\x72\x9c\x3b\x20\x8e\xa8\x65\x76\x71\x3a\xe4\xea\xc6\x98\x8a\x19\xcf\xe0\xbf\xe0\x8f\x0d\xfc\x98\x30\x1e\xfc\x50\x18\x4b\x5c\x93\xf0\x9d\x78\x23\x6a\x05\x41\x30\x2b\x30\xa6\xb6\x9d\x6b\x3b\x99\xec\xc7\x1e\x7e\x8c\x74\x55\x9e\xc3\x68\x83\x37\x97\x0e\x7c\x73\xd9\x02\x70\x1a\xe5\xd5\x5d\x42\x0e\x88\xd3\x97\xe1\x76\xc2\x3d\x85\x16\x1a\xb0\x89\xd8\x58\x73\x2f\x93\x4a\x61\xab\x69\x50\x0b\xba\x1b\x53\x75\x6c\x18\x3a\xd3\x6d\x04\xba\xb5\x6d\xe2\x32\xe9\x58\xeb\xea\x22\xb3\x2c\x9f\xba\x9d\x18\x59\xac\xe1\xea\x78\xbe\x83\xa7\x1f\x18\x54\x8f\xa4\xaf\xfd\x49\x59\x71\xcb\xe1\xd6\x19\xe2\x72\x99\x48\x50\x7d\xf3\x46\xc7\xd0\x61\x42\x79\x06\xd3\x06\x68\x35\x8f\x81\x6f\xd4\xed\x5e\x8c\x20\x9a\x89\x06\xa4\xc7\x5d\xb5\x38\xd5\x4c\x66\x18\x63\x44\xf3\x54\x54\xff\x5c\x94\x0f\x66\xf5\xce\x0f\x75\x4c\x59\x3d\xdf\x6e\xcb\x00\x04\x97\x1f\xb5\x2d\xbe\x6f\x6b\x3b\xf4\xa2\xee\xbf\x58\xf5\xb4\xe9\x6c\xb7\xf0\xc6\x59\xc7\xa6\xd7\xcc\xa2\xd8\xa4\xfc\xa0\x98\x5c\xed\x89\xf0\x66\x5c\xbe\x97\x5c\x88\x5f\x7e\xad\xb6\x49\x6c\x0a\xe9\x21\x94\x64\xd3\x99\xe5\x08\x19\xda\x3d\xc2\x0c\x2f\x16\x38\xfa\x24\x3b\x10\x0b\x5e\x8d\xac\xb6\x96\xff\xe4\x09\x0d\x7e\xa6\x2b\xc4\xf8\x3d\x8a\xa7\xbf\xfc\x7a\xf7\x94\xe1\xe9\x6f\x9b\x8d\x7c\x53\xd1\xe1\xb7\xd9\x35\xfc\xbb\x50\xff\x0e\xc3\x98\x22\x4a\xc2\x69\x61\x08\x45\xeb\x62\x56\xff\x7b\x0d\xeb\xfa\x42\x34\x31\xba\xf2\x33\xdf\x9e\x29\x56\x66\xd5\x57\xe2\x1a\xd6\xaa\x83\xed\xa4\xd2\x1f\x0d\x00\xa5\x45\x5c\xac\xc0\x57\xc3\xf1\xdd\xdf\x91\xed\x3e\x01\x9b\xa2\xec\xfe\x1a\xe2\x32\x24\xa4\xe4\xe2\xba\x66\xb4\x03\xf9\xf1\xdd\x34\xd7\xf5\x90\x23\x80\x26\x06\xfb\x03\xe2\xd8\x1a\x70\x31\xd2\x6b\x2f\xd5\xb4\xaf\x2d\xcb\x26\x6e\x61\xbb\x5d\xa0\x98\xe3\x7a\xe9\x32\x96\xe3\x61\x51\x28\x4b\xeb\x6d\x3c\x1f\xa7\x2b\x35\x84\x4f\x70\xea\x42\xa6\xf4\xec\x25\x3e\x9a\x13\xd5\x5f\x86\xf4\xe1\x8e\x2a\x48\x75\x47\xad\xd2\x54\x15\xeb\x27\x52\x57\xf5\x99\xd6\x61\x16\xd6\x69\x62\xbb\x1d\xb6\x13\x92\x9c\xea\x9b\x98\x87\x17\x1f\x8d\x08\xcf\x2e\x43\xdd\xb7\x4f\x5a\xc6\xbe\x30\x55\x5a\x5c\x40\x60\x17\xee\x95\xbd\xea\xee\x95\x43\xca\xde\x29\x9a\xae\x7a\xa2\xad\x12\x57\x15\x1b\x24\x71\x63\x9b\xa8\xfa\x86\x9c\xd3\x90\xb6\x71\x04\x4d\x5b\xfb\xf1\x05\xad\x11\x44\x29\x7f\xcf\xe7\xd0\x48\x0e\x70\x7f\x76\xe0\xf5\x46\xff\xed\xe3\x43\x43\x22\xfc\x2f\x3d\xc4\x5f\x7f\x31\xd7\x4c\x96\xb6\x46\xf9\x6d\xb7\x70\x9c\xf8\x7e\x8f\xa1\x75\x86\xd9\x5a\x95\x4d\x9f\x3b\x2d\xbe\x96\xb0\xfe\x18\xf1\xfc\x93\x08\x93\x77\xc4\xc6\x7b\x30\xd9\x21\xc2\xe3\x7d\x4f\x28\xee\x1e\x12\x77\x06\xc0\x77\x89\x7c\x1f\x52\x3e\xc7\x93\xcd\xd7\x17\xf6\xee\x88\x77\xf7\x93\x3c\xef\x40\x55\x01\x31\x46\xc8\x64\xe5\x6a\x1c\xe3\x4a\x69\x0b\x9d\xdc\x9e\xb4\x9c\xa1\x84\xaf\x53\x3b\x64\x32\xb3\xc9\x32\xa9\xed\x68\x8e\x65\xc0\x6c\xdf\x19\x49\xe8\x79\x71\x71\x0d\x17\x77\x49\xf4\x74\x71\xed\x6a\x61\xcf\x89\x8e\x99\xbb\xe8\x23\xdf\x6d\xa2\xdb\x08\x97\xfb\x22\x1a\x95\x1b\x2d\x34\x9c\x73\x25\x45\xf7\xaf\xd9\xdd\x1a\xb0\x02\x4e\x3f\xac\x7f\x7d\xdd\x41\x33\xa1\x54\x9f\x30\x37\xb4\x85\xba\xcd\x22\xc2\x81\xa6\xa2\x6f\x51\xa8\x44\xfd\x66\x34\x1c\x5a\x22\xe2\xe0\x8d\x8a\x4f\xed\xb0\xcc\xcc\x78\x54\xf6\x3b\x3b\xe9\xb0\x39\x38\x42\xe7\xd0\x08\x9f\x8b\xb9\xe8\xfa\xa8\x47\x0c\xeb\x38\x79\xa5\xaf\x33\x52\x3c\x44\xea\x9e\xc3\x35\xb7\xf1\x69\xbf\x78\xb2\x4e\xcf\x96\x88\xe5\x01\x73\x34\xa7\x19\x64\xee\xbb\x0e\xed\x0a\xb8\xbd\xf2\xc0\x80\xf4\x09\x0a\xf3\xf0\x08\xb6\xa8\xa0\xc9\x75\xf1\xaf\x2d\xdd\xc5\xe3\xd3\x8c\x69\xf7\xa6\xee\x51\xa5\xdc\xeb\x3a\xfb\x4a\x9c\x18\x20\x73\x8e\xbf\xbf\x82\xf0\x4c\xee\x15\xe1\xb5\x97\xa9\x31\x86\x28\x0b\x9b\x86\x3e\xe7\xb4\xa9\x40\x9a\x05\x0e\xa0\x4a\x9a\x1c\xf9\xaa\xd1\x83\x53\xb3\xd8\xff\xf7\xfd\xb2\x9b\x9d\x5f\xb3\x72\x6b\x45\x15\x0d\xdc\x0e\xc3\x25\xaf\x3e\x03\xd7\x77\xfa\x3b\xc0\x91\xdd\xb2\x75\x27\xa9\x5c\x5e\x77\x8a\xaf\x37\x19\x8f\xaf\x1f\x1a\x21\xfd\xfd\xa3\xbe\xa7\xba\x89\xb2\x57\xa8\xb9\x73\xa3\xa4\x91\xd2\x6b\x7e\x97\x0a\x8c\xdb\x6e\xac\xd3\xe2\xe2\xa1\x7d\x6c\x6e\xf0\x97\x2a\x9b\x5f\xa9\x74\x1d\xf7\x1e\xf2\x59\x4a\xe3\x26\xcb\x96\x54\x96\x11\x35\xbf\xd4\x45\x52\x5e\x37\x38\x7c\x31\xfa\x1c\x9b\x3f\xee\x91\x79\x7b\x26\x06\x19\xc6\x3c\xee\x69\xe4\x1f\xcb\x35\x3c\xc8\x6c\x5d\x2d\x77\x8c\xb5\xf5\x38\x67\xcb\x29\xd1\x46\x57\xee\xfb\x7a\x0f\x3e\x9c\x1d\xae\x3e\x6a\x61\xf8\xc6\xa3\xee\x3b\x27\x77\xde\x23\xbd\xdf\xc6\xf6\xc3\x66\xd5\xcf\xd1\xff\x93\xf4\x26\x8b\xf8\xb2\x60\xbb\x73\x74\xf9\x94\xc1\xdf\x09\xfb\x87\x63\x46\x98\xcf\x21\xe6\x73\x88\xf9\x1c\x62\x3e\x52\x88\xb9\x45\xd4\x5b\xc2\xcc\xe7\x40\xf3\xeb\x80\x06\x2f\x53\x6f\x9c\x03\xcd\x2f\x07\x48\x78\xf4\x4b\xf3\x49\xbf\x70\x73\x7f\x27\x63\x50\x30\xf9\xd5\x39\x18\xcf\x14\x4b\xee\x13\xee\x7f\x99\x3a\xe6\x1c\x6f\x3e\x21\x35\x31\x79\xfd\x21\xe2\x3d\x22\xc4\x1d\x41\xd1\x53\x8c\x13\x3f\x6f\x88\x6c\xa2\xdf\xe3\xe0\x41\xb5\x03\xf1\xec\xa8\x3e\xed\x0b\x82\xad\x3d\x5d\xda\xb3\xf3\xfa\x75\x21\xd1\x23\xb9\xb3\xb5\xc8\xb7\xda\x8b\x26\x31\xfb\xd0\xba\x9f\x36\xd7\xe2\xea\x2e\xa2\xd7\x71\x74\xfb\x8d\x1d\x57\x57\x39\x1f\xbb\x94\xff\x43\x6e\x85\xd0\xca\x2f\xfe\xd1\x08\x3f\x7e\x46\x4c\xcc\xb7\x92\x5f\xb7\x3a\x0f\xfc\xf3\xd5\x3e\xac\xd6\xae\x9c\x9d\xea\xaa\xa9\x8f\xbd\x27\xb9\xeb\x5f\xff\x1f\x00\x00\xff\xff\xa7\x3e\x84\xa4\x22\xc3\x00\x00")
 
 func templatesSchemavalidatorGotmplBytes() ([]byte, error) {
 	return bindataRead(
@@ -466,8 +466,8 @@ func templatesSchemavalidatorGotmpl() (*asset, error) {
 		return nil, err
 	}
 
-	info := bindataFileInfo{name: "templates/schemavalidator.gotmpl", size: 49841, mode: os.FileMode(0644), modTime: time.Unix(1482416923, 0)}
-	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x33, 0x87, 0xec, 0x63, 0x19, 0x5e, 0xec, 0x23, 0x1d, 0x7f, 0xf4, 0x49, 0x51, 0x96, 0x63, 0xc5, 0x67, 0x43, 0xe3, 0xbd, 0x27, 0x76, 0xb2, 0x5d, 0x8c, 0x51, 0xb1, 0x57, 0xb1, 0xa6, 0x45, 0x6}}
+	info := bindataFileInfo{name: "templates/schemavalidator.gotmpl", size: 49954, mode: os.FileMode(0644), modTime: time.Unix(1482416923, 0)}
+	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc3, 0xc7, 0x20, 0x1d, 0x6e, 0x71, 0xcb, 0x5b, 0x1b, 0xc8, 0x5d, 0x64, 0xfd, 0xa6, 0xd6, 0x46, 0xf0, 0x50, 0xe9, 0x9b, 0xb2, 0x95, 0x5c, 0x8d, 0xc0, 0x9c, 0x16, 0xea, 0x7b, 0xcb, 0x86, 0x69}}
 	return a, nil
 }
 
@@ -851,7 +851,7 @@ func templatesSwagger_json_embedGotmpl() (*asset, error) {
 	return a, nil
 }
 
-var _templatesValidationCustomformatGotmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x91\xcd\x4a\x04\x31\x10\x84\xef\x79\x8a\x32\x20\xcc\xc0\x9a\x07\x50\xf6\xe0\x41\x41\x10\x14\x56\xbc\x37\x6e\x67\x0c\xc4\xcc\xd8\xc9\xfa\x43\x93\x77\x97\xcc\x8e\xe0\x61\x0e\x1e\xf7\x56\x24\x55\x95\xfa\x88\xea\x05\x82\x87\xbb\xcb\xd7\x31\x50\xe6\x3d\x6a\x35\x68\x47\x2c\x82\xcb\x2d\x3e\x28\x86\x3d\x15\x76\xb7\xa3\xbc\x51\x79\xf0\x9d\xea\x9c\x78\xa4\xf2\x8a\x5a\x55\xff\x4a\x8e\x99\x51\xab\xb5\x4d\xa7\x56\xb6\x81\x2a\x26\x09\xa9\x78\xd8\xf3\x77\x0b\x77\x3f\xbe\x50\x09\x63\x5a\xbd\xdc\x7d\xd2\x30\xb0\x1c\x1f\xfb\x75\xb8\x65\xdb\xd3\xf7\xd4\xda\x3b\x55\xf7\x4c\xf1\xc0\x37\x5f\x93\x70\xce\xc7\xae\xde\xed\x8a\x84\x34\x74\xfd\x06\x7e\x8e\xe7\xfe\x6a\xa6\x38\xdb\x22\x85\x08\x35\x0d\x76\x59\x78\x6a\x8c\x2b\x40\xff\xe4\x49\xcb\x97\x09\x97\x83\xa4\x66\x30\x40\x35\x3f\x01\x00\x00\xff\xff\x01\xdb\x67\xc9\xd9\x01\x00\x00")
+var _templatesValidationCustomformatGotmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\x8e\x41\xca\xc2\x30\x10\x46\xf7\x3d\xc5\xf7\x07\x7e\x50\x90\x1c\x40\xe9\xd6\x95\xa0\x50\x2f\x10\x6c\x52\x07\x6a\xa2\xd3\x51\x17\xc3\xdc\x5d\x1a\x11\x5c\xb8\x7b\xbc\x37\x30\x1f\x25\x44\x66\xac\x5b\x3c\xc2\x48\x7d\x90\xe8\xb7\x85\x2f\x41\xf6\x69\xa1\x0a\x4a\xf0\x87\x20\x67\x98\xa9\x7e\x63\x1c\xa7\x08\x33\xe7\x66\xce\x3d\xcc\x56\x50\xc5\x95\x29\x4b\x82\xfb\xbf\x39\xf8\x5d\x39\x05\xa1\x92\x7f\xc6\xee\x19\x86\x21\xf2\xfb\xd9\xe7\xc2\x1f\x4b\x27\x4c\x79\xa8\x22\xd5\x36\x2d\x37\x75\xe2\x5f\x8b\x4c\x23\xb4\x01\x38\xca\x9d\xf3\x6c\x1b\x6b\x5e\x01\x00\x00\xff\xff\x86\x82\x64\xad\xc2\x00\x00\x00")
 
 func templatesValidationCustomformatGotmplBytes() ([]byte, error) {
 	return bindataRead(
@@ -866,8 +866,8 @@ func templatesValidationCustomformatGotmpl() (*asset, error) {
 		return nil, err
 	}
 
-	info := bindataFileInfo{name: "templates/validation/customformat.gotmpl", size: 473, mode: os.FileMode(0644), modTime: time.Unix(1482416923, 0)}
-	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x21, 0x62, 0x2d, 0xb8, 0x17, 0x7, 0xcb, 0xa3, 0xb, 0xe0, 0xa4, 0xc4, 0xc7, 0x3c, 0xc4, 0x11, 0x74, 0x28, 0x61, 0x83, 0x41, 0x6f, 0xe1, 0x5, 0x73, 0xcb, 0x2f, 0x47, 0xe0, 0xa3, 0x22, 0xeb}}
+	info := bindataFileInfo{name: "templates/validation/customformat.gotmpl", size: 194, mode: os.FileMode(0644), modTime: time.Unix(1482416923, 0)}
+	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb9, 0x99, 0xde, 0x16, 0x1f, 0x38, 0xaf, 0xe8, 0x4d, 0xe9, 0x62, 0xf1, 0x21, 0xc7, 0xc4, 0x36, 0x27, 0xe2, 0xb7, 0xa0, 0x6b, 0x57, 0x5c, 0x6c, 0xb9, 0x3a, 0x30, 0x57, 0x56, 0x4e, 0x97, 0xe7}}
 	return a, nil
 }
 
@@ -931,7 +931,7 @@ func templatesValidationMultipleofGotmpl() (*asset, error) {
 	return a, nil
 }
 
-var _templatesValidationPrimitiveGotmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x53\xd1\x6a\xd5\x40\x10\x7d\xcf\x57\x8c\x11\xe1\x46\x24\x1f\xa0\xf4\x41\x6b\xc5\x0b\x55\x0b\x82\xcf\x1d\x73\x27\xed\xd0\xcd\x6c\xdc\x9d\x94\xca\x32\xff\x2e\x1b\xb7\xf7\x06\x0d\xf5\x16\x7c\xea\xdb\x26\xe7\xcc\xd9\x99\x33\x67\x53\xe2\x1e\xda\x4f\x2c\xe7\x24\x57\x7a\x6d\x56\x71\x0f\x14\x02\xbc\x3e\x81\x5b\x74\xbc\x43\xa5\x03\xbc\x49\x09\x32\xff\x02\xf5\x1a\xcc\x52\x5a\x1c\xc9\x45\x32\xab\xeb\x94\x48\x76\x66\xaf\x20\x25\x18\x03\x8b\xf6\x50\xbf\xf8\x51\x43\x7b\xee\x3b\x54\xf6\x02\x05\xcc\x42\xdb\xf8\x79\x72\x0e\xbf\x3b\x02\xb3\xcd\xcb\x94\x80\x64\x37\xcb\xb5\xdf\xd0\x4d\x74\x76\x37\x06\x8a\x91\xbd\xcc\xb7\xfd\x55\xd2\x2c\x2a\x0a\x7a\x3a\x45\xf5\xc3\x07\x1f\x06\x54\xa5\x00\x66\xed\x57\x0d\x2c\x57\x9b\x03\x39\xdf\xbf\x1c\xba\x79\x33\xcf\xfc\xec\x04\x84\x1d\xa4\x0a\x20\x90\x4e\x41\xf2\xdf\xca\xaa\x32\x52\x55\xcc\xc2\xbb\x07\xcd\xba\x87\x9f\x96\x59\x87\xa1\x1f\x65\xd6\xc5\xac\x2b\xeb\x56\x15\xf0\xe9\x18\x75\x99\xcf\xb1\xc3\x91\xde\x61\x77\xa3\xdc\xdd\xc4\xbd\x05\x60\x76\xf9\xb8\x9c\xb1\xf0\x30\x0d\x66\x15\xe4\xc1\x94\x86\xd1\xa1\x12\xd4\xc5\x3f\xf6\x52\x28\x35\xb4\x60\x2b\x31\xfd\x67\xf9\x6f\xca\x7a\xf9\xe4\x94\x47\x47\x5f\xfa\x07\x15\xf6\xac\x55\x91\x33\x99\x1b\x58\x59\x7d\x46\x4e\x31\xd2\xff\xde\x3d\xca\x0e\x36\xe2\x35\xef\xec\x6d\x08\xf8\xb3\x29\x9f\x1f\x31\xbe\xe7\xd8\x05\x1e\x58\x50\x7d\x68\xf6\xb4\xad\x28\x85\x1e\x3b\x6a\xfe\x88\xc1\x91\xc1\x39\xf6\x0d\x1d\x7a\x7f\x7e\x5b\xdf\x7b\xb3\xc8\xec\x6c\xc9\x16\xcc\x7a\x74\x91\x72\xa9\x8b\xb9\x0d\x0d\x13\xed\x85\x8e\x4c\xd0\xaf\x00\x00\x00\xff\xff\x86\xb8\x1e\x86\xd7\x05\x00\x00")
+var _templatesValidationPrimitiveGotmpl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x92\x51\x6b\xd5\x40\x10\x85\xdf\xf3\x2b\xc6\x88\x70\x23\x92\x1f\xa0\xf4\x41\x6b\xc5\x40\xd5\x82\xe2\x73\xc7\xdc\x49\x3b\x74\x33\x1b\x77\x27\xa5\xb2\xcc\x7f\x97\x4d\xf7\xde\x5e\x21\x54\x0b\xde\xb7\xec\x9e\x33\x67\xbf\xec\xd9\x94\x78\x80\xf6\x13\xcb\x39\xc9\x95\x5e\x9b\x55\x3c\x00\x85\x00\xaf\x4f\xe0\x16\x1d\x6f\x51\xe9\x41\xde\xa4\x04\xd9\x7f\x81\x7a\x0d\x66\x29\x1d\x7c\x92\x8b\x64\x56\xd7\x29\x91\x6c\xcd\x5e\x41\x4a\x30\x05\x16\x1d\xa0\x7e\xf1\xb3\x86\xf6\xdc\xf7\xa8\xec\x05\x8a\xd8\x7e\xf3\x5f\x35\xb0\x5c\x95\x8d\x43\x8a\xe6\xcd\x02\xf1\xec\x04\x84\x1d\xa4\x0a\x20\x90\xce\x41\xf2\x6e\x65\x55\x39\xa3\x2a\xf4\x78\xf7\x28\xfd\x4e\x3e\x32\xfd\x03\xc5\x93\xe8\x2f\x50\x95\x82\xac\xb3\x17\xf1\x88\xe4\x97\x29\x51\xec\x71\xa2\x77\xd8\xdf\x28\xf7\x37\xf1\x00\xe9\xf2\x69\x3d\xb0\xf0\x38\x8f\x66\x15\xe4\x73\x94\xc6\xc9\xa1\x12\xd4\xe5\x77\xd8\x4b\xb1\xd4\xd0\x82\xad\xd4\xf8\xd7\xf1\x7b\xcb\xfa\xf8\xec\x94\x27\x47\x5f\x86\x47\x13\xf6\xae\xd5\x90\x33\x59\x00\x56\x9a\xc8\xca\x29\x46\xfa\xaf\x55\xf0\x00\x28\x5b\xd8\x88\x57\x68\xbb\xf8\x36\x04\xfc\xd5\x94\xe5\x47\x8c\xef\x39\xf6\x81\x47\x16\x54\x1f\x9a\xbd\xad\x13\xa5\x30\x60\x4f\x4d\x5e\x7d\x9e\x9d\xc3\x1f\x8e\xc0\xec\x65\x4a\x40\xb2\x5d\x58\xda\xef\xe8\x66\x3a\xbb\x9b\x02\xc5\xc8\x5e\x16\xd4\x0c\xde\xc5\xd3\x39\xaa\x1f\x3f\xf8\x30\x2e\x3d\x83\x59\x7b\xff\x20\x36\xcd\x3e\xe0\x4f\xf6\xe7\xb7\xf5\xee\x6e\x76\xdc\x6d\x17\x97\x2b\xe9\xc0\x6c\x40\x17\x29\x8f\xba\x98\x31\x34\xcc\xb4\x0f\xfa\xc7\x17\xf4\x3b\x00\x00\xff\xff\x64\x29\xc0\xde\x88\x04\x00\x00")
 
 func templatesValidationPrimitiveGotmplBytes() ([]byte, error) {
 	return bindataRead(
@@ -946,8 +946,8 @@ func templatesValidationPrimitiveGotmpl() (*asset, error) {
 		return nil, err
 	}
 
-	info := bindataFileInfo{name: "templates/validation/primitive.gotmpl", size: 1495, mode: os.FileMode(0644), modTime: time.Unix(1482416923, 0)}
-	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc7, 0xa1, 0x97, 0xb8, 0x1f, 0xd7, 0xe7, 0x5b, 0x7d, 0x28, 0xb9, 0xb9, 0xad, 0x1d, 0xd3, 0xf2, 0x26, 0x6c, 0xc6, 0x43, 0x3e, 0x42, 0x52, 0x37, 0x92, 0x66, 0x30, 0xcf, 0x2a, 0x17, 0xfb, 0x3c}}
+	info := bindataFileInfo{name: "templates/validation/primitive.gotmpl", size: 1160, mode: os.FileMode(0644), modTime: time.Unix(1482416923, 0)}
+	a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x35, 0x51, 0x4f, 0x1b, 0x47, 0xcc, 0x6e, 0x7b, 0x5, 0xd4, 0x8f, 0xb4, 0x2c, 0x3f, 0x55, 0xd2, 0xab, 0xda, 0xe3, 0xdf, 0x9c, 0x14, 0x22, 0xa2, 0xb5, 0x9b, 0xe2, 0x76, 0xa5, 0x82, 0xb2, 0x1e}}
 	return a, nil
 }
 
@@ -1151,67 +1151,67 @@ type bintree struct {
 }
 
 var _bintree = &bintree{nil, map[string]*bintree{
-	"templates": {nil, map[string]*bintree{
-		"client": {nil, map[string]*bintree{
-			"client.gotmpl": {templatesClientClientGotmpl, map[string]*bintree{}},
-			"facade.gotmpl": {templatesClientFacadeGotmpl, map[string]*bintree{}},
-			"parameter.gotmpl": {templatesClientParameterGotmpl, map[string]*bintree{}},
-			"response.gotmpl": {templatesClientResponseGotmpl, map[string]*bintree{}},
+	"templates": &bintree{nil, map[string]*bintree{
+		"client": &bintree{nil, map[string]*bintree{
+			"client.gotmpl":    &bintree{templatesClientClientGotmpl, map[string]*bintree{}},
+			"facade.gotmpl":    &bintree{templatesClientFacadeGotmpl, map[string]*bintree{}},
+			"parameter.gotmpl": &bintree{templatesClientParameterGotmpl, map[string]*bintree{}},
+			"response.gotmpl":  &bintree{templatesClientResponseGotmpl, map[string]*bintree{}},
 		}},
-		"contrib": {nil, map[string]*bintree{
-			"stratoscale": {nil, map[string]*bintree{
-				"client": {nil, map[string]*bintree{
-					"client.gotmpl": {templatesContribStratoscaleClientClientGotmpl, map[string]*bintree{}},
-					"facade.gotmpl": {templatesContribStratoscaleClientFacadeGotmpl, map[string]*bintree{}},
+		"contrib": &bintree{nil, map[string]*bintree{
+			"stratoscale": &bintree{nil, map[string]*bintree{
+				"client": &bintree{nil, map[string]*bintree{
+					"client.gotmpl": &bintree{templatesContribStratoscaleClientClientGotmpl, map[string]*bintree{}},
+					"facade.gotmpl": &bintree{templatesContribStratoscaleClientFacadeGotmpl, map[string]*bintree{}},
 				}},
-				"server": {nil, map[string]*bintree{
-					"configureapi.gotmpl": {templatesContribStratoscaleServerConfigureapiGotmpl, map[string]*bintree{}},
-					"server.gotmpl": {templatesContribStratoscaleServerServerGotmpl, map[string]*bintree{}},
+				"server": &bintree{nil, map[string]*bintree{
+					"configureapi.gotmpl": &bintree{templatesContribStratoscaleServerConfigureapiGotmpl, map[string]*bintree{}},
+					"server.gotmpl":       &bintree{templatesContribStratoscaleServerServerGotmpl, map[string]*bintree{}},
 				}},
 			}},
 		}},
-		"docstring.gotmpl": {templatesDocstringGotmpl, map[string]*bintree{}},
-		"header.gotmpl": {templatesHeaderGotmpl, map[string]*bintree{}},
-		"markdown": {nil, map[string]*bintree{
-			"docs.gotmpl": {templatesMarkdownDocsGotmpl, map[string]*bintree{}},
+		"docstring.gotmpl": &bintree{templatesDocstringGotmpl, map[string]*bintree{}},
+		"header.gotmpl":    &bintree{templatesHeaderGotmpl, map[string]*bintree{}},
+		"markdown": &bintree{nil, map[string]*bintree{
+			"docs.gotmpl": &bintree{templatesMarkdownDocsGotmpl, map[string]*bintree{}},
 		}},
-		"model.gotmpl": {templatesModelGotmpl, map[string]*bintree{}},
-		"schema.gotmpl": {templatesSchemaGotmpl, map[string]*bintree{}},
-		"schemabody.gotmpl": {templatesSchemabodyGotmpl, map[string]*bintree{}},
-		"schemaembedded.gotmpl": {templatesSchemaembeddedGotmpl, map[string]*bintree{}},
-		"schemapolymorphic.gotmpl": {templatesSchemapolymorphicGotmpl, map[string]*bintree{}},
-		"schematype.gotmpl": {templatesSchematypeGotmpl, map[string]*bintree{}},
-		"schemavalidator.gotmpl": {templatesSchemavalidatorGotmpl, map[string]*bintree{}},
-		"serializers": {nil, map[string]*bintree{
-			"additionalpropertiesserializer.gotmpl": {templatesSerializersAdditionalpropertiesserializerGotmpl, map[string]*bintree{}},
-			"aliasedserializer.gotmpl": {templatesSerializersAliasedserializerGotmpl, map[string]*bintree{}},
-			"allofserializer.gotmpl": {templatesSerializersAllofserializerGotmpl, map[string]*bintree{}},
-			"basetypeserializer.gotmpl": {templatesSerializersBasetypeserializerGotmpl, map[string]*bintree{}},
-			"marshalbinaryserializer.gotmpl": {templatesSerializersMarshalbinaryserializerGotmpl, map[string]*bintree{}},
-			"schemaserializer.gotmpl": {templatesSerializersSchemaserializerGotmpl, map[string]*bintree{}},
-			"subtypeserializer.gotmpl": {templatesSerializersSubtypeserializerGotmpl, map[string]*bintree{}},
-			"tupleserializer.gotmpl": {templatesSerializersTupleserializerGotmpl, map[string]*bintree{}},
+		"model.gotmpl":             &bintree{templatesModelGotmpl, map[string]*bintree{}},
+		"schema.gotmpl":            &bintree{templatesSchemaGotmpl, map[string]*bintree{}},
+		"schemabody.gotmpl":        &bintree{templatesSchemabodyGotmpl, map[string]*bintree{}},
+		"schemaembedded.gotmpl":    &bintree{templatesSchemaembeddedGotmpl, map[string]*bintree{}},
+		"schemapolymorphic.gotmpl": &bintree{templatesSchemapolymorphicGotmpl, map[string]*bintree{}},
+		"schematype.gotmpl":        &bintree{templatesSchematypeGotmpl, map[string]*bintree{}},
+		"schemavalidator.gotmpl":   &bintree{templatesSchemavalidatorGotmpl, map[string]*bintree{}},
+		"serializers": &bintree{nil, map[string]*bintree{
+			"additionalpropertiesserializer.gotmpl": &bintree{templatesSerializersAdditionalpropertiesserializerGotmpl, map[string]*bintree{}},
+			"aliasedserializer.gotmpl":              &bintree{templatesSerializersAliasedserializerGotmpl, map[string]*bintree{}},
+			"allofserializer.gotmpl":                &bintree{templatesSerializersAllofserializerGotmpl, map[string]*bintree{}},
+			"basetypeserializer.gotmpl":             &bintree{templatesSerializersBasetypeserializerGotmpl, map[string]*bintree{}},
+			"marshalbinaryserializer.gotmpl":        &bintree{templatesSerializersMarshalbinaryserializerGotmpl, map[string]*bintree{}},
+			"schemaserializer.gotmpl":               &bintree{templatesSerializersSchemaserializerGotmpl, map[string]*bintree{}},
+			"subtypeserializer.gotmpl":              &bintree{templatesSerializersSubtypeserializerGotmpl, map[string]*bintree{}},
+			"tupleserializer.gotmpl":                &bintree{templatesSerializersTupleserializerGotmpl, map[string]*bintree{}},
 		}},
-		"server": {nil, map[string]*bintree{
-			"builder.gotmpl": {templatesServerBuilderGotmpl, map[string]*bintree{}},
-			"configureapi.gotmpl": {templatesServerConfigureapiGotmpl, map[string]*bintree{}},
-			"doc.gotmpl": {templatesServerDocGotmpl, map[string]*bintree{}},
-			"main.gotmpl": {templatesServerMainGotmpl, map[string]*bintree{}},
-			"operation.gotmpl": {templatesServerOperationGotmpl, map[string]*bintree{}},
-			"parameter.gotmpl": {templatesServerParameterGotmpl, map[string]*bintree{}},
-			"responses.gotmpl": {templatesServerResponsesGotmpl, map[string]*bintree{}},
-			"server.gotmpl": {templatesServerServerGotmpl, map[string]*bintree{}},
-			"urlbuilder.gotmpl": {templatesServerUrlbuilderGotmpl, map[string]*bintree{}},
+		"server": &bintree{nil, map[string]*bintree{
+			"builder.gotmpl":      &bintree{templatesServerBuilderGotmpl, map[string]*bintree{}},
+			"configureapi.gotmpl": &bintree{templatesServerConfigureapiGotmpl, map[string]*bintree{}},
+			"doc.gotmpl":          &bintree{templatesServerDocGotmpl, map[string]*bintree{}},
+			"main.gotmpl":         &bintree{templatesServerMainGotmpl, map[string]*bintree{}},
+			"operation.gotmpl":    &bintree{templatesServerOperationGotmpl, map[string]*bintree{}},
+			"parameter.gotmpl":    &bintree{templatesServerParameterGotmpl, map[string]*bintree{}},
+			"responses.gotmpl":    &bintree{templatesServerResponsesGotmpl, map[string]*bintree{}},
+			"server.gotmpl":       &bintree{templatesServerServerGotmpl, map[string]*bintree{}},
+			"urlbuilder.gotmpl":   &bintree{templatesServerUrlbuilderGotmpl, map[string]*bintree{}},
 		}},
-		"structfield.gotmpl": {templatesStructfieldGotmpl, map[string]*bintree{}},
-		"swagger_json_embed.gotmpl": {templatesSwagger_json_embedGotmpl, map[string]*bintree{}},
-		"validation": {nil, map[string]*bintree{
-			"customformat.gotmpl": {templatesValidationCustomformatGotmpl, map[string]*bintree{}},
-			"maximum.gotmpl": {templatesValidationMaximumGotmpl, map[string]*bintree{}},
-			"minimum.gotmpl": {templatesValidationMinimumGotmpl, map[string]*bintree{}},
-			"multipleOf.gotmpl": {templatesValidationMultipleofGotmpl, map[string]*bintree{}},
-			"primitive.gotmpl": {templatesValidationPrimitiveGotmpl, map[string]*bintree{}},
-			"structfield.gotmpl": {templatesValidationStructfieldGotmpl, map[string]*bintree{}},
+		"structfield.gotmpl":        &bintree{templatesStructfieldGotmpl, map[string]*bintree{}},
+		"swagger_json_embed.gotmpl": &bintree{templatesSwagger_json_embedGotmpl, map[string]*bintree{}},
+		"validation": &bintree{nil, map[string]*bintree{
+			"customformat.gotmpl": &bintree{templatesValidationCustomformatGotmpl, map[string]*bintree{}},
+			"maximum.gotmpl":      &bintree{templatesValidationMaximumGotmpl, map[string]*bintree{}},
+			"minimum.gotmpl":      &bintree{templatesValidationMinimumGotmpl, map[string]*bintree{}},
+			"multipleOf.gotmpl":   &bintree{templatesValidationMultipleofGotmpl, map[string]*bintree{}},
+			"primitive.gotmpl":    &bintree{templatesValidationPrimitiveGotmpl, map[string]*bintree{}},
+			"structfield.gotmpl":  &bintree{templatesValidationStructfieldGotmpl, map[string]*bintree{}},
 		}},
 	}},
 }}
diff --git a/generator/model.go b/generator/model.go
index c851853c..f836d5a5 100644
--- a/generator/model.go
+++ b/generator/model.go
@@ -186,7 +186,7 @@ func shallowValidationLookup(sch GenSchema) bool {
 	if sch.Required || hasFormatValidation(sch.resolvedType) {
 		return true
 	}
-	if sch.MaxLength != nil || sch.MinLength != nil || sch.Pattern != "" || sch.MultipleOf != nil || sch.Minimum != nil || sch.Maximum != nil || len(sch.Enum) > 0 || len(sch.ItemsEnum) > 0 {
+	if sch.HasStringValidations() || sch.HasNumberValidations() || sch.HasEnum() || len(sch.ItemsEnum) > 0 {
 		return true
 	}
 	for _, a := range sch.AllOf {
@@ -624,11 +624,6 @@ func (sg *schemaGenContext) NewAdditionalProperty(schema spec.Schema) *schemaGen
 	return pg
 }
 
-func hasSliceValidations(model *spec.Schema) (hasSliceValidations bool) {
-	hasSliceValidations = model.MaxItems != nil || model.MinItems != nil || model.UniqueItems || len(model.Enum) > 0
-	return
-}
-
 func hasContextValidations(model *spec.Schema) bool {
 	// always assume ref needs context validate
 	// TODO: find away to determine ref needs context validate or not
@@ -638,28 +633,30 @@ func hasContextValidations(model *spec.Schema) bool {
 	return false
 }
 
-func hasValidations(model *spec.Schema, isRequired bool) (hasValidation bool) {
-	// NOTE: needsValidation has gone deprecated and is replaced by top-level's shallowValidationLookup()
-	hasNumberValidation := model.Maximum != nil || model.Minimum != nil || model.MultipleOf != nil
-	hasStringValidation := model.MaxLength != nil || model.MinLength != nil || model.Pattern != ""
-	hasEnum := len(model.Enum) > 0
+func hasValidations(model *spec.Schema, isRequired bool) bool {
+	if isRequired {
+		return true
+	}
+
+	v := model.Validations()
+	if v.HasNumberValidations() || v.HasStringValidations() || v.HasArrayValidations() || v.HasEnum() {
+		return true
+	}
 
 	// since this was added to deal with discriminator, we'll fix this when testing discriminated types
-	simpleObject := len(model.Properties) > 0 && model.Discriminator == ""
+	if len(model.Properties) > 0 && model.Discriminator == "" {
+		return true
+	}
 
 	// lift validations from allOf branches
-	hasAllOfValidation := false
 	for _, s := range model.AllOf {
-		hasAllOfValidation = hasValidations(&s, false)
-		hasAllOfValidation = s.Ref.String() != "" || hasAllOfValidation
-		if hasAllOfValidation {
-			break
+		schema := s
+		if s.Ref.String() != "" || hasValidations(&schema, false) {
+			return true
 		}
 	}
 
-	hasValidation = hasNumberValidation || hasStringValidation || hasSliceValidations(model) || hasEnum || simpleObject || hasAllOfValidation || isRequired
-
-	return
+	return false
 }
 
 func hasFormatValidation(tpe resolvedType) bool {
@@ -672,34 +669,25 @@ func hasFormatValidation(tpe resolvedType) bool {
 	return false
 }
 
-// handleFormatConflicts handles all conflicting model properties when a format is set
-func handleFormatConflicts(model *spec.Schema) {
-	switch model.Format {
-	case "date", "datetime", "uuid", "bsonobjectid", "base64", "duration":
-		model.MinLength = nil
-		model.MaxLength = nil
-		model.Pattern = ""
-		// more cases should be inserted here if they arise
-	}
-}
-
 func (sg *schemaGenContext) schemaValidations() sharedValidations {
 	model := sg.Schema
-	// resolve any conflicting properties if the model has a format
-	handleFormatConflicts(&model)
 
 	isRequired := sg.Required
 	if model.Default != nil || model.ReadOnly {
 		// when readOnly or default is specified, this disables Required validation (Swagger-specific)
 		isRequired = false
+		if sg.Required {
+			log.Printf("warn: properties with a default value or readOnly should not be required [%s]", sg.Name)
+		}
 	}
-	hasSliceValidations := model.MaxItems != nil || model.MinItems != nil || model.UniqueItems || len(model.Enum) > 0
-	hasValidations := hasValidations(&model, isRequired)
 
-	s := sharedValidationsFromSchema(model, sg.Required)
-	s.HasValidations = hasValidations
-	s.HasSliceValidations = hasSliceValidations
-	return s
+	v := model.Validations()
+	return sharedValidations{
+		Required:            sg.Required, /* TODO(fred): guard for cases with discriminator field, default and readOnly*/
+		SchemaValidations:   v,
+		HasSliceValidations: v.HasArrayValidations() || v.HasEnum(),
+		HasValidations:      hasValidations(&model, isRequired),
+	}
 }
 
 func mergeValidation(other *schemaGenContext) bool {
@@ -756,10 +744,8 @@ func (sg *schemaGenContext) buildProperties() error {
 	debugLog("building properties %s (parent: %s)", sg.Name, sg.Container)
 
 	for k, v := range sg.Schema.Properties {
-		debugLogAsJSON("building property %s[%q] (tup: %t) (BaseType: %t)",
-			sg.Name, k, sg.IsTuple, sg.GenSchema.IsBaseType, v)
-		debugLog("property %s[%q] (tup: %t) HasValidations: %t)",
-			sg.Name, k, sg.IsTuple, sg.GenSchema.HasValidations)
+		debugLogAsJSON("building property %s[%q] (IsTuple: %t) (IsBaseType: %t) (HasValidations: %t)",
+			sg.Name, k, sg.IsTuple, sg.GenSchema.IsBaseType, sg.GenSchema.HasValidations, v)
 
 		// check if this requires de-anonymizing, if so lift this as a new struct and extra schema
 		tpe, err := sg.TypeResolver.ResolveSchema(&v, true, sg.IsTuple || swag.ContainsStrings(sg.Schema.Required, k))
@@ -1508,7 +1494,7 @@ func (sg *schemaGenContext) buildArray() error {
 
 	// lift validations
 	sg.GenSchema.HasValidations = sg.GenSchema.HasValidations || schemaCopy.HasValidations
-	sg.GenSchema.HasSliceValidations = hasSliceValidations(&sg.Schema)
+	sg.GenSchema.HasSliceValidations = sg.Schema.Validations().HasArrayValidations() || sg.Schema.Validations().HasEnum()
 
 	// prevents bubbling custom formatter flag
 	sg.GenSchema.IsCustomFormatter = false
diff --git a/generator/operation.go b/generator/operation.go
index 8b0e72c6..5b624a19 100644
--- a/generator/operation.go
+++ b/generator/operation.go
@@ -578,26 +578,29 @@ func (b *codeGenOpBuilder) MakeResponse(receiver, name string, isSuccess bool, r
 }
 
 func (b *codeGenOpBuilder) MakeHeader(receiver, name string, hdr spec.Header) (GenHeader, error) {
-	tpe := typeForHeader(hdr) //simpleResolvedType(hdr.Type, hdr.Format, hdr.Items)
+	tpe := simpleResolvedType(hdr.Type, hdr.Format, hdr.Items, &hdr.CommonValidations)
 
 	id := swag.ToGoName(name)
 	res := GenHeader{
-		sharedValidations: sharedValidationsFromSimple(tpe, hdr.CommonValidations, true), // NOTE: Required is not defined by the Swagger schema for header. Set arbitrarily to true for convenience in templates.
-		resolvedType:      tpe,
-		Package:           b.GenOpts.LanguageOpts.ManglePackageName(b.APIPackage, defaultOperationsTarget),
-		ReceiverName:      receiver,
-		ID:                id,
-		Name:              name,
-		Path:              fmt.Sprintf("%q", name),
-		ValueExpression:   fmt.Sprintf("%s.%s", receiver, id),
-		Description:       trimBOM(hdr.Description),
-		Default:           hdr.Default,
-		HasDefault:        hdr.Default != nil,
-		Converter:         stringConverters[tpe.GoType],
-		Formatter:         stringFormatters[tpe.GoType],
-		ZeroValue:         tpe.Zero(),
-		CollectionFormat:  hdr.CollectionFormat,
-		IndexVar:          "i",
+		sharedValidations: sharedValidations{
+			Required:          true,
+			SchemaValidations: hdr.Validations(), // NOTE: Required is not defined by the Swagger schema for header. Set arbitrarily to true for convenience in templates.
+		},
+		resolvedType:     tpe,
+		Package:          b.GenOpts.LanguageOpts.ManglePackageName(b.APIPackage, defaultOperationsTarget),
+		ReceiverName:     receiver,
+		ID:               id,
+		Name:             name,
+		Path:             fmt.Sprintf("%q", name),
+		ValueExpression:  fmt.Sprintf("%s.%s", receiver, id),
+		Description:      trimBOM(hdr.Description),
+		Default:          hdr.Default,
+		HasDefault:       hdr.Default != nil,
+		Converter:        stringConverters[tpe.GoType],
+		Formatter:        stringFormatters[tpe.GoType],
+		ZeroValue:        tpe.Zero(),
+		CollectionFormat: hdr.CollectionFormat,
+		IndexVar:         "i",
 	}
 	res.HasValidations, res.HasSliceValidations = b.HasValidations(hdr.CommonValidations, res.resolvedType)
 
@@ -620,8 +623,12 @@ func (b *codeGenOpBuilder) MakeHeader(receiver, name string, hdr spec.Header) (G
 
 func (b *codeGenOpBuilder) MakeHeaderItem(receiver, paramName, indexVar, path, valueExpression string, items, parent *spec.Items) (GenItems, error) {
 	var res GenItems
-	res.resolvedType = simpleResolvedType(items.Type, items.Format, items.Items)
-	res.sharedValidations = sharedValidationsFromSimple(res.resolvedType, items.CommonValidations, false)
+	res.resolvedType = simpleResolvedType(items.Type, items.Format, items.Items, &items.CommonValidations)
+
+	res.sharedValidations = sharedValidations{
+		Required:          false,
+		SchemaValidations: items.Validations(),
+	}
 	res.Name = paramName
 	res.Path = path
 	res.Location = "header"
@@ -651,20 +658,20 @@ func (b *codeGenOpBuilder) MakeHeaderItem(receiver, paramName, indexVar, path, v
 
 // HasValidations resolves the validation status for simple schema objects
 func (b *codeGenOpBuilder) HasValidations(sh spec.CommonValidations, rt resolvedType) (hasValidations bool, hasSliceValidations bool) {
-	guardSimpleValidations(rt.SwaggerType, &sh)
-
-	hasNumberValidation := sh.Maximum != nil || sh.Minimum != nil || sh.MultipleOf != nil
-	hasStringValidation := sh.MaxLength != nil || sh.MinLength != nil || sh.Pattern != ""
-	hasSliceValidations = sh.MaxItems != nil || sh.MinItems != nil || sh.UniqueItems || len(sh.Enum) > 0
-	hasValidations = hasNumberValidation || hasStringValidation || hasSliceValidations || hasFormatValidation(rt)
+	hasSliceValidations = sh.HasArrayValidations() || sh.HasEnum()
+	hasValidations = sh.HasNumberValidations() || sh.HasStringValidations() || hasSliceValidations || hasFormatValidation(rt)
 	return
 }
 
 func (b *codeGenOpBuilder) MakeParameterItem(receiver, paramName, indexVar, path, valueExpression, location string, resolver *typeResolver, items, parent *spec.Items) (GenItems, error) {
 	debugLog("making parameter item recv=%s param=%s index=%s valueExpr=%s path=%s location=%s", receiver, paramName, indexVar, valueExpression, path, location)
 	var res GenItems
-	res.resolvedType = simpleResolvedType(items.Type, items.Format, items.Items)
-	res.sharedValidations = sharedValidationsFromSimple(res.resolvedType, items.CommonValidations, false)
+	res.resolvedType = simpleResolvedType(items.Type, items.Format, items.Items, &items.CommonValidations)
+
+	res.sharedValidations = sharedValidations{
+		Required:          false,
+		SchemaValidations: items.Validations(),
+	}
 	res.Name = paramName
 	res.Path = path
 	res.Location = location
@@ -738,8 +745,11 @@ func (b *codeGenOpBuilder) MakeParameter(receiver string, resolver *typeResolver
 		}
 	} else {
 		// Process parameters declared in other inputs: path, query, header (SimpleSchema)
-		res.resolvedType = simpleResolvedType(param.Type, param.Format, param.Items)
-		res.sharedValidations = sharedValidationsFromSimple(res.resolvedType, param.CommonValidations, param.Required)
+		res.resolvedType = simpleResolvedType(param.Type, param.Format, param.Items, &param.CommonValidations)
+		res.sharedValidations = sharedValidations{
+			Required:          param.Required,
+			SchemaValidations: param.Validations(),
+		}
 
 		res.ZeroValue = res.resolvedType.Zero()
 
diff --git a/generator/shared.go b/generator/shared.go
index 0bd5daba..f0e48ca1 100644
--- a/generator/shared.go
+++ b/generator/shared.go
@@ -1007,46 +1007,6 @@ func gatherURISchemes(swsp *spec.Swagger, operation spec.Operation) ([]string, [
 	return schemes, extraSchemes
 }
 
-func sharedValidationsFromSimple(tpe resolvedType, v spec.CommonValidations, isRequired bool) sharedValidations {
-	guardSimpleValidations(tpe.SwaggerType, &v)
-
-	return sharedValidations{
-		Required:         isRequired,
-		Maximum:          v.Maximum,
-		ExclusiveMaximum: v.ExclusiveMaximum,
-		Minimum:          v.Minimum,
-		ExclusiveMinimum: v.ExclusiveMinimum,
-		MaxLength:        v.MaxLength,
-		MinLength:        v.MinLength,
-		Pattern:          v.Pattern,
-		MaxItems:         v.MaxItems,
-		MinItems:         v.MinItems,
-		UniqueItems:      v.UniqueItems,
-		MultipleOf:       v.MultipleOf,
-		Enum:             v.Enum,
-	}
-}
-
-func sharedValidationsFromSchema(v spec.Schema, isRequired bool) sharedValidations {
-	// validation guards have already been carried out directly by the type resolver
-
-	return sharedValidations{
-		Required:         isRequired,
-		Maximum:          v.Maximum,
-		ExclusiveMaximum: v.ExclusiveMaximum,
-		Minimum:          v.Minimum,
-		ExclusiveMinimum: v.ExclusiveMinimum,
-		MaxLength:        v.MaxLength,
-		MinLength:        v.MinLength,
-		Pattern:          v.Pattern,
-		MaxItems:         v.MaxItems,
-		MinItems:         v.MinItems,
-		UniqueItems:      v.UniqueItems,
-		MultipleOf:       v.MultipleOf,
-		Enum:             v.Enum,
-	}
-}
-
 func dumpData(data interface{}) error {
 	bb, err := json.MarshalIndent(data, "", "  ")
 	if err != nil {
diff --git a/generator/structs.go b/generator/structs.go
index 5805b8af..44cdd73e 100644
--- a/generator/structs.go
+++ b/generator/structs.go
@@ -192,6 +192,11 @@ func (g GenSchema) UnderlyingType() string {
 	return g.GoType
 }
 
+// ToString returns a string conversion expression for the schema
+func (g GenSchema) ToString() string {
+	return g.resolvedType.ToString(g.ValueExpression)
+}
+
 func (g GenSchemaList) Len() int      { return len(g) }
 func (g GenSchemaList) Swap(i, j int) { g[i], g[j] = g[j], g[i] }
 func (g GenSchemaList) Less(i, j int) bool {
@@ -218,33 +223,13 @@ func (g GenSchemaList) Less(i, j int) bool {
 }
 
 type sharedValidations struct {
+	spec.SchemaValidations
+
 	HasValidations        bool
 	HasContextValidations bool
 	Required              bool
-
-	// String validations
-	MaxLength *int64
-	MinLength *int64
-	Pattern   string
-
-	// Number validations
-	MultipleOf       *float64
-	Minimum          *float64
-	Maximum          *float64
-	ExclusiveMinimum bool
-	ExclusiveMaximum bool
-
-	Enum      []interface{}
-	ItemsEnum []interface{}
-
-	// Slice validations
-	MinItems            *int64
-	MaxItems            *int64
-	UniqueItems         bool
-	HasSliceValidations bool
-
-	// Not used yet (perhaps intended for maxProperties, minProperties validations?)
-	NeedsSize bool
+	HasSliceValidations   bool
+	ItemsEnum             []interface{}
 
 	// NOTE: "patternProperties" and "dependencies" not supported by Swagger 2.0
 }
@@ -321,11 +306,16 @@ type GenHeader struct {
 
 // ItemsDepth returns a string "items.items..." with as many items as the level of nesting of the array.
 // For a header objects it always returns "".
-func (g *GenHeader) ItemsDepth() string {
+func (h *GenHeader) ItemsDepth() string {
 	// NOTE: this is currently used by templates to generate explicit comments in nested structures
 	return ""
 }
 
+// ToString returns a string conversion expression for the header
+func (h GenHeader) ToString() string {
+	return h.resolvedType.ToString(h.ValueExpression)
+}
+
 // GenHeaders is a sorted collection of headers for codegen
 type GenHeaders []GenHeader
 
@@ -439,6 +429,11 @@ func (g GenParameter) UnderlyingType() string {
 	return g.GoType
 }
 
+// ToString returns a string conversion expression for the parameter
+func (g GenParameter) ToString() string {
+	return g.resolvedType.ToString(g.ValueExpression)
+}
+
 // GenParameters represents a sorted parameter collection
 type GenParameters []GenParameter
 
@@ -498,6 +493,11 @@ func (g GenItems) UnderlyingType() string {
 	return g.GoType
 }
 
+// ToString returns a string conversion expression for the item
+func (g GenItems) ToString() string {
+	return g.resolvedType.ToString(g.ValueExpression)
+}
+
 // GenOperationGroup represents a named (tagged) group of operations
 type GenOperationGroup struct {
 	GenCommon
diff --git a/generator/templates/schemavalidator.gotmpl b/generator/templates/schemavalidator.gotmpl
index c0f25efb..0d81f312 100644
--- a/generator/templates/schemavalidator.gotmpl
+++ b/generator/templates/schemavalidator.gotmpl
@@ -7,22 +7,26 @@
 {{ end }}
 {{ define "primitivefieldvalidator" }}
   {{ if .Required }}
-  if err := validate.Required{{ if and (eq .GoType "string") (not .IsNullable) }}String{{ end }}({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, {{ if not (or .IsAnonymous .IsNullable) }}{{ .GoType }}({{ end }}{{.ValueExpression }}{{ if not (or .IsAnonymous .IsNullable) }}){{ end }}); err != nil {
+    {{- if and (eq .GoType "string") (not .IsNullable) }}
+  if err := validate.RequiredString({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, {{ if .IsAliased }}{{ .GoType }}({{ end }}{{.ValueExpression }}{{ if .IsAliased }}){{ end }}); err != nil {
+    {{- else }}
+  if err := validate.Required({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, {{ if not (or .IsAnonymous .IsNullable) }}{{ .GoType }}({{ end }}{{.ValueExpression }}{{ if not (or .IsAnonymous .IsNullable) }}){{ end }}); err != nil {
+    {{- end }}
     return err
   }
   {{ end }}
   {{ if .MinLength }}
-  if err := validate.MinLength({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, string({{ if .IsNullable }}*{{ end }}{{.ValueExpression }}), {{.MinLength }}); err != nil {
+    if err := validate.MinLength({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, {{ .ToString }}, {{.MinLength }}); err != nil {
     return err
   }
   {{ end }}
   {{ if .MaxLength }}
-  if err := validate.MaxLength({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, string({{ if .IsNullable }}*{{ end }}{{.ValueExpression }}), {{.MaxLength }}); err != nil {
+  if err := validate.MaxLength({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, {{ .ToString }}, {{.MaxLength }}); err != nil {
     return err
   }
   {{ end }}
   {{ if .Pattern }}
-  if err := validate.Pattern({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, string({{ if .IsNullable }}*{{ end }}{{.ValueExpression }}), `{{ escapeBackticks .Pattern }}`); err != nil {
+  if err := validate.Pattern({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, {{ .ToString }}, `{{ escapeBackticks .Pattern }}`); err != nil {
     return err
   }
   {{ end }}
diff --git a/generator/templates/validation/customformat.gotmpl b/generator/templates/validation/customformat.gotmpl
index df69a585..354075a9 100644
--- a/generator/templates/validation/customformat.gotmpl
+++ b/generator/templates/validation/customformat.gotmpl
@@ -1,7 +1,3 @@
-{{- if .IsAliased }}
-  if err := validate.FormatOf({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, {{ printf "%q" .SwaggerFormat }}, {{ .AliasedType }}({{.ValueExpression }}).String(), formats); err != nil {
-{{- else }}
-  if err := validate.FormatOf({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, {{ printf "%q" .SwaggerFormat }}, {{.ValueExpression }}.String(), formats); err != nil {
-{{- end }}
+if err := validate.FormatOf({{ if .Path }}{{ .Path }}{{ else }}""{{ end }}, {{ printf "%q" .Location }}, {{ printf "%q" .SwaggerFormat }}, {{ .ToString }}, formats); err != nil {
   return err
-  }
+}
diff --git a/generator/templates/validation/primitive.gotmpl b/generator/templates/validation/primitive.gotmpl
index b067668c..35238d78 100644
--- a/generator/templates/validation/primitive.gotmpl
+++ b/generator/templates/validation/primitive.gotmpl
@@ -1,15 +1,15 @@
 {{if .MinLength}}
-if err := validate.MinLength({{ if .Path }}{{ .Path }}{{else}}""{{end}}, {{ printf "%q" .Location }}, {{ if .IsNullable }}(*{{ end }}{{.ValueExpression}}{{ if .IsNullable }}){{ end }}{{ if .IsCustomFormatter }}.String(){{ end }}, {{.MinLength}}); err != nil {
+if err := validate.MinLength({{ if .Path }}{{ .Path }}{{else}}""{{end}}, {{ printf "%q" .Location }}, {{ .ToString }}, {{.MinLength}}); err != nil {
   return err
 }
 {{end}}
 {{if .MaxLength}}
-if err := validate.MaxLength({{ if .Path }}{{ .Path }}{{else}}""{{end}}, {{ printf "%q" .Location }}, {{ if .IsNullable }}(*{{ end }}{{.ValueExpression}}{{ if .IsNullable }}){{ end }}{{ if .IsCustomFormatter }}.String(){{ end }}, {{.MaxLength}}); err != nil {
+if err := validate.MaxLength({{ if .Path }}{{ .Path }}{{else}}""{{end}}, {{ printf "%q" .Location }}, {{ .ToString }}, {{.MaxLength}}); err != nil {
   return err
 }
 {{end}}
 {{if .Pattern}}
-if err := validate.Pattern({{ if .Path }}{{ .Path }}{{else}}""{{end}}, {{ printf "%q" .Location }}, {{ if .IsNullable }}(*{{ end }}{{.ValueExpression}}{{ if .IsNullable }}){{ end }}{{ if .IsCustomFormatter }}.String(){{ end }}, `{{ escapeBackticks .Pattern }}`); err != nil {
+if err := validate.Pattern({{ if .Path }}{{ .Path }}{{else}}""{{end}}, {{ printf "%q" .Location }}, {{ .ToString }}, `{{escapeBackticks .Pattern}}`); err != nil {
   return err
 }
 {{end}}
diff --git a/generator/types.go b/generator/types.go
index c3c839c6..94806e52 100644
--- a/generator/types.go
+++ b/generator/types.go
@@ -18,6 +18,7 @@ import (
 	"fmt"
 	"log"
 	"path/filepath"
+	"reflect"
 	"strings"
 
 	"github.com/go-openapi/loads"
@@ -68,10 +69,14 @@ func initTypes() {
 	}
 }
 
-func simpleResolvedType(tn, fmt string, items *spec.Items) (result resolvedType) {
+func simpleResolvedType(tn, fmt string, items *spec.Items, v *spec.CommonValidations) (result resolvedType) {
 	result.SwaggerType = tn
 	result.SwaggerFormat = fmt
 
+	defer func() {
+		guardValidations(result.SwaggerType, v)
+	}()
+
 	if tn == file {
 		// special case of swagger type "file", rendered as io.ReadCloser interface
 		result.IsPrimitive = true
@@ -81,6 +86,10 @@ func simpleResolvedType(tn, fmt string, items *spec.Items) (result resolvedType)
 	}
 
 	if fmt != "" {
+		defer func() {
+			guardFormatConflicts(result.SwaggerFormat, v)
+		}()
+
 		fmtn := strings.Replace(fmt, "-", "", -1)
 		if fmm, ok := formatMapping[tn]; ok {
 			if tpe, ok := fmm[fmtn]; ok {
@@ -113,7 +122,7 @@ func simpleResolvedType(tn, fmt string, items *spec.Items) (result resolvedType)
 			result.GoType = "[]" + iface
 			return
 		}
-		res := simpleResolvedType(items.Type, items.Format, items.Items)
+		res := simpleResolvedType(items.Type, items.Format, items.Items, &items.CommonValidations)
 		result.GoType = "[]" + res.GoType
 		return
 	}
@@ -122,10 +131,6 @@ func simpleResolvedType(tn, fmt string, items *spec.Items) (result resolvedType)
 	return
 }
 
-func typeForHeader(header spec.Header) resolvedType {
-	return simpleResolvedType(header.Type, header.Format, header.Items)
-}
-
 func newTypeResolver(pkg, fullPkg string, doc *loads.Document) *typeResolver {
 	resolver := typeResolver{ModelsPackage: pkg, Doc: doc}
 	resolver.KnownDefs = make(map[string]struct{}, len(doc.Spec().Definitions))
@@ -369,6 +374,8 @@ func (t *typeResolver) resolveFormat(schema *spec.Schema, isAnonymous bool, isRe
 			result.IsNullable = t.isNullable(schema)
 		}
 	}
+
+	guardFormatConflicts(schema.Format, schema)
 	return
 }
 
@@ -862,7 +869,7 @@ func (t *typeResolver) ResolveSchema(schema *spec.Schema, isAnonymous, isRequire
 	tpe := t.firstType(schema)
 	var returns bool
 
-	guardValidations(tpe, schema)
+	guardValidations(tpe, schema, schema.Type...)
 
 	returns, result, err = t.resolveSchemaRef(schema, isRequired)
 
@@ -948,208 +955,83 @@ func (t *typeResolver) ResolveSchema(schema *spec.Schema, isAnonymous, isRequire
 	return
 }
 
-func warnSkipValidation(val string, types interface{}) {
-	log.Printf("warning: validation %q not compatible with type %v. Skipped", val, types)
-}
-
-func removeStringValidations(schema *spec.Schema) {
-	if schema.Pattern != "" {
-		schema.Pattern = ""
-		warnSkipValidation("pattern", schema.Type)
-	}
-	if schema.MinLength != nil {
-		schema.MinLength = nil
-		warnSkipValidation("minLength", schema.Type)
-	}
-	if schema.MaxLength != nil {
-		schema.MaxLength = nil
-		warnSkipValidation("maxLength", schema.Type)
+func warnSkipValidation(types interface{}) func(string, interface{}) {
+	return func(validation string, value interface{}) {
+		value = reflect.Indirect(reflect.ValueOf(value)).Interface()
+		log.Printf("warning: validation %s (value: %v) not compatible with type %v. Skipped", validation, value, types)
 	}
 }
 
-func removeStringCommonValidations(tpe string, schema *spec.CommonValidations) {
-	if schema.Pattern != "" {
-		schema.Pattern = ""
-		warnSkipValidation("pattern", tpe)
-	}
-	if schema.MinLength != nil {
-		schema.MinLength = nil
-		warnSkipValidation("minLength", tpe)
-	}
-	if schema.MaxLength != nil {
-		schema.MaxLength = nil
-		warnSkipValidation("maxLength", tpe)
-	}
-}
+// guardValidations removes (with a warning) validations that don't fit with the schema type.
+//
+// Notice that the "enum" validation is allowed on any type but file.
+func guardValidations(tpe string, schema interface {
+	Validations() spec.SchemaValidations
+	SetValidations(spec.SchemaValidations)
+}, types ...string) {
 
-func removeNumberValidations(schema *spec.Schema) {
-	if schema.Minimum != nil {
-		schema.Minimum = nil
-		warnSkipValidation("minimum", schema.Type)
+	v := schema.Validations()
+	if len(types) == 0 {
+		types = []string{tpe}
 	}
-	if schema.Maximum != nil {
-		schema.Maximum = nil
-		warnSkipValidation("maximum", schema.Type)
-	}
-	if schema.ExclusiveMaximum {
-		schema.ExclusiveMaximum = false
-		warnSkipValidation("exclusiveMaximum", schema.Type)
-	}
-	if schema.ExclusiveMinimum {
-		schema.ExclusiveMinimum = false
-		warnSkipValidation("exclusiveMinimum", schema.Type)
-	}
-	if schema.MultipleOf != nil {
-		schema.MultipleOf = nil
-		warnSkipValidation("multipleOf", schema.Type)
-	}
-}
+	defer func() {
+		schema.SetValidations(v)
+	}()
 
-func removeNumberCommonValidations(tpe string, schema *spec.CommonValidations) {
-	if schema.Minimum != nil {
-		schema.Minimum = nil
-		warnSkipValidation("minimum", tpe)
-	}
-	if schema.Maximum != nil {
-		schema.Maximum = nil
-		warnSkipValidation("maximum", tpe)
-	}
-	if schema.ExclusiveMaximum {
-		schema.ExclusiveMaximum = false
-		warnSkipValidation("exclusiveMaximum", tpe)
+	if tpe != array {
+		v.ClearArrayValidations(warnSkipValidation(types))
 	}
-	if schema.ExclusiveMinimum {
-		schema.ExclusiveMinimum = false
-		warnSkipValidation("exclusiveMinimum", tpe)
-	}
-	if schema.MultipleOf != nil {
-		schema.MultipleOf = nil
-		warnSkipValidation("multipleOf", tpe)
-	}
-}
 
-func removeSliceValidations(schema *spec.Schema) {
-	if schema.MaxItems != nil {
-		schema.MaxItems = nil
-		warnSkipValidation("maxItems", schema.Type)
-	}
-	if schema.MinItems != nil {
-		schema.MinItems = nil
-		warnSkipValidation("minItems", schema.Type)
-	}
-	if schema.UniqueItems {
-		schema.UniqueItems = false
-		warnSkipValidation("uniqueItems", schema.Type)
+	if tpe != str && tpe != file {
+		v.ClearStringValidations(warnSkipValidation(types))
 	}
-}
 
-func removeSliceCommonValidations(tpe string, schema *spec.CommonValidations) {
-	if schema.MaxItems != nil {
-		schema.MaxItems = nil
-		warnSkipValidation("maxItems", tpe)
-	}
-	if schema.MinItems != nil {
-		schema.MinItems = nil
-		warnSkipValidation("minItems", tpe)
+	if tpe != object {
+		v.ClearObjectValidations(warnSkipValidation(types))
 	}
-	if schema.UniqueItems {
-		schema.UniqueItems = false
-		warnSkipValidation("uniqueItems", tpe)
-	}
-}
 
-func removeObjectValidations(schema *spec.Schema) {
-	if schema.MaxProperties != nil {
-		schema.MaxProperties = nil
-		warnSkipValidation("maxProperties", schema.Type)
+	if tpe != number && tpe != integer {
+		v.ClearNumberValidations(warnSkipValidation(types))
 	}
-	if schema.MinProperties != nil {
-		schema.MinProperties = nil
-		warnSkipValidation("minProperties", schema.Type)
-	}
-}
-
-// guardValidations removes (with a warning) validations that don't fit with the schema type.
-//
-// Notice that the "enum" validation is allowed on any type.
-func guardValidations(tpe string, schema *spec.Schema) {
-	switch tpe {
-	case array:
-		removeStringValidations(schema)
-		removeNumberValidations(schema)
-		removeObjectValidations(schema)
-
-	case boolean:
-		removeStringValidations(schema)
-		removeNumberValidations(schema)
-		removeSliceValidations(schema)
-		removeObjectValidations(schema)
-
-	case file:
-		removeNumberValidations(schema)
-		removeSliceValidations(schema)
-		removeObjectValidations(schema)
 
+	if tpe == file {
 		// keep MinLength/MaxLength on file
-		if schema.Pattern != "" {
-			schema.Pattern = ""
-			warnSkipValidation("pattern", schema)
+		if v.Pattern != "" {
+			warnSkipValidation(types)("pattern", v.Pattern)
+			v.Pattern = ""
+		}
+		if v.HasEnum() {
+			warnSkipValidation(types)("enum", v.Enum)
+			v.Enum = nil
 		}
-
-	case number, integer:
-		removeStringValidations(schema)
-		removeSliceValidations(schema)
-		removeObjectValidations(schema)
-
-	case str:
-		removeNumberValidations(schema)
-		removeSliceValidations(schema)
-		removeObjectValidations(schema)
-
-	case object:
-		removeStringValidations(schema)
-		removeNumberValidations(schema)
-		removeSliceValidations(schema)
-
-	case "null":
-		// mapped as interface{}: no validations allowed atm (TODO(fred): support minProperties, maxProperties)
-		removeStringValidations(schema)
-		removeNumberValidations(schema)
-		removeSliceValidations(schema)
-		removeObjectValidations(schema)
 	}
-}
 
-// guardSimpleValidations removes (with a warning) validations that don't fit with the simple schema type.
-func guardSimpleValidations(tpe string, validations *spec.CommonValidations) {
-	switch tpe {
-	case array:
-		removeStringCommonValidations(tpe, validations)
-		removeNumberCommonValidations(tpe, validations)
-
-	case boolean:
-		removeStringCommonValidations(tpe, validations)
-		removeNumberCommonValidations(tpe, validations)
-		removeSliceCommonValidations(tpe, validations)
-
-	case file:
-		removeNumberCommonValidations(tpe, validations)
-		removeSliceCommonValidations(tpe, validations)
+	// other cases:  mapped as interface{}: no validations allowed but Enum
+}
 
-		// keep MinLength/MaxLength on file
-		if validations.Pattern != "" {
-			validations.Pattern = ""
-			warnSkipValidation("pattern", tpe)
+// guardFormatConflicts handles all conflicting properties
+// (for schema model or simple schema) when a format is set.
+//
+// At this moment, validation guards already handle all known conflicts, but for the
+// special case of binary (i.e. io.Reader).
+func guardFormatConflicts(format string, schema interface {
+	Validations() spec.SchemaValidations
+	SetValidations(spec.SchemaValidations)
+}) {
+	v := schema.Validations()
+	msg := fmt.Sprintf("for format %q", format)
+
+	// for this format, no additional validations are supported
+	if format == "binary" {
+		// no validations supported on binary fields at this moment (io.Reader)
+		v.ClearStringValidations(warnSkipValidation(msg))
+		if v.HasEnum() {
+			warnSkipValidation(msg)
+			v.Enum = nil
 		}
-
-	case number, integer:
-		removeStringCommonValidations(tpe, validations)
-		removeSliceCommonValidations(tpe, validations)
-
-	case str:
-		removeNumberCommonValidations(tpe, validations)
-		removeSliceCommonValidations(tpe, validations)
+		schema.SetValidations(v)
 	}
+	// more cases should be inserted here if they arise
 }
 
 // resolvedType is a swagger type that has been resolved and analyzed for usage
@@ -1208,7 +1090,8 @@ type resolvedType struct {
 	SkipExternalValidation bool
 }
 
-func (rt *resolvedType) Zero() string {
+// Zero returns an initializer for the type
+func (rt resolvedType) Zero() string {
 	// if type is aliased, provide zero from the aliased type
 	if rt.IsAliased {
 		if zr, ok := zeroes[rt.AliasedType]; ok {
@@ -1240,6 +1123,28 @@ func (rt *resolvedType) Zero() string {
 	return ""
 }
 
+// ToString returns a string conversion for a type akin to a string
+func (rt resolvedType) ToString(value string) string {
+	if !rt.IsPrimitive || rt.SwaggerType != "string" || rt.IsStream {
+		return ""
+	}
+	if rt.IsCustomFormatter {
+		if rt.IsAliased {
+			return fmt.Sprintf("%s(%s).String()", rt.AliasedType, value)
+		}
+		return fmt.Sprintf("%s.String()", value)
+	}
+	var deref string
+	if rt.IsNullable {
+		deref = "*"
+	}
+	if rt.GoType == "string" || rt.GoType == "*string" {
+		return fmt.Sprintf("%s%s", deref, value)
+	}
+
+	return fmt.Sprintf("string(%s%s)", deref, value)
+}
+
 func (rt *resolvedType) setExtensions(schema *spec.Schema, origType string) {
 	rt.IsEnumCI = hasEnumCI(schema.Extensions)
 	rt.setIsEmptyOmitted(schema, origType)
diff --git a/go.sum b/go.sum
index 09b1605d..6d7c4f15 100644
--- a/go.sum
+++ b/go.sum
@@ -92,7 +92,6 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
 github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ=
 github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
-github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
 github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
@@ -118,11 +117,8 @@ github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQH
 github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0=
 github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94=
 github.com/go-openapi/errors v0.19.3/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94=
-github.com/go-openapi/errors v0.19.6 h1:xZMThgv5SQ7SMbWtKFkCf9bBdvR2iEyw9k3zGZONuys=
 github.com/go-openapi/errors v0.19.6/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M=
-github.com/go-openapi/errors v0.19.7 h1:Lcq+o0mSwCLKACMxZhreVHigB9ebghJ/lrmeaqASbjo=
 github.com/go-openapi/errors v0.19.7/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M=
-github.com/go-openapi/errors v0.19.8 h1:doM+tQdZbUm9gydV9yR+iQNmztbjj7I3sW4sIcAwIzc=
 github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M=
 github.com/go-openapi/errors v0.19.9 h1:9SnKdGhiPZHF3ttwFMiCBEb8jQ4IDdrK+5+a0oTygA4=
 github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M=
@@ -130,9 +126,7 @@ github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNP
 github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
 github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
 github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
-github.com/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0=
 github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
-github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w=
 github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
 github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
 github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
@@ -147,9 +141,7 @@ github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf
 github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU=
 github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs=
 github.com/go-openapi/loads v0.19.3/go.mod h1:YVfqhUCdahYwR3f3iiwQLhicVRvLlU/WO5WPaZvcvSI=
-github.com/go-openapi/loads v0.19.5 h1:jZVYWawIQiA1NBnHla28ktg6hrcfTHsCE+3QLVRBIls=
 github.com/go-openapi/loads v0.19.5/go.mod h1:dswLCAdonkRufe/gSUC3gN8nTSaB9uaS2es0x5/IbjY=
-github.com/go-openapi/loads v0.19.6 h1:6IAtnx22MNSjPocZZ2sV7EjgF6wW5rDC9r6ZkNxjiN8=
 github.com/go-openapi/loads v0.19.6/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc=
 github.com/go-openapi/loads v0.19.7 h1:6cALLpCAq4tYhaic7TMbEzjv8vq/wg+0AFivNy/Bma8=
 github.com/go-openapi/loads v0.19.7/go.mod h1:brCsvE6j8mnbmGBh103PT/QLHfbyDxA4hsKvYBNEGVc=
@@ -178,28 +170,21 @@ github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+Z
 github.com/go-openapi/strfmt v0.19.2/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU=
 github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU=
 github.com/go-openapi/strfmt v0.19.4/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk=
-github.com/go-openapi/strfmt v0.19.5 h1:0utjKrw+BAh8s57XE9Xz8DUBsVvPmRUB6styvl9wWIM=
 github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk=
 github.com/go-openapi/strfmt v0.19.11 h1:0+YvbNh05rmBkgztd6zHp4OCFn7Mtu30bn46NQo2ZRw=
 github.com/go-openapi/strfmt v0.19.11/go.mod h1:UukAYgTaQfqJuAFlNxxMWNvMYiwiXtLsF2VwmoFtbtc=
 github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
 github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
-github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE=
 github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
-github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=
 github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
-github.com/go-openapi/swag v0.19.7 h1:VRuXN2EnMSsZdauzdss6JBC29YotDqG59BZ+tdlIL1s=
 github.com/go-openapi/swag v0.19.7/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY=
-github.com/go-openapi/swag v0.19.9 h1:1IxuqvBUU3S2Bi4YC7tlP9SJF1gVpCvqN0T2Qof4azE=
 github.com/go-openapi/swag v0.19.9/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY=
 github.com/go-openapi/swag v0.19.12 h1:Bc0bnY2c3AoF7Gc+IMIAQQsD8fLHjHpc19wXvYuayQI=
 github.com/go-openapi/swag v0.19.12/go.mod h1:eFdyEBkTdoAf/9RXBvj4cr1nH7GD8Kzo5HTt47gr72M=
 github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4=
 github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA=
 github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo=
-github.com/go-openapi/validate v0.19.10 h1:tG3SZ5DC5KF4cyt7nqLVcQXGj5A7mpaYkAcNPlDK+Yk=
 github.com/go-openapi/validate v0.19.10/go.mod h1:RKEZTUWDkxKQxN2jDT7ZnZi2bhZlbNMAuKvKB+IaGx8=
-github.com/go-openapi/validate v0.19.12 h1:mPLM/bfbd00PGOCJlU0yJL7IulkZ+q9VjPv7U11RMQQ=
 github.com/go-openapi/validate v0.19.12/go.mod h1:Rzou8hA/CBw8donlS6WNEUQupNvUZ0waH08tGe6kAQ4=
 github.com/go-openapi/validate v0.19.15 h1:oUHZO8jD7p5oRLANlXF0U8ic9ePBUkDQyRZdN0EhL6M=
 github.com/go-openapi/validate v0.19.15/go.mod h1:tbn/fdOwYHgrhPBzidZfJC2MIVvs9GA7monOmWBbeCI=
@@ -260,7 +245,6 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU
 github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
 github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
 github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
-github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
 github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
 github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
 github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
@@ -270,10 +254,8 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ
 github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
 github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
 github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
 github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
 github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
@@ -356,7 +338,6 @@ github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
 github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
 github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
 github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
 github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
 github.com/magiconair/properties v1.8.4 h1:8KGKTcQQGm0Kv7vEbKFErAoAOFyyacLStRtQSeYtvkY=
 github.com/magiconair/properties v1.8.4/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
@@ -380,9 +361,7 @@ github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS4
 github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
 github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
 github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
-github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYGN7GeoRg=
 github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
-github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8=
 github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
 github.com/mitchellh/mapstructure v1.4.0 h1:7ks8ZkOP5/ujthUsT07rNv+nkLXCQWKNHuwzOAesEks=
 github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
@@ -454,7 +433,6 @@ github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk=
 github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
 github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
@@ -480,7 +458,6 @@ go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
 go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
 go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM=
 go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE=
-go.mongodb.org/mongo-driver v1.3.4 h1:zs/dKNwX0gYUtzwrN9lLiR15hCO0nDwQj5xXx+vjCdE=
 go.mongodb.org/mongo-driver v1.3.4/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE=
 go.mongodb.org/mongo-driver v1.4.3 h1:moga+uhicpVshTyaqY9L23E6QqwcHRUv1sqyOsoyOO8=
 go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc=
@@ -506,7 +483,6 @@ golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8U
 golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392 h1:xYJJ3S178yv++9zXV/hnr29plCAGO9vAFG9dorqaFQc=
 golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
@@ -572,7 +548,6 @@ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/
 golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM=
 golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
 golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
@@ -586,7 +561,6 @@ golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAG
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=
 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58 h1:Mj83v+wSRNEar42a/MQgxk9X42TdEmrOl9i+y8WbxLo=
 golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
@@ -638,7 +612,6 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
 golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20201126233918-771906719818 h1:f1CIuDlJhwANEC2MM87MBEVMr3jl5bifgsfj90XAF9c=
 golang.org/x/sys v0.0.0-20201126233918-771906719818/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -646,9 +619,7 @@ golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXR
 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
-golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc=
 golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
@@ -710,7 +681,6 @@ golang.org/x/tools v0.0.0-20201125231158-b5590deeca9b h1:Lq5JUTFhiybGVf28jB6QRpq
 golang.org/x/tools v0.0.0-20201125231158-b5590deeca9b/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -735,7 +705,6 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7
 google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
 google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
-google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc=
 google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
 google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
 google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
@@ -808,12 +777,10 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
 gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
 gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c h1:grhR+C34yXImVGp7EzNk+DTIk+323eIUWOmEevy6bDo=
 gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ=
 gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=


Test patch:
diff --git a/generator/moreschemavalidation_fixtures_test.go b/generator/moreschemavalidation_fixtures_test.go
index 93acae17..251461e8 100644
--- a/generator/moreschemavalidation_fixtures_test.go
+++ b/generator/moreschemavalidation_fixtures_test.go
@@ -14,6 +14,138 @@
 
 package generator
 
+func initFixtureGuardFormats() {
+	f := newModelFixture("../fixtures/enhancements/guard-formats/fixture-guard-formats.yaml", "guard format validations")
+	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
+
+	flattenRun.AddExpectations("aliased_date.go", []string{
+		`type AliasedDate strfmt.Date`,
+		`func (m AliasedDate) Validate(formats strfmt.Registry) error {`,
+		`if err := validate.MinLength("", "body", strfmt.Date(m).String(), 16); err != nil {`,
+		`if err := validate.MaxLength("", "body", strfmt.Date(m).String(), 20); err != nil {`,
+		"if err := validate.Pattern(\"\", \"body\", strfmt.Date(m).String(), `(\\d+)/(\\d+)`); err != nil {",
+		`if err := validate.FormatOf("", "body", "date", strfmt.Date(m).String(), formats); err != nil {`,
+	}, todo, noLines, noLines)
+
+	flattenRun.AddExpectations("aliased_reader.go",
+		[]string{
+			`type AliasedReader io.ReadCloser`,
+		},
+		// no validations for binary
+		[]string{
+			`validate.MinLength(`,
+			`validate.MaxLength(`,
+			`validate.Pattern(`,
+			`validate.FormatOf(`,
+		},
+		[]string{
+			`warning: validation pattern`,
+			`warning: validation minLength (value: 16) not compatible with type for format "binary". Skipped`,
+			`warning: validation maxLength (value: 20) not compatible with type for format "binary". Skipped`,
+		}, noLines,
+	)
+
+	flattenRun.AddExpectations("aliased_string.go", []string{
+		`type AliasedString string`,
+		`func (m AliasedString) Validate(formats strfmt.Registry) error {`,
+		`if err := validate.MinLength("", "body", string(m), 16); err != nil {`,
+		`if err := validate.MaxLength("", "body", string(m), 20); err != nil {`,
+		"if err := validate.Pattern(\"\", \"body\", string(m), `(\\d+)/(\\d+)`); err != nil {",
+	}, todo, noLines, noLines)
+
+	flattenRun.AddExpectations("object.go", []string{
+		`func (m *Object) Validate(formats strfmt.Registry) error {`,
+		`if err := m.validateP0(formats); err != nil {`,
+		`if err := m.validateP1(formats); err != nil {`,
+		`if err := m.validateP10(formats); err != nil {`,
+		`if err := m.validateP11(formats); err != nil {`,
+		`if err := m.validateP1Nullable(formats); err != nil {`,
+		`if err := m.validateP2(formats); err != nil {`,
+		`if err := m.validateP3(formats); err != nil {`,
+		`if err := m.validateP4(formats); err != nil {`,
+		`if err := m.validateP5(formats); err != nil {`,
+		`if err := m.validateP6(formats); err != nil {`,
+		`if err := m.validateP7(formats); err != nil {`,
+		`if err := m.validateP8(formats); err != nil {`,
+		`if err := m.validateP9(formats); err != nil {`,
+		`func (m *Object) validateP0(formats strfmt.Registry) error {`,
+		`if err := validate.Required("p0", "body", m.P0); err != nil {`,
+		`if err := validate.MinLength("p0", "body", *m.P0, 12); err != nil {`,
+		`if err := validate.MaxLength("p0", "body", *m.P0, 16); err != nil {`,
+		"if err := validate.Pattern(\"p0\", \"body\", *m.P0, `(\\d+)-(\\d+)`); err != nil {",
+		`func (m *Object) validateP1(formats strfmt.Registry) error {`,
+		`if err := validate.Required("p1", "body", m.P1); err != nil {`,
+		`if err := validate.MinLength("p1", "body", m.P1.String(), 12); err != nil {`,
+		`if err := validate.MaxLength("p1", "body", m.P1.String(), 16); err != nil {`,
+		"if err := validate.Pattern(\"p1\", \"body\", m.P1.String(), `(\\d+)/(\\d+)`); err != nil {",
+		`if err := validate.FormatOf("p1", "body", "date", m.P1.String(), formats); err != nil {`,
+		`func (m *Object) validateP10(formats strfmt.Registry) error {`,
+		`if err := validate.RequiredString("p10", "body", m.P10); err != nil {`,
+		`if err := validate.MinLength("p10", "body", m.P10, 12); err != nil {`,
+		`if err := validate.MaxLength("p10", "body", m.P10, 16); err != nil {`,
+		"if err := validate.Pattern(\"p10\", \"body\", m.P10, `(\\d+)-(\\d+)`); err != nil {",
+		`func (m *Object) validateP11(formats strfmt.Registry) error {`,
+		`	if err := validate.Required("p11", "body", m.P11); err != nil {`,
+		`	if err := validate.Required("p11", "body", m.P11); err != nil {`,
+		`	if m.P11 != nil {`,
+		`		if err := m.P11.Validate(formats); err != nil {`,
+		`			if ve, ok := err.(*errors.Validation); ok {`,
+		`				return ve.ValidateName("p11")`,
+		`func (m *Object) validateP1Nullable(formats strfmt.Registry) error {`,
+		`	if swag.IsZero(m.P1Nullable) {`,
+		`	if err := validate.MinLength("p1Nullable", "body", m.P1Nullable.String(), 12); err != nil {`,
+		`	if err := validate.MaxLength("p1Nullable", "body", m.P1Nullable.String(), 16); err != nil {`,
+		"	if err := validate.Pattern(\"p1Nullable\", \"body\", m.P1Nullable.String(), `(\\d+)/(\\d+)`); err != nil {",
+		`	if err := validate.FormatOf("p1Nullable", "body", "date", m.P1Nullable.String(), formats); err != nil {`,
+		`func (m *Object) validateP2(formats strfmt.Registry) error {`,
+		`	if swag.IsZero(m.P2) {`,
+		`	if err := validate.MinLength("p2", "body", m.P2.String(), 12); err != nil {`,
+		`	if err := validate.MaxLength("p2", "body", m.P2.String(), 16); err != nil {`,
+		"	if err := validate.Pattern(\"p2\", \"body\", m.P2.String(), `(\\d+)-(\\d+)`); err != nil {",
+		`	if err := validate.FormatOf("p2", "body", "uuid", m.P2.String(), formats); err != nil {`,
+		`func (m *Object) validateP3(formats strfmt.Registry) error {`,
+		`	if swag.IsZero(m.P3) {`,
+		`	if err := validate.MinLength("p3", "body", m.P3.String(), 12); err != nil {`,
+		`	if err := validate.MaxLength("p3", "body", m.P3.String(), 16); err != nil {`,
+		"	if err := validate.Pattern(\"p3\", \"body\", m.P3.String(), `(\\d+)-(\\d+)`); err != nil {",
+		`	if err := validate.FormatOf("p3", "body", "datetime", m.P3.String(), formats); err != nil {`,
+		`func (m *Object) validateP4(formats strfmt.Registry) error {`,
+		`	if swag.IsZero(m.P4) {`,
+		`	if err := validate.MinLength("p4", "body", m.P4.String(), 12); err != nil {`,
+		`	if err := validate.MaxLength("p4", "body", m.P4.String(), 16); err != nil {`,
+		"	if err := validate.Pattern(\"p4\", \"body\", m.P4.String(), `(\\d+)-(\\d+)`); err != nil {",
+		`	if err := validate.FormatOf("p4", "body", "bsonobjectid", m.P4.String(), formats); err != nil {`,
+		`func (m *Object) validateP5(formats strfmt.Registry) error {`,
+		`	if swag.IsZero(m.P5) {`,
+		`	if err := validate.MinLength("p5", "body", m.P5.String(), 12); err != nil {`,
+		`	if err := validate.MaxLength("p5", "body", m.P5.String(), 16); err != nil {`,
+		"	if err := validate.Pattern(\"p5\", \"body\", m.P5.String(), `(\\d+)-(\\d+)`); err != nil {",
+		`	if err := validate.FormatOf("p5", "body", "duration", m.P5.String(), formats); err != nil {`,
+		`func (m *Object) validateP6(formats strfmt.Registry) error {`,
+		`	if swag.IsZero(m.P6) {`,
+		`	if err := validate.MinLength("p6", "body", m.P6.String(), 12); err != nil {`,
+		`	if err := validate.MaxLength("p6", "body", m.P6.String(), 16); err != nil {`,
+		"	if err := validate.Pattern(\"p6\", \"body\", m.P6.String(), `(\\d+)-(\\d+)`); err != nil {",
+		`func (m *Object) validateP7(formats strfmt.Registry) error {`,
+		`	if err := validate.Required("p7", "body", io.ReadCloser(m.P7)); err != nil {`,
+		`func (m *Object) validateP8(formats strfmt.Registry) error {`,
+		`	if err := validate.Required("p8", "body", m.P8); err != nil {`,
+		`	if err := validate.Required("p8", "body", m.P8); err != nil {`,
+		`	if m.P8 != nil {`,
+		`		if err := m.P8.Validate(formats); err != nil {`,
+		`			if ve, ok := err.(*errors.Validation); ok {`,
+		`				return ve.ValidateName("p8")`,
+		`func (m *Object) validateP9(formats strfmt.Registry) error {`,
+		`	if err := validate.Required("p9", "body", AliasedReader(m.P9)); err != nil {`,
+	}, todo,
+		[]string{
+			// warnings about no validations for binary
+			`warning: validation minLength (value: 12) not compatible with type for format "binary". Skipped`,
+			`warning: validation maxLength (value: 16) not compatible with type for format "binary". Skipped`,
+			`warning: validation pattern`,
+		}, noLines)
+}
+
 func initFixture2448() {
 	f := newModelFixture("../fixtures/bugs/2448/fixture-2448.yaml", "numerical validations")
 	flattenRun := f.AddRun(false).WithMinimalFlatten(true)
@@ -462,10 +594,10 @@ func initFixture1479Part() {
 		`		if err := m.validateExposedPortsValueEnum("ExposedPorts"+"."+k, "body", m.ExposedPorts[k]); err != nil {`,
 		`func (m *ContainerConfig) validateHostname(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Hostname) {`,
-		`	if err := validate.MinLength("Hostname", "body", string(m.Hostname), 1); err != nil {`,
+		`	if err := validate.MinLength("Hostname", "body", m.Hostname.String(), 1); err != nil {`,
 		`	if err := validate.FormatOf("Hostname", "body", "hostname", m.Hostname.String(), formats); err != nil {`,
 		`func (m *ContainerConfig) validateImage(formats strfmt.Registry) error {`,
-		`	if err := validate.RequiredString("Image", "body", string(m.Image)); err != nil {`,
+		`	if err := validate.RequiredString("Image", "body", m.Image); err != nil {`,
 		`var containerConfigTypeRichModePropEnum []interface{`,
 		`	var res []string`,
 		"	if err := json.Unmarshal([]byte(`[\"dumb-init\",\"sbin-init\",\"systemd\"]`), &res); err != nil {",
@@ -952,10 +1084,10 @@ func initFixture1479Part() {
 		`		if err := m.validateExposedPortsValueEnum("ExposedPorts"+"."+k, "body", m.ExposedPorts[k]); err != nil {`,
 		`func (m *ContainerCreateConfig) validateHostname(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Hostname) {`,
-		`	if err := validate.MinLength("Hostname", "body", string(m.Hostname), 1); err != nil {`,
+		`	if err := validate.MinLength("Hostname", "body", m.Hostname.String(), 1); err != nil {`,
 		`	if err := validate.FormatOf("Hostname", "body", "hostname", m.Hostname.String(), formats); err != nil {`,
 		`func (m *ContainerCreateConfig) validateImage(formats strfmt.Registry) error {`,
-		`	if err := validate.RequiredString("Image", "body", string(m.Image)); err != nil {`,
+		`	if err := validate.RequiredString("Image", "body", m.Image); err != nil {`,
 		`var containerCreateConfigTypeRichModePropEnum []interface{`,
 		`	var res []string`,
 		"	if err := json.Unmarshal([]byte(`[\"dumb-init\",\"sbin-init\",\"systemd\"]`), &res); err != nil {",
@@ -3446,10 +3578,10 @@ func initFixtureAdditionalProps() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *AdditionalObjectAnon) validateMockA(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.MockA) {`,
-		"	if err := validate.Pattern(\"mockA\", \"body\", string(m.MockA), `^[A-Z]$`); err != nil {",
+		"	if err := validate.Pattern(\"mockA\", \"body\", m.MockA, `^[A-Z]$`); err != nil {",
 		`func (m *AdditionalObjectAnon) validateMockB(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("mockB", "body", m.MockB); err != nil {`,
-		`	if err := validate.MinLength("mockB", "body", string(*m.MockB), 1); err != nil {`,
+		`	if err := validate.MinLength("mockB", "body", *m.MockB, 1); err != nil {`,
 	},
 		// not expected
 		todo,
@@ -3751,10 +3883,10 @@ func initFixtureAdditionalProps() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *AdditionalObjectAdditionalProperties) validateMockA(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.MockA) {`,
-		"	if err := validate.Pattern(\"mockA\", \"body\", string(m.MockA), `^[A-Z]$`); err != nil {",
+		"	if err := validate.Pattern(\"mockA\", \"body\", m.MockA, `^[A-Z]$`); err != nil {",
 		`func (m *AdditionalObjectAdditionalProperties) validateMockB(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("mockB", "body", m.MockB); err != nil {`,
-		`	if err := validate.MinLength("mockB", "body", string(*m.MockB), 1); err != nil {`,
+		`	if err := validate.MinLength("mockB", "body", *m.MockB, 1); err != nil {`,
 	},
 		// not expected
 		todo,
@@ -4689,10 +4821,10 @@ func initFixtureTuple() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *ClassicsClassicsItemsTuple0P3Tuple0P3) validateAuthor(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Author) {`,
-		`	if err := validate.MinLength("P3"+"."+"author", "body", string(*m.Author), 1); err != nil {`,
+		`	if err := validate.MinLength("P3"+"."+"author", "body", *m.Author, 1); err != nil {`,
 		`func (m *ClassicsClassicsItemsTuple0P3Tuple0P3) validateCharacter(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Character) {`,
-		"	if err := validate.Pattern(\"P3\"+\".\"+\"character\", \"body\", string(*m.Character), `^[A-Z]+$`); err != nil {",
+		"	if err := validate.Pattern(\"P3\"+\".\"+\"character\", \"body\", *m.Character, `^[A-Z]+$`); err != nil {",
 		`type ClassicsTuple0 struct {`,
 		"	P0 *string `json:\"-\"`",
 		"	P1 *ClassicsTuple0P1 `json:\"-\"`",
@@ -4754,10 +4886,10 @@ func initFixtureTuple() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *ClassicsTuple0P3) validateAuthor(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Author) {`,
-		`	if err := validate.MinLength("P3"+"."+"author", "body", string(*m.Author), 1); err != nil {`,
+		`	if err := validate.MinLength("P3"+"."+"author", "body", *m.Author, 1); err != nil {`,
 		`func (m *ClassicsTuple0P3) validateCharacter(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Character) {`,
-		"	if err := validate.Pattern(\"P3\"+\".\"+\"character\", \"body\", string(*m.Character), `^[A-Z]+$`); err != nil {",
+		"	if err := validate.Pattern(\"P3\"+\".\"+\"character\", \"body\", *m.Character, `^[A-Z]+$`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -4964,10 +5096,10 @@ func initFixtureTuple() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *ComicsItems3) validateAuthor(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Author) {`,
-		`	if err := validate.MinLength("author", "body", string(m.Author), 1); err != nil {`,
+		`	if err := validate.MinLength("author", "body", m.Author, 1); err != nil {`,
 		`func (m *ComicsItems3) validateCharacter(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Character) {`,
-		"	if err := validate.Pattern(\"character\", \"body\", string(m.Character), `^[A-Z]+$`); err != nil {",
+		"	if err := validate.Pattern(\"character\", \"body\", m.Character, `^[A-Z]+$`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -6002,9 +6134,9 @@ func initTodolistSchemavalidation() {
 		`			if err := validate.MinItems("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiTagsSize, 3); err != nil {`,
 		`			if err := validate.MaxItems("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiTagsSize, 10); err != nil {`,
 		`			for iii := 0; iii < len(m.Tags[i][ii]); iii++ {`,
-		`				if err := validate.MinLength("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Tags[i][ii][iii]), 3); err != nil {`,
-		`				if err := validate.MaxLength("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Tags[i][ii][iii]), 10); err != nil {`,
-		"				if err := validate.Pattern(\"tags\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", string(m.Tags[i][ii][iii]), `\\w+`); err != nil {",
+		`				if err := validate.MinLength("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Tags[i][ii][iii], 3); err != nil {`,
+		`				if err := validate.MaxLength("tags"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Tags[i][ii][iii], 10); err != nil {`,
+		"				if err := validate.Pattern(\"tags\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", m.Tags[i][ii][iii], `\\w+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -6048,14 +6180,14 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *SimpleZeroAllowed) validateID(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.ID) {`,
-		`	if err := validate.MinLength("id", "body", string(m.ID), 2); err != nil {`,
-		`	if err := validate.MaxLength("id", "body", string(m.ID), 50); err != nil {`,
-		"	if err := validate.Pattern(\"id\", \"body\", string(m.ID), `[A-Za-z0-9][\\w- ]+`); err != nil {",
+		`	if err := validate.MinLength("id", "body", m.ID, 2); err != nil {`,
+		`	if err := validate.MaxLength("id", "body", m.ID, 50); err != nil {`,
+		"	if err := validate.Pattern(\"id\", \"body\", m.ID, `[A-Za-z0-9][\\w- ]+`); err != nil {",
 		`func (m *SimpleZeroAllowed) validateName(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("name", "body", m.Name); err != nil {`,
-		`	if err := validate.MinLength("name", "body", string(*m.Name), 2); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(*m.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", *m.Name, 2); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", *m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", *m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
 		`func (m *SimpleZeroAllowed) validateUrls(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("urls", "body", m.Urls); err != nil {`,
 	},
@@ -6076,9 +6208,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *NamedAllOfAllOf6CoordsAllOf0) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 2); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -6117,9 +6249,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *NamedArrayMulti) validateP0(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
-		`	if err := validate.MinLength("0", "body", string(*m.P0), 3); err != nil {`,
-		`	if err := validate.MaxLength("0", "body", string(*m.P0), 10); err != nil {`,
-		"	if err := validate.Pattern(\"0\", \"body\", string(*m.P0), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("0", "body", *m.P0, 3); err != nil {`,
+		`	if err := validate.MaxLength("0", "body", *m.P0, 10); err != nil {`,
+		"	if err := validate.Pattern(\"0\", \"body\", *m.P0, `\\w+`); err != nil {",
 		`func (m *NamedArrayMulti) validateP1(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
 		`	if err := validate.Minimum("1", "body", *m.P1, 3, false); err != nil {`,
@@ -6142,9 +6274,9 @@ func initTodolistSchemavalidation() {
 		`	if err := validate.MinItems("", "body", iNamedArraySize, 3); err != nil {`,
 		`	if err := validate.MaxItems("", "body", iNamedArraySize, 10); err != nil {`,
 		`	for i := 0; i < len(m); i++ {`,
-		`		if err := validate.MinLength(strconv.Itoa(i), "body", string(m[i]), 3); err != nil {`,
-		`		if err := validate.MaxLength(strconv.Itoa(i), "body", string(m[i]), 10); err != nil {`,
-		"		if err := validate.Pattern(strconv.Itoa(i), \"body\", string(m[i]), `\\w+`); err != nil {",
+		`		if err := validate.MinLength(strconv.Itoa(i), "body", m[i], 3); err != nil {`,
+		`		if err := validate.MaxLength(strconv.Itoa(i), "body", m[i], 10); err != nil {`,
+		"		if err := validate.Pattern(strconv.Itoa(i), \"body\", m[i], `\\w+`); err != nil {",
 		`		return errors.CompositeValidationError(res...`,
 	},
 		// not expected
@@ -6210,9 +6342,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *ArrayMultiValidationsArgs) validateP0(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
-		`	if err := validate.MinLength("0", "body", string(*m.P0), 3); err != nil {`,
-		`	if err := validate.MaxLength("0", "body", string(*m.P0), 10); err != nil {`,
-		"	if err := validate.Pattern(\"0\", \"body\", string(*m.P0), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("0", "body", *m.P0, 3); err != nil {`,
+		`	if err := validate.MaxLength("0", "body", *m.P0, 10); err != nil {`,
+		"	if err := validate.Pattern(\"0\", \"body\", *m.P0, `\\w+`); err != nil {",
 		`func (m *ArrayMultiValidationsArgs) validateP1(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
 		`	if err := validate.Minimum("1", "body", *m.P1, 3, false); err != nil {`,
@@ -6241,9 +6373,9 @@ func initTodolistSchemavalidation() {
 		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
 		`func (m *NamedMapComplexAdditionalProperties) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -6299,9 +6431,9 @@ func initTodolistSchemavalidation() {
 		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
 		`func (m *NamedNestedMapComplexAnon) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -6436,9 +6568,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *ArrayMultiValidationsArgsTuple0) validateP0(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
-		`	if err := validate.MinLength("P0", "body", string(*m.P0), 3); err != nil {`,
-		`	if err := validate.MaxLength("P0", "body", string(*m.P0), 10); err != nil {`,
-		"	if err := validate.Pattern(\"P0\", \"body\", string(*m.P0), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("P0", "body", *m.P0, 3); err != nil {`,
+		`	if err := validate.MaxLength("P0", "body", *m.P0, 10); err != nil {`,
+		"	if err := validate.Pattern(\"P0\", \"body\", *m.P0, `\\w+`); err != nil {",
 		`func (m *ArrayMultiValidationsArgsTuple0) validateP1(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("P1", "body", m.P1); err != nil {`,
 		`	if err := validate.Minimum("P1", "body", *m.P1, 3, false); err != nil {`,
@@ -6460,9 +6592,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *StringValidations) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 2); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -6593,9 +6725,9 @@ func initTodolistSchemavalidation() {
 		`			if err := validate.MinItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`,
 		`			if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`,
 		`			for iii := 0; iii < len(m.Assoc[i][ii]); iii++ {`,
-		`				if err := validate.MinLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Assoc[i][ii][iii]), 2); err != nil {`,
-		`				if err := validate.MaxLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Assoc[i][ii][iii]), 50); err != nil {`,
-		"				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 {",
+		`				if err := validate.MinLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 2); err != nil {`,
+		`				if err := validate.MaxLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 50); err != nil {`,
+		"				if err := validate.Pattern(\"assoc\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", m.Assoc[i][ii][iii], `[A-Za-z0-9][\\w- ]+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -6653,9 +6785,9 @@ func initTodolistSchemavalidation() {
 		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
 		`func (m *MapComplexValidationsMetaAnon) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -6679,9 +6811,9 @@ func initTodolistSchemavalidation() {
 		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
 		`func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -6718,9 +6850,9 @@ func initTodolistSchemavalidation() {
 		`	if err := validate.MinItems("tags", "body", iTagsSize, 3); err != nil {`,
 		`	if err := validate.MaxItems("tags", "body", iTagsSize, 10); err != nil {`,
 		`	for i := 0; i < len(m.Tags); i++ {`,
-		`		if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 3); err != nil {`,
-		`		if err := validate.MaxLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 10); err != nil {`,
-		"		if err := validate.Pattern(\"tags\"+\".\"+strconv.Itoa(i), \"body\", string(m.Tags[i]), `\\w+`); err != nil {",
+		`		if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", m.Tags[i], 3); err != nil {`,
+		`		if err := validate.MaxLength("tags"+"."+strconv.Itoa(i), "body", m.Tags[i], 10); err != nil {`,
+		"		if err := validate.Pattern(\"tags\"+\".\"+strconv.Itoa(i), \"body\", m.Tags[i], `\\w+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -6772,9 +6904,9 @@ func initTodolistSchemavalidation() {
 		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
 		`func (m *MapComplexValidationsMetaAdditionalProperties) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -6825,9 +6957,9 @@ func initTodolistSchemavalidation() {
 		`			if err := validate.MinItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`,
 		`			if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`,
 		`			for iii := 0; iii < len(m.Assoc[i][ii]); iii++ {`,
-		`				if err := validate.MinLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Assoc[i][ii][iii]), 2); err != nil {`,
-		`				if err := validate.MaxLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Assoc[i][ii][iii]), 50); err != nil {`,
-		"				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 {",
+		`				if err := validate.MinLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 2); err != nil {`,
+		`				if err := validate.MaxLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 50); err != nil {`,
+		"				if err := validate.Pattern(\"assoc\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", m.Assoc[i][ii][iii], `[A-Za-z0-9][\\w- ]+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -6891,9 +7023,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *NestedObjectValidationsArgsMeta) validateFirst(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.First) {`,
-		`	if err := validate.MinLength("args"+"."+"meta"+"."+"first", "body", string(m.First), 2); err != nil {`,
-		`	if err := validate.MaxLength("args"+"."+"meta"+"."+"first", "body", string(m.First), 50); err != nil {`,
-		"	if err := validate.Pattern(\"args\"+\".\"+\"meta\"+\".\"+\"first\", \"body\", string(m.First), `^\\w+`); err != nil {",
+		`	if err := validate.MinLength("args"+"."+"meta"+"."+"first", "body", m.First, 2); err != nil {`,
+		`	if err := validate.MaxLength("args"+"."+"meta"+"."+"first", "body", m.First, 50); err != nil {`,
+		"	if err := validate.Pattern(\"args\"+\".\"+\"meta\"+\".\"+\"first\", \"body\", m.First, `^\\w+`); err != nil {",
 		`func (m *NestedObjectValidationsArgsMeta) validateFourth(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Fourth) {`,
 		`	iFourthSize := int64(len(m.Fourth)`,
@@ -6945,9 +7077,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *NamedArrayAdditional) validateP0(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
-		`	if err := validate.MinLength("0", "body", string(*m.P0), 3); err != nil {`,
-		`	if err := validate.MaxLength("0", "body", string(*m.P0), 10); err != nil {`,
-		"	if err := validate.Pattern(\"0\", \"body\", string(*m.P0), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("0", "body", *m.P0, 3); err != nil {`,
+		`	if err := validate.MaxLength("0", "body", *m.P0, 10); err != nil {`,
+		"	if err := validate.Pattern(\"0\", \"body\", *m.P0, `\\w+`); err != nil {",
 		`func (m *NamedArrayAdditional) validateP1(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
 		`	if err := validate.Minimum("1", "body", *m.P1, 3, false); err != nil {`,
@@ -7108,9 +7240,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *ArrayAdditionalValidationsArgs) validateP0(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
-		`	if err := validate.MinLength("0", "body", string(*m.P0), 3); err != nil {`,
-		`	if err := validate.MaxLength("0", "body", string(*m.P0), 10); err != nil {`,
-		"	if err := validate.Pattern(\"0\", \"body\", string(*m.P0), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("0", "body", *m.P0, 3); err != nil {`,
+		`	if err := validate.MaxLength("0", "body", *m.P0, 10); err != nil {`,
+		"	if err := validate.Pattern(\"0\", \"body\", *m.P0, `\\w+`); err != nil {",
 		`func (m *ArrayAdditionalValidationsArgs) validateP1(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
 		`	if err := validate.Minimum("1", "body", *m.P1, 3, false); err != nil {`,
@@ -7141,9 +7273,9 @@ func initTodolistSchemavalidation() {
 		`	if err := validate.MinItems("args", "body", iArgsSize, 5); err != nil {`,
 		`	if err := validate.MaxItems("args", "body", iArgsSize, 20); err != nil {`,
 		`	for i := 0; i < len(m.Args); i++ {`,
-		`		if err := validate.MinLength("args"+"."+strconv.Itoa(i), "body", string(m.Args[i]), 2); err != nil {`,
-		`		if err := validate.MaxLength("args"+"."+strconv.Itoa(i), "body", string(m.Args[i]), 50); err != nil {`,
-		"		if err := validate.Pattern(\"args\"+\".\"+strconv.Itoa(i), \"body\", string(m.Args[i]), `[A-Za-z0-9][\\w- ]+`); err != nil {",
+		`		if err := validate.MinLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 2); err != nil {`,
+		`		if err := validate.MaxLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 50); err != nil {`,
+		"		if err := validate.Pattern(\"args\"+\".\"+strconv.Itoa(i), \"body\", m.Args[i], `[A-Za-z0-9][\\w- ]+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -7160,9 +7292,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *AllOfValidationsMetaAllOf0) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 2); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -7200,9 +7332,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *NamedAllOfAllOf0) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 2); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -7226,9 +7358,9 @@ func initTodolistSchemavalidation() {
 		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
 		`func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -7379,9 +7511,9 @@ func initTodolistSchemavalidation() {
 		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
 		`func (m *NestedMapComplexValidationsMetaAnon) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -7418,9 +7550,9 @@ func initTodolistSchemavalidation() {
 		`	if err := validate.MinItems("args", "body", iArgsSize, 5); err != nil {`,
 		`	if err := validate.MaxItems("args", "body", iArgsSize, 20); err != nil {`,
 		`	for i := 0; i < len(m.Args); i++ {`,
-		`		if err := validate.MinLength("args"+"."+strconv.Itoa(i), "body", string(m.Args[i]), 2); err != nil {`,
-		`		if err := validate.MaxLength("args"+"."+strconv.Itoa(i), "body", string(m.Args[i]), 50); err != nil {`,
-		"		if err := validate.Pattern(\"args\"+\".\"+strconv.Itoa(i), \"body\", string(m.Args[i]), `[A-Za-z0-9][\\w- ]+`); err != nil {",
+		`		if err := validate.MinLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 2); err != nil {`,
+		`		if err := validate.MaxLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 50); err != nil {`,
+		"		if err := validate.Pattern(\"args\"+\".\"+strconv.Itoa(i), \"body\", m.Args[i], `[A-Za-z0-9][\\w- ]+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -7450,9 +7582,9 @@ func initTodolistSchemavalidation() {
 		`			if err := validate.MinItems(strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiNamedNestedArraySize, 3); err != nil {`,
 		`			if err := validate.MaxItems(strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiNamedNestedArraySize, 10); err != nil {`,
 		`			for iii := 0; iii < len(m[i][ii]); iii++ {`,
-		`				if err := validate.MinLength(strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m[i][ii][iii]), 3); err != nil {`,
-		`				if err := validate.MaxLength(strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m[i][ii][iii]), 10); err != nil {`,
-		"				if err := validate.Pattern(strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", string(m[i][ii][iii]), `\\w+`); err != nil {",
+		`				if err := validate.MinLength(strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m[i][ii][iii], 3); err != nil {`,
+		`				if err := validate.MaxLength(strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m[i][ii][iii], 10); err != nil {`,
+		"				if err := validate.Pattern(strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", m[i][ii][iii], `\\w+`); err != nil {",
 		`		return errors.CompositeValidationError(res...`,
 	},
 		// not expected
@@ -7512,9 +7644,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *NamedAllOf) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 2); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
 		`func (m *NamedAllOf) validateAge(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Age) {`,
 		`	if err := validate.MinimumInt("age", "body", int64(m.Age), 2, false); err != nil {`,
@@ -7526,9 +7658,9 @@ func initTodolistSchemavalidation() {
 		`	if err := validate.MinItems("args", "body", iArgsSize, 5); err != nil {`,
 		`	if err := validate.MaxItems("args", "body", iArgsSize, 20); err != nil {`,
 		`	for i := 0; i < len(m.Args); i++ {`,
-		`		if err := validate.MinLength("args"+"."+strconv.Itoa(i), "body", string(m.Args[i]), 2); err != nil {`,
-		`		if err := validate.MaxLength("args"+"."+strconv.Itoa(i), "body", string(m.Args[i]), 50); err != nil {`,
-		"		if err := validate.Pattern(\"args\"+\".\"+strconv.Itoa(i), \"body\", string(m.Args[i]), `[A-Za-z0-9][\\w- ]+`); err != nil {",
+		`		if err := validate.MinLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 2); err != nil {`,
+		`		if err := validate.MaxLength("args"+"."+strconv.Itoa(i), "body", m.Args[i], 50); err != nil {`,
+		"		if err := validate.Pattern(\"args\"+\".\"+strconv.Itoa(i), \"body\", m.Args[i], `[A-Za-z0-9][\\w- ]+`); err != nil {",
 		`func (m *NamedAllOf) validateAssoc(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Assoc) {`,
 		`	iAssocSize := int64(len(m.Assoc)`,
@@ -7543,9 +7675,9 @@ func initTodolistSchemavalidation() {
 		`			if err := validate.MinItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`,
 		`			if err := validate.MaxItems("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`,
 		`			for iii := 0; iii < len(m.Assoc[i][ii]); iii++ {`,
-		`				if err := validate.MinLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Assoc[i][ii][iii]), 2); err != nil {`,
-		`				if err := validate.MaxLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", string(m.Assoc[i][ii][iii]), 50); err != nil {`,
-		"				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 {",
+		`				if err := validate.MinLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 2); err != nil {`,
+		`				if err := validate.MaxLength("assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Assoc[i][ii][iii], 50); err != nil {`,
+		"				if err := validate.Pattern(\"assoc\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", m.Assoc[i][ii][iii], `[A-Za-z0-9][\\w- ]+`); err != nil {",
 		`func (m *NamedAllOf) validateOpts(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Opts) {`,
 		`	for k := range m.Opts {`,
@@ -7566,9 +7698,9 @@ func initTodolistSchemavalidation() {
 		`				if err := validate.MultipleOf("extOpts"+"."+k+"."+kk+"."+kkk, "body", float64(m.ExtOpts[k][kk][kkk]), 1.5); err != nil {`,
 		`func (m *NamedAllOf) validateCoords(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Coords) {`,
-		`	if err := validate.MinLength("coords"+"."+"name", "body", string(m.Coords.Name), 2); err != nil {`,
-		`	if err := validate.MaxLength("coords"+"."+"name", "body", string(m.Coords.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"coords\"+\".\"+\"name\", \"body\", string(m.Coords.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
+		`	if err := validate.MinLength("coords"+"."+"name", "body", m.Coords.Name, 2); err != nil {`,
+		`	if err := validate.MaxLength("coords"+"."+"name", "body", m.Coords.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"coords\"+\".\"+\"name\", \"body\", m.Coords.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
 		`	if err := validate.MinimumInt("coords"+"."+"age", "body", int64(m.Coords.Age), 2, false); err != nil {`,
 		`	if err := validate.MaximumInt("coords"+"."+"age", "body", int64(m.Coords.Age), 50, false); err != nil {`,
 		`	if err := validate.MultipleOf("coords"+"."+"age", "body", float64(m.Coords.Age), 1.5); err != nil {`,
@@ -7617,9 +7749,9 @@ func initTodolistSchemavalidation() {
 		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
 		`func (m *NamedMapComplexAnon) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -7672,9 +7804,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *ArrayAdditionalValidationsArgsTuple0) validateP0(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
-		`	if err := validate.MinLength("P0", "body", string(*m.P0), 3); err != nil {`,
-		`	if err := validate.MaxLength("P0", "body", string(*m.P0), 10); err != nil {`,
-		"	if err := validate.Pattern(\"P0\", \"body\", string(*m.P0), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("P0", "body", *m.P0, 3); err != nil {`,
+		`	if err := validate.MaxLength("P0", "body", *m.P0, 10); err != nil {`,
+		"	if err := validate.Pattern(\"P0\", \"body\", *m.P0, `\\w+`); err != nil {",
 		`func (m *ArrayAdditionalValidationsArgsTuple0) validateP1(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("P1", "body", m.P1); err != nil {`,
 		`	if err := validate.Minimum("P1", "body", *m.P1, 3, false); err != nil {`,
@@ -7707,9 +7839,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *NestedObjectValidationsArgsMeta) validateFirst(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.First) {`,
-		`	if err := validate.MinLength("first", "body", string(m.First), 2); err != nil {`,
-		`	if err := validate.MaxLength("first", "body", string(m.First), 50); err != nil {`,
-		"	if err := validate.Pattern(\"first\", \"body\", string(m.First), `^\\w+`); err != nil {",
+		`	if err := validate.MinLength("first", "body", m.First, 2); err != nil {`,
+		`	if err := validate.MaxLength("first", "body", m.First, 50); err != nil {`,
+		"	if err := validate.Pattern(\"first\", \"body\", m.First, `^\\w+`); err != nil {",
 		`func (m *NestedObjectValidationsArgsMeta) validateFourth(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Fourth) {`,
 		`	iFourthSize := int64(len(m.Fourth)`,
@@ -7854,9 +7986,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *AllOfValidations) validateMeta(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Meta) {`,
-		`	if err := validate.MinLength("meta"+"."+"name", "body", string(m.Meta.Name), 2); err != nil {`,
-		`	if err := validate.MaxLength("meta"+"."+"name", "body", string(m.Meta.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"meta\"+\".\"+\"name\", \"body\", string(m.Meta.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
+		`	if err := validate.MinLength("meta"+"."+"name", "body", m.Meta.Name, 2); err != nil {`,
+		`	if err := validate.MaxLength("meta"+"."+"name", "body", m.Meta.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"meta\"+\".\"+\"name\", \"body\", m.Meta.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
 		`	if err := validate.MinimumInt("meta"+"."+"age", "body", int64(m.Meta.Age), 2, false); err != nil {`,
 		`	if err := validate.MaximumInt("meta"+"."+"age", "body", int64(m.Meta.Age), 50, false); err != nil {`,
 		`	if err := validate.MultipleOf("meta"+"."+"age", "body", float64(m.Meta.Age), 1.5); err != nil {`,
@@ -7864,9 +7996,9 @@ func initTodolistSchemavalidation() {
 		`	if err := validate.MinItems("meta"+"."+"args", "body", iArgsSize, 5); err != nil {`,
 		`	if err := validate.MaxItems("meta"+"."+"args", "body", iArgsSize, 20); err != nil {`,
 		`	for i := 0; i < len(m.Meta.Args); i++ {`,
-		`		if err := validate.MinLength("meta"+"."+"args"+"."+strconv.Itoa(i), "body", string(m.Meta.Args[i]), 2); err != nil {`,
-		`		if err := validate.MaxLength("meta"+"."+"args"+"."+strconv.Itoa(i), "body", string(m.Meta.Args[i]), 50); err != nil {`,
-		"		if err := validate.Pattern(\"meta\"+\".\"+\"args\"+\".\"+strconv.Itoa(i), \"body\", string(m.Meta.Args[i]), `[A-Za-z0-9][\\w- ]+`); err != nil {",
+		`		if err := validate.MinLength("meta"+"."+"args"+"."+strconv.Itoa(i), "body", m.Meta.Args[i], 2); err != nil {`,
+		`		if err := validate.MaxLength("meta"+"."+"args"+"."+strconv.Itoa(i), "body", m.Meta.Args[i], 50); err != nil {`,
+		"		if err := validate.Pattern(\"meta\"+\".\"+\"args\"+\".\"+strconv.Itoa(i), \"body\", m.Meta.Args[i], `[A-Za-z0-9][\\w- ]+`); err != nil {",
 		`	iAssocSize := int64(len(m.Meta.Assoc)`,
 		`	if err := validate.MinItems("meta"+"."+"assoc", "body", iAssocSize, 5); err != nil {`,
 		`	if err := validate.MaxItems("meta"+"."+"assoc", "body", iAssocSize, 20); err != nil {`,
@@ -7879,9 +8011,9 @@ func initTodolistSchemavalidation() {
 		`			if err := validate.MinItems("meta"+"."+"assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 5); err != nil {`,
 		`			if err := validate.MaxItems("meta"+"."+"assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii), "body", iiiAssocSize, 20); err != nil {`,
 		`			for iii := 0; iii < len(m.Meta.Assoc[i][ii]); iii++ {`,
-		`				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 {`,
-		`				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 {`,
-		"				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 {",
+		`				if err := validate.MinLength("meta"+"."+"assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Meta.Assoc[i][ii][iii], 2); err != nil {`,
+		`				if err := validate.MaxLength("meta"+"."+"assoc"+"."+strconv.Itoa(i)+"."+strconv.Itoa(ii)+"."+strconv.Itoa(iii), "body", m.Meta.Assoc[i][ii][iii], 50); err != nil {`,
+		"				if err := validate.Pattern(\"meta\"+\".\"+\"assoc\"+\".\"+strconv.Itoa(i)+\".\"+strconv.Itoa(ii)+\".\"+strconv.Itoa(iii), \"body\", m.Meta.Assoc[i][ii][iii], `[A-Za-z0-9][\\w- ]+`); err != nil {",
 		`	for k := range m.Meta.Opts {`,
 		//`		if swag.IsZero(m.Meta.Opts[k]) {`,
 		`		if err := validate.MinimumInt("meta"+"."+"opts"+"."+k, "body", int64(m.Meta.Opts[k]), 2, false); err != nil {`,
@@ -7896,9 +8028,9 @@ func initTodolistSchemavalidation() {
 		`				if err := validate.MinimumInt("meta"+"."+"extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.Meta.ExtOpts[k][kk][kkk]), 2, false); err != nil {`,
 		`				if err := validate.MaximumInt("meta"+"."+"extOpts"+"."+k+"."+kk+"."+kkk, "body", int64(m.Meta.ExtOpts[k][kk][kkk]), 50, false); err != nil {`,
 		`				if err := validate.MultipleOf("meta"+"."+"extOpts"+"."+k+"."+kk+"."+kkk, "body", float64(m.Meta.ExtOpts[k][kk][kkk]), 1.5); err != nil {`,
-		`	if err := validate.MinLength("meta"+"."+"coords"+"."+"name", "body", string(m.Meta.Coords.Name), 2); err != nil {`,
-		`	if err := validate.MaxLength("meta"+"."+"coords"+"."+"name", "body", string(m.Meta.Coords.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"meta\"+\".\"+\"coords\"+\".\"+\"name\", \"body\", string(m.Meta.Coords.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
+		`	if err := validate.MinLength("meta"+"."+"coords"+"."+"name", "body", m.Meta.Coords.Name, 2); err != nil {`,
+		`	if err := validate.MaxLength("meta"+"."+"coords"+"."+"name", "body", m.Meta.Coords.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"meta\"+\".\"+\"coords\"+\".\"+\"name\", \"body\", m.Meta.Coords.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
 		`	if err := validate.MinimumInt("meta"+"."+"coords"+"."+"age", "body", int64(m.Meta.Coords.Age), 2, false); err != nil {`,
 		`	if err := validate.MaximumInt("meta"+"."+"coords"+"."+"age", "body", int64(m.Meta.Coords.Age), 50, false); err != nil {`,
 		`	if err := validate.MultipleOf("meta"+"."+"coords"+"."+"age", "body", float64(m.Meta.Coords.Age), 1.5); err != nil {`,
@@ -7924,9 +8056,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *NamedNestedObjectMeta) validateFirst(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.First) {`,
-		`	if err := validate.MinLength("first", "body", string(m.First), 2); err != nil {`,
-		`	if err := validate.MaxLength("first", "body", string(m.First), 50); err != nil {`,
-		"	if err := validate.Pattern(\"first\", \"body\", string(m.First), `^\\w+`); err != nil {",
+		`	if err := validate.MinLength("first", "body", m.First, 2); err != nil {`,
+		`	if err := validate.MaxLength("first", "body", m.First, 50); err != nil {`,
+		"	if err := validate.Pattern(\"first\", \"body\", m.First, `^\\w+`); err != nil {",
 		`func (m *NamedNestedObjectMeta) validateFourth(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Fourth) {`,
 		`	iFourthSize := int64(len(m.Fourth)`,
@@ -8010,9 +8142,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *NamedNestedObjectMeta) validateFirst(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.First) {`,
-		`	if err := validate.MinLength("meta"+"."+"first", "body", string(m.First), 2); err != nil {`,
-		`	if err := validate.MaxLength("meta"+"."+"first", "body", string(m.First), 50); err != nil {`,
-		"	if err := validate.Pattern(\"meta\"+\".\"+\"first\", \"body\", string(m.First), `^\\w+`); err != nil {",
+		`	if err := validate.MinLength("meta"+"."+"first", "body", m.First, 2); err != nil {`,
+		`	if err := validate.MaxLength("meta"+"."+"first", "body", m.First, 50); err != nil {`,
+		"	if err := validate.Pattern(\"meta\"+\".\"+\"first\", \"body\", m.First, `^\\w+`); err != nil {",
 		`func (m *NamedNestedObjectMeta) validateFourth(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Fourth) {`,
 		`	iFourthSize := int64(len(m.Fourth)`,
@@ -8060,9 +8192,9 @@ func initTodolistSchemavalidation() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *AllOfValidationsMetaAllOf6CoordsAllOf0) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 2); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `[A-Za-z0-9][\\w- ]+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 2); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `[A-Za-z0-9][\\w- ]+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -8217,9 +8349,9 @@ func initFixtureNestedMaps() {
 		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
 		`func (m *NamedNestedMapComplexAnon) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -8264,9 +8396,9 @@ func initFixtureNestedMaps() {
 		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
 		`func (m *NamedNestedMapComplexAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -8344,9 +8476,9 @@ func initFixtureNestedMaps() {
 		`	if err := validate.MultipleOfInt("age", "body", int64(m.Age), 1); err != nil {`,
 		`func (m *NestedMapComplexValidationsMetaAdditionalPropertiesAdditionalPropertiesAdditionalProperties) validateName(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Name) {`,
-		`	if err := validate.MinLength("name", "body", string(m.Name), 10); err != nil {`,
-		`	if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil {`,
-		"	if err := validate.Pattern(\"name\", \"body\", string(m.Name), `\\w+`); err != nil {",
+		`	if err := validate.MinLength("name", "body", m.Name, 10); err != nil {`,
+		`	if err := validate.MaxLength("name", "body", m.Name, 50); err != nil {`,
+		"	if err := validate.Pattern(\"name\", \"body\", m.Name, `\\w+`); err != nil {",
 	},
 		// not expected
 		todo,
@@ -9663,7 +9795,7 @@ func initFixture1548() {
 		`type Base64Map map[string]strfmt.Base64`,
 		`func (m Base64Map) Validate(formats strfmt.Registry) error {`,
 		`	for k := range m {`,
-		`		if err := validate.MaxLength(k, "body", string(m[k]), 100); err != nil {`,
+		`		if err := validate.MaxLength(k, "body", m[k].String(), 100); err != nil {`,
 		`		return errors.CompositeValidationError(res...`,
 	},
 		// not expected
@@ -9769,7 +9901,7 @@ func initFixtureSimpleTuple() {
 		`func (m *TupleThingWithMapElement) validateP0(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 		`	for k := range m.P0 {`,
-		`		if err := validate.MaxLength("0"+"."+k, "body", string(m.P0[k]), 10); err != nil {`,
+		`		if err := validate.MaxLength("0"+"."+k, "body", m.P0[k], 10); err != nil {`,
 		`func (m *TupleThingWithMapElement) validateP1(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
 		`	for k := range m.P1 {`,
@@ -9951,8 +10083,8 @@ func initFixtureSimpleTuple() {
 		`	if err := m.validateTupleThingWithNotNullableItems(formats); err != nil {`,
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *TupleThingWithNotNullable) validateP0(formats strfmt.Registry) error {`,
-		`	if err := validate.RequiredString("0", "body", string(m.P0)); err != nil {`,
-		`	if err := validate.MaxLength("0", "body", string(m.P0), 10); err != nil {`,
+		`	if err := validate.RequiredString("0", "body", m.P0); err != nil {`,
+		`	if err := validate.MaxLength("0", "body", m.P0, 10); err != nil {`,
 		`func (m *TupleThingWithNotNullable) validateP1(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("1", "body", m.P1); err != nil {`,
 		`	if err := validate.MaximumInt("1", "body", *m.P1, 10, false); err != nil {`,
@@ -10166,7 +10298,7 @@ func initFixtureSimpleTuple() {
 		`	iP0Size := int64(len(m.P0)`,
 		`	if err := validate.MaxItems("0", "body", iP0Size, 10); err != nil {`,
 		`	for i := 0; i < len(m.P0); i++ {`,
-		`		if err := validate.MaxLength("0"+"."+strconv.Itoa(i), "body", string(m.P0[i]), 10); err != nil {`,
+		`		if err := validate.MaxLength("0"+"."+strconv.Itoa(i), "body", m.P0[i], 10); err != nil {`,
 		`func (m *TupleThingWithArrayElement) validateP1(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 		`	iP1Size := int64(len(m.P1)`,
@@ -10251,7 +10383,7 @@ func initFixtureSimpleTuple() {
 		`	iP0Size := int64(len(m.P0)`,
 		`	if err := validate.MaxItems("P0", "body", iP0Size, 10); err != nil {`,
 		`	for i := 0; i < len(m.P0); i++ {`,
-		`		if err := validate.MaxLength("P0"+"."+strconv.Itoa(i), "body", string(m.P0[i]), 10); err != nil {`,
+		`		if err := validate.MaxLength("P0"+"."+strconv.Itoa(i), "body", m.P0[i], 10); err != nil {`,
 		`func (m *ArrayOfTuplesTuple0) validateP1(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("P0", "body", m.P0); err != nil {`,
 		`	iP1Size := int64(len(m.P1)`,
@@ -10346,7 +10478,7 @@ func initFixtureSimpleTuple() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *TupleThingWithObjectElementItems0) validateProp1(formats strfmt.Registry) error {`,
 		`	if swag.IsZero(m.Prop1) {`,
-		`	if err := validate.MaxLength("prop1", "body", string(m.Prop1), 10); err != nil {`,
+		`	if err := validate.MaxLength("prop1", "body", m.Prop1, 10); err != nil {`,
 	},
 		// not expected
 		todo,
@@ -10457,7 +10589,7 @@ func initFixtureSimpleTuple() {
 		`		return errors.CompositeValidationError(res...`,
 		`func (m *TupleThingWithAnyAdditionalItems) validateP0(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
-		`	if err := validate.MaxLength("0", "body", string(*m.P0), 10); err != nil {`,
+		`	if err := validate.MaxLength("0", "body", *m.P0, 10); err != nil {`,
 		`func (m *TupleThingWithAnyAdditionalItems) validateP1(formats strfmt.Registry) error {`,
 		`	if err := validate.Required("0", "body", m.P0); err != nil {`,
 		`	if err := validate.MaximumInt("1", "body", *m.P1, 10, false); err != nil {`,
diff --git a/generator/moreschemavalidation_test.go b/generator/moreschemavalidation_test.go
index 5bf54029..12b82676 100644
--- a/generator/moreschemavalidation_test.go
+++ b/generator/moreschemavalidation_test.go
@@ -278,6 +278,8 @@ func initModelFixtures() {
 
 	// numerical validations
 	initFixture2448()
+
+	initFixtureGuardFormats()
 }
 
 /* Template initTxxx() to prepare and load a fixture:
diff --git a/generator/parameter_test.go b/generator/parameter_test.go
index 4d8eb1f0..6b562b4a 100644
--- a/generator/parameter_test.go
+++ b/generator/parameter_test.go
@@ -3131,7 +3131,7 @@ func TestGenParameter_Issue1536_MapsWithExpand(t *testing.T) {
 }
 func TestGenParameter_Issue1536_MoreMaps(t *testing.T) {
 	t.Parallel()
-	defer discardOutput()()
+	//defer discardOutput()()
 
 	// testing fixture-1536-4.yaml with flatten
 	// param body with maps
@@ -3509,7 +3509,7 @@ func TestGenParameter_Issue1536_MoreMaps(t *testing.T) {
 				`			for kkk, nestedMap02IIIV := range nestedMap02IIIC {`,
 				`				if nestedMap02IIIV == nil {`,
 				`				nestedMap02III := nestedMap02IIIV`,
-				`				if err := validate.MinLength(fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", "nestedMap02", k), kk), kkk), "", (*nestedMap02III), 0); err != nil {`,
+				`				if err := validate.MinLength(fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", "nestedMap02", k), kk), kkk), "", *nestedMap02III, 0); err != nil {`,
 				`				nestedMap02IIIR[kkk] = nestedMap02III`,
 				`			nestedMap02IIR[kk] = nestedMap02IIIR`,
 				`		nestedMap02IR[k] = nestedMap02IIR`,
@@ -3612,7 +3612,7 @@ func TestGenParameter_Issue1536_MoreMaps(t *testing.T) {
 				`				for kkkk, nestedSliceAndMap02IIIIV := range nestedSliceAndMap02IIIIC {`,
 				`					if nestedSliceAndMap02IIIIV == nil {`,
 				`					nestedSliceAndMap02IIII := nestedSliceAndMap02IIIIV`,
-				`					if err := validate.MinLength(fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", "nestedSliceAndMap02", i), kk), iii), kkkk), "", (*nestedSliceAndMap02IIII), 0); err != nil {`,
+				`					if err := validate.MinLength(fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", "nestedSliceAndMap02", i), kk), iii), kkkk), "", *nestedSliceAndMap02IIII, 0); err != nil {`,
 				`					nestedSliceAndMap02IIIIR[kkkk] = nestedSliceAndMap02IIII`,
 				`				nestedSliceAndMap02IIIR = append(nestedSliceAndMap02IIIR, nestedSliceAndMap02IIIIR`,
 				`			nestedSliceAndMap02IIR[kk] = nestedSliceAndMap02IIIR`,
@@ -3794,7 +3794,7 @@ func TestGenParameter_Issue1536_MoreMaps(t *testing.T) {
 				// with Required
 				//`							return errors.Required(fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", "nestedArray01", i), ii), iii), ""`,
 				`						nestedArray01III := nestedArray01IIIV`,
-				`						if err := validate.MinLength(fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", "nestedArray01", i), ii), iii), "", (*nestedArray01III), 0); err != nil {`,
+				`						if err := validate.MinLength(fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", fmt.Sprintf("%s.%v", "nestedArray01", i), ii), iii), "", *nestedArray01III, 0); err != nil {`,
 				`						nestedArray01IIIR = append(nestedArray01IIIR, nestedArray01III`,
 				`					nestedArray01IIR = append(nestedArray01IIR, nestedArray01IIIR`,
 				`			nestedArray01IR = append(nestedArray01IR, nestedArray01IIR`,
diff --git a/generator/schemavalidation_test.go b/generator/schemavalidation_test.go
index 0a409ccb..2004e3d0 100644
--- a/generator/schemavalidation_test.go
+++ b/generator/schemavalidation_test.go
@@ -1031,7 +1031,7 @@ func TestSchemaValidation_SimpleZeroAllowed(t *testing.T) {
 	assertInCode(t, k+") Validate(formats", res)
 	assertInCode(t, "swag.IsZero(m.ID)", res)
 	assertInCode(t, "validate.Required(\"name\", \"body\", m.Name)", res)
-	assertInCode(t, "validate.MinLength(\"id\", \"body\", string(m.ID), 2)", res)
+	assertInCode(t, "validate.MinLength(\"id\", \"body\", m.ID, 2)", res)
 	assertInCode(t, "validate.Required(\"urls\", \"body\", m.Urls)", res)
 	assertInCode(t, "errors.CompositeValidationError(res...)", res)
 }
diff --git a/generator/types_test.go b/generator/types_test.go
index e26cd3cf..add184a5 100644
--- a/generator/types_test.go
+++ b/generator/types_test.go
@@ -2,6 +2,9 @@ package generator
 
 import (
 	"encoding/json"
+	"io/ioutil"
+	"log"
+	"os"
 	"strconv"
 	"testing"
 
@@ -360,3 +363,175 @@ func TestShortCircuitResolveExternal(t *testing.T) {
 		})
 	}
 }
+
+type guardValidationsFixture struct {
+	Title        string
+	ResolvedType string
+	Type         interface {
+		Validations() spec.SchemaValidations
+		SetValidations(spec.SchemaValidations)
+	}
+	Asserter func(testing.TB, spec.SchemaValidations)
+}
+
+func makeGuardValidationFixtures() []guardValidationsFixture {
+	return []guardValidationsFixture{
+		{
+			Title:        "simple schema: guard array",
+			ResolvedType: "array",
+			Type: spec.NewItems().
+				Typed("number", "int64").
+				WithValidations(spec.CommonValidations{MinLength: swag.Int64(15), Maximum: swag.Float64(12.00)}).
+				UniqueValues(),
+			Asserter: func(t testing.TB, val spec.SchemaValidations) {
+				require.False(t, val.HasNumberValidations(), "expected no number validations, got: %#v", val)
+				require.False(t, val.HasStringValidations(), "expected no string validations, got: %#v", val)
+				require.True(t, val.HasArrayValidations(), "expected array validations, got: %#v", val)
+			},
+		},
+		{
+			Title:        "simple schema: guard string",
+			ResolvedType: "string",
+			Type: spec.QueryParam("p1").
+				Typed("string", "uuid").
+				WithValidations(spec.CommonValidations{MinItems: swag.Int64(15), Maximum: swag.Float64(12.00)}).
+				WithMinLength(12),
+			Asserter: func(t testing.TB, val spec.SchemaValidations) {
+				require.False(t, val.HasNumberValidations(), "expected no number validations, got: %#v", val)
+				require.False(t, val.HasArrayValidations(), "expected no array validations, got: %#v", val)
+				require.True(t, val.HasStringValidations(), "expected string validations, got: %#v", val)
+			},
+		},
+		{
+			Title:        "simple schema: guard file (1/3)",
+			ResolvedType: "file",
+			Type: spec.FileParam("p1").
+				WithValidations(spec.CommonValidations{MinItems: swag.Int64(15), Maximum: swag.Float64(12.00)}).
+				WithMinLength(12),
+			Asserter: func(t testing.TB, val spec.SchemaValidations) {
+				require.False(t, val.HasNumberValidations(), "expected no number validations, got: %#v", val)
+				require.False(t, val.HasArrayValidations(), "expected no array validations, got: %#v", val)
+				require.True(t, val.HasStringValidations(), "expected string validations, got: %#v", val)
+			},
+		},
+		{
+			Title:        "simple schema: guard file (2/3)",
+			ResolvedType: "file",
+			Type: spec.FileParam("p1").
+				WithValidations(spec.CommonValidations{
+					MinItems: swag.Int64(15),
+					Maximum:  swag.Float64(12.00),
+					Pattern:  "xyz",
+					Enum:     []interface{}{"x", 34},
+				}),
+			Asserter: func(t testing.TB, val spec.SchemaValidations) {
+				require.False(t, val.HasNumberValidations(), "expected no number validations, got: %#v", val)
+				require.False(t, val.HasArrayValidations(), "expected no array validations, got: %#v", val)
+				require.False(t, val.HasStringValidations(), "expected no string validations, got: %#v", val)
+				require.False(t, val.HasEnum(), "expected no enum validations, got: %#v", val)
+			},
+		},
+		{
+			Title:        "schema: guard object",
+			ResolvedType: "object",
+			Type: spec.RefSchema("#/definitions/nowhere").
+				WithValidations(spec.SchemaValidations{
+					CommonValidations: spec.CommonValidations{
+						MinItems: swag.Int64(15),
+						Maximum:  swag.Float64(12.00),
+					},
+					MinProperties: swag.Int64(10),
+				}).
+				WithMinLength(12),
+			Asserter: func(t testing.TB, val spec.SchemaValidations) {
+				require.False(t, val.HasNumberValidations(), "expected no number validations, got: %#v", val)
+				require.False(t, val.HasArrayValidations(), "expected no array validations, got: %#v", val)
+				require.False(t, val.HasStringValidations(), "expected no string validations, got: %#v", val)
+				require.True(t, val.HasObjectValidations(), "expected object validations, got: %#v", val)
+			},
+		},
+		{
+			Title:        "simple schema: guard number",
+			ResolvedType: "number",
+			Type: spec.QueryParam("p1").
+				Typed("number", "double").
+				WithValidations(spec.CommonValidations{MinItems: swag.Int64(15), MultipleOf: swag.Float64(12.00), Pattern: "xyz"}).
+				WithMinLength(12),
+			Asserter: func(t testing.TB, val spec.SchemaValidations) {
+				require.False(t, val.HasArrayValidations(), "expected no array validations, got: %#v", val)
+				require.False(t, val.HasStringValidations(), "expected no string validations, got: %#v", val)
+				require.True(t, val.HasNumberValidations(), "expected number validations, got: %#v", val)
+			},
+		},
+	}
+}
+
+func TestGuardValidations(t *testing.T) {
+	log.SetOutput(ioutil.Discard)
+	defer func() {
+		log.SetOutput(os.Stdout)
+	}()
+
+	for _, toPin := range makeGuardValidationFixtures() {
+		testCase := toPin
+		t.Run(testCase.Title, func(t *testing.T) {
+			t.Parallel()
+			input := testCase.Type
+			guardValidations(testCase.ResolvedType, input)
+			if testCase.Asserter != nil {
+				testCase.Asserter(t, input.Validations())
+			}
+		})
+	}
+}
+
+func makeGuardFormatFixtures() []guardValidationsFixture {
+	return []guardValidationsFixture{
+		{
+			Title:        "schema: guard date format",
+			ResolvedType: "date",
+			Type: spec.StringProperty().
+				WithValidations(spec.SchemaValidations{
+					CommonValidations: spec.CommonValidations{
+						MinLength: swag.Int64(15),
+						Pattern:   "xyz",
+						Enum:      []interface{}{"x", 34},
+					}}),
+			Asserter: func(t testing.TB, val spec.SchemaValidations) {
+				require.True(t, val.HasStringValidations(), "expected string validations, got: %#v", val)
+				require.True(t, val.HasEnum())
+			},
+		},
+		{
+			Title:        "simple schema: guard binary format",
+			ResolvedType: "binary",
+			Type: spec.StringProperty().
+				WithValidations(spec.SchemaValidations{
+					CommonValidations: spec.CommonValidations{
+						MinLength: swag.Int64(15),
+						Pattern:   "xyz",
+						Enum:      []interface{}{"x", 34},
+					}}),
+			Asserter: func(t testing.TB, val spec.SchemaValidations) {
+				require.False(t, val.HasStringValidations(), "expected no string validations, got: %#v", val)
+				require.False(t, val.HasEnum())
+			},
+		},
+	}
+}
+
+func TestGuardFormatConflicts(t *testing.T) {
+	defer discardOutput()()
+
+	for _, toPin := range makeGuardFormatFixtures() {
+		testCase := toPin
+		t.Run(testCase.Title, func(t *testing.T) {
+			t.Parallel()
+			input := testCase.Type
+			guardFormatConflicts(testCase.ResolvedType, input)
+			if testCase.Asserter != nil {
+				testCase.Asserter(t, input.Validations())
+			}
+		})
+	}
+}