Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI - combined OpenAPI doc #87

Merged
merged 22 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .circleci/build-openapi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,25 @@ FNAMES=`find . -name "openapi.yaml" -not -path "./fragments/*" -not -path "./nod
for fin in $FNAMES; do
fout=./build/$fin
mkdir -p ${fout%/*}
speccy resolve $fin > $fout
done
#speccy resolve $fin > $fout
swagger-cli bundle $fin -o $fout -t yaml
cp build/index.html ${fout%/*}/
done

cp build/core/openapi.yaml build/openapi.yaml
m-mohr marked this conversation as resolved.
Show resolved Hide resolved

# use swagger-combine
#swagger-combine build/swagger-config.yaml --continueOnConflictingPaths -o build/openapi.yaml

# use openapi-merge-cli
#openapi-merge-cli -c build/openapi-merge-config.json
#json2yaml build/openapi-merge.json > build/openapi-merge.yaml

# use yq
#yq merge -a \
# build/core/openapi.yaml \
# build/item-search/openapi.yaml \
# build/ogcapi-features/openapi.yaml \
# build/ogcapi-features/extensions/transaction/openapi.yaml \
# build/ogcapi-features/extensions/version/openapi.yaml \
# | tee build/openapi-yq.yaml
20 changes: 20 additions & 0 deletions build/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<link rel="shortcut icon" href="../assets/images/favicon.png">
<title>STAC API</title>
</head>
<body>
<div id="content"></div>
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
<script type="text/javascript">
Redoc.init('openapi.yaml', {
expandResponses:"200,201,202,203,204",
pathInMiddlePanel: true,
hideDownloadButton: true
}, document.getElementById('content'));
</script>
</body>
</html>
19 changes: 19 additions & 0 deletions build/swagger-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
openapi: 3.0.3
info:
title: STAC API - Complete
version: 1.0.0-beta.1
apis:
- url: 'build/core/openapi.yaml'
paths:
exclude:
- "^\/$"
- url: 'build/ogcapi-features/openapi.yaml'
#- url: 'build/ogcapi-features/extensions/transaction/openapi.yaml'
# dereference:
# circular: ignore
- url: 'build/item-search/openapi.yaml'
#dereference:
# circular: ignore
- url: 'build/ogcapi-features/extensions/version/openapi.yaml'
#dereference:
# circular: ignore
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@
"dependencies": {
"@stoplight/spectral": "^5.7.1",
"gh-pages": "^3.1.0",
"klaw-sync": "^6.0.0",
"redoc-cli": "^0.10.2",
"remark-cli": "^8.0.1",
"remark-lint": "^7.0.1",
"remark-lint-no-html": "^2.0.1",
"remark-preset-lint-consistent": "^3.0.1",
"remark-preset-lint-markdown-style-guide": "^3.0.1",
"remark-preset-lint-recommended": "^4.0.1",
"remark-validate-links": "^10.0.2",
"speccy": "^0.11.0",
"yaml-files": "^1.1.0"
"swagger-cli": "^4.0.4",
"swagger-combine": "^1.3.0"
}
}