import json


def key_dumps(obj):
    """Return serialized JSON keys and values without wrapping object."""
    s = json.dumps(obj, sort_keys=True, indent=4, separators=(',', ': '))
    # first and last lines will be "{" and "}" (resp.), strip these
    return '\n'.join(s.split('\n')[1:-1])