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

String pattern in ID field not taken into account #1942

Closed
leplatrem opened this issue Dec 20, 2018 · 0 comments
Closed

String pattern in ID field not taken into account #1942

leplatrem opened this issue Dec 20, 2018 · 0 comments
Labels

Comments

@leplatrem
Copy link
Contributor

leplatrem commented Dec 20, 2018

Steps to reproduce

  • Create a collection with a JSON schema:
"schema": {
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[0-7]$"
    },
    "title": {
      "title": "Title",
      "type": "string",
      "pattern": "^[0-7]$",
      "description": "Short title"
    }
}
  • Post a record {"id": "abc", "title": "1"}

Expected

  • the record should be rejected because id field does not match pattern

Actual behaviour

  • pattern is verified on the title field, but not on id

See:

# Remove internal and auto-assigned fields from schemas and record.
internal_fields = (
self.model.id_field,
self.model.modified_field,
self.schema_field,
self.model.permissions_field,
)

@leplatrem leplatrem added the bug label Dec 20, 2018
leplatrem added a commit that referenced this issue Jan 2, 2019
leplatrem added a commit that referenced this issue Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant