Skip to content
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

[python-experimental] fixes delete endpoint with no body use case #12287

Merged

Conversation

spacether
Copy link
Contributor

@spacether spacether commented May 2, 2022

There is a bug where invoking a delete endpoint with no body is unable to call the rest client self.pool_manager.request method because it doesn't understand how to prepare the request/what to send.

This fixes that bug. The solution is to detect this no body use case and omit sending the body in the request.

  • sample endpoint has been added to the spec
  • test test_delete_endpoint_without_request_body has been added

Note: these responses also lack content (content type to schema) definitions.

This PR was written for:
#12265

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@spacether spacether changed the title Adds delete endpoint and test example to python-experimental [python-experimental] fixes delete endpoint with no body use case May 3, 2022
@spacether spacether added this to the 6.0.0 milestone May 3, 2022
@@ -127,15 +127,21 @@ class RESTClientObject(object):
len(timeout) == 2):
timeout = urllib3.Timeout(connect=timeout[0], read=timeout[1])

if 'Content-Type' not in headers:
headers['Content-Type'] = 'application/json'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content-type should not be assumed. It should be set by body serialization.

@spacether spacether merged commit 8fc8553 into OpenAPITools:master May 3, 2022
@spacether spacether deleted the feat_fixes_python_exp_delete branch May 3, 2022 01:42
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.

[BUG][python-experimental] calling a delete method with just a path parameter fails
1 participant