1
1
SHELL: =bash
2
2
OPENAPI_GENERATOR_VERSION: =5.4.0
3
- OPENAPI_GENERATOR_COMMAND: =openapi-generator-cli
4
-
5
- ifeq (, $(shell which $(OPENAPI_GENERATOR_COMMAND ) ) )
6
- OPENAPI_GENERATOR_COMMAND = openapi-generator
7
- endif
8
-
9
- ifeq (, $(shell which $(OPENAPI_GENERATOR_COMMAND ) ) )
10
- $(error Error : Command '$(OPENAPI_GENERATOR_COMMAND ) ' not found, make sure 'openapi-generator' is installed globablly)
11
- endif
12
-
13
- ifneq ($(shell OPENAPI_GENERATOR_VERSION=$(OPENAPI_GENERATOR_VERSION ) $(OPENAPI_GENERATOR_COMMAND ) version) , $(OPENAPI_GENERATOR_VERSION ) )
14
- $(error Error : Expected $(OPENAPI_GENERATOR_COMMAND ) version $(OPENAPI_GENERATOR_VERSION ) (found $(shell $(OPENAPI_GENERATOR_COMMAND ) version) ))
15
- endif
3
+ OPENAPI_GENERATOR_COMMAND: =local-openapi-generator-cli
16
4
17
5
# Additional debugging output can be enabled by setting e.g. DEBUG_MODELS=1.
18
6
ifeq ($(DEBUG_MODELS ) ,1)
@@ -30,12 +18,17 @@ download_spec: ## Download openapi.yaml from public pinterest github repo
30
18
31
19
validate_spec : # # Validates the openapi spec: sdk.yaml
32
20
@echo ====Validates the openapi spec: sdk.yaml====
33
- openapi- generator validate -i openapi.yaml
21
+ ./local-open- generator-cli validate -i openapi.yaml
34
22
35
23
generate_client : # # Generates a python client
36
24
@echo ====Generates a python client using the sdk.yaml spec====
37
- openapi- generator generate -c config.yml -o ..
25
+ ./local-open- generator-cli generate -c config.yml -o ..
38
26
rm -rf ../test ../.gitlab-ci.yml ../.travis.yml ../git_push.sh
39
27
28
+
29
+ generate_client : # # Patch the generated client
30
+ @echo ====Execiting patches====
31
+ python ./patches/remove_bool_none_type.py
32
+
40
33
help : # # Show list of targets and purposes.
41
34
@fgrep -h " ##" $(MAKEFILE_LIST ) | fgrep -v fgrep | sed -e ' s/\\$$//' | sed -e ' s/##//'
0 commit comments