Feature: oneOf
Scenario: oneOf with objects with types
Given a YAML schema:
```
oneOf:
- type: object
properties:
type:
const: "integer"
minimum:
type: integer
maximum:
type: integer
multipleOf:
type: integer
exclusiveMinimum:
type: integer
exclusiveMaximum:
type: integer
required:
- type
- type: object
properties:
type:
const: "string"
required:
- type
```
Then it should accept:
```
type: integer
```
And it should accept:
```
type: integer
minimum: 1
maximum: 10
multipleOf: 2
exclusiveMinimum: 0
exclusiveMaximum: 11
```
And it should accept:
```
type: string
```
But it should NOT accept:
```
type: boolean
```
Scenario: oneOf with string and object branches
Given a YAML schema:
```
type: object
properties:
items:
type: array
items:
oneOf:
- type: string
minLength: 1
- type: object
required:
- name
properties:
name:
type: string
```
Then it should accept:
```
items:
- hello
- name: world
```
And it should accept:
```
items:
- just_a_string
```
And it should accept:
```
items:
- name: structured
```
But it should NOT accept:
```
items:
- ""
```
Scenario: oneOf for propertyNames
Given a YAML schema:
```
type: array
items:
oneOf:
- type: string
enum: [alpha, beta]
- type: integer
- type: boolean
```
Then it should accept:
```
- alpha
- beta
- 1
- true
```
But it should NOT accept:
```
- gamma
```
And the error message should be "[1:3] .: None of the schemas in `oneOf` matched!"