Skip to content

Parse arrays with a single item and no numbering - #2

Merged
sheppard merged 1 commit into
wq:masterfrom
zvyn:zvyn/single_item_array
Apr 17, 2019
Merged

sheppard merged 1 commit into
wq:masterfrom
zvyn:zvyn/single_item_array

Conversation

@zvyn

@zvyn zvyn commented Apr 9, 2019

Copy link
Copy Markdown
Contributor

This patch fixes an issue when integrating with
mozilla-services/react-jsonschema-form where only one item is in an
array.

Example:

{
    "nested[][nested_key_1]": "nested_value_1",
    "nested[][nested_key_2]": "nested_value_2",
}

With this patch the result is (instead of the original example above):

{
    "nested": [{
    "nested_key_1": "nested_value_1",
    "nested_key_2": "nested_value_2",
    }],
}

This patch fixes an issue when integrating with
mozilla-services/react-jsonschema-form where only one item is in an
array.

Example:

    {
        "nested[][nested_key_1]": "nested_value_1",
        "nested[][nested_key_2]": "nested_value_2",
    }

With this patch the result is (instead of the original example above):

    {
        "nested": [{
	    "nested_key_1": "nested_value_1",
	    "nested_key_2": "nested_value_2",
        }],
    }
@sheppard
sheppard merged commit 4dc6ffb into wq:master Apr 17, 2019
@sheppard

Copy link
Copy Markdown
Member

This seems like a useful change, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants