This repository was archived by the owner on Jan 21, 2020. It is now read-only.
skip Swagger model properties on invalid input_filter fields #29
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.
skip Swagger model properties when input_filter fields are incorrectly defined.
i have some routes defined that take advantage of the http-method-based input-filter-specs offered by zfcampus/zf-content-validation, namely an input-filter-spec for GET requests. this Swagger doc module isn't built to handle method-based models though, so i'm getting the following Fatal error in my error log:
this patch will fix the 500 error and restore my Swagger docs, but it doesn't solve the bigger question. if i choose to define different input-filter-specs for GET, POST, PUT, and PATCH, which one(s) should be used to define my Swagger model? i think GET shouldn't be considered because these are validator definitions for how my collection can be queried, and PATCH shouldn't be used since it's a partial model definition. we could check for POST and PUT input-filter-specs (in that order?) before falling back to the default.
this pull request acts as a safety net and will restore Swagger docs if anyone is using method-based input-filter-specs in their content-validation config.