From d145e4da3d46204879fb5959acf0121cea2b4ece Mon Sep 17 00:00:00 2001 From: Vitalii Yarmus <71256742+Vitalii4as@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:16:32 +0200 Subject: [PATCH] HCK-9201: fixed the proper priority of Doc property in union types (#172) --- forward_engineering/helpers/convertChoicesToProperties.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/forward_engineering/helpers/convertChoicesToProperties.js b/forward_engineering/helpers/convertChoicesToProperties.js index b260608..4298c12 100644 --- a/forward_engineering/helpers/convertChoicesToProperties.js +++ b/forward_engineering/helpers/convertChoicesToProperties.js @@ -55,6 +55,7 @@ const convertChoiceToProperties = (schema, choice) => { const multipleFieldsHash = allSubSchemaFields.reduce((multipleFieldsHash, field, index) => { const fieldName = choiceMeta.code || choiceMeta.name || field.name || getDefaultName(); + const fieldDescription = choiceMeta.description || field.description || field.refDescription; const multipleField = multipleFieldsHash[fieldName] || { ...choiceMeta, default: convertDefaultMetaFieldType(field.type, choiceMeta.default), @@ -64,6 +65,7 @@ const convertChoiceToProperties = (schema, choice) => { }; const multipleTypeAttributes = { ...field, + ...(fieldDescription && { description: fieldDescription }), type: field.$ref ? getTypeFromReference(field) : field.type, name: prepareName(field.name || fieldName), };