Skip to main content

Versioning tools for use with Django Rest Framework

Project description

Django Rest Framework Versioning

Work In Progress!

Todo:

  • BUG: Allow multiple transforms per version -.-
  • Version class
    • Admin page for Versions (no editing, but just to view what is included in each version)
    • Overridable Version class
    • Version class to have methods to describe Transforms, ViewSets / views, etc
    • FUTURE and PAST version singletons (?) that always "win" comparisons with normal Versions.
      • This will allow marking features with introduced_in=Version.FUTURE, allowing release to be postponed till a later version. -VersionedSerializer
    • Make VersionedSerializer work as inline serializer
      • Needs to get context.request from parent probably
  • Make VersionDoesNotExist a subclass of rest framework APIerror so views can handle it.
  • The holy grail: get drf's openapi schema generator to listen to all this stuff.
  • Cases for the transforms to handle (add your edge cases here!) (and examples in the docs):
    • Field becomes required / nullable or reverse
    • Add value to field choices (shouldn't appear in old schema)
    • Add value to field schema and map to old value. E. G. Active / Failed -> Active /Failed / Retrying but for older versions Retrying should be displayed as Failed

Done:

  • Have Transform, VersionedViewSet add themselves to Version's .transforms/.views attributes. (The reverse is pretty cumbersome to maintain)
  • Hard(er) link between VersioningSerializer and its transforms
  • Startup checks:
    • VersioningSerializers have transform_base declared
  • Add Versions for the versions of this repo :mind-blown:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djangorestframework_versioning-0.2.0.tar.gz (8.5 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page