mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 20:50:55 +00:00
update python samples
This commit is contained in:
parent
de41fd27d1
commit
bd8cd8bf9f
@ -151,6 +151,13 @@ class ApiException(OpenApiException):
|
|||||||
if http_resp.status == 404:
|
if http_resp.status == 404:
|
||||||
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
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:
|
if 500 <= http_resp.status <= 599:
|
||||||
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
||||||
raise ApiException(http_resp=http_resp, body=body, data=data)
|
raise ApiException(http_resp=http_resp, body=body, data=data)
|
||||||
@ -189,6 +196,16 @@ class ServiceException(ApiException):
|
|||||||
pass
|
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):
|
def render_path(path_to_item):
|
||||||
"""Returns a string representation of a path"""
|
"""Returns a string representation of a path"""
|
||||||
result = ""
|
result = ""
|
||||||
|
@ -151,6 +151,13 @@ class ApiException(OpenApiException):
|
|||||||
if http_resp.status == 404:
|
if http_resp.status == 404:
|
||||||
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
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:
|
if 500 <= http_resp.status <= 599:
|
||||||
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
||||||
raise ApiException(http_resp=http_resp, body=body, data=data)
|
raise ApiException(http_resp=http_resp, body=body, data=data)
|
||||||
@ -189,6 +196,16 @@ class ServiceException(ApiException):
|
|||||||
pass
|
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):
|
def render_path(path_to_item):
|
||||||
"""Returns a string representation of a path"""
|
"""Returns a string representation of a path"""
|
||||||
result = ""
|
result = ""
|
||||||
|
@ -150,6 +150,13 @@ class ApiException(OpenApiException):
|
|||||||
if http_resp.status == 404:
|
if http_resp.status == 404:
|
||||||
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
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:
|
if 500 <= http_resp.status <= 599:
|
||||||
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
||||||
raise ApiException(http_resp=http_resp, body=body, data=data)
|
raise ApiException(http_resp=http_resp, body=body, data=data)
|
||||||
@ -188,6 +195,16 @@ class ServiceException(ApiException):
|
|||||||
pass
|
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):
|
def render_path(path_to_item):
|
||||||
"""Returns a string representation of a path"""
|
"""Returns a string representation of a path"""
|
||||||
result = ""
|
result = ""
|
||||||
|
@ -150,8 +150,7 @@ class ApiException(OpenApiException):
|
|||||||
if http_resp.status == 404:
|
if http_resp.status == 404:
|
||||||
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
||||||
|
|
||||||
# Added new exception classes for 409 and 422
|
# Added new conditions for 409 and 422
|
||||||
|
|
||||||
if http_resp.status == 409:
|
if http_resp.status == 409:
|
||||||
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
||||||
|
|
||||||
@ -191,16 +190,18 @@ class UnauthorizedException(ApiException):
|
|||||||
class ForbiddenException(ApiException):
|
class ForbiddenException(ApiException):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ServiceException(ApiException):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class ConflictException(ApiException):
|
class ConflictException(ApiException):
|
||||||
"""Exception raised for HTTP 409 Conflict errors."""
|
"""Exception for HTTP 409 Conflict."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class UnprocessableEntityException(ApiException):
|
class UnprocessableEntityException(ApiException):
|
||||||
"""Exception raised for HTTP 422 Unprocessable Entity errors."""
|
"""Exception for HTTP 422 Unprocessable Entity."""
|
||||||
pass
|
|
||||||
|
|
||||||
class ServiceException(ApiException):
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user