Skip to content

Commit

Permalink
fix: label not found if no annotations available (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
marianfoo authored Dec 6, 2024
1 parent 51fb42c commit 3801d1a
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ export default class MetadataHandlerV4 extends MetadataHandler {
propertyObject.maxLength = propertyValue.$MaxLength;
listObject.set(propertyName, propertyObject);
}
// if no annotation is found, still try to add the property
if(!propertyLabel && !propertyName.startsWith("SAP__")){
let propertyObject: Property = {} as Property;
propertyObject.label = this.getLabel(annotations, properties, propertyName, propertyLabel, odataType);
if (!propertyObject.label) {
propertyObject.label = propertyName;
}
propertyObject.type = propertyValue.$Type;
propertyObject.maxLength = propertyValue.$MaxLength;
listObject.set(propertyName, propertyObject);
}
}
} else {
const propertiesFiltered = [];
Expand All @@ -102,6 +113,17 @@ export default class MetadataHandlerV4 extends MetadataHandler {
propertyObject.maxLength = propertyValue.$MaxLength;
listObject.set(propertyName, propertyObject);
}
// if no annotation is found, still try to add the property
if(!propertyLabel && !propertyName.startsWith("SAP__")){
let propertyObject: Property = {} as Property;
propertyObject.label = this.getLabel(annotations, properties, propertyName, propertyLabel, odataType);
if (!propertyObject.label) {
propertyObject.label = propertyName;
}
propertyObject.type = propertyValue.$Type;
propertyObject.maxLength = propertyValue.$MaxLength;
listObject.set(propertyName, propertyObject);
}
}
}

Expand Down

0 comments on commit 3801d1a

Please sign in to comment.