chisel 2.0.26__tar.gz → 2.1.1__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chisel
3
- Version: 2.0.26
3
+ Version: 2.1.1
4
4
  Summary: Lightweight WSGI application framework, schema-validated JSON APIs, and API documentation
5
5
  Home-page: https://github.com/craigahobbs/chisel
6
6
  Author: Craig A. Hobbs
@@ -20,7 +20,7 @@ Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
20
20
  Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
- Requires-Dist: schema-markdown<1.3.0,>=1.2.0
23
+ Requires-Dist: schema-markdown<1.4.0,>=1.3.0
24
24
  Dynamic: license-file
25
25
 
26
26
  # chisel
@@ -84,7 +84,7 @@ If there is a schema validation error the appropriate error code is automaticall
84
84
  status, _, content_bytes = application.request('GET', '/sum_numbers')
85
85
 
86
86
  '400 Bad Request'
87
- b'{"error":"InvalidInput","message":"Required member \'numbers\' missing (query string)"}'
87
+ b'{"error":"InvalidInput","message":"Required member \\"numbers\\" missing (query string)"}'
88
88
  ~~~
89
89
 
90
90
 
@@ -59,7 +59,7 @@ If there is a schema validation error the appropriate error code is automaticall
59
59
  status, _, content_bytes = application.request('GET', '/sum_numbers')
60
60
 
61
61
  '400 Bad Request'
62
- b'{"error":"InvalidInput","message":"Required member \'numbers\' missing (query string)"}'
62
+ b'{"error":"InvalidInput","message":"Required member \\"numbers\\" missing (query string)"}'
63
63
  ~~~
64
64
 
65
65
 
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = chisel
3
- version = 2.0.26
3
+ version = 2.1.1
4
4
  url = https://github.com/craigahobbs/chisel
5
5
  author = Craig A. Hobbs
6
6
  author_email = craigahobbs@gmail.com
@@ -27,7 +27,7 @@ packages = chisel, chisel.static
27
27
  package_dir =
28
28
  = src
29
29
  install_requires =
30
- schema-markdown >= 1.2.0, < 1.3.0
30
+ schema-markdown >= 1.3.0, < 1.4.0
31
31
 
32
32
  [options.package_data]
33
33
  chisel =
@@ -55,8 +55,8 @@ def action(action_callback=None, **kwargs):
55
55
  >>> pprint(json.loads(response.decode('utf-8')))
56
56
  {'error': 'InvalidInput',
57
57
  'member': 'numbers',
58
- 'message': "Invalid value '1' (type 'str') for member 'numbers', expected "
59
- "type 'array' (query string)"}
58
+ 'message': 'Invalid value "1" (type "str") for member "numbers", expected '
59
+ 'type "array" (query string)'}
60
60
 
61
61
  When :attr:`~chisel.Application.validate_output` the response dictionary is also validated to the output schema.
62
62
 
@@ -251,7 +251,7 @@ class Action(Request):
251
251
  else:
252
252
  request = {}
253
253
  except Exception as exc:
254
- ctx.log.warning("Error decoding JSON content for action '%s'", self.name)
254
+ ctx.log.warning('Error decoding JSON content for action "%s"', self.name)
255
255
  raise _ActionErrorInternal(HTTPStatus.BAD_REQUEST, 'InvalidInput', message=f'Invalid request JSON: {exc}')
256
256
 
257
257
  # Validate the content
@@ -259,12 +259,12 @@ class Action(Request):
259
259
  try:
260
260
  request = validate_type(input_types, input_type, request)
261
261
  except ValidationError as exc:
262
- ctx.log.warning("Invalid content for action '%s': %s", self.name, f'{exc}')
262
+ ctx.log.warning('Invalid content for action "%s": %s', self.name, f'{exc}')
263
263
  raise _ActionErrorInternal(
264
264
  HTTPStatus.BAD_REQUEST,
265
265
  'InvalidInput',
266
266
  message=f'{exc} (content)',
267
- member=exc.member
267
+ member=exc.member_fqn
268
268
  )
269
269
 
270
270
  # Decode the query string
@@ -272,7 +272,7 @@ class Action(Request):
272
272
  try:
273
273
  request_query = decode_query_string(query_string)
274
274
  except Exception as exc:
275
- ctx.log.warning("Error decoding query string for action '%s': %.1000r", self.name, query_string)
275
+ ctx.log.warning('Error decoding query string for action "%s": %.1000r', self.name, query_string)
276
276
  raise _ActionErrorInternal(HTTPStatus.BAD_REQUEST, 'InvalidInput', message=f'{exc}')
277
277
 
278
278
  # JSONP?
@@ -285,12 +285,12 @@ class Action(Request):
285
285
  try:
286
286
  request_query = validate_type(query_types, query_type, request_query)
287
287
  except ValidationError as exc:
288
- ctx.log.warning("Invalid query string for action '%s': %s", self.name, f'{exc}')
288
+ ctx.log.warning('Invalid query string for action "%s": %s', self.name, f'{exc}')
289
289
  raise _ActionErrorInternal(
290
290
  HTTPStatus.BAD_REQUEST,
291
291
  'InvalidInput',
292
292
  message=f'{exc} (query string)',
293
- member=exc.member
293
+ member=exc.member_fqn
294
294
  )
295
295
 
296
296
  # Validate the path args
@@ -299,12 +299,12 @@ class Action(Request):
299
299
  try:
300
300
  request_path = validate_type(path_types, path_type, request_path)
301
301
  except ValidationError as exc:
302
- ctx.log.warning("Invalid path for action '%s': %s", self.name, f'{exc}')
302
+ ctx.log.warning('Invalid path for action "%s": %s', self.name, f'{exc}')
303
303
  raise _ActionErrorInternal(
304
304
  HTTPStatus.BAD_REQUEST,
305
305
  'InvalidInput',
306
306
  message=f'{exc} (path)',
307
- member=exc.member
307
+ member=exc.member_fqn
308
308
  )
309
309
 
310
310
  # Copy top-level path keys and query string keys
@@ -333,7 +333,7 @@ class Action(Request):
333
333
  else:
334
334
  output_types, output_type = self._get_error_type()
335
335
  except Exception as exc:
336
- ctx.log.exception("Unexpected error in action '%s'", self.name)
336
+ ctx.log.exception('Unexpected error in action "%s"', self.name)
337
337
  raise _ActionErrorInternal(HTTPStatus.INTERNAL_SERVER_ERROR, 'UnexpectedError')
338
338
 
339
339
  # Validate the response
@@ -341,8 +341,8 @@ class Action(Request):
341
341
  try:
342
342
  validate_type(output_types, output_type, response)
343
343
  except ValidationError as exc:
344
- ctx.log.error("Invalid output returned from action '%s': %s", self.name, f'{exc}')
345
- raise _ActionErrorInternal(HTTPStatus.INTERNAL_SERVER_ERROR, 'InvalidOutput', message=f'{exc}', member=exc.member)
344
+ ctx.log.error('Invalid output returned from action "%s": %s', self.name, f'{exc}')
345
+ raise _ActionErrorInternal(HTTPStatus.INTERNAL_SERVER_ERROR, 'InvalidOutput', message=f'{exc}', member=exc.member_fqn)
346
346
 
347
347
  except _ActionErrorInternal as exc:
348
348
  status = exc.status
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chisel
3
- Version: 2.0.26
3
+ Version: 2.1.1
4
4
  Summary: Lightweight WSGI application framework, schema-validated JSON APIs, and API documentation
5
5
  Home-page: https://github.com/craigahobbs/chisel
6
6
  Author: Craig A. Hobbs
@@ -20,7 +20,7 @@ Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
20
20
  Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
21
21
  Description-Content-Type: text/markdown
22
22
  License-File: LICENSE
23
- Requires-Dist: schema-markdown<1.3.0,>=1.2.0
23
+ Requires-Dist: schema-markdown<1.4.0,>=1.3.0
24
24
  Dynamic: license-file
25
25
 
26
26
  # chisel
@@ -84,7 +84,7 @@ If there is a schema validation error the appropriate error code is automaticall
84
84
  status, _, content_bytes = application.request('GET', '/sum_numbers')
85
85
 
86
86
  '400 Bad Request'
87
- b'{"error":"InvalidInput","message":"Required member \'numbers\' missing (query string)"}'
87
+ b'{"error":"InvalidInput","message":"Required member \\"numbers\\" missing (query string)"}'
88
88
  ~~~
89
89
 
90
90
 
@@ -0,0 +1 @@
1
+ schema-markdown<1.4.0,>=1.3.0
@@ -1 +0,0 @@
1
- schema-markdown<1.3.0,>=1.2.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes