From 69a5ac9d249dec74e327aea971fc28257a1520eb Mon Sep 17 00:00:00 2001 From: jld3103 Date: Thu, 17 Aug 2023 20:47:54 +0200 Subject: [PATCH] chore(tool): Switch to server provided openapi-extractor Signed-off-by: jld3103 --- .gitmodules | 3 --- external/nextcloud-openapi-extractor | 1 - tool/generate-specs.sh | 20 ++++++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) delete mode 160000 external/nextcloud-openapi-extractor diff --git a/.gitmodules b/.gitmodules index eb6ac71b..6be3a4a0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -19,6 +19,3 @@ [submodule "external/flathub-shared-modules"] path = external/flathub-shared-modules url = https://github.com/flathub/shared-modules.git -[submodule "external/nextcloud-openapi-extractor"] - path = external/nextcloud-openapi-extractor - url = https://github.com/nextcloud/openapi-extractor diff --git a/external/nextcloud-openapi-extractor b/external/nextcloud-openapi-extractor deleted file mode 160000 index 85b552a0..00000000 --- a/external/nextcloud-openapi-extractor +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 85b552a0c82ac71e1f5660109113b6235156e92e diff --git a/tool/generate-specs.sh b/tool/generate-specs.sh index cc7d8472..7b6f86e7 100755 --- a/tool/generate-specs.sh +++ b/tool/generate-specs.sh @@ -6,20 +6,24 @@ rm -rf /tmp/nextcloud-neon mkdir -p /tmp/nextcloud-neon ( - cd external/nextcloud-openapi-extractor - composer update && composer install + cd external/nextcloud-server + composer update + composer install --no-dev + git checkout . # Remove changed files ) for path in core apps/files_sharing apps/provisioning_api apps/settings apps/theming apps/user_status; do codename="$(echo $path | sed "s/^apps\///")" - ./external/nextcloud-openapi-extractor/generate-spec "external/nextcloud-server/$path" "packages/nextcloud/lib/src/api/$codename.openapi.json" --first-status-code --first-content-type --openapi-version 3.1.0 + ( + cd external/nextcloud-server + composer exec generate-spec -- "$path" "../../packages/nextcloud/lib/src/api/$codename.openapi.json" --first-status-code --first-content-type --openapi-version 3.1.0 + ) done -./external/nextcloud-openapi-extractor/merge-specs \ - --openapi-version 3.1.0 \ - --core packages/nextcloud/lib/src/api/core.openapi.json \ - --merged /tmp/nextcloud-neon/merged.json \ - packages/nextcloud/lib/src/api/*.openapi.json +( + cd external/nextcloud-server + composer exec merge-specs -- --core ../../packages/nextcloud/lib/src/api/core.openapi.json --merged /tmp/nextcloud-neon/merged.json ../../packages/nextcloud/lib/src/api/*.openapi.json --openapi-version 3.1.0 +) jq \ -s \