-
Notifications
You must be signed in to change notification settings - Fork 6
chore: upgrade openapi-generator to latest release (v7.4.0) #88
Conversation
def type_validate_enum(cls, value): | ||
"""Validates the enum""" | ||
if value is None: | ||
return value | ||
|
||
if value not in ('vlan', 'vrf'): |
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.
This is an example of the benefits of upgrading: previously, the type
field could not be used to determine that a VrfVirtualCircuit
is not a VlanVirtualCircuit
because the VlanVirtualCircuit
model accepted vrf
as a valid value for type
.
return method, url, header_params, body, post_params | ||
|
||
|
||
def call_api( |
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.
Manual integration test run is failing with a bunch of errors like this:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: ApiClient.call_api() got multiple values for argument 'body'
fatal: [testhost]: FAILED! => {"changed": false, "msg": "Error in metal_project: ApiClient.call_api() got multiple values for argument 'body'"}
This is quite strange, the call to return self.api_client.call_api(
'/projects/{id}/devices', 'POST',
_path_params,
_query_params,
_header_params,
body=_body_params,
# order of params: [self], url, method, path_params, query_params, header_params, body but client.call_api is defined as def call_api(
self,
method,
url,
header_params=None,
body=None,
post_params=None,
_request_timeout=None
) -> rest.RESTResponse: The order is different in functin call and in function definitoin. I suspect it's caused by our templating. |
c1be29f
to
8f8733e
Compare
8f8733e
to
83e072c
Compare
83e072c
to
21683b1
Compare
Updated templates to match the v7.4.0 generator and regenerated the code, and now there's one integration test failure:
I think this one is expected because there was a spec change for that field. I'm still concerned that the integration test workflow isn't triggering automatically for this PR. It seems like it should, since this PR touches nearly every file in the repo. |
@ctreatma I tested with events and it seems that the all_pages listers are working fine! |
This PR is included in version 0.9.0 🎉 |
This updates the Makefile to stitch the API spec and generate the SDK code using the latest release of openapi-generator. Among other things, this fixes an issue where openapi-generator would occasionally add extra values to
enum
properties nested underoneOf
schemas.