Comments (6)
Hi @alxdru , thanks for the report :)
I have two questions:
- Which framework (e.g. react, angular, vue) and which renderer set did you use?
- Could you try this with the latest released version
3.2.1
to see if that fixes the issue?
Thanks!
from jsonforms.
- We're using react 18 and @jsonforms/material-renderers
3.1.0
- I've tried both
3.2.0
and3.2.1
, unfortunately no positive results.
from jsonforms.
We are still having this issue.
@lucas-koehler Have you reproduced the issue by any chance?
from jsonforms.
Hi @alxdru , I have tested this now in the react seed and I could reproduce the issue. I also contrasted the oneOf with a simple string property outside the oneOf and there a validation error was still shown even with validation mode NoValidation
.
For reference for future investigations. I used the following in the jsonforms react seed with jsonforms 3.2.1
Schema
{
"type": "object",
"properties": {
"addressOrUser": {
"oneOf": [
{
"type": "object",
"title": "Address",
"properties": {
"street_address": { "type": "string" },
"city": { "type": "string" }
},
"required": ["street_address", "city"]
},
{
"type": "object",
"title": "User",
"properties": {
"name": { "type": "string" },
"mail": { "type": "string" }
},
"required": ["name", "mail"]
}
]
},
"plain-prop": {
"type": "string"
}
},
"required": ["plain-prop"]
}
Manual validation
import Ajv, { ErrorObject } from 'ajv';
// [...]
const [additionalErrors, setAdditionalErrors] = useState<ErrorObject[] | undefined>([]);
const ajv = new Ajv();
const validator = ajv.compile(schema);
// [...]
<JsonForms
schema={schema as any}
// uischema={uischema}
data={data}
renderers={renderers}
cells={materialCells}
onChange={({ errors, data }) => {
setData(data);
validator(data);
setAdditionalErrors(validator.errors ?? undefined);
}}
additionalErrors={additionalErrors}
validationMode='NoValidation'
/>
from jsonforms.
Hi @alxdru ,
I had a look again and noticed that I forgot that we need the AJV options allErrors
. You can use convenience method createAjv
from @jsonforms/core
to get an Ajv with required options preconfigured. Using this, the validation in the oneOf also worked with NoValidation
.
Can you check whether that works for you?
from jsonforms.
Thanks @lucas-koehler , using the createAjv
did the trick.
Prior to this I was indeed passing allErrors: true
to the ajv constructor, but I guess there were some other properties missing as well.
from jsonforms.
Related Issues (20)
- UI broken in the Documentation HOT 2
- uischema props are not propagated to Layout renderer when using a material Object Renderer HOT 1
- Typescript types not exported HOT 2
- ArrayLayoutRenderer was not found in '@jsonforms/angular-material' HOT 8
- Detect and restructure import cycles
- Data not be modify HOT 2
- Errors duplication while validating HOT 1
- Support 'dependentRequired'
- UpdateAction array context should also be handed over in the ExpandPanels [Material UI]
- The delete button should be displayed only when an item is hovered and hidden HOT 1
- Support @mui/x-date-pickers v7 HOT 1
- Only one Json HOT 1
- interface UISchemaElement type error HOT 4
- UiSchema in Jupyter Dialog Box not working at all HOT 6
- Support Bundling json schema HOT 1
- JSON Schema with special characters like "." in the key not rendering properly HOT 1
- Add Angular 18 support HOT 4
- Programmatic builder pattern UISchema alternative HOT 1
- Value-based Enum Filters HOT 1
- Unexpected oneOf re-rendering when filling other schema fields [React Material] HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonforms.