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

Om hase master #20385

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ class ApiException(OpenApiException):
if http_resp.status == 404:
raise NotFoundException(http_resp=http_resp, body=body, data=data)

# Added new conditions for 409 and 422
if http_resp.status == 409:
raise ConflictException(http_resp=http_resp, body=body, data=data)

if http_resp.status == 422:
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)

if 500 <= http_resp.status <= 599:
raise ServiceException(http_resp=http_resp, body=body, data=data)
raise ApiException(http_resp=http_resp, body=body, data=data)
Expand Down Expand Up @@ -178,6 +185,16 @@ class ServiceException(ApiException):
pass


class ConflictException(ApiException):
"""Exception for HTTP 409 Conflict."""
pass


class UnprocessableEntityException(ApiException):
"""Exception for HTTP 422 Unprocessable Entity."""
pass


def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ def from_response(
if http_resp.status == 404:
raise NotFoundException(http_resp=http_resp, body=body, data=data)

# Added new conditions for 409 and 422
if http_resp.status == 409:
raise ConflictException(http_resp=http_resp, body=body, data=data)

if http_resp.status == 422:
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)

if 500 <= http_resp.status <= 599:
raise ServiceException(http_resp=http_resp, body=body, data=data)
raise ApiException(http_resp=http_resp, body=body, data=data)
Expand Down Expand Up @@ -189,6 +196,16 @@ class ServiceException(ApiException):
pass


class ConflictException(ApiException):
"""Exception for HTTP 409 Conflict."""
pass


class UnprocessableEntityException(ApiException):
"""Exception for HTTP 422 Unprocessable Entity."""
pass


def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
Expand Down
17 changes: 17 additions & 0 deletions samples/client/echo_api/python/openapi_client/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ def from_response(
if http_resp.status == 404:
raise NotFoundException(http_resp=http_resp, body=body, data=data)

# Added new conditions for 409 and 422
if http_resp.status == 409:
raise ConflictException(http_resp=http_resp, body=body, data=data)

if http_resp.status == 422:
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)

if 500 <= http_resp.status <= 599:
raise ServiceException(http_resp=http_resp, body=body, data=data)
raise ApiException(http_resp=http_resp, body=body, data=data)
Expand Down Expand Up @@ -189,6 +196,16 @@ class ServiceException(ApiException):
pass


class ConflictException(ApiException):
"""Exception for HTTP 409 Conflict."""
pass


class UnprocessableEntityException(ApiException):
"""Exception for HTTP 422 Unprocessable Entity."""
pass


def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ def from_response(
if http_resp.status == 404:
raise NotFoundException(http_resp=http_resp, body=body, data=data)

# Added new conditions for 409 and 422
if http_resp.status == 409:
raise ConflictException(http_resp=http_resp, body=body, data=data)

if http_resp.status == 422:
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)

if 500 <= http_resp.status <= 599:
raise ServiceException(http_resp=http_resp, body=body, data=data)
raise ApiException(http_resp=http_resp, body=body, data=data)
Expand Down Expand Up @@ -188,6 +195,16 @@ class ServiceException(ApiException):
pass


class ConflictException(ApiException):
"""Exception for HTTP 409 Conflict."""
pass


class UnprocessableEntityException(ApiException):
"""Exception for HTTP 422 Unprocessable Entity."""
pass


def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
Expand Down
17 changes: 17 additions & 0 deletions samples/openapi3/client/petstore/python/petstore_api/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ def from_response(
if http_resp.status == 404:
raise NotFoundException(http_resp=http_resp, body=body, data=data)

# Added new conditions for 409 and 422
if http_resp.status == 409:
raise ConflictException(http_resp=http_resp, body=body, data=data)

if http_resp.status == 422:
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)

if 500 <= http_resp.status <= 599:
raise ServiceException(http_resp=http_resp, body=body, data=data)
raise ApiException(http_resp=http_resp, body=body, data=data)
Expand Down Expand Up @@ -188,6 +195,16 @@ class ServiceException(ApiException):
pass


class ConflictException(ApiException):
"""Exception for HTTP 409 Conflict."""
pass


class UnprocessableEntityException(ApiException):
"""Exception for HTTP 422 Unprocessable Entity."""
pass


def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
Expand Down
Loading