// fixSchemaTypes traverses the schema and checks for some common
// errors for the type field. This currently involves users using
// 'int' instead of 'integer' and 'bool' instead of 'boolean'. Early versions
// of setters didn't validate this, so there are users that have invalid
// types in their packages.
fixSchemaTypes traverses the schema and checks for some common
errors for the type field. This currently involves users using
'int' instead of 'integer' and 'bool' instead of 'boolean'. Early versions
of setters didn't validate this, so there are users that have invalid
types in their packages.
// fixSchemaTypes traverses the schema and checks for some common // errors for the type field . This currently involves users using // ' int ' instead of ' integer ' and ' bool ' instead of ' boolean ' . Early versions // of setters didn ' t validate this so there are users that have invalid // types in their packages .
func fixSchemaTypes(sc *spec.Schema) {
	for i := range sc.Type {
		currentType := sc.Type[i]
		if currentType == "int" {
			sc.Type[i] = "integer"
		}
		if currentType == "bool" {
			sc.Type[i] = "boolean"
		}
	}
	if items := sc.Items; items != nil {
		if items.Schema != nil {
			fixSchemaTypes(items.Schema)
		}
		for i := range items.Schemas {
			schema := items.Schemas[i]
			fixSchemaTypes(&schema)
		}
	}
}
func fixSchemaTypes ( sc * spec . Schema ) { for i := range sc . Type { currentType := sc . Type [ i ] if currentType == " " { sc . Type [ i ] = " " } if currentType == " " { sc . Type [ i ] = " " } } if items := sc . Items ; items != nil { if items . Schema != nil { fixSchemaTypes ( items . Schema ) } for i := range items . Schemas { schema := items . Schemas [ i ] fixSchemaTypes ( & schema ) } } }
fixSchemaTypes traverses the schema and checks for some common
errors for the type field.
fixSchemaTypes traverses the schema and checks for some common errors for the type field .