Skip to content

Commit 3dda15b

Browse files
authored
fix: Remove special characters from placeholders (#139)
* Remove special characters from placeholders * Changelog * Adjust test files * Adjust tests * Fix expected test output
1 parent 519a18c commit 3dda15b

17 files changed

Lines changed: 994 additions & 513 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
88

99
### Added
1010
### Changed
11+
- Removed special characters from placeholders for fields like short text, description, etc.
1112
### Deprecated
1213
### Removed
1314
### Fixed

lib/compile/csdl2openapi.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ module.exports.csdl2openapi = function (
120120
Object.keys(entityContainer).forEach(element => {
121121
if (entityContainer[element].$Type) {
122122
const fullTypeName = entityContainer[element].$Type;
123-
const type = fullTypeName.startsWith(serviceName + '.')
124-
? fullTypeName.substring(serviceName.length + 1)
123+
const type = fullTypeName.startsWith(serviceName + '.')
124+
? fullTypeName.substring(serviceName.length + 1)
125125
: nameParts(fullTypeName).name;
126126
if ((csdl[serviceName]?.[type]?.['@cds.autoexpose'] || csdl[serviceName]?.[type]?.['@cds.autoexposed'])
127127
&& (!entityContainer[type] || type.endsWith('_texts'))) {
@@ -288,15 +288,15 @@ module.exports.csdl2openapi = function (
288288
description = containerSchema[meta.voc.Core.Description];
289289
}
290290
else {
291-
description = "Use @Core.LongDescription: '...' or @Core.Description: '...' on your CDS service to provide a meaningful description.";
291+
description = "Use the Core.LongDescription or Core.Description annotation on your CDS service to provide a meaningful description.";
292292
}
293293
description += (diagram ? new Diagram(meta).getResourceDiagram(entityContainer) : '');
294294
let title;
295295
if (entityContainer && entityContainer[meta.voc.Common.Label]) {
296296
title = entityContainer[meta.voc.Common.Label];
297297
}
298298
else {
299-
title = "Use @title: '...' on your CDS service to provide a meaningful title.";
299+
title = "Use the title annotation on your CDS service to provide a meaningful title.";
300300
}
301301
return {
302302
title,
@@ -338,7 +338,7 @@ module.exports.csdl2openapi = function (
338338
shortText = containerSchema[meta.voc.Core.Description];
339339
}
340340
else {
341-
shortText = "Use @Core.Description: '...' on your CDS service to provide a meaningful short text.";
341+
shortText = "Use the Core.Description annotation on your CDS service to provide a meaningful short text.";
342342
}
343343
return shortText;
344344
}

0 commit comments

Comments
 (0)