Add option to ignore undefined fields during JSON generation