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

add new encode option method 'encode_empty_table' to control how to encode empty table. #27

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

Conversation

mythay
Copy link

@mythay mythay commented Sep 24, 2015

there are three possiable values for the parameter, dict/array/null
If a table is empty, we can control the encoding result to an empty dictionary or empty array of null in json format

@lipp
Copy link

lipp commented Sep 24, 2015

👍

@mpx
Copy link
Owner

mpx commented Aug 24, 2016

I think this would be better handled by a metatable to specify whether an object or table is needed. That would allow more consistent use of types.

@brimworks
Copy link

Please see #11

...I agree with @mpx that this needs to be done on a per-value basis rather than a per-encode operation since you may want to mix an empty JSON object with an empty JSON array.

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.

4 participants