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

Missing status code 204 support. #28

Open
myheartsgoon opened this issue Jun 29, 2021 · 0 comments
Open

Missing status code 204 support. #28

myheartsgoon opened this issue Jun 29, 2021 · 0 comments

Comments

@myheartsgoon
Copy link

myheartsgoon commented Jun 29, 2021

There is no 204 status code support in api_client.py, which will cause issue when status code is 204 like set_assignee api etc.

Current Code

async def send(self, request: Request, type_: Type[T]) -> T:
  response = await self.middleware(request, self.send_inner)
  if response.status_code in [200, 201]:
      try:
          return parse_obj_as(type_, response.json())
      except ValidationError as e:
          raise ResponseHandlingException(e)
  raise UnexpectedResponse.for_response(response)

Issue:

Exception raised when 204 returned.

Unexpected Response: 204 (Unrecognized Status Code)

Current resolution:

We manually added 204 support as below to avoid exception.

if response.status_code == 204:
    return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant