Skip to content

Commit

Permalink
Merge 9290e38 into ec50308
Browse files Browse the repository at this point in the history
  • Loading branch information
radekmie authored Feb 10, 2021
2 parents ec50308 + 9290e38 commit 278b2ef
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/api-bridges.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,34 @@ const schemaValidator = createValidator(schema);
const bridge = new JSONSchemaBridge(schema, schemaValidator);
```
### Note on `allOf`/`anyOf`/`oneOf`
The current handling of `allOf`/`anyOf`/`oneOf` is not complete and does not work with all possible cases. For an in-detail discussion, see [\#863](/~https://github.com/vazco/uniforms/issues/863). How it works, is that only a few properties are being used:
- `properties`, where all subfields are merged (last definition wins),
- `required`, where all properties are accumulated, and
- `type`, where the first one is being used.
Below is an example of these implications:
```json
{
"type": "object",
"properties": {
// This will render `NumField` WITHOUT `min` nor `max` properties.
// It will be properly validated, but without any UI guidelines.
"foo": {
"type": "number",
"allOf": [{ "minimum": 0 }, { "maximum": 10 }]
},
// This will render as `TextField`.
"bar": {
"oneOf": [{ "type": "string" }, { "type": "number" }]
}
}
}
```
## `SimpleSchema2Bridge`
```js
Expand Down

0 comments on commit 278b2ef

Please sign in to comment.