PW-6591: Add new job to generate models (#902)

* PW-6591: Add new job to generate models

* PW-6591: Point to checkout spec

* PW-6591: Use generator from Docker image

* PW-6591: Reset templates to defaults

* PW-6591: Updating templates

* PW-6591: Propose changes via PR

* PW-6591: PR via external action

* PW-6591: Based on develop

* PW-6591: Update PR details

* PW-6591: Pin generator to v5.4.0

* PW-6591: Updating templates

Keep previous property template and move custom SaleToAcquirerData serializer to template.

* PW-6591: Author PR as Adyen bot

* PW-6591: Update author
This commit is contained in:
Michael Paul
2022-06-30 10:57:01 +02:00
committed by GitHub
parent 020a392239
commit 55c924f925
5 changed files with 254 additions and 12 deletions

26
Makefile Normal file
View File

@@ -0,0 +1,26 @@
generator=typescript-node
openapi-generator-cli=docker run --rm -v ${PWD}:/local -w /local openapitools/openapi-generator-cli:v5.4.0
clean:
rm -rf build
# Extract templates (copy them for modifications)
.PHONY: templates
templates:
$(openapi-generator-cli) author template -g ${generator} -o build/templates/typescript
build/spec:
mkdir -p build/spec
# Fetch spec files (git clone/submodule?)
build/spec/CheckoutService-v69.json: build/spec
wget https://raw.githubusercontent.com/Adyen/adyen-openapi/main/json/CheckoutService-v69.json -O build/spec/CheckoutService-v69.json
sed -i 's/"openapi" : "3.[0-9].[0-9]"/"openapi" : "3.0.0"/' build/spec/CheckoutService-v69.json
models: build/spec/CheckoutService-v69.json
$(openapi-generator-cli) generate \
-i build/spec/CheckoutService-v69.json \
-g ${generator} \
-t templates/typescript \
-o build \
--global-property models,supportingFiles