Skip to content

Commit

Permalink
HCK-9201: fixed the proper priority of Doc property in union types (#172
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Vitalii4as authored Dec 20, 2024
1 parent d739826 commit d145e4d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions forward_engineering/helpers/convertChoicesToProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
};
Expand Down

0 comments on commit d145e4d

Please sign in to comment.