Skip to content

Commit

Permalink
Clean description refs from openapi spec before generating
Browse files Browse the repository at this point in the history
  • Loading branch information
XieX committed Jul 15, 2021
1 parent 274aa7c commit 21e2da1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ SAMPLE_FORMAT_python = python
SAMPLE_FORMAT_ruby = ruby
SAMPLE_FORMAT_typescript-node = ts

TARGET_OPENAPI_YAML = $(TARGETS_PATH)/openapi.yaml
TARGET_OPENAPI_JSON = $(TARGETS_PATH)/openapi.json
TARGET_OPENAPI_JSON_CLEAN = $(TARGETS_PATH)/openapi-clean.json

CODEGEN = exec java -jar ${GENERATOR_JAR}

Expand All @@ -126,7 +126,8 @@ $(TARGETS_PATH):
$(API_TARGETS): TARGET_OPENAPI_JSON
$(eval BUILD_DIR := $(TARGETS_PATH)/$(API_CLIENT_PREFIX)-$@)
mkdir -p $(BUILD_DIR) && rm -rf $(BUILD_DIR)/*
$(CODEGEN) generate -i $(TARGET_OPENAPI_JSON) $(CODEGEN_PARAMS_$@) -g $@ --additional-properties=artifactVersion=$(VERSION) -o $(BUILD_DIR) --skip-validate-spec
jq 'delpaths([["info","description"], ["tags"]])' < $(TARGET_OPENAPI_JSON) > $(TARGET_OPENAPI_JSON_CLEAN)
$(CODEGEN) generate -i $(TARGET_OPENAPI_JSON_CLEAN) $(CODEGEN_PARAMS_$@) -g $@ --additional-properties=artifactVersion=$(VERSION) -o $(BUILD_DIR)
cp ./LICENSE.txt $(BUILD_DIR)/LICENSE.txt
mv $(BUILD_DIR)/README.md $(BUILD_DIR)/README-ORIGINAL.md || touch $(BUILD_DIR)/README-ORIGINAL.md
cat ./README-PREFIX.md $(BUILD_DIR)/README-ORIGINAL.md > $(BUILD_DIR)/README.md
Expand All @@ -149,7 +150,7 @@ targets_docker:
$(DOC_TARGETS):
$(eval BUILD_DIR := $(TARGETS_PATH)/$@)
mkdir -p $(BUILD_DIR) && rm -rf $(BUILD_DIR)/*
$(CODEGEN) generate -i $(TARGET_OPENAPI_JSON) $(CODEGEN_PARAMS_$@) -g $@ --artifact-version $(VERSION) -o $(BUILD_DIR)
$(CODEGEN) generate -i $(TARGET_OPENAPI_JSON_CLEAN) $(CODEGEN_PARAMS_$@) -g $@ --artifact-version $(VERSION) -o $(BUILD_DIR)

gh-pages:
mkdir -p targets/gh-pages
Expand Down

0 comments on commit 21e2da1

Please sign in to comment.