-
-
Notifications
You must be signed in to change notification settings - Fork 239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable use of 'map' type from JSONSchema #934
Comments
Hi @MatthewJonD. I've never heard about And as for the question: no, there's no out-of-the-box handling for such objects. You'd have to make a field (React component) that would allow users to add their own keys. |
For some context. Im using Mongoose->mongoose-schema-jsonschema->To generate this schema... So the mongoose schema looks like -
It then gets converted to with mongoose-schema-jsonschema that turns that into -
This lets me quickly build CRUD forms for my Mongoose based apps. I'll see if there are some options to not use the map field... And- Is there a way to register fields by the schema field type, and let any field that is rendered with the
Just use that custom component?
Where the {DataTimeField} is my own custom component. But I have the call each field out separately... |
Yep, I checked the code and it looks like your schema hit this fallback. And thanks for opening DScheglov/mongoose-schema-jsonschema#26! I'll link it here so both sides would benefit. About registering a component: yes, there is function componentDetector(props, uniforms) {
if (props.field.type === 'map') {
return MapField;
}
return AutoField.defaultComponentDetector(props, uniforms);
} |
@radekmie Thanks much.
Is now the output, which does have normal JSONSchema types/values.
I have only added the new field to the |
@MatthewJonD hey, Oh! I see the problem with unneeded field |
@MatthewJonD, @DScheglov: I'd say it's a problem in uniforms: we assume that the |
Loving this library...saving so much time.
Quick question/ask
Getting the error-
Im using a 'map' in my models on a language field that allows data to be stored like -
With a schema that looks like this-
Any chance this is on the roadmap to be supported?
The text was updated successfully, but these errors were encountered: