Skip to content

Nested unique constraint doesn't work #1360

@elias-garcia

Description

@elias-garcia

Expected Behavior

The unique constraint does not work when is inside of a dict or a list, for example. The problem comes from this line. The resulting query will find only properties in the root document.

The unique constraint won't work also when nested inside lists, as the query will try to find by a numeric index instead of the key of the parent schema.

{
    "dict_test": {
        "type": "dict",
        "schema": {
            "string_attribute": {
                "type": "string",
                "unique": true
            }
        }
    }
}

Actual Behavior

You can create more than one resource of that schema with the same string_attribute value.

Environment

  • Python version: 3.7
  • Eve version: 1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions