Skip to content

Commit

Permalink
Docs include field description (#3973)
Browse files Browse the repository at this point in the history
- include field description
  • Loading branch information
brendanlaschke authored Feb 16, 2024
1 parent b90b3e7 commit 5471453
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ const getSchemaComponentsProperties = (
break;
}

if (field.description) {
itemProperty.description = field.description;
}

if (Object.keys(itemProperty).length) {
node[field.name] = itemProperty;
}
Expand All @@ -98,6 +102,7 @@ const computeSchemaComponent = (
): OpenAPIV3.SchemaObject => {
const result = {
type: 'object',
description: item.description,
properties: getSchemaComponentsProperties(item),
example: {},
} as OpenAPIV3.SchemaObject;
Expand Down

0 comments on commit 5471453

Please sign in to comment.