Skip to content

Commit 1f09d0e

Browse files
Merge pull request #29 from sailpoint-oss/upgrade-generator-v7.8.0
Update generator and template files for python to v7.8.0
2 parents 59b096b + 3d9dc38 commit 1f09d0e

23 files changed

+370
-251
lines changed

openapi-generator-cli.jar

2.62 MB
Binary file not shown.

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
python_dateutil >= 2.5.3
22
setuptools >= 21.0.0
33
urllib3 >= 1.25.3, < 2.1.0
4-
pydantic >= 1.10.5, < 2
4+
pydantic >= 2
55
aenum >= 3.1.11
6+
mypy>=1.4.1
7+
types-python-dateutil>=2.8.19

sdk-resources/resources/README.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
1010
{{^hideGenerationTimestamp}}
1111
- Build date: {{generatedDate}}
1212
{{/hideGenerationTimestamp}}
13+
- Generator version: {{generatorVersion}}
1314
- Build package: {{generatorClass}}
1415
{{#infoUrl}}
1516
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})

sdk-resources/resources/README_onlypackage.mustache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The `{{packageName}}` package is automatically generated by the [OpenAPI Generat
1010
{{^hideGenerationTimestamp}}
1111
- Build date: {{generatedDate}}
1212
{{/hideGenerationTimestamp}}
13+
- Generator version: {{generatorVersion}}
1314
- Build package: {{generatorClass}}
1415
{{#infoUrl}}
1516
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})

sdk-resources/resources/api.mustache

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
# coding: utf-8
22

33
{{>partial_header}}
4-
5-
import io
64
import warnings
7-
85
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
9-
from typing import Dict, List, Optional, Tuple, Union, Any
10-
11-
try:
12-
from typing import Annotated
13-
except ImportError:
14-
from typing_extensions import Annotated
6+
from typing import Any, Dict, List, Optional, Tuple, Union
7+
from typing_extensions import Annotated
158

169
{{#imports}}
1710
{{import}}
1811
{{/imports}}
1912

20-
from {{packageName}}.api_client import ApiClient
13+
from {{packageName}}.api_client import ApiClient, RequestSerialized
2114
from {{packageName}}.api_response import ApiResponse
2215
from {{packageName}}.rest import RESTResponseType
2316

@@ -84,7 +77,7 @@ class {{classname}}:
8477
_content_type,
8578
_headers,
8679
_host_index,
87-
) -> Tuple:
80+
) -> RequestSerialized:
8881

8982
{{#servers.0}}
9083
_hosts = [{{#servers}}
@@ -108,7 +101,7 @@ class {{classname}}:
108101
_query_params: List[Tuple[str, str]] = []
109102
_header_params: Dict[str, Optional[str]] = _headers or {}
110103
_form_params: List[Tuple[str, str]] = []
111-
_files: Dict[str, str] = {}
104+
_files: Dict[str, Union[str, bytes]] = {}
112105
_body_params: Optional[bytes] = None
113106

114107
# process the path parameters
@@ -170,7 +163,7 @@ class {{classname}}:
170163
{{#isBinary}}
171164
# convert to byte array if the input is a file name (str)
172165
if isinstance({{paramName}}, str):
173-
with io.open({{paramName}}, "rb") as _fp:
166+
with open({{paramName}}, "rb") as _fp:
174167
_body_params = _fp.read()
175168
else:
176169
_body_params = {{paramName}}
@@ -183,7 +176,7 @@ class {{classname}}:
183176
{{#constantParams}}
184177
{{#isQueryParam}}
185178
# Set client side default value of Query Param "{{baseName}}".
186-
_query_params['{{baseName}}'] = {{#_enum}}'{{{.}}}'{{/_enum}}
179+
_query_params.append(('{{baseName}}', {{#_enum}}'{{{.}}}'{{/_enum}}))
187180
{{/isQueryParam}}
188181
{{#isHeaderParam}}
189182
# Set client side default value of Header Param "{{baseName}}".
@@ -193,11 +186,12 @@ class {{classname}}:
193186

194187
{{#hasProduces}}
195188
# set the HTTP header `Accept`
196-
_header_params['Accept'] = self.api_client.select_header_accept(
197-
[{{#produces}}
198-
'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}
199-
]
200-
)
189+
if 'Accept' not in _header_params:
190+
_header_params['Accept'] = self.api_client.select_header_accept(
191+
[{{#produces}}
192+
'{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}}
193+
]
194+
)
201195
{{/hasProduces}}
202196

203197
{{#hasConsumes}}

0 commit comments

Comments
 (0)