@@ -68,7 +68,7 @@ if err := validation.Enum({{.Path}}, "{{.Location}}", {{.ValueExpression}}, {{.E
{{if .IsContainer}}{{template "slicevalidator" .}}{{end}}
{{end}}{{define "bindprimitive"}}
{{end}}{{define "slicebinder"}}
{{if .Parent}}{{.IndexVar}}c := util.SplitByFormat({{.Parent.IndexVar}}c[{{.Parent.IndexVar}}], "{{.CollectionFormat}}")
{{if .Parent}}{{.IndexVar}}c := swag.SplitByFormat({{.Parent.IndexVar}}c[{{.Parent.IndexVar}}], "{{.CollectionFormat}}")
{{else}}{{.IndexVar}}c := raw{{end}}
{{.IndexVar}}sz := size
var {{.IndexVar}}r {{.Type}}
@@ -106,6 +106,7 @@ for {{.IndexVar}} := 0; {{.IndexVar}} < {{.IndexVar}}sz; {{.IndexVar}}++ {
import (
"net/http"
"github.com/casualjim/go-swagger"
"github.com/casualjim/go-swagger/swag"
"github.com/casualjim/go-swagger/errors"
"github.com/casualjim/go-swagger/validation"
"github.com/casualjim/go-swagger/middleware/httputils"
@@ -152,10 +153,10 @@ func ({{.ReceiverName}} *{{.ClassName}}Params) BindRequest(r *http.Request, rout
res = append(res, err)
}
{{end}}{{end}}
{{else if .IsContainer}}{{if .IsQueryParam}}if err := {{.ReceiverName}}.bind{{.PropertyName}}(util.SplitByFormat(qs.Get({{.Path}}), "{{.CollectionFormat}}"), route.Formats); err != nil {
{{else if .IsContainer}}{{if .IsQueryParam}}if err := {{.ReceiverName}}.bind{{.PropertyName}}(swag.SplitByFormat(qs.Get({{.Path}}), "{{.CollectionFormat}}"), route.Formats); err != nil {
res = append(res, err)
}
{{else if and .IsFormParam}}if err := {{.ReceiverName}}.bind{{.PropertyName}}(util.SplitByFormat(r.FormValue({{.Path}}), "{{.CollectionFormat}}"), route.Formats); err != nil {
{{else if and .IsFormParam}}if err := {{.ReceiverName}}.bind{{.PropertyName}}(swag.SplitByFormat(r.FormValue({{.Path}}), "{{.CollectionFormat}}"), route.Formats); err != nil {
res = append(res, err)
}
{{end}}{{end}}
@@ -215,7 +216,7 @@ func ({{.ReceiverName}} *{{$className}}Params) bind{{.PropertyName}}(raw []strin
}
{{end}}

{{if .DefaultValue}}defValue := util.SplitByFormat({{.DefaultValue}}, "{{.CollectionFormat}}")
{{if .DefaultValue}}defValue := swag.SplitByFormat({{.DefaultValue}}, "{{.CollectionFormat}}")
if size == 0 && len(defValue) > 0 {
{{.ValueExpression}} = defValue
{{else}}if size == 0 {
@@ -5,7 +5,7 @@ import (
"strings"

"github.com/casualjim/go-swagger/spec"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

func typeForSchemaOrArray(schemas *spec.SchemaOrArray, modelsPkg string) string {
@@ -57,17 +57,17 @@ var zeroes = map[string]string{
}

var stringConverters = map[string]string{
"int8": "util.ConvertInt8",
"int16": "util.ConvertInt16",
"int32": "util.ConvertInt32",
"int64": "util.ConvertInt64",
"uint8": "util.ConvertUint8",
"uint16": "util.ConvertUint16",
"uint32": "util.ConvertUint32",
"uint64": "util.ConvertUint64",
"bool": "util.ConvertBool",
"float32": "util.ConvertFloat32",
"float64": "util.ConvertFloat64",
"int8": "swag.ConvertInt8",
"int16": "swag.ConvertInt16",
"int32": "swag.ConvertInt32",
"int64": "swag.ConvertInt64",
"uint8": "swag.ConvertUint8",
"uint16": "swag.ConvertUint16",
"uint32": "swag.ConvertUint32",
"uint64": "swag.ConvertUint64",
"bool": "swag.ConvertBool",
"float32": "swag.ConvertFloat32",
"float64": "swag.ConvertFloat64",
}

// typeMapping contais a mapping of format or type name to go type
@@ -149,7 +149,7 @@ func typeForSchema(schema *spec.Schema, modelsPkg string) string {
return "interface{}"
}
if schema.Ref.GetURL() != nil {
tn := util.ToGoName(filepath.Base(schema.Ref.GetURL().Fragment))
tn := swag.ToGoName(filepath.Base(schema.Ref.GetURL().Fragment))
if modelsPkg != "" {
return modelsPkg + "." + tn
}
@@ -5,7 +5,7 @@ import (

"github.com/casualjim/go-swagger/spec"
"github.com/casualjim/go-swagger/strfmt"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

var specSchemaType = reflect.TypeOf(&spec.Schema{})
@@ -79,7 +79,7 @@ func (s *SchemaValidator) Validate(data interface{}) *Result {
}
d := data
if kind == reflect.Struct {
d = util.ToDynamicJSON(data)
d = swag.ToDynamicJSON(data)
}

for _, v := range s.validators {
@@ -8,7 +8,7 @@ import (
"github.com/casualjim/go-swagger/errors"
"github.com/casualjim/go-swagger/spec"
"github.com/casualjim/go-swagger/strfmt"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

type typeValidator struct {
@@ -134,7 +134,7 @@ func (t *typeValidator) Validate(data interface{}) *Result {
return result
}

isFloatInt := schType == "number" && util.IsFloat64AJSONInteger(val.Float()) && t.Type.Contains("integer")
isFloatInt := schType == "number" && swag.IsFloat64AJSONInteger(val.Float()) && t.Type.Contains("integer")
isIntFloat := schType == "integer" && t.Type.Contains("number")
if !(t.Type.Contains(schType) || isFloatInt || isIntFloat) {
return sErr(errors.InvalidType(t.Path, t.In, strings.Join(t.Type, ","), schType))
@@ -11,7 +11,7 @@ import (

"github.com/casualjim/go-swagger/spec"
"github.com/casualjim/go-swagger/strfmt"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
. "github.com/smartystreets/goconvey/convey"
)

@@ -100,7 +100,7 @@ func (n *noopResCache) Set(string, interface{}) {
}

func isEnabled(nm string) bool {
return util.ContainsStringsCI(enabled, nm)
return swag.ContainsStringsCI(enabled, nm)
}

func TestJSONSchemaSuite(t *testing.T) {
@@ -32,7 +32,7 @@ import (
"strconv"
"strings"

"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

const (
@@ -97,12 +97,12 @@ func (p *Pointer) parse(jsonPointerString string) error {

// Get uses the pointer to retrieve a value from a JSON document
func (p *Pointer) Get(document interface{}) (interface{}, reflect.Kind, error) {
return p.get(document, util.DefaultJSONNameProvider)
return p.get(document, swag.DefaultJSONNameProvider)
}

// GetForToken gets a value for a json pointer token 1 level deep
func GetForToken(document interface{}, decodedToken string) (interface{}, reflect.Kind, error) {
return getSingleImpl(document, decodedToken, util.DefaultJSONNameProvider)
return getSingleImpl(document, decodedToken, swag.DefaultJSONNameProvider)
}

func isZero(data reflect.Value) bool {
@@ -113,7 +113,7 @@ func isZero(data reflect.Value) bool {
return reflect.DeepEqual(data.Interface(), reflect.Zero(tpe).Interface())
}

func getSingleImpl(node interface{}, decodedToken string, nameProvider *util.NameProvider) (interface{}, reflect.Kind, error) {
func getSingleImpl(node interface{}, decodedToken string, nameProvider *swag.NameProvider) (interface{}, reflect.Kind, error) {
kind := reflect.Invalid
rValue := reflect.Indirect(reflect.ValueOf(node))
kind = rValue.Kind()
@@ -161,10 +161,10 @@ func getSingleImpl(node interface{}, decodedToken string, nameProvider *util.Nam

}

func (p *Pointer) get(node interface{}, nameProvider *util.NameProvider) (interface{}, reflect.Kind, error) {
func (p *Pointer) get(node interface{}, nameProvider *swag.NameProvider) (interface{}, reflect.Kind, error) {

if nameProvider == nil {
nameProvider = util.DefaultJSONNameProvider
nameProvider = swag.DefaultJSONNameProvider
}

kind := reflect.Invalid
@@ -5,7 +5,7 @@ import (
"net/http"
"strings"

"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

// CanHaveBody returns true if this method can have a body
@@ -38,5 +38,5 @@ func ReadSingleValue(values Gettable, name string) string {
// ReadCollectionValue reads a collection value from a string data source
func ReadCollectionValue(values Gettable, name, collectionFormat string) []string {
v := ReadSingleValue(values, name)
return util.SplitByFormat(v, collectionFormat)
return swag.SplitByFormat(v, collectionFormat)
}
@@ -16,7 +16,7 @@ import (
"github.com/casualjim/go-swagger/middleware/httputils"
"github.com/casualjim/go-swagger/spec"
"github.com/casualjim/go-swagger/strfmt"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

const defaultMaxMemory = 32 << 20
@@ -291,7 +291,7 @@ func (p *untypedParamBinder) setFieldValue(target reflect.Value, defaultValue in
target.SetBool(defVal.Bool())
return nil
}
b, err := util.ConvertBool(data)
b, err := swag.ConvertBool(data)
if err != nil {
return err
}
@@ -391,7 +391,7 @@ func (p *untypedParamBinder) readFormattedSliceFieldValue(data string, target re
return nil, true, nil
}

return util.SplitByFormat(data, p.parameter.CollectionFormat), false, nil
return swag.SplitByFormat(data, p.parameter.CollectionFormat), false, nil
}

func (p *untypedParamBinder) setSliceFieldValue(target reflect.Value, defaultValue interface{}, data []string) error {
@@ -9,7 +9,7 @@ import (

"github.com/casualjim/go-swagger/spec"
"github.com/casualjim/go-swagger/strfmt"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
"github.com/stretchr/testify/assert"
)

@@ -264,8 +264,8 @@ func TestSliceConversion(t *testing.T) {
assert.Empty(t, tags)
}

assert.Nil(t, util.SplitByFormat("yada", "multi"))
assert.Nil(t, util.SplitByFormat("", ""))
assert.Nil(t, swag.SplitByFormat("yada", "multi"))
assert.Nil(t, swag.SplitByFormat("", ""))

categoriesField := val.FieldByName("Categories")
binder := &untypedParamBinder{
@@ -7,7 +7,7 @@ import (
"github.com/casualjim/go-swagger"
"github.com/casualjim/go-swagger/errors"
"github.com/casualjim/go-swagger/middleware/httputils"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

// NewValidation starts a new validation middleware
@@ -49,7 +49,7 @@ func validateContentType(allowed []string, actual string) *errors.Validation {
if err != nil {
return errors.InvalidContentType(actual, allowed)
}
if util.ContainsStringsCI(allowed, mt) {
if swag.ContainsStringsCI(allowed, mt) {
return nil
}
return errors.InvalidContentType(actual, allowed)
@@ -11,7 +11,7 @@ import (
"golang.org/x/tools/go/loader"

"github.com/casualjim/go-swagger/spec"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

const (
@@ -311,7 +311,7 @@ func (a *appScanner) parseMeta(file *ast.File) error {

// MustExpandPackagePath gets the real package path on disk
func (a *appScanner) MustExpandPackagePath(packagePath string) string {
pkgRealpath := util.FindInGoSearchPath(packagePath)
pkgRealpath := swag.FindInGoSearchPath(packagePath)
if pkgRealpath == "" {
log.Fatalf("Can't find package %s \n", packagePath)
}
@@ -3,7 +3,7 @@ package spec
import (
"strings"

"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

// type operationRef struct {
@@ -146,7 +146,7 @@ func fieldNameFromParam(param *Parameter) string {
if nm, ok := param.Extensions.GetString("go-name"); ok {
return nm
}
return util.ToGoName(param.Name)
return swag.ToGoName(param.Name)
}

func (s *specAnalyzer) paramsAsMap(parameters []Parameter, res map[string]Parameter) {
@@ -9,7 +9,7 @@ import (
"sync"

"github.com/casualjim/go-swagger/jsonpointer"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

// ResolutionCache a cache for resolving urls
@@ -75,7 +75,7 @@ func defaultSchemaLoader(root interface{}, ref *Ref, cache ResolutionCache) (*sc
loadingRef: ref,
startingRef: ref,
cache: cache,
loadDoc: util.JSONDoc,
loadDoc: swag.JSONDoc,
currentRef: currentRef,
}, nil
}
@@ -175,7 +175,7 @@ func (r *schemaLoader) resolveRef(currentRef, ref *Ref, node, target interface{}
if rv.Type().AssignableTo(tgtType) {
reflect.Indirect(tgt).Set(reflect.Indirect(reflect.ValueOf(res)))
} else {
if err := util.DynamicJSONToStruct(rv.Interface(), target); err != nil {
if err := swag.DynamicJSONToStruct(rv.Interface(), target); err != nil {
return err
}
}
@@ -207,7 +207,7 @@ func (r *schemaLoader) resolveRef(currentRef, ref *Ref, node, target interface{}
res = data
}

if err := util.DynamicJSONToStruct(res, target); err != nil {
if err := swag.DynamicJSONToStruct(res, target); err != nil {
return err
}

@@ -9,7 +9,7 @@ import (

testingutil "github.com/casualjim/go-swagger/internal/testing"
"github.com/casualjim/go-swagger/jsonpointer"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
. "github.com/smartystreets/goconvey/convey"
"github.com/stretchr/testify/assert"
)
@@ -22,7 +22,7 @@ func TestSpecExpansion(t *testing.T) {
err := expandSpec(spec)
assert.NoError(t, err)

specDoc, err := util.JSONDoc("../fixtures/expansion/all-the-things.json")
specDoc, err := swag.JSONDoc("../fixtures/expansion/all-the-things.json")
assert.NoError(t, err)

spec = new(Swagger)
@@ -61,7 +61,7 @@ func TestSpecExpansion(t *testing.T) {
}

func TestResponseExpansion(t *testing.T) {
specDoc, err := util.JSONDoc("../fixtures/expansion/all-the-things.json")
specDoc, err := swag.JSONDoc("../fixtures/expansion/all-the-things.json")
assert.NoError(t, err)

spec := new(Swagger)
@@ -94,7 +94,7 @@ func TestResponseExpansion(t *testing.T) {
}

func TestParameterExpansion(t *testing.T) {
paramDoc, err := util.JSONDoc("../fixtures/expansion/params.json")
paramDoc, err := swag.JSONDoc("../fixtures/expansion/params.json")
assert.NoError(t, err)

spec := new(Swagger)
@@ -120,7 +120,7 @@ func TestParameterExpansion(t *testing.T) {
}

func TestSchemaExpansion(t *testing.T) {
carsDoc, err := util.JSONDoc("../fixtures/expansion/schemas1.json")
carsDoc, err := swag.JSONDoc("../fixtures/expansion/schemas1.json")
assert.NoError(t, err)

spec := new(Swagger)
@@ -357,7 +357,7 @@ func TestResolveRemoteRef(t *testing.T) {
var tgt Schema
ref, err := NewRef(server.URL + "/refed.json#/definitions/pet")
So(err, ShouldBeNil)
resolver := &schemaLoader{root: rootDoc, cache: defaultResolutionCache(), loadDoc: util.JSONDoc}
resolver := &schemaLoader{root: rootDoc, cache: defaultResolutionCache(), loadDoc: swag.JSONDoc}
err = resolver.Resolve(&ref, &tgt)
So(err, ShouldBeNil)
So(tgt.Required, ShouldResemble, []string{"id", "name"})
@@ -3,7 +3,7 @@ package spec
import (
"encoding/json"

"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

type headerProps struct {
@@ -48,7 +48,7 @@ func (h Header) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
return util.ConcatJSON(b1, b2, b3), nil
return swag.ConcatJSON(b1, b2, b3), nil
}

// UnmarshalJSON marshal this from JSON
@@ -5,7 +5,7 @@ import (
"strings"

"github.com/casualjim/go-swagger/jsonpointer"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

// Extensions vendor specific extensions
@@ -105,7 +105,7 @@ func (i Info) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
return util.ConcatJSON(b1, b2), nil
return swag.ConcatJSON(b1, b2), nil
}

// UnmarshalJSON marshal this from JSON
@@ -3,7 +3,7 @@ package spec
import (
"encoding/json"

"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

type simpleSchema struct {
@@ -181,5 +181,5 @@ func (i Items) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
return util.ConcatJSON(b3, b1, b2), nil
return swag.ConcatJSON(b3, b1, b2), nil
}
@@ -4,7 +4,7 @@ import (
"encoding/json"

"github.com/casualjim/go-swagger/jsonpointer"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

type operationProps struct {
@@ -75,6 +75,6 @@ func (o Operation) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
concated := util.ConcatJSON(b1, b2)
concated := swag.ConcatJSON(b1, b2)
return concated, nil
}
@@ -4,7 +4,7 @@ import (
"encoding/json"

"github.com/casualjim/go-swagger/jsonpointer"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

// QueryParam creates a query parameter
@@ -243,5 +243,5 @@ func (p Parameter) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
return util.ConcatJSON(b3, b1, b2, b4, b5), nil
return swag.ConcatJSON(b3, b1, b2, b4, b5), nil
}
@@ -4,7 +4,7 @@ import (
"encoding/json"

"github.com/casualjim/go-swagger/jsonpointer"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

// pathItemProps the path item specific properties
@@ -71,6 +71,6 @@ func (p PathItem) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
concated := util.ConcatJSON(b3, b4, b5)
concated := swag.ConcatJSON(b3, b4, b5)
return concated, nil
}
@@ -5,7 +5,7 @@ import (
"fmt"
"strings"

"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

// Paths holds the relative paths to the individual endpoints.
@@ -80,6 +80,6 @@ func (p Paths) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
concated := util.ConcatJSON(b1, b2)
concated := swag.ConcatJSON(b1, b2)
return concated, nil
}
@@ -3,7 +3,7 @@ package spec
import (
"encoding/json"

"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

type responseProps struct {
@@ -42,5 +42,5 @@ func (r Response) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
return util.ConcatJSON(b1, b2), nil
return swag.ConcatJSON(b1, b2), nil
}
@@ -6,7 +6,7 @@ import (
"reflect"
"strconv"

"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

// Responses is a container for the expected responses of an operation.
@@ -67,7 +67,7 @@ func (r Responses) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
concated := util.ConcatJSON(b1, b2)
concated := swag.ConcatJSON(b1, b2)
return concated, nil
}

@@ -7,7 +7,7 @@ import (
"strings"

"github.com/casualjim/go-swagger/jsonpointer"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

// BooleanProperty creates a boolean property
@@ -416,7 +416,7 @@ func (s Schema) MarshalJSON() ([]byte, error) {
}
b6 = jj
}
return util.ConcatJSON(b1, b2, b3, b4, b5, b6), nil
return swag.ConcatJSON(b1, b2, b3, b4, b5, b6), nil
}

// UnmarshalJSON marshal this from JSON
@@ -442,7 +442,7 @@ func (s *Schema) UnmarshalJSON(data []byte) error {

delete(d, "$ref")
delete(d, "$schema")
for _, pn := range util.DefaultJSONNameProvider.GetJSONNames(s) {
for _, pn := range swag.DefaultJSONNameProvider.GetJSONNames(s) {
delete(d, pn)
}

@@ -4,7 +4,7 @@ import (
"encoding/json"

"github.com/casualjim/go-swagger/jsonpointer"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

const (
@@ -113,7 +113,7 @@ func (s SecurityScheme) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
return util.ConcatJSON(b1, b2), nil
return swag.ConcatJSON(b1, b2), nil
}

// UnmarshalJSON marshal this from JSON
@@ -7,7 +7,7 @@ import (
"path/filepath"

"github.com/casualjim/go-swagger/assets"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

const (
@@ -22,7 +22,7 @@ type DocLoader func(string) (json.RawMessage, error)

// JSONSpec loads a spec from a json document
func JSONSpec(path string) (*Document, error) {
data, err := util.JSONDoc(path)
data, err := swag.JSONDoc(path)
if err != nil {
return nil, err
}
@@ -32,7 +32,7 @@ func JSONSpec(path string) (*Document, error) {

// YAMLSpec loads a swagger spec document
func YAMLSpec(path string) (*Document, error) {
data, err := util.YAMLDoc(path)
data, err := swag.YAMLDoc(path)
if err != nil {
return nil, err
}
@@ -7,7 +7,7 @@ import (
"strconv"

"github.com/casualjim/go-swagger/jsonpointer"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

// Swagger this is the root document object for the API specification.
@@ -28,7 +28,7 @@ func (s Swagger) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
return util.ConcatJSON(schemaJSONBytes, b1), nil
return swag.ConcatJSON(schemaJSONBytes, b1), nil
}

// UnmarshalJSON unmarshals a swagger spec from json
@@ -4,7 +4,7 @@ import (
"encoding/json"

"github.com/casualjim/go-swagger/jsonpointer"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

type tagProps struct {
@@ -47,7 +47,7 @@ func (t Tag) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
return util.ConcatJSON(b1, b2), nil
return swag.ConcatJSON(b1, b2), nil
}

// UnmarshalJSON marshal this from JSON
@@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"

"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
"github.com/stretchr/testify/assert"
)

@@ -18,7 +18,7 @@ func TestLoadStrategy(t *testing.T) {
return []byte("not it"), nil
}

ld := util.LoadStrategy("blah", loader, remLoader)
ld := swag.LoadStrategy("blah", loader, remLoader)
b, _ := ld("")
assert.Equal(t, []byte(yamlPetStore), b)

@@ -3,7 +3,7 @@
https://github.com/elazarl/go-bindata-assetfs/blob/master/assetfs.go
*/

package util
package swag

import (
"fmt"
@@ -1,4 +1,4 @@
package util
package swag

import (
"math"
@@ -1,4 +1,4 @@
package util
package swag

import (
"bytes"
@@ -1,4 +1,4 @@
package util
package swag

import (
"reflect"
@@ -1,4 +1,4 @@
package util
package swag

import (
"fmt"
@@ -1,4 +1,4 @@
package util
package swag

import (
"os"
@@ -1,4 +1,4 @@
package util
package swag

import (
"io/ioutil"
@@ -1,4 +1,4 @@
package util
package swag

import (
"math"
@@ -1,4 +1,4 @@
package util
package swag

import (
"strings"
@@ -1,4 +1,4 @@
package util
package swag

import (
"encoding/json"
@@ -1,4 +1,4 @@
package util
package swag

import (
"encoding/json"
@@ -7,7 +7,7 @@ import (

"github.com/casualjim/go-swagger/errors"
"github.com/casualjim/go-swagger/strfmt"
"github.com/casualjim/go-swagger/util"
"github.com/casualjim/go-swagger/swag"
)

// Enum validates if the data is a member of the enum
@@ -134,7 +134,7 @@ func Minimum(path, in string, data, min float64, exclusive bool) *errors.Validat

// MultipleOf validates if the provided number is a multiple of the factor
func MultipleOf(path, in string, data, factor float64) *errors.Validation {
if !util.IsFloat64AJSONInteger(data / factor) {
if !swag.IsFloat64AJSONInteger(data / factor) {
return errors.NotMultipleOf(path, in, factor)
}
return nil