Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested unique constraint doesn't work #1360

Closed
elias-garcia opened this issue Feb 25, 2020 · 0 comments
Closed

Nested unique constraint doesn't work #1360

elias-garcia opened this issue Feb 25, 2020 · 0 comments
Milestone

Comments

@elias-garcia
Copy link
Contributor

elias-garcia commented Feb 25, 2020

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants