Skip to content

Commit 4a99e39

Browse files
authored
Bump open api generator version (#81)
* Update open api generator version to 7.0.0 for every language and fix the related template patches
1 parent a2de39f commit 4a99e39

13 files changed

+84
-109
lines changed

config/config.yaml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
container_opts:
2-
image: datadog/apigentools:1.1.0
2+
image: datadog/apigentools:1.6.5
33
languages:
44
go:
55
generation:
@@ -19,7 +19,7 @@ languages:
1919
templates:
2020
source:
2121
type: openapi-git
22-
git_committish: "v4.3.1" # git committish to checkout before extracting the templates
22+
git_committish: "v7.0.0" # git committish to checkout before extracting the templates
2323
templates_dir: go # directory with templates for this language
2424
system: true
2525
downstream_templates:
@@ -40,14 +40,11 @@ languages:
4040
templates:
4141
patches:
4242
- template-patches/html2-arduino-css.patch
43-
- template-patches/html2-set-package-name.patch
44-
- template-patches/html2-unused-languages.patch
45-
- template-patches/html2-create-api-token.patch
46-
- template-patches/html2-auth-reference-links.patch
47-
- template-patches/html2-rate-limiting-error.patch
43+
- template-patches/html2-index.patch
44+
- template-patches/html2-sample-js.patch
4845
source:
4946
type: openapi-git
50-
git_committish: "v4.3.1" # git committish to checkout before extracting the templates
47+
git_committish: "v7.0.0" # git committish to checkout before extracting the templates
5148
templates_dir: htmlDocs2 # directory with templates for this language
5249
system: true
5350
github_org_name: arduino
@@ -76,8 +73,8 @@ languages:
7673
- template-patches/javascript-api-client.patch
7774
source:
7875
type: openapi-git
79-
git_committish: "v4.3.1" # git committish to checkout before extracting the templates
80-
templates_dir: Javascript/es6 # directory with templates for this language
76+
git_committish: "v7.0.0" # git committish to checkout before extracting the templates
77+
templates_dir: Javascript # directory with templates for this language
8178
system: true
8279
downstream_templates:
8380
downstream-templates/javascript/README.md: README.md
@@ -105,7 +102,7 @@ languages:
105102
- template-patches/python-configuration.patch
106103
source:
107104
type: openapi-git
108-
git_committish: "v4.3.1" # git committish to checkout before extracting the templates
105+
git_committish: "v7.0.0" # git committish to checkout before extracting the templates
109106
templates_dir: python # directory with templates for this language
110107
system: true
111108
downstream_templates:

config/languages/go_v2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"gitRepoId": "iot-client-go",
44
"isGoSubmodule": false,
55
"packageName": "iot",
6-
"packageVersion": "1.4.5",
6+
"packageVersion": "1.5.0",
77
"withGoCodegenComment": true
88
}

config/languages/html2_v2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"packageName": "iot",
3-
"packageVersion": "1.4.5",
3+
"packageVersion": "1.5.0",
44
"usePromises": true
55
}

config/languages/javascript_v2.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"projectName": "@arduino/arduino-iot-client",
33
"moduleName": "ArduinoIotClient",
4-
"projectVersion": "1.4.5",
5-
"packageVersion": "1.4.5",
4+
"projectVersion": "1.5.0",
5+
"packageVersion": "1.5.0",
66
"usePromises": true,
77
"licenseName":"GPLv3",
88
"generateSourceCodeOnly": true

config/languages/python_v2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"packageName": "iot_api_client",
33
"projectName": "arduino-iot-client",
4-
"packageVersion": "1.4.5",
4+
"packageVersion": "1.5.0",
55
"generateSourceCodeOnly": true
66
}

spec/v2/swagger.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ components:
13131313
wifi_fw_version:
13141314
description: The version of the NINA/WIFI101 firmware running on the device
13151315
maxLength: 10
1316-
pattern: ^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
1316+
pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
13171317
type: string
13181318
required:
13191319
- type
@@ -1530,7 +1530,7 @@ components:
15301530
wifi_fw_version:
15311531
description: The version of the NINA/WIFI101 firmware running on the device
15321532
maxLength: 10
1533-
pattern: ^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
1533+
pattern: ^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
15341534
type: string
15351535
title: devicev2
15361536
type: object

template-patches/html2-auth-reference-links.patch

Lines changed: 0 additions & 26 deletions
This file was deleted.

template-patches/html2-create-api-token.patch

Lines changed: 0 additions & 26 deletions
This file was deleted.

template-patches/html2-unused-languages.patch renamed to template-patches/html2-index.patch

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,62 @@
11
diff --git a/htmlDocs2/index.mustache b/htmlDocs2/index.mustache
2-
index 02571cd..6acb879 100644
2+
index 65c210b..e09cc2e 100644
33
--- a/htmlDocs2/index.mustache
44
+++ b/htmlDocs2/index.mustache
5-
@@ -268,17 +268,17 @@ You have reached maximum request limit.
5+
@@ -206,6 +206,41 @@
6+
<div id="app-description" class="app-desc">
7+
{{{appDescription}}}
8+
</div>
9+
+ <div id="create-auth-token" class="app-desc">
10+
+ <h2 id="create-auth-token">Create Auth Token</h2>
11+
+ <pre class="prettyprint"><code class="language-bsh">
12+
+curl --request POST \
13+
+ --url 'https://api2.arduino.cc/iot/v1/clients/token' \
14+
+ --header 'content-type: application/x-www-form-urlencoded' \
15+
+ --data 'grant_type=client_credentials' \
16+
+ --data 'client_id=YOUR_CLIENT_ID' \
17+
+ --data 'client_secret=YOUR_SECRET_ID' \
18+
+ --data 'audience=https://api2.arduino.cc/iot'
19+
+ </code></pre>
20+
+ </div>
21+
+ <div id="app-description" class="app-desc">
22+
+ <p>Token generation code for supported clients are available at the following links:</p>
23+
+ <ul>
24+
+ <li>
25+
+ <p><a href="https://github.com/arduino/iot-client-js#authentication">Javascript Client</a></p>
26+
+ </li>
27+
+ <li>
28+
+ <p><a href="https://github.com/arduino/iot-client-py#authentication">Python Client</a></p>
29+
+ </li>
30+
+ <li>
31+
+ <p><a href="https://github.com/arduino/iot-client-go#getting-started">Golang Client</a></p>
32+
+ </li>
33+
+ </ul>
34+
+ </div>
35+
+ <div id="create-auth-token" class="app-desc">
36+
+ <h2 id="create-auth-token">Rate Limiting</h2>
37+
+ <p>Arduino IoT APIs are rate limited, authenticated clients limit is up to 10req/s.</p>
38+
+ <p>The following code and message are returned from the Arduino servers in case of rate limit error:</p>
39+
+ <p><b>Status: 429 - Too Many Requests</b></p>
40+
+ <pre>
41+
+You have reached maximum request limit.
42+
+ </pre>
43+
+ </div>
44+
</div>
45+
</div>
46+
<div id="sections">
47+
@@ -233,18 +268,18 @@
648
</p>
749
<ul class="nav nav-tabs nav-tabs-examples">
850
<li class="active"><a href="#examples-{{baseName}}-{{nickname}}-0-curl">Curl</a></li>
951
- <li class=""><a href="#examples-{{baseName}}-{{nickname}}-0-java">Java</a></li>
52+
- <li class=""><a href="#examples-{{baseName}}-{{nickname}}-0-dart">Dart</a></li>
1053
- <li class=""><a href="#examples-{{baseName}}-{{nickname}}-0-android">Android</a></li>
54+
- <!--<li class=""><a href="#examples-{{baseName}}-{{nickname}}-0-groovy">Groovy</a></li>-->
55+
- <li class=""><a href="#examples-{{baseName}}-{{nickname}}-0-objc">Obj-C</a></li>
1156
+ <!--<li class=""><a href="#examples-{{baseName}}-{{nickname}}-0-java">Java</a></li>-->
57+
+ <!--<li class=""><a href="#examples-{{baseName}}-{{nickname}}-0-dart">Dart</a></li>-->
1258
+ <!--<li class=""><a href="#examples-{{baseName}}-{{nickname}}-0-android">Android</a></li>-->
13-
<!--<li class=""><a href="#examples-{{baseName}}-{{nickname}}-0-groovy">Groovy</a></li>-->
14-
- <li class=""><a href="#examples-{{baseName}}-{{nickname}}-0-objc">Obj-C</a></li>
59+
+ <!--<!--<li class=""><a href="#examples-{{baseName}}-{{nickname}}-0-groovy">Groovy</a></li>-->
1560
+ <!--<li class=""><a href="#examples-{{baseName}}-{{nickname}}-0-objc">Obj-C</a></li>-->
1661
<li class=""><a href="#examples-{{baseName}}-{{nickname}}-0-javascript">JavaScript</a></li>
1762
<!--<li class=""><a href="#examples-{{baseName}}-{{nickname}}-0-angular">Angular</a></li>-->
@@ -28,3 +73,6 @@ index 02571cd..6acb879 100644
2873
</ul>
2974

3075
<div class="tab-content">
76+
--
77+
2.34.1
78+

template-patches/html2-rate-limiting-error.patch

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/htmlDocs2/sample_js.mustache b/htmlDocs2/sample_js.mustache
2-
index 362400aaaa..18a49755e4 100644
2+
index 5100cda..4beb704 100644
33
--- a/htmlDocs2/sample_js.mustache
44
+++ b/htmlDocs2/sample_js.mustache
55
@@ -1,6 +1,6 @@
@@ -8,15 +8,18 @@ index 362400aaaa..18a49755e4 100644
88
{{#hasAuthMethods}}
99
-var defaultClient = {{{jsModuleName}}}.ApiClient.instance;
1010
+var defaultClient = ArduinoIotClient.ApiClient.instance;
11-
{{#authMethods}}{{#isBasic}}
11+
{{#authMethods}}{{#isBasicBasic}}
1212
// Configure HTTP basic authorization: {{{name}}}
1313
var {{{name}}} = defaultClient.authentications['{{{name}}}'];
14-
@@ -17,7 +17,7 @@ var {{{name}}} = defaultClient.authentications['{{{name}}}'];
15-
{{/authMethods}}
14+
@@ -21,7 +21,7 @@ var {{{name}}} = defaultClient.authentications['{{{name}}}'];
1615
{{/hasAuthMethods}}
1716

17+
// Create an instance of the API class
1818
-var api = new {{{jsModuleName}}}.{{{classname}}}(){{#hasParams}}
1919
+var api = new ArduinoIotClient.{{{classname}}}(){{#hasParams}}
2020
{{#hasRequiredParams}}
2121
{{#requiredParams}}
2222
var {{{paramName}}} = {{{example}}}; // {{=< >=}}{<&dataType>}<={{ }}=> {{{unescapedDescription}}}
23+
--
24+
2.34.1
25+

template-patches/javascript-api-client.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
diff --git a/Javascript/es6/ApiClient.mustache b/Javascript/es6/ApiClient.mustache
1+
diff --git a/Javascript/libraries/javascript/ApiClient.mustache b/Javascript/libraries/javascript/ApiClient.mustache
22
index fcb92377e1..20c1aaee78 100644
3-
--- a/Javascript/es6/ApiClient.mustache
4-
+++ b/Javascript/es6/ApiClient.mustache
5-
@@ -358,7 +358,7 @@ class ApiClient {
3+
--- a/Javascript/libraries/javascript/ApiClient.mustache
4+
+++ b/Javascript/libraries/javascript/ApiClient.mustache
5+
@@ -370,7 +370,7 @@ class ApiClient {
66
var data = response.body;
77
if (data == null || (typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length)) {
88
// SuperAgent does not always produce a body; use the unparsed response as a fallback
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
diff --git a/python/configuration.mustache b/python/configuration.mustache
2-
index dceab63..b2d56ab 100644
2+
index ac51800..2511102 100644
33
--- a/python/configuration.mustache
44
+++ b/python/configuration.mustache
5-
@@ -259,7 +259,7 @@ conf = {{{packageName}}}.Configuration(
5+
@@ -265,7 +265,7 @@ conf = {{{packageName}}}.Configuration(
66
"""Adding retries to override urllib3 default value 3
77
"""
8-
# Disable client side validation
8+
- # Enable client side validation
99
- self.client_side_validation = True
10+
+ # Disable client side validation
1011
+ self.client_side_validation = False
1112

12-
def __deepcopy__(self, memo):
13-
cls = self.__class__
13+
self.socket_options = None
14+
"""Options to pass down to the underlying urllib3 socket
1415
--
15-
2.17.1
1616

0 commit comments

Comments
 (0)