fix(oas31): avoid capitalizing first character of components.schemas (#8710)
Refs #8611
This commit is contained in:
@@ -11,8 +11,10 @@ export const upperFirst = (value) => {
|
||||
}
|
||||
|
||||
export const getTitle = (schema) => {
|
||||
if (schema?.title) return upperFirst(schema.title)
|
||||
if (schema?.$anchor) return upperFirst(schema.$anchor)
|
||||
const fn = useFn()
|
||||
|
||||
if (schema?.title) return fn.upperFirst(schema.title)
|
||||
if (schema?.$anchor) return fn.upperFirst(schema.$anchor)
|
||||
if (schema?.$id) return schema.$id
|
||||
|
||||
return ""
|
||||
|
||||
@@ -12,7 +12,6 @@ const Models = ({
|
||||
layoutActions,
|
||||
getComponent,
|
||||
getConfigs,
|
||||
fn,
|
||||
}) => {
|
||||
const schemas = specSelectors.selectSchemas()
|
||||
const hasSchemas = Object.keys(schemas).length > 0
|
||||
@@ -92,7 +91,7 @@ const Models = ({
|
||||
key={schemaName}
|
||||
ref={handleJSONSchema202012Ref(schemaName)}
|
||||
schema={schema}
|
||||
name={fn.upperFirst(schemaName)}
|
||||
name={schemaName}
|
||||
onExpand={handleJSONSchema202012Expand(schemaName)}
|
||||
/>
|
||||
))}
|
||||
@@ -118,9 +117,6 @@ Models.propTypes = {
|
||||
show: PropTypes.func.isRequired,
|
||||
readyToScroll: PropTypes.func.isRequired,
|
||||
}).isRequired,
|
||||
fn: PropTypes.shape({
|
||||
upperFirst: PropTypes.func.isRequired,
|
||||
}).isRequired,
|
||||
}
|
||||
|
||||
export default Models
|
||||
|
||||
Reference in New Issue
Block a user