You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PATCH incorrectly normalizes default values in sub-documents #1234
To resolve this problem, I think the solution would be changing the eve/validation.py's validate_update method and set normalize to be True.
def validate_update(self, document, document_id, persisted_document=None):
""" Validate method to be invoked when performing an update, not an
insert.
:param document: the document to be validated.
:param document_id: the unique id of the document.
:param persisted_document: the persisted document to be updated.
"""
self.document_id = document_id
self.persisted_document = persisted_document
return super(Validator, self).validate(document, update=True, normalize=False)
changed the title [-]PATCH not working as expected for nested document[/-][+]PATCH incorrectly normalizes default values in subdocuments[/+]on Apr 4, 2019
changed the title [-]PATCH incorrectly normalizes default values in subdocuments[/-][+]PATCH incorrectly normalizes default values in sub-documents[/+]on Apr 4, 2019
Activity
zhangtemplar commentedon Mar 12, 2019
To resolve this problem, I think the solution would be changing the
eve/validation.py'svalidate_updatemethod and setnormalizeto beTrue.zhangtemplar commentedon Mar 12, 2019
@nicolaiarocci D1235 is ready.
nicolaiarocci commentedon Mar 28, 2019
@zhangtemplar see my comment in the PR
nicolaiarocci commentedon Apr 2, 2019
I reverted 9b2ba0f while we wait for a non-failing patch.
[-]PATCH not working as expected for nested document[/-][+]PATCH incorrectly normalizes default values in subdocuments[/+][-]PATCH incorrectly normalizes default values in subdocuments[/-][+]PATCH incorrectly normalizes default values in sub-documents[/+]PATCH not working as expected for nested document
Changelog for #1234
s/NORMALIZE_DOCUMENT_FOR_PATCH/NORMALIZE_ON_PATCH
Merge branch 'pull_#1261'
Merge branch 'pull_#1246'
PATCH incorrectly normalizes default values in sub-documents