# I would like to be able to add and remove objects in an object

**URL:** <https://jsonforms.discourse.group/t/i-would-like-to-be-able-to-add-and-remove-objects-in-an-object/400>\
**Category:** General\
**Created:** [September 18, 2021, 9:55pm UTC](https://jsonforms.discourse.group/t/i-would-like-to-be-able-to-add-and-remove-objects-in-an-object/400 "2021-09-18T21:55:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![abdel74100](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@abdel74100](https://jsonforms.discourse.group/u/abdel74100)\
**Post date:** [September 18, 2021, 9:55pm UTC](https://jsonforms.discourse.group/t/i-would-like-to-be-able-to-add-and-remove-objects-in-an-object/400/1 "2021-09-18T21:55:23Z")

</div>

```auto
{
        "active": true,
        "name": "conjug",
        "description": "Help to conjug words together",
        "type": "API",
        "config": {
            "protocol": "https",
            "host": "nr-faibrik-testsqddqsdqsdmix.net",
            "generic": true,
            "action": {
                "default": {
                    "method": "POST",
                    "path": "/conjug",
                    "mapping": {
                        "in": {
                            "parameters.selector": "selector",
                            "parameters.word": "word",
                            "header.language": "language"
                        },
                        "out": {
                            "response": "response:"
                        }
                    }
                },
                "conjugTwoWords": {
                    "method": "POST",
                    "path": "/conjug/twoWords",
                    "mapping": {
                        "in": {
                            "parameters.word1": "word_one",
                            "parameters.word2": "word_two",
                            "header.language": "language"
                        },
                        "out": {
                            "response": "result"
                        }
                    }
                },
                "getGender": {
                    "method": "POST",
                    "path": "/gender",
                    "mapping": {
                        "in": {
                            "parameters.word": "word",
                            "header.language": "language"
                        },
                        "out": {
                            "response": "gender.result[0]"
                        }
                    }
                }
            }
        }
    }

```

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [September 20, 2021, 6:54am UTC](https://jsonforms.discourse.group/t/i-would-like-to-be-able-to-add-and-remove-objects-in-an-object/400/2 "2021-09-20T06:54:01Z")

</div>

Hi @abdel74100, can you describe what your exact problem is, what you tried and what did not work?

---

<div class="post-metadata">

**Author:** ![abdel74100](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@abdel74100](https://jsonforms.discourse.group/u/abdel74100)\
**Post date:** [September 26, 2021, 12:59am UTC](https://jsonforms.discourse.group/t/i-would-like-to-be-able-to-add-and-remove-objects-in-an-object/400/3 "2021-09-26T00:59:54Z")

</div>

Hi Stéphane

Thank you for you suport! 😅  
let me describe my problem to you.

If you see the above data (API configuration data)  
we first have generic values:  
` `  
“active”: true,  
“name”: “conjug”,  
“description”: “Helps conjugate words together”,  
“type”: “API”,  
` `

so  
2.A nested object name \*\* config \*\*  
in this config object we also have generic values  
` `  
“protocol”: “https”,  
“host”: “[nr-faabrik-testsqddqsdqsdmix.net](http://nr-faabrik-testsqddqsdqsdmix.net)”,  
“generic”: true,  
` `  
after that

3 “action” objects but we could have 1 or 2 or 4 depending on the name of the API here (conjug)

I would like to be able to display all of this and dynamically add or remove actions / mapping / In and mapping / Out and also be able to modify their values.

What is the best solution ?  
1.I have thought of a recursive function? for each key whose value is an object I generate an array  
2. try to generate the schema dynamically

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [September 29, 2021, 4:12pm UTC](https://jsonforms.discourse.group/t/i-would-like-to-be-able-to-add-and-remove-objects-in-an-object/400/4 "2021-09-29T16:12:27Z")

</div>

Hi @abdel74100, I would like to recommend creating a JSON Schema which describes your data format. This JSON Schema can then be handed over to JSON Forms which in turn will render a UI for your data.

I can recommend [this guide](https://json-schema.org/understanding-json-schema/) to get started with JSON Schema.

---

<div class="post-metadata">

**Author:** ![abdel74100](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@abdel74100](https://jsonforms.discourse.group/u/abdel74100)\
**Post date:** [October 4, 2021, 11:36am UTC](https://jsonforms.discourse.group/t/i-would-like-to-be-able-to-add-and-remove-objects-in-an-object/400/5 "2021-10-04T11:36:59Z")

</div>

Hy stephane

I’m already using jsonfom my question is if I should set everything for a schema like mine where there are multiple nested objects it’s long very long or is there a way to do it I’m looking in the documentation…but not found

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [October 4, 2021, 11:41am UTC](https://jsonforms.discourse.group/t/i-would-like-to-be-able-to-add-and-remove-objects-in-an-object/400/6 "2021-10-04T11:41:09Z")

</div>

We have a very basic `Generate.schema` utility by which you can generate a default JSON Schema based on your data. However the resulting schema will be very basic as it doesn’t know anything about your domain. You could use that as a starting point.

---

<div class="post-metadata">

**Author:** ![abdel74100](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@abdel74100](https://jsonforms.discourse.group/u/abdel74100)\
**Post date:** [October 4, 2021, 11:44am UTC](https://jsonforms.discourse.group/t/i-would-like-to-be-able-to-add-and-remove-objects-in-an-object/400/7 "2021-10-04T11:44:41Z")

</div>

ok thanks i will try and another question jsonform does not support DOT in the key? example: “parameters.selector” is my key and does not appear

Very thanks Stephane

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [October 4, 2021, 11:50am UTC](https://jsonforms.discourse.group/t/i-would-like-to-be-able-to-add-and-remove-objects-in-an-object/400/8 "2021-10-04T11:50:02Z")

</div>

Hi! Dot in keys currently don’t properly work in JSON Forms. We have an [open issue](https://github.com/eclipsesource/jsonforms/issues/1631) for that.

---

<div class="post-metadata">

**Author:** ![abdel74100](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@abdel74100](https://jsonforms.discourse.group/u/abdel74100)\
**Post date:** [October 5, 2021, 8:59am UTC](https://jsonforms.discourse.group/t/i-would-like-to-be-able-to-add-and-remove-objects-in-an-object/400/9 "2021-10-05T08:59:16Z")

</div>

Hey Stephane

I would like to generate the schema dynamically according to the datas I give it I use the “json-s-generator” package before switching to jsonform but doesn’t jsonfor already have a way to do it?

thanks

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [October 7, 2021, 3:00pm UTC](https://jsonforms.discourse.group/t/i-would-like-to-be-able-to-add-and-remove-objects-in-an-object/400/10 "2021-10-07T15:00:52Z")

</div>

We have a `Generate` utility we export from `@jsonforms/core`. With it you can generate JSON Schemas and UI Schemas, e.g. `const generatedUiSchema = Generate.uiSchema(schema)`.

---

<div class="post-metadata">

**Author:** ![abdel74100](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@abdel74100](https://jsonforms.discourse.group/u/abdel74100)\
**Post date:** [October 8, 2021, 11:46pm UTC](https://jsonforms.discourse.group/t/i-would-like-to-be-able-to-add-and-remove-objects-in-an-object/400/11 "2021-10-08T23:46:23Z")

</div>

great thank you very much Stéphane !! and how can i access the preprocessing function in the options?  
example `const generateSchema = Generate.jsonSchema (obj, options);`

normally the options have a function to process the input data, don’t they?  
for example if i have a type : null i replace it by a type 'string"

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [October 11, 2021, 8:54am UTC](https://jsonforms.discourse.group/t/i-would-like-to-be-able-to-add-and-remove-objects-in-an-object/400/12 "2021-10-11T08:54:12Z")

</div>

We don’t have a preprocessing option. I would like to suggest to preprocess your data/schema/uischema before handing it over to JSON Forms.
