Skip to content

Commit 4063c1c

Browse files
authored
Merge pull request #576 from DataDog/datadog-api-spec/generated/1143
Update templates from openapi-generator
2 parents e41853e + 0a5775f commit 4063c1c

File tree

92 files changed

+395
-92
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+395
-92
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.4.1.dev11",
7-
"regenerated": "2021-09-09 11:03:46.290971",
8-
"spec_repo_commit": "7c115a3"
7+
"regenerated": "2021-09-09 15:50:27.979385",
8+
"spec_repo_commit": "965e51f"
99
},
1010
"v2": {
1111
"apigentools_version": "1.4.1.dev11",
12-
"regenerated": "2021-09-09 11:04:11.681872",
13-
"spec_repo_commit": "7c115a3"
12+
"regenerated": "2021-09-09 15:50:52.098700",
13+
"spec_repo_commit": "965e51f"
1414
}
1515
}
1616
}

.generator/templates/README.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# {{{projectName}}}
22
{{#appDescriptionWithNewLines}}
3-
{{{appDescriptionWithNewLines}}}
3+
{{{.}}}
44
{{/appDescriptionWithNewLines}}
55

66
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

.generator/templates/README_common.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ All URIs are relative to *{{basePath}}*
4242

4343
Class | Method | HTTP request | Description
4444
------------ | ------------- | ------------- | -------------
45-
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
45+
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}}
4646
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
4747

4848
## Documentation For Models

.generator/templates/README_onlypackage.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# {{{projectName}}}
22
{{#appDescription}}
3-
{{{appDescription}}}
3+
{{{.}}}
44
{{/appDescription}}
55

66
The `{{packageName}}` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

.generator/templates/api.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ class {{classname}}(object):
133133
{{#hasValidation}}
134134
('{{paramName}}',): {
135135
{{#maxLength}}
136-
'max_length': {{maxLength}},{{/maxLength}}{{#minLength}}
137-
'min_length': {{minLength}},{{/minLength}}{{#maxItems}}
138-
'max_items': {{maxItems}},{{/maxItems}}{{#minItems}}
139-
'min_items': {{minItems}},{{/minItems}}{{#maximum}}
136+
'max_length': {{.}},{{/maxLength}}{{#minLength}}
137+
'min_length': {{.}},{{/minLength}}{{#maxItems}}
138+
'max_items': {{.}},{{/maxItems}}{{#minItems}}
139+
'min_items': {{.}},{{/minItems}}{{#maximum}}
140140
{{#exclusiveMaximum}}'exclusive_maximum'{{/exclusiveMaximum}}{{^exclusiveMaximum}}'inclusive_maximum'{{/exclusiveMaximum}}: {{maximum}},{{/maximum}}{{#minimum}}
141141
{{#exclusiveMinimum}}'exclusive_minimum'{{/exclusiveMinimum}}{{^exclusiveMinimum}}'inclusive_minimum'{{/exclusiveMinimum}}: {{minimum}},{{/minimum}}{{#pattern}}
142142
'regex': {

.generator/templates/api_client.mustache

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -603,12 +603,12 @@ class ApiClient(object):
603603
else:
604604
return content_types[0]
605605

606-
def update_params_for_auth(self, headers, querys, auth_settings,
606+
def update_params_for_auth(self, headers, queries, auth_settings,
607607
resource_path, method, body):
608608
"""Updates header and query params based on authentication setting.
609609

610610
:param headers: Header parameters dict to be updated.
611-
:param querys: Query parameters tuple list to be updated.
611+
:param queries: Query parameters tuple list to be updated.
612612
:param auth_settings: Authentication setting identifiers list.
613613
:param resource_path: A string representation of the HTTP request resource path.
614614
:param method: A string representation of the HTTP request method.
@@ -625,20 +625,18 @@ class ApiClient(object):
625625
headers['Cookie'] = auth_setting['value']
626626
elif auth_setting['in'] == 'header':
627627
if auth_setting['type'] != 'http-signature':
628-
if auth_setting["value"] is None:
629-
raise ApiValueError("Invalid authentication token for {}".format(auth_setting["key"]))
630628
headers[auth_setting['key']] = auth_setting['value']
631629
{{#hasHttpSignatureMethods}}
632630
else:
633631
# The HTTP signature scheme requires multiple HTTP headers
634632
# that are calculated dynamically.
635633
signing_info = self.configuration.signing_info
636634
auth_headers = signing_info.get_http_signature_headers(
637-
resource_path, method, headers, body, querys)
635+
resource_path, method, headers, body, queries)
638636
headers.update(auth_headers)
639637
{{/hasHttpSignatureMethods}}
640638
elif auth_setting['in'] == 'query':
641-
querys.append((auth_setting['key'], auth_setting['value']))
639+
queries.append((auth_setting['key'], auth_setting['value']))
642640
else:
643641
raise ApiValueError(
644642
'Authentication token must be in `query` or `header`'

.generator/templates/api_doc.mustache

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# {{packageName}}.{{classname}}{{#description}}
2-
{{description}}{{/description}}
2+
{{.}}{{/description}}
33

44
All URIs are relative to *{{basePath}}*
55

66
Method | HTTP request | Description
77
------------- | ------------- | -------------
8-
{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
8+
{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}}
99
{{/operation}}{{/operations}}
1010

1111
{{#operations}}
1212
{{#operation}}
1313
# **{{{operationId}}}**
14-
> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{^-last}}, {{/-last}}{{/defaultValue}}{{/requiredParams}})
14+
> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#requiredParams}}{{^defaultValue}}{{paramName}}{{^-last}}, {{/-last}}{{/defaultValue}}{{/requiredParams}})
1515

1616
{{#notes}}{{{unescapedNotes}}}{{/notes}}
1717

@@ -62,6 +62,7 @@ Name | Type | Description | Notes
6262
{{#responses.0}}
6363

6464
### HTTP response details
65+
6566
| Status code | Description | Response headers |
6667
|-------------|-------------|------------------|
6768
{{#responses}}

.generator/templates/api_doc_example.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ with ApiClient() as api_client:
2121
{{/defaultValue}}
2222
{{/requiredParams}}
2323
{{#optionalParams}}
24-
{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}}
24+
{{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}}
2525
{{/optionalParams}}
2626
{{#requiredParams}}
2727
{{#-last}}

.generator/templates/api_test.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class {{#operations}}Test{{classname}}(unittest.TestCase):
2020
"""Test case for {{{operationId}}}
2121

2222
{{#summary}}
23-
{{{summary}}} # noqa: E501
23+
{{{.}}} # noqa: E501
2424
{{/summary}}
2525
"""
2626
pass

.generator/templates/configuration.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Configuration(object):
7272
:param server_operation_variables: Mapping from operation ID to a mapping with
7373
string values to replace variables in templated server configuration.
7474
The validation of enums is performed for variables with defined enum values before.
75-
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
75+
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
7676
in PEM format
7777

7878
{{#hasAuthMethods}}
@@ -134,7 +134,7 @@ conf = {{{packageName}}}.Configuration(
134134
'Authorization' header, which is used to carry the signature.
135135

136136
One may be tempted to sign all headers by default, but in practice it rarely works.
137-
This is beccause explicit proxies, transparent proxies, TLS termination endpoints or
137+
This is because explicit proxies, transparent proxies, TLS termination endpoints or
138138
load balancers may add/modify/remove headers. Include the HTTP headers that you know
139139
are not going to be modified in transit.
140140

@@ -346,7 +346,7 @@ conf = {{{packageName}}}.Configuration(
346346
self._disabled_client_side_validations = s
347347
{{#hasHttpSignatureMethods}}
348348
if name == "signing_info" and value is not None:
349-
# Ensure the host paramater from signing info is the same as
349+
# Ensure the host parameter from signing info is the same as
350350
# Configuration.host.
351351
value.host = self.host
352352
{{/hasHttpSignatureMethods}}

0 commit comments

Comments
 (0)