Skip to content

Recommendation for versioning many=True endpoints #12

@phillbaker

Description

@phillbaker

Thanks for your work on this library, it's been very useful!

We have a few version changes where, rather than changes the values within a response, are changing what's sent back with the response. For example, if an endpoint started returning Foo.objects.all(is_bar=True), we might update it to return Foo.objects.all().

To date, we've been taking the approach of returning different responses in the views, e.g.:

if request.META.get('HTTP_API_VERSION', CURRENT_VERSION) <= '0003':
    serializer = FooSerializer(foos, many=True, context={'request': request})
    return Response({'foos': serializer.data})

What would be the recommended approach for handling that with this library? (It doesn't look like it's currently handled.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions