docs-util: fixes to base OAS + circular-patch redocly plugin (#7382)

* docs-util: remove MultipleErrors schema from base OAS

* fixes to circular patch plugin

* general fixes

* change nested schemas to references
This commit is contained in:
Shahed Nasser
2024-05-27 15:29:48 +03:00
committed by GitHub
parent b5b41c7a33
commit 98615c388b
15 changed files with 237 additions and 217 deletions

View File

@@ -114,7 +114,7 @@ const TagOperationParametersObject = ({
)
}
if (!schema.properties) {
if (!schema.properties || !Object.values(schema.properties).length) {
return getPropertyDescriptionElm()
}

View File

@@ -15,6 +15,7 @@ import SectionContainer from "../../../Section/Container"
import useSchemaExample from "../../../../hooks/use-schema-example"
import { InView } from "react-intersection-observer"
import checkElementInViewport from "../../../../utils/check-element-in-viewport"
import { singular } from "pluralize"
export type TagSectionSchemaProps = {
schema: SchemaObject
@@ -24,15 +25,10 @@ export type TagSectionSchemaProps = {
const TagSectionSchema = ({ schema, tagName }: TagSectionSchemaProps) => {
const { addItems, setActivePath, activePath } = useSidebar()
const tagSlugName = useMemo(() => getSectionId([tagName]), [tagName])
const formattedName = useMemo(() => {
if (!schema["x-schemaName"]) {
return tagName.replaceAll(" ", "")
}
return schema["x-schemaName"]
.replaceAll(/^(Admin|Store)/g, "")
.replaceAll(/^Create/g, "")
}, [schema, tagName])
const formattedName = useMemo(
() => singular(tagName).replaceAll(" ", ""),
[tagName]
)
const schemaSlug = useMemo(
() => getSectionId([tagName, formattedName, "schema"]),
[tagName, formattedName]