Skip to content

Commit

Permalink
address ErrOneOfConflict
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Fenoll <[email protected]>
  • Loading branch information
fenollp committed Mar 4, 2021
1 parent fd1ab6f commit 87f951d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,9 @@ func xmlBodyDecoder(body []byte) (interface{}, error) {

## Sub-v0 breaking API changes

### v0.49.0
OpenAPIv3 "in-house" schema validation was replaced with a correct JSON Schema implementation and conversion from OpenAPIv3 Schema to JSON Schema.
* Dropped `openapi3.ErrOneOfConflict`: now when a value matches more than one `oneOf` schemas the error string contains `Must validate one and only one schema (oneOf)`

### v0.47.0
Field `(*openapi3.SwaggerLoader).LoadSwaggerFromURIFunc` of type `func(*openapi3.SwaggerLoader, *url.URL) (*openapi3.Swagger, error)` was removed after the addition of the field `(*openapi3.SwaggerLoader).ReadFromURIFunc` of type `func(*openapi3.SwaggerLoader, *url.URL) ([]byte, error)`.
3 changes: 0 additions & 3 deletions openapi3/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ var (

errSchema = errors.New("Input does not match the schema")

// ErrOneOfConflict is the SchemaError Origin when data matches more than one oneOf schema
ErrOneOfConflict = errors.New("input matches more than one oneOf schemas")

// ErrSchemaInputNaN may be returned when validating a number
ErrSchemaInputNaN = errors.New("NaN is not allowed")
// ErrSchemaInputInf may be returned when validating a number
Expand Down
2 changes: 1 addition & 1 deletion openapi3/schema_issue289_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ openapi: "3.0.1"
"name": "kin-openapi",
"address": "127.0.0.1",
})
require.EqualError(t, err, ErrOneOfConflict.Error())
require.EqualError(t, err, "address: Must validate one and only one schema (oneOf)")
}

0 comments on commit 87f951d

Please sign in to comment.