-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
react-jsonschema-form to generate a form itself #1465
Comments
I'm interested in this too! I think the definition you found on json-schema.org is the correct one; it's just that rjsf can't render such a complicated schema yet. We may have to change the framework to add more features (such as, for example, handling types of both |
Consider Stoplight Studio: https://stoplight.io/studio/ |
@epicfaace it makes sense rjsf cant render a tuple of types as the form should only output one type of result? Once I fixed the unsupported schema problem setting
@Relequestual my use case for making a meta form is to dynamically generate validating forms for different schemas on the fly and persist them in a database. Thanks for the link though, looks super useful! |
@GitToby Ah OK. |
Not really, it would be nice to support this. See #282 and @mfulton26 's suggestion at #282 (comment) on how to handle it by having a "type" dropdown. That being said, though, the only time in which
This is probably because currently, the only definitions rjsf supports are those whose paths start with
Yeah, I'm working on the same problem too (creating a form builder UI using react-jsonschema-form itself), so would love to get some progress on this. Those two issues above are probably the major issues needed to be resolved, but more may crop up. If you are willing to help move these fixes forward, that would be great! |
Yeah, i can take a quick look over the weekend. looks like that PR has gone a bit stale and out of date, i'll look into it anyways! 📚 🔍 |
@GitToby we're using my fork in production at ReadMe to generate dynamic forms from user's OAS files. You can see this in action here: https://preview.readme.io/. Would love to get it merged in so we don't have to rely on my fork and so others can use it. |
If the form support the meta schema then it should be possible. node -p "JSON.stringify((new require('ajv')()).getSchema('http://json-schema.org/draft-07/schema').schema,null,2)" |
Guys, I'm just starting a project that would really benefit from having this working. Can anyone give me the status of this issue ? We may have some time to throw at it... Many thanks, Jules |
Looking at the draft-07 meta-schema (https://json-schema.org/draft-07/schema), it looks to me as though it is defined tightly enough to validate a schema, yet not tightly enough to make building one via react-jsonschema-form as easy an experience as it could be... For example, The draft-07 meta-schema seems to define the set of properties that an object in the schema might have as a big flat space including e.g. "multipleOf" (for use with "number"s) and "additionaItems" (for use with "array"s) in the same breath. It also includes what appear to be semantically mutually exclusive pairs e.g. "maximum" and "exclusiveMaximum" with no indication of this exclusivity. I was hoping to use the meta-schema to drive a web-form in which, if I chose to add a new string-property in the resulting schema, I would only be presented with potential attributes for that property which made sense in the context of a string. As far as I can make out, the introduction of vocabularies in draft-2019-09 does not address this. In conclusion, it looks to me as though, in order to get the best results out of my meta-schema-generated form, I will have to define my own form-friendly meta-schema ? Has anyone else come to the same conclusion or know of any work in this direction which I might use/extend/contribute-to ? Many thanks, Jules |
Yeah, that's probably correct. Doing this would be a great addition to rjsf, though, as it would clarify what exactly we support and what features of JSON Schema we don't yet support. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you. |
Prerequisites
Description
Is there a schema that produces a form to generate another form JSON schema? Simmilar to issue #1276, however the owner of that issue vanished.
i.e. a meta jsonschema form that creates other jsonschema forms
Steps to Reproduce
make and run this app:
https://jsfiddle.net/jsToby/u98aygc6/
Expected behavior
A form that allows the user to generate a fully valid JSONSchema which produces a form.
Actual behavior
Inputting the definition provided on http://json-schema.org creates the following error:
Version
1.8.0
You can usually get this information in your
package.json
or in the file URL if you're using the unpkg one.The text was updated successfully, but these errors were encountered: