Integrating camelcase for Django REST Framework & drf_spectacular

django swagger drf django rest framework drf_spectacular

In Django REST API you usually want to achieve:

  1. Camelcase instead of snake_case for your data:
  1. Autogenerated Swagger documentation for your API

However, if you combine these two, types generated by drf_spectacular are still in snake_case.

The following configuration helps to solve the issue:

# makes params in URLs camelcase for consistency
# transforms data types and responses