The goal of the PR is to fix issues spotted while working on #331.
Namely I noticed that:
unmarshaling is not unmarshaling additional properties.
Unmarshaling {"key1": "2019-05-22"} against the following schema
{"type": "object", "additionalProperties": {"type": "string", "format": "date"}}
would result into {'key1': '2019-05-22'} (master) instead of {'key1': datetime.date(2019, 5, 22)} (after this PR)
when default values are used they are not unmarshaled.
Unmarshaling {} against the following schema
{"type": "object", "property": {"key1": {"type": "string", "format": "date", "default": "2019-05-22"}}}
would result into {'key1': '2019-05-22'} (master) instead of {'key1': datetime.date(2019, 5, 22)} (after this PR)
~unmarshaling a polymorphic object into a dictionary (unmarshal_object) does not keep into account the identified polymorphic object and this misaligns unmarshal_object from unmarshal_model
NOTE: respect #331 this PR still raises SwaggerMappingError in case of not found model (even if validation is disabled). This will be addressed on a separate PR~
unmarshaling a polymorphic object into a dictionary (unmarshal_object) does not keep into account the identified polymorphic object and this misaligns unmarshal_object from unmarshal_model
NOTE: this PR removes the raise SwaggerMappingError in case of not found model as validation will take care of this (added test to ensure that this is the case)
Coverage increased (+0.08%) to 98.393% when pulling 4c3270c16ad69cdbbdde48bab315426ef8a0e762 on macisamuele:maci-enance-unmarshaling-of-additional-properties-and-defaults into 92276f5566cc7662e0889c09535c61d66ea2cb4c on Yelp:master.
The goal of the PR is to fix issues spotted while working on #331.
Namely I noticed that:
{"key1": "2019-05-22"}
against the following schema{"type": "object", "additionalProperties": {"type": "string", "format": "date"}}
would result into{'key1': '2019-05-22'}
(master) instead of{'key1': datetime.date(2019, 5, 22)}
(after this PR){}
against the following schema{"type": "object", "property": {"key1": {"type": "string", "format": "date", "default": "2019-05-22"}}}
would result into{'key1': '2019-05-22'}
(master) instead of{'key1': datetime.date(2019, 5, 22)}
(after this PR)unmarshal_object
) does not keep into account the identified polymorphic object and this misalignsunmarshal_object
fromunmarshal_model
NOTE: respect #331 this PR still raisesSwaggerMappingError
in case of not found model (even if validation is disabled). This will be addressed on a separate PR~unmarshal_object
) does not keep into account the identified polymorphic object and this misalignsunmarshal_object
fromunmarshal_model
NOTE: this PR removes the raiseSwaggerMappingError
in case of not found model as validation will take care of this (added test to ensure that this is the case)