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

RHINENG-14390: openapi spec for /clean-advisory-account-data #1540

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
45 changes: 45 additions & 0 deletions docs/admin/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,51 @@
]
}
},
"/clean-advisory-account-data": {
"put": {
"summary": "Clean advisory_account_data",
"description": "Delete rows with no installable and applicable systems",
"operationId": "cleanAdvisoryAccountData",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
},
"409": {
"description": "Conflict",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
},
"500": {
"description": "Internal Server Error",
"content": {
"application/json": {
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"security": [
{
"RhIdentity": []
}
]
}
},
"/pprof/evaluator_recalc/{param}": {
"get": {
"summary": "Get profile info",
Expand Down
31 changes: 19 additions & 12 deletions scripts/check-openapi-docs.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
#!/bin/bash
#!/usr/bin/env bash

APIVERS="v3 admin"
declare -A OPENAPI_COPY
for APIVER in $APIVERS; do
OPENAPI_COPY["$APIVER"]=$(mktemp -t openapi.json.XXX)
cp docs/$APIVER/openapi.json ${OPENAPI_COPY["$APIVER"]}
done

APIVER=v3
OPENAPI_COPY=$(mktemp -t openapi.json.XXX)
cp docs/$APIVER/openapi.json $OPENAPI_COPY
./scripts/generate_docs.sh
diff docs/$APIVER/openapi.json $OPENAPI_COPY
rc=$?
if [ $rc -gt 0 ]; then
echo "docs/$APIVER/openapi.json different from file generated with './scripts/generate_docs.sh'!"
else
echo "docs/$APIVER/openapi.json consistent with generated file."
fi

rm $OPENAPI_COPY
for APIVER in ${!OPENAPI_COPY[@]}; do
diff docs/$APIVER/openapi.json ${OPENAPI_COPY["$APIVER"]}
rc+=$?
if [ $rc -gt 0 ]; then
echo "docs/$APIVER/openapi.json different from file generated with './scripts/generate_docs.sh'!"
else
echo "docs/$APIVER/openapi.json consistent with generated file."
fi

rm ${OPENAPI_COPY["$APIVER"]}
done
exit $rc
Loading