Skip to content

Commit

Permalink
fix: Handling description for Combiners-STOP-95 (#289)
Browse files Browse the repository at this point in the history
* fix: description for Combiners(allOf,anyOf,oneOf)

* fix: handling description for Combiners

* fix: have removed export keyword before function
  • Loading branch information
SB-venkatyadavilli authored Jan 8, 2025
1 parent 230134c commit 0ea66e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/SchemaRow/SchemaRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ export const SchemaRow: React.FunctionComponent<SchemaRowProps> = React.memo(
{hasProperties && <Divider atom={isNodeHoveredAtom(schemaNode)} />}
<Properties required={required} deprecated={deprecated} validations={validations} />
</Flex>
{typeof description === 'string' && description.length > 0 && <Description value={description} />}
{typeof description === 'string' &&
(!combiner || schemaNode.parent?.fragment.description !== description) &&
description.length > 0 && <Description value={description} />}
<Validations
validations={isRegularNode(schemaNode) ? getValidationsFromSchema(schemaNode) : {}}
hideExamples={hideExamples}
Expand Down
4 changes: 3 additions & 1 deletion src/components/SchemaRow/TopLevelSchemaRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ export const TopLevelSchemaRow = ({
return (
<>
<ScrollCheck />
<Description value={schemaNode.annotations.description} />
{schemaNode.annotations.description !== schemaNode.parent?.fragment.description && (
<Description value={schemaNode.annotations.description} />
)}
<HStack spacing={3} pb={4}>
<Menu
aria-label="Pick a type"
Expand Down

0 comments on commit 0ea66e2

Please sign in to comment.