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:
@@ -114,7 +114,7 @@ const TagOperationParametersObject = ({
|
||||
)
|
||||
}
|
||||
|
||||
if (!schema.properties) {
|
||||
if (!schema.properties || !Object.values(schema.properties).length) {
|
||||
return getPropertyDescriptionElm()
|
||||
}
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user