Skip to content

Commit

Permalink
chore(tool): Switch to server provided openapi-extractor
Browse files Browse the repository at this point in the history
Signed-off-by: jld3103 <[email protected]>
  • Loading branch information
provokateurin committed Aug 25, 2023
1 parent 2ed6268 commit 69a5ac9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion external/nextcloud-openapi-extractor
Submodule nextcloud-openapi-extractor deleted from 85b552
20 changes: 12 additions & 8 deletions tool/generate-specs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 69a5ac9

Please sign in to comment.