def _rewrite_constants(schema):
    """
    Rewrites a "constant" into an "enum" with only one value.
    """
    constants = schema.get('const')
    if constants:
        schema['enum'] = [constants]
        del schema['const']
    return schema
