Skip to content

Multiple http methods per action in schema #4400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Nnonexistent
Copy link

Description

See #4391

Problem with schema generation for this kind of statements:

    @detail_route(methods=['put', 'post'])
    def custom_action(self, request, pk):
        ...

@tomchristie tomchristie added this to the 3.4.5 Release milestone Aug 15, 2016
@tomchristie
Copy link
Member

Okay, we're not going to be able to address this use-case, since there's no way for us to differentiate between the two methods. On the backlog to review the most graceful way to handle it, but ultimately multiple methods are not going to be a style we can support.

@tomchristie
Copy link
Member

Possibly also be an issue with function based views with multiple methods.

@Nnonexistent
Copy link
Author

Add suffix (http method name) for actions with identical category+action.

- add similar action test
- decouple links check from overall request
@Nnonexistent
Copy link
Author

Nnonexistent commented Sep 1, 2016

I dug through coreapi-codec and find that it doesn't use action keys at all while generating paths object (openapi_codec.encode._get_paths_object).
So we can name our actions in coreapi documents as we want as far they are unique.

If so, this patch should fix problem with no side effects.

@tomchristie tomchristie modified the milestones: 3.4.7 Release, 3.4.8 Release Sep 21, 2016
@tomchristie tomchristie modified the milestones: 3.4.8 Release, 3.5.0 Release Sep 29, 2016
@tomchristie tomchristie removed this from the 3.4.8 Release milestone Sep 29, 2016
@tomchristie
Copy link
Member

Closed via #4529. Incoming in version 3.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants