From 8add3856b2b834ab48c7e73bc120864c6a49b5ee Mon Sep 17 00:00:00 2001 From: jspdown Date: Wed, 27 Sep 2023 11:20:33 +0200 Subject: [PATCH 1/4] fix: remove old SmartAPI non-standard fields --- httpbin/core.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/httpbin/core.py b/httpbin/core.py index a82c1b88..dcabea51 100644 --- a/httpbin/core.py +++ b/httpbin/core.py @@ -107,9 +107,7 @@ def jsonify(*args, **kwargs): "$ docker run -p 80:8080 ghcr.io/psf/httpbin" ), "contact": { - "responsibleOrganization": "Python Software Foundation", - "responsibleDeveloper": "Kenneth Reitz", - "url": "https://github.com/psf/httpbin/", + "url": "https://kennethreitz.org", }, # "termsOfService": "http://me.com/terms", "version": version, From 45bb7150fcc3765b68c39edce76196184b9bf822 Mon Sep 17 00:00:00 2001 From: jspdown Date: Wed, 27 Sep 2023 11:20:57 +0200 Subject: [PATCH 2/4] fix: remove non-standard `protocol` field --- httpbin/core.py | 1 - 1 file changed, 1 deletion(-) diff --git a/httpbin/core.py b/httpbin/core.py index dcabea51..fbbd2be5 100644 --- a/httpbin/core.py +++ b/httpbin/core.py @@ -115,7 +115,6 @@ def jsonify(*args, **kwargs): "host": "httpbin.org", # overrides localhost:5000 "basePath": "/", # base bash for blueprint registration "schemes": ["https"], - "protocol": "https", "tags": [ { "name": "HTTP Methods", From 5f7af52ab692a214fca8f0d61f0854224cb50f2e Mon Sep 17 00:00:00 2001 From: jspdown Date: Wed, 27 Sep 2023 12:23:42 +0200 Subject: [PATCH 3/4] fix: parameter fields type and required --- httpbin/core.py | 73 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 17 deletions(-) diff --git a/httpbin/core.py b/httpbin/core.py index fbbd2be5..a9964ec1 100644 --- a/httpbin/core.py +++ b/httpbin/core.py @@ -547,7 +547,8 @@ def redirect_n_times(n): parameters: - in: path name: n - type: int + type: number + required: true produces: - text/html responses: @@ -589,7 +590,7 @@ def redirect_to(): required: true - in: query name: status_code - type: int + type: number post: consumes: - application/x-www-form-urlencoded @@ -600,7 +601,7 @@ def redirect_to(): required: true - in: formData name: status_code - type: int + type: number required: false patch: consumes: @@ -612,7 +613,7 @@ def redirect_to(): required: true - in: formData name: status_code - type: int + type: number required: false put: consumes: @@ -624,7 +625,7 @@ def redirect_to(): required: true - in: formData name: status_code - type: int + type: number required: false responses: 302: @@ -654,7 +655,8 @@ def relative_redirect_n_times(n): parameters: - in: path name: n - type: int + type: number + required: true produces: - text/html responses: @@ -684,7 +686,8 @@ def absolute_redirect_n_times(n): parameters: - in: path name: n - type: int + type: number + required: true produces: - text/html responses: @@ -709,7 +712,8 @@ def stream_n_messages(n): parameters: - in: path name: n - type: int + type: number + required: true produces: - application/json responses: @@ -738,6 +742,8 @@ def view_status_code(codes): parameters: - in: path name: codes + type: string + required: true produces: - text/plain responses: @@ -864,9 +870,11 @@ def set_cookie(name, value): - in: path name: name type: string + required: true - in: path name: value type: string + required: true produces: - text/plain responses: @@ -952,9 +960,11 @@ def basic_auth(user="user", passwd="passwd"): - in: path name: user type: string + required: true - in: path name: passwd type: string + required: true produces: - application/json responses: @@ -980,9 +990,11 @@ def hidden_basic_auth(user="user", passwd="passwd"): - in: path name: user type: string + required: true - in: path name: passwd type: string + required: true produces: - application/json responses: @@ -1006,8 +1018,7 @@ def bearer_auth(): parameters: - in: header name: Authorization - schema: - type: string + type: string produces: - application/json responses: @@ -1039,12 +1050,15 @@ def digest_auth_md5(qop=None, user="user", passwd="passwd"): name: qop type: string description: auth or auth-int + required: true - in: path name: user type: string + required: true - in: path name: passwd type: string + required: true produces: - application/json responses: @@ -1067,17 +1081,21 @@ def digest_auth_nostale(qop=None, user="user", passwd="passwd", algorithm="MD5") name: qop type: string description: auth or auth-int + required: true - in: path name: user type: string + required: true - in: path name: passwd type: string + required: true - in: path name: algorithm type: string description: MD5, SHA-256, SHA-512 default: MD5 + required: true produces: - application/json responses: @@ -1103,21 +1121,26 @@ def digest_auth( name: qop type: string description: auth or auth-int + required: true - in: path name: user type: string + required: true - in: path name: passwd type: string + required: true - in: path name: algorithm type: string description: MD5, SHA-256, SHA-512 default: MD5 + required: true - in: path name: stale_after type: string default: never + required: true produces: - application/json responses: @@ -1202,7 +1225,8 @@ def delay_response(delay): parameters: - in: path name: delay - type: int + type: number + required: true produces: - application/json responses: @@ -1299,6 +1323,7 @@ def decode_base64(value): name: value type: string default: SFRUUEJJTiBpcyBhd2Vzb21l + required: true produces: - text/html responses: @@ -1321,8 +1346,10 @@ def cache(): parameters: - in: header name: If-Modified-Since + type: string - in: header name: If-None-Match + type: string produces: - application/json responses: @@ -1352,10 +1379,16 @@ def etag(etag): tags: - Response inspection parameters: + - in: path + name: etag + type: string + required: true - in: header name: If-None-Match + type: string - in: header name: If-Match + type: string produces: - application/json responses: @@ -1392,7 +1425,8 @@ def cache_control(value): parameters: - in: path name: value - type: integer + type: number + required: true produces: - application/json responses: @@ -1429,7 +1463,8 @@ def random_bytes(n): parameters: - in: path name: n - type: int + type: number + required: true produces: - application/octet-stream responses: @@ -1460,7 +1495,8 @@ def stream_random_bytes(n): parameters: - in: path name: n - type: int + type: number + required: true produces: - application/octet-stream responses: @@ -1504,7 +1540,8 @@ def range_request(numbytes): parameters: - in: path name: numbytes - type: int + type: number + required: true produces: - application/octet-stream responses: @@ -1594,10 +1631,12 @@ def link_page(n, offset): parameters: - in: path name: n - type: int + type: number + required: true - in: path name: offset - type: int + type: number + required: true produces: - text/html responses: From 6b172ccd561a8509b999b44c3531df9f541f7541 Mon Sep 17 00:00:00 2001 From: jspdown Date: Wed, 27 Sep 2023 12:24:39 +0200 Subject: [PATCH 4/4] chore: update AUTHORS --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 048ecf1c..15926383 100644 --- a/AUTHORS +++ b/AUTHORS @@ -23,3 +23,4 @@ Patches and Suggestions - Dave Challis (https://github.com/davechallis) - Florian Bruhin (https://github.com/The-Compiler) - Brett Randall (https://github.com/javabrett) +- Harold Ozouf (https://github.com/jspdown)