Skip to content

Commit d145e4d

Browse files
authored
HCK-9201: fixed the proper priority of Doc property in union types (#172)
1 parent d739826 commit d145e4d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

forward_engineering/helpers/convertChoicesToProperties.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const convertChoiceToProperties = (schema, choice) => {
5555

5656
const multipleFieldsHash = allSubSchemaFields.reduce((multipleFieldsHash, field, index) => {
5757
const fieldName = choiceMeta.code || choiceMeta.name || field.name || getDefaultName();
58+
const fieldDescription = choiceMeta.description || field.description || field.refDescription;
5859
const multipleField = multipleFieldsHash[fieldName] || {
5960
...choiceMeta,
6061
default: convertDefaultMetaFieldType(field.type, choiceMeta.default),
@@ -64,6 +65,7 @@ const convertChoiceToProperties = (schema, choice) => {
6465
};
6566
const multipleTypeAttributes = {
6667
...field,
68+
...(fieldDescription && { description: fieldDescription }),
6769
type: field.$ref ? getTypeFromReference(field) : field.type,
6870
name: prepareName(field.name || fieldName),
6971
};

0 commit comments

Comments
 (0)