Skip to content

Commit

Permalink
Derived types with undescribed properties (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen authored Sep 28, 2023
1 parent 7f96fb5 commit 1e0e049
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/csdl2markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ module.exports.csdl2markdown = function (filename, csdl, referenced = {}) {
p.$$filename = type.$$filename;
p.$$parent = type;
let desc = "";
for (let t = type; !desc; t = modelElement(t.$BaseType)) {
for (let t = type; t[name] && !desc; t = modelElement(t.$BaseType)) {
desc = descriptionInTable(t[name]);
if (!t.$BaseType) break;
}
Expand Down
4 changes: 3 additions & 1 deletion test/csdl2markdown.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ describe("Edge cases", function () {
DerivedType: {
$Kind: "ComplexType",
$BaseType: "Derived.v1.BaseType",
Value: {"$Type": "Edm.String"}
Value: {"$Type": "Edm.String"},
SelfExplanatory: {"$Type": "Edm.String"}
},
},
};
Expand Down Expand Up @@ -482,6 +483,7 @@ describe("Edge cases", function () {
"Property|Type|Description",
":-------|:---|:----------",
"Value|String|The value",
"SelfExplanatory|String|",
"",
];
const markdown = lib.csdl2markdown(filename, vocabulary);
Expand Down

0 comments on commit 1e0e049

Please sign in to comment.