File tree 2 files changed +16
-7
lines changed
2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,9 @@ DOCS_SRC = docs-src
3
3
DOCS = $(DOCS_SRC ) /docs
4
4
DOCS_OUT = $(DOCS_SRC ) /out
5
5
API_DOCS = $(BUILD ) /api
6
- DOCS_SERVER := "http://localhost:5000" # Use this value as the docserver for a locally hosted baldur instance
7
- # DOCS_SERVER := "http://localhost:8080" # Use this value as the docserver for a locally hosted api gateway instance
6
+ DOCS_SERVER = "https://api.us.code42.com" # Use this value to run against production api-gateway
7
+ # DOCS_SERVER := "http://localhost:5000" # Use this value as the docserver for a locally hosted baldur instance
8
+ # DOCS_SERVER := "http://localhost:8080" # Use this value as the docserver for a locally hosted api-gateway instance
8
9
BUILD_SCRIPTS = build-scripts
9
10
10
11
all :: clean docs html locations download transform definitions unify
Original file line number Diff line number Diff line change 4
4
local docs=" ${1:? Missing param docs at index 1.} "
5
5
TMP=.transform.tmp
6
6
ALERTS=" ${docs} /alerts"
7
+ AUTHORITY=" ${docs} /authority.json"
7
8
RULES_V1=" ${docs} /alert-rules"
8
9
RULES_V2=" ${docs} /alert-rules-v2"
9
10
TRUSTED_ACTIVITIES_V2=" ${docs} /trusted-activities.json"
@@ -16,14 +17,21 @@ main() {
16
17
# ## Audit log
17
18
echo " Transforming Audit Log docs..."
18
19
api-spec-converter -f openapi_3 -t swagger_2 -c ${docs} /audit > ${docs} /audit.json
20
+ rm ${docs} /audit
19
21
20
22
# ## Authority
21
23
echo " Transforming Authority docs..."
22
- # The new api gateway lists the authority docs as "Authority" while Baldur lists them as "Core"
23
- # This "if" check can be removed after Baldur has been removed
24
- if [ -f " ${docs} " /authority ]; then
25
- api-spec-converter -f openapi_3 -t swagger_2 -c ${docs} /authority > ${docs} /authority.json
26
- fi
24
+ api-spec-converter -f openapi_3 -t swagger_2 -c ${docs} /authority > $AUTHORITY
25
+ # The authority's File component schema overwrites FFS', rename it
26
+ # ## SWAGGER 2 ###
27
+ jq ' .definitions |= with_entries( if .key == "File" then .key |= "AuthorityFile" else . end)' < $AUTHORITY > $TMP && mv $TMP $AUTHORITY
28
+ jq ' .definitions.RestoreGroup.properties.files.items."$ref" |= "#/definitions/AuthorityFile"' < $AUTHORITY > $TMP && mv $TMP $AUTHORITY
29
+
30
+ # ## OPENAPI 3 ###
31
+ # jq '.components.schemas |= with_entries( if .key == "File" then .key |= "AuthorityFile" else . end)' < ${docs}/authority > $AUTHORITY
32
+ # jq '.components.schemas.RestoreGroup.properties.files.items."$ref" |= "#/components/schemas/AuthorityFile"' < $AUTHORITY > $TMP && mv $TMP $AUTHORITY
33
+
34
+ rm ${docs} /authority
27
35
28
36
# ## Trusted Activities v2
29
37
echo " Transforming Trusted Activities docs..."
You can’t perform that action at this time.
0 commit comments