Skip to content

Checklist for implementing new Serializers

Lojack edited this page Jan 12, 2023 · 1 revision

There's a lot to think about to make sure a new Serializer has all the features, so here's a checklist:

  • Implement core functionality (packing/unpacking logic).
  • Implement prepack/preunpack when needed. For container type Serializers, consider something similar to what CompoundSerializer does to optimize only if any of the sub-serializers need a special prepack/preunpack call.
  • Check if you need to handle TypeVars at all.
  • Implement any transformations needed for type_checking.annotated to automatically unwrap the Serializer correctly. See StructuredSerializer for an example - hinted Structured-derived classes get automatically wrapped with a StructuredSerializer.
  • Tests, try to get 100% coverage to make sure you've covered all the edge cases.
  • Documentation.
Clone this wiki locally