views:

458

answers:

0

1.5hr of coding in their smaller than by bedroom office with 4 desks lol. Afterward, while destressing at a bar, I refactored it a bit. objective was:

  • develop a mechanism to define a schema for json objects and validate against it
  • coerce data to schema types if possible, in case an int came in as a float or str
  • develop mechanism to convert between versions of schema

I googled an MIT licensed json schema validator and patched in type coercion support.

output.txt
json_validator.py
diff of hacked library

Question is: How good/bad is this code sample, what improvements would you make?