(status_code: int | str | None)
| 24 | |
| 25 | |
| 26 | def is_body_allowed_for_status_code(status_code: int | str | None) -> bool: |
| 27 | if status_code is None: |
| 28 | return True |
| 29 | # Ref: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#patterned-fields-1 |
| 30 | if status_code in { |
| 31 | "default", |
| 32 | "1XX", |
| 33 | "2XX", |
| 34 | "3XX", |
| 35 | "4XX", |
| 36 | "5XX", |
| 37 | }: |
| 38 | return True |
| 39 | current_status_code = int(status_code) |
| 40 | return not (current_status_code < 200 or current_status_code in {204, 205, 304}) |
| 41 | |
| 42 | |
| 43 | def get_path_param_names(path: str) -> set[str]: |
no outgoing calls
no test coverage detected
searching dependent graphs…