-
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
Widgets with custom formData json output #1225
Comments
Have you tried using |
So if I understand correctly you mean change the schema to this: {
"definitions": {
"Color": {
"type": "array",
"minItems": 3,
"maxItems": 3,
"items": {
"type": "integer"
}
}
},
"type": "object",
"properties": {
"Color": {
"$ref": "#/definitions/Color"
}
}
} And use I guess that will work. But this was just a simple example, I have a few more cases like this, for example: Schema: {
"definitions": {
"List<Foo>": {
"type": "array",
"items": {
"$ref": "#/definitions/Foo"
}
},
"Foo": {
"type": "object",
"oneOf": [
{
"title": "Bar",
"$ref": "#/definitions/Bar"
},
{
"title": "Baz",
"$ref": "#/definitions/Baz"
}
]
},
"Bar": {
"type": "object",
"properties": {
"BarP": {
"type": "integer"
}
}
},
"Baz": {
"type": "object",
"properties": {
"BazP": {
"type": "integer"
}
}
}
},
"type": "object",
"properties": {
"Test": {
"$ref": "#/definitions/List<Foo>"
}
}
} Current formData: {
"Test": [
{
"BarP": 1
},
{
"BazP": 2
}
]
} But I need to include the selected option in the formData like this: {
"Test": [
{
"Type": "Bar",
"BarP": 1
},
{
"Type": "Baz",
"BazP": 2
}
]
} |
@devcompl I don't see how one could create a formData with properties (
Then your data would look like:
|
@epicfaace The const value should work, I will just add it when generating the schema. But it seems the form is not populated with the const value (demo), might be a bug? |
@devcompl Oh, I missed something in my schema -- it should also include So the schema would look like this:
|
@epicfaace |
@devcompl I believe your schema in the linked codepen has a small error, it should look like this: https://jsfiddle.net/epicfaace/j27t4rLq/ However, you are right in that the |
@epicfaace I found a few issues that seem similar to this: #1043, #768 and pr that aims to solve it: #579 |
@devcompl
I think you should, this seems to be a problem specifically within |
@epicfaace I'm closing this as its kinda off topic now. |
Prerequisites
Description
Given this schema:
the formData looks like this:
Actual behavior
But is possible to make a widget that will make the output look like this?:
Expected behavior
Looking at the docs the
object
widgets are not supported and I was not able to find any issues/feature request similar to this.So I guess this is more of a feature request to support custom
object
type widgets and/or ability for widgets to output customizableformData
.In the end I wanted to create a color picker widget that would fill the
R
/G
/B
properties and then convert them to json array.The text was updated successfully, but these errors were encountered: