clear-skies 1.22.16__py3-none-any.whl → 1.22.17__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of clear-skies might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: clear-skies
3
- Version: 1.22.16
3
+ Version: 1.22.17
4
4
  Summary: A framework for building backends in the cloud
5
5
  Home-page: https://github.com/cmancone/clearskies
6
6
  License: MIT
@@ -159,7 +159,7 @@ clearskies/handlers/simple_search.py,sha256=bSfq8rzdqkBj-dTGUBSZ1EkfjzUWHID7mKD2
159
159
  clearskies/handlers/update.py,sha256=rx8HW87Pfh95e_9nEfKKnxfkh2HBlCUdYqVwljtXiJ8,4116
160
160
  clearskies/handlers/write.py,sha256=Gu1w1PQ1F7tlqCqALorMRek3UH6IkViPIO195dxPd8k,9372
161
161
  clearskies/input_outputs/__init__.py,sha256=mQWL-u41FRTrPGuHe8FhLmcHjAEaUxjFwUf7RgDcbAs,182
162
- clearskies/input_outputs/cli.py,sha256=DCoSHn2fd7cwi4-3eZU_M0-Txk85PQNB1x6D_B50f1M,6529
162
+ clearskies/input_outputs/cli.py,sha256=ar2TeW-24BdCRbw9JFilZyJlZ2Qg34uwluutKx1XKSA,6694
163
163
  clearskies/input_outputs/exceptions/__init__.py,sha256=bc5Tc1XBZnqA1fKbk7pk5hyx102vqx3sDE19E03xGk4,82
164
164
  clearskies/input_outputs/exceptions/cli_input_error.py,sha256=kOFU8aLTLmeTL_AKDshxMu8_ufildg6p8ndhE1xHfb0,41
165
165
  clearskies/input_outputs/exceptions/cli_not_found.py,sha256=JBBuZA9ZwdkPhd3a0qaGgEPQrxh1fehy4R3ZaV2gWXU,39
@@ -207,7 +207,7 @@ clearskies/tests/simple_api/models/__init__.py,sha256=nUA0W6fgXw_Bxa9CudkaDkC80t
207
207
  clearskies/tests/simple_api/models/status.py,sha256=PEhPbaQh5qdUNHp8O0gz91LOLENAEBtqSaHxUPXchaM,699
208
208
  clearskies/tests/simple_api/models/user.py,sha256=5_P4Tp1tTdX7PkMJ__epPM5MA7JAeVYGas69vcWloLc,819
209
209
  clearskies/tests/simple_api/users_api.py,sha256=KYXCgEofDxHeRdQK67txN5oYUPvxxmB8JTku7L-apk4,2344
210
- clear_skies-1.22.16.dist-info/LICENSE,sha256=3Ehd0g3YOpCj8sqj0Xjq5qbOtjjgk9qzhhD9YjRQgOA,1053
211
- clear_skies-1.22.16.dist-info/METADATA,sha256=CxzPQbb-JBnBFmMTlnk9Q_tX1u3uuXiJgvy2TCbi9BU,1920
212
- clear_skies-1.22.16.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
213
- clear_skies-1.22.16.dist-info/RECORD,,
210
+ clear_skies-1.22.17.dist-info/LICENSE,sha256=3Ehd0g3YOpCj8sqj0Xjq5qbOtjjgk9qzhhD9YjRQgOA,1053
211
+ clear_skies-1.22.17.dist-info/METADATA,sha256=FrDzoVin5njD_n8BwJSkfIE2za9cKltGlgiaf5rMv8s,1920
212
+ clear_skies-1.22.17.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
213
+ clear_skies-1.22.17.dist-info/RECORD,,
@@ -79,10 +79,10 @@ class CLI:
79
79
  def get_request_method(self):
80
80
  return self._request_method if self._request_method else "GET"
81
81
 
82
- def request_data(self, required=True):
83
- request_data = self.json_body(False)
82
+ def request_data(self, required=True, allow_non_json_bodies=False):
83
+ request_data = self.json_body(False, allow_non_json_bodies=allow_non_json_bodies)
84
84
  if not request_data:
85
- if self.has_body():
85
+ if self.has_body() and not allow_non_json_bodies:
86
86
  raise ClientError("Request body was not valid JSON")
87
87
  request_data = {}
88
88
  return request_data
@@ -126,7 +126,7 @@ class CLI:
126
126
  # in the _get_json_body method
127
127
  return self._cached_body
128
128
 
129
- def json_body(self, required=True):
129
+ def json_body(self, required=True, allow_non_json_bodies=False):
130
130
  json = self._get_json_body()
131
131
  # if we get None then either the body was not JSON or was empty.
132
132
  # If it is required then we have an exception either way. If it is not required
@@ -134,7 +134,7 @@ class CLI:
134
134
  # if json is None and there is an actual request body. If json is none, the body is empty,
135
135
  # and it was not required, then we can just return None
136
136
  if json is None:
137
- if required or self.has_body():
137
+ if required or (self.has_body() and not allow_non_json_bodies):
138
138
  raise ClientError("Request body was not valid JSON")
139
139
  return json
140
140