|
Ran
|
Jobs
5
|
Files
53
|
Run time
5s
|
Badge
README BADGES
|
push
github
Improve JSON req error on disallowed empty body (#1761) Fixes #1152. Currently, when a request body is empty, the JSON request validator would parse it into None, which is later passed down to the JSON Schema validator. However, jsonschema's validation error message for this case (when nullable is false) "None is not of type 'object'" is not particularly friendly to either the API user, nor the website developer. This change adds a specific check before the None value is passed to jsonschema to emit a better error message directly. I also added some drive-by improvements on function argument typing since _validate in validators don't seem to expect receiving None, but _parse (the result of which is passed to _validate) is totally allowed to return None (or anything really). This does not seem to reflect the logic well. Iām not exactly sure if this is the best way to do this in Connexion 3.x. [We do have a patch in Connexion 2.x to achieve a similar effect](https://github.com/apache/airflow/commit/e89a7eeea) so if anyone understands how the two implementations correspond please tell me whether the two do the same thing š --------- Co-authored-by: Robbe Sneyders <robbe.sneyders@ml6.eu>
7 of 8 new or added lines in 2 files covered. (87.5%)
3565 of 3783 relevant lines covered (94.24%)
4.7 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | test-3.8 - 6724414581.1 | 0 |
94.22 |
||
| 2 | test-3.10 - 6724414581.2 | 0 |
94.24 |
||
| 3 | test-3.9 - 6724414581.3 | 0 |
94.22 |
||
| 4 | test-3.12 - 6724414581.4 | 0 |
94.24 |
||
| 5 | test-3.11 - 6724414581.5 | 0 |
94.24 |