Disable coerece_form_params option in the case of application/json #301
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To fix #286.
This disables coerece_form_params option in the case of
application/json
.But, disabling coerce_form_params prevents coercing DateTime in object.
https://github.com/ota42y/openapi_parser/blob/d17334a866b39fa197d324b9d321df2b03d469b6/lib/openapi_parser/schema_validators/object_validator.rb#L41
I found that defining
ObjectValidator#initialize(validator, coerce_value, datetime_coerce_class)
in OpenAPIParser and adding coercing condition like below makes it working well. but I'm not sure this way is good or not.