docs-util: fix removal of manually-added schemas in clean script (#8840)

This commit is contained in:
Shahed Nasser
2024-08-29 10:22:50 +03:00
committed by GitHub
parent 77b874f272
commit c86a9fe864

View File

@@ -20,6 +20,12 @@ import parseOas from "../utils/parse-oas.js"
const OAS_PREFIX_REGEX = /@oas \[(?<method>(get|post|delete))\] (?<path>.+)/
const ignoreSchemas = [
"AuthResponse",
"AuthAdminSessionResponse",
"AuthStoreSessionResponse",
]
export default async function () {
const oasOutputBasePath = getOasOutputBasePath()
const oasOperationsPath = path.join(oasOutputBasePath, "operations")
@@ -274,7 +280,10 @@ export default async function () {
// clean up schemas
allSchemas.forEach((schemaName) => {
if (referencedSchemas.has(schemaName)) {
if (
referencedSchemas.has(schemaName) ||
ignoreSchemas.includes(schemaName)
) {
return
}