Skip to content
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

Parse arrays with a single item and no numbering #2

Merged
merged 1 commit into from Apr 17, 2019

Conversation

Projects
None yet
2 participants
@zvyn
Copy link
Contributor

zvyn commented Apr 9, 2019

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",
    }],
}
Parse arrays with a single item and no numbering
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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@sheppard

This comment has been minimized.

Copy link
Member

sheppard commented Apr 17, 2019

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
You can’t perform that action at this time.