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

Fix for 'single element array' issue. #42

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

CaFlow
Copy link

@CaFlow CaFlow commented Jan 27, 2020

Have added a method named Spark as it is like the Spark Convention.This is similar to the Parker method except that this method takes and extra list parameter 'single_element_array_tags'. Specified tags in this list are formatted in the json as single element arrays if there is only one child.
After importing the required modules we can call this method as:
formatted_json = dumps(spark.data(fromstring(''), preserve_root=True, single_element_array_tags=['<tag 1>','<tag 2>']), sort_keys=True, indent=4)

@CaFlow CaFlow requested a review from sanand0 January 28, 2020 08:11
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.

1 participant