-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: upgrade openapi-generator to v7.10.0 #40
Conversation
if 'Accept' not in _header_params: | ||
_header_params['Accept'] = self.api_client.select_header_accept( | ||
[ | ||
'application/json' | ||
] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes like these in the API classes are a result of OpenAPITools/openapi-generator#19025, which enables overriding the Accept
header
@@ -39,7 +39,7 @@ print(AccessPoint.to_json()) | |||
# convert the object into a dict | |||
access_point_dict = access_point_instance.to_dict() | |||
# create an instance of AccessPoint from a dict | |||
access_point_form_dict = access_point.from_dict(access_point_dict) | |||
access_point_from_dict = AccessPoint.from_dict(access_point_dict) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes in the docs are a result of OpenAPITools/openapi-generator#18359, which fixes invalid code samples in docs.
* `COLO` (value: `'COLO'`) | ||
|
||
* `VD` (value: `'VD'`) | ||
|
||
* `NETWORK` (value: `'NETWORK'`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These kinds of changes are a result of OpenAPITools/openapi-generator#18804, which includes supported enum values in the docs for enum models
for _item_data in self.data: | ||
if _item_data: | ||
_items.append(_item_data.to_dict()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These sorts of changes are a result of OpenAPITools/openapi-generator#19223, which fixes a potential bug when models contain multiple list attributes with different element types.
_files: Dict[ | ||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] | ||
] = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes add support for multiple file parameters; I suspect this isn't relevant to us but it should be backwards-compatible anyway since the str
type is still a member of the updated union type. OpenAPITools/openapi-generator#19329
@@ -65,6 +67,7 @@ class ApiClient: | |||
'bool': bool, | |||
'date': datetime.date, | |||
'datetime': datetime.datetime, | |||
'decimal': decimal.Decimal, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decimal support added in OpenAPITools/openapi-generator#19203
@@ -312,7 +316,7 @@ def response_deserialize( | |||
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) | |||
encoding = match.group(1) if match else "utf-8" | |||
response_text = response_data.data.decode(encoding) | |||
return_data = self.deserialize(response_text, response_type) | |||
return_data = self.deserialize(response_text, response_type, content_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix for issues with deserialization not matching the specified content type: OpenAPITools/openapi-generator#18800
@@ -332,9 +336,11 @@ def sanitize_for_serialization(self, obj): | |||
"""Builds a JSON POST object. | |||
|
|||
If obj is None, return None. | |||
If obj is SecretStr, return obj.get_secret_value() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix for handling credentials & other sensitive strings, which would previously crash: OpenAPITools/openapi-generator#18023
_default: ClassVar[Optional[Self]] = None | ||
|
||
def __init__( | ||
self, | ||
host: Optional[str]=None, | ||
api_key: Optional[Dict[str, str]]=None, | ||
api_key_prefix: Optional[Dict[str, str]]=None, | ||
username: Optional[str]=None, | ||
password: Optional[str]=None, | ||
access_token: Optional[str]=None, | ||
server_index: Optional[int]=None, | ||
server_variables: Optional[ServerVariablesT]=None, | ||
server_operation_index: Optional[Dict[int, int]]=None, | ||
server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, | ||
ignore_operation_servers: bool=False, | ||
ssl_ca_cert: Optional[str]=None, | ||
retries: Optional[int] = None, | ||
*, | ||
debug: Optional[bool] = None, | ||
) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stronger typing for Python configuration class: OpenAPITools/openapi-generator#20014
@@ -40,7 +40,7 @@ class CloudRouterActionsSearchFilter(BaseModel): | |||
actual_instance: Optional[Union[CloudRouterActionsSearchExpression, CloudRouterActionsSearchOrFilter]] = None | |||
else: | |||
actual_instance: Any = None | |||
any_of_schemas: List[str] = Field(default=Literal["CloudRouterActionsSearchExpression", "CloudRouterActionsSearchOrFilter"]) | |||
any_of_schemas: Set[str] = { "CloudRouterActionsSearchExpression", "CloudRouterActionsSearchOrFilter" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressing Pydantic warnings when serializing complex models: OpenAPITools/openapi-generator#17941
Ansible collection E2E tests passing with this generator upgrade: https://github.com/equinix/ansible-collection-equinix/actions/runs/12912927895/job/36008933210 |
This PR is included in version 0.8.0 🎉 |
No description provided.