Skip to content

Commit 87f951d

Browse files
committed
address ErrOneOfConflict
Signed-off-by: Pierre Fenoll <[email protected]>
1 parent fd1ab6f commit 87f951d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,5 +162,9 @@ func xmlBodyDecoder(body []byte) (interface{}, error) {
162162

163163
## Sub-v0 breaking API changes
164164

165+
### v0.49.0
166+
OpenAPIv3 "in-house" schema validation was replaced with a correct JSON Schema implementation and conversion from OpenAPIv3 Schema to JSON Schema.
167+
* 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)`
168+
165169
### v0.47.0
166170
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)`.

openapi3/schema.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ var (
2323

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

26-
// ErrOneOfConflict is the SchemaError Origin when data matches more than one oneOf schema
27-
ErrOneOfConflict = errors.New("input matches more than one oneOf schemas")
28-
2926
// ErrSchemaInputNaN may be returned when validating a number
3027
ErrSchemaInputNaN = errors.New("NaN is not allowed")
3128
// ErrSchemaInputInf may be returned when validating a number

openapi3/schema_issue289_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ openapi: "3.0.1"
3939
"name": "kin-openapi",
4040
"address": "127.0.0.1",
4141
})
42-
require.EqualError(t, err, ErrOneOfConflict.Error())
42+
require.EqualError(t, err, "address: Must validate one and only one schema (oneOf)")
4343
}

0 commit comments

Comments
 (0)