docs-util: fix removal of manually-added schemas in clean script (#8840)
This commit is contained in:
@@ -20,6 +20,12 @@ import parseOas from "../utils/parse-oas.js"
|
|||||||
|
|
||||||
const OAS_PREFIX_REGEX = /@oas \[(?<method>(get|post|delete))\] (?<path>.+)/
|
const OAS_PREFIX_REGEX = /@oas \[(?<method>(get|post|delete))\] (?<path>.+)/
|
||||||
|
|
||||||
|
const ignoreSchemas = [
|
||||||
|
"AuthResponse",
|
||||||
|
"AuthAdminSessionResponse",
|
||||||
|
"AuthStoreSessionResponse",
|
||||||
|
]
|
||||||
|
|
||||||
export default async function () {
|
export default async function () {
|
||||||
const oasOutputBasePath = getOasOutputBasePath()
|
const oasOutputBasePath = getOasOutputBasePath()
|
||||||
const oasOperationsPath = path.join(oasOutputBasePath, "operations")
|
const oasOperationsPath = path.join(oasOutputBasePath, "operations")
|
||||||
@@ -274,7 +280,10 @@ export default async function () {
|
|||||||
|
|
||||||
// clean up schemas
|
// clean up schemas
|
||||||
allSchemas.forEach((schemaName) => {
|
allSchemas.forEach((schemaName) => {
|
||||||
if (referencedSchemas.has(schemaName)) {
|
if (
|
||||||
|
referencedSchemas.has(schemaName) ||
|
||||||
|
ignoreSchemas.includes(schemaName)
|
||||||
|
) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user