React-jsonschema-form: type is undefined but have allOf

Created on 26 Mar 2019  路  6Comments  路  Source: rjsf-team/react-jsonschema-form

Hi, I have a very long jsonschema which I want see as form.
Using the live demo, have this error:

image

doing some test using the live demo, I found that if type is not declared, throw the error, its possible use allOf without type?

bug help wanted

Most helpful comment

I was able to work around the current limitations with a couple extra libraries.First I resolve all the refs then I merge all the allOf...

import deref from 'json-schema-deref-sync';
import mergeAllOf from 'json-schema-merge-allof';
const schema = {...}
...
const resolvedSchema = deref(schema);
const mergedSchema = mergeAllOf(resolvedSchema);
export default mergedSchema;

not ideal, but could get you by in a pinch and easy enough to remove once these issues are resolved.

All 6 comments

@joneldiablo
Can you please send a playground link demonstrating this issue? https://mozilla-services.github.io/react-jsonschema-form/

running into the same problem, it looks like allOf isnt supported yet...
https://github.com/mozilla-services/react-jsonschema-form/issues/52

I was able to work around the current limitations with a couple extra libraries.First I resolve all the refs then I merge all the allOf...

import deref from 'json-schema-deref-sync';
import mergeAllOf from 'json-schema-merge-allof';
const schema = {...}
...
const resolvedSchema = deref(schema);
const mergedSchema = mergeAllOf(resolvedSchema);
export default mergedSchema;

not ideal, but could get you by in a pinch and easy enough to remove once these issues are resolved.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anttivikman picture anttivikman  路  3Comments

n1k0 picture n1k0  路  3Comments

MedinaGitHub picture MedinaGitHub  路  3Comments

sstarrAtmeta picture sstarrAtmeta  路  3Comments

mammad2c picture mammad2c  路  3Comments