Skip to content

Commit a68b363

Browse files
api-clients-generation-pipeline[bot]therveci.datadog-api-spec
authored
Use openapi-generator-cli for generation (#476)
* Use openapi-generator-cli instead of docker-compose * Move to .generator * Regenerate client from commit 1ae19d0 of spec repo Co-authored-by: Thomas Hervé <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 7f7fcbe commit a68b363

File tree

6 files changed

+48
-65
lines changed

6 files changed

+48
-65
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.5.1.dev2",
7-
"regenerated": "2022-01-13 11:49:30.037062",
8-
"spec_repo_commit": "bb2c57f"
7+
"regenerated": "2022-01-13 12:57:46.651047",
8+
"spec_repo_commit": "1ae19d0"
99
},
1010
"v2": {
1111
"apigentools_version": "1.5.1.dev2",
12-
"regenerated": "2022-01-13 11:49:30.064653",
13-
"spec_repo_commit": "bb2c57f"
12+
"regenerated": "2022-01-13 12:57:46.681987",
13+
"spec_repo_commit": "1ae19d0"
1414
}
1515
}
1616
}

.generator/openapitools.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
3+
"spaces": 2,
4+
"generator-cli": {
5+
"version": "5.3.1",
6+
"storageDir": "lib",
7+
"repository": {
8+
"downloadUrl": "https://github.com/DataDog/openapi-generator/releases/download/5.3.0-60b29e1f8e2/openapi-generator-cli.jar"
9+
},
10+
"generators": {
11+
"v1": {
12+
"generatorName": "typescript",
13+
"config": "config/v1.json",
14+
"inputSpec": "schemas/v1/openapi.yaml",
15+
"output": "../packages/datadog-api-client-v1/",
16+
"typeMappings": "AnyType=any",
17+
"additionalProperties": "disallowAdditionalPropertiesIfNotPresent=false,useObjectParameters=true,platform=node",
18+
"globalProperty": "skipFormModel=false",
19+
"templateDir": "templates"
20+
},
21+
"v2": {
22+
"generatorName": "typescript",
23+
"config": "config/v2.json",
24+
"inputSpec": "schemas/v2/openapi.yaml",
25+
"output": "../packages/datadog-api-client-v2/",
26+
"typeMappings": "AnyType=any",
27+
"additionalProperties": "disallowAdditionalPropertiesIfNotPresent=false,useObjectParameters=true,platform=node",
28+
"globalProperty": "skipFormModel=false",
29+
"templateDir": "templates"
30+
}
31+
}
32+
}
33+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ dist
33
node_modules
44
package-lock.json
55
@rerun.txt
6+
.generator/lib
67

78
examples
89

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,12 @@ repos:
2525
entry: yarn run lint:fix
2626
stages: [manual]
2727
pass_filenames: false
28+
- id: openapi-generator
29+
name: OpenAPI-generator
30+
language: node
31+
entry: bash -c "cd .generator && openapi-generator-cli generate"
32+
files: "^.generator/.*"
33+
stages: [manual]
34+
pass_filenames: false
35+
additional_dependencies:
36+
- "@openapitools/openapi-generator-cli"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.PHONY: all
22
all: .generator .env
33
@rm -rf packages/datadog-api-client-v*/models
4-
@docker-compose -f docker-compose.generator.yaml up
4+
@pre-commit run --all-files --hook-stage=manual openapi-generator || true
55
@mkdir -p docs/v1 docs/v2
66
@mv -f packages/datadog-api-client-v1/*.md docs/v1
77
@mv -f packages/datadog-api-client-v2/*.md docs/v2

docker-compose.generator.yaml

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

0 commit comments

Comments
 (0)