kpvdr commented on a change in pull request #263: URL: https://github.com/apache/qpid-proton/pull/263#discussion_r448980074
########## File path: c/src/core/encoder.c ########## @@ -336,8 +336,10 @@ static int pni_encoder_exit(void *ctx, pn_data_t *data, pni_node_t *node) pn_encoder_t *encoder = (pn_encoder_t *) ctx; char *pos; - // Special case 0 length list - if (node->atom.type==PN_LIST && node->children-encoder->null_count==0) { + // Special case 0 length list, but not as first element in an array + pni_node_t *parent = pn_data_node(data, node->parent); + if (node->atom.type==PN_LIST && node->children-encoder->null_count==0 && + !(pn_is_in_array(data, parent, node) && pn_is_first_in_array(data, parent, node))) { Review comment: Agreed. You are correct, this needs to happen for ALL list array members that are empty. I have checked in an update and tested it with empty lists as several members of the array including first, and all now work correctly. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org For additional commands, e-mail: dev-h...@qpid.apache.org