You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to pass custom definitions (like Kafka topics) to a catalog-info API entity definition but because of hardcoded validator rule it's impossible to do that and pass validation.
Could you please add the possibility to pass definition options?
Validation of this catalog info will fail because of hardcoded tule here:
function modifyPlaceholders(obj) {
for (const k in obj) {
if (typeof obj[k] === 'object') {
try {
if (obj[k].$text || obj[k].$openapi || obj[k].$asyncapi) {
obj[k] = 'DUMMY TEXT';
return;
}
} catch (e) {
throw new Error(
`Placeholder with name '${k}' is empty. Please remove it or populate it.`,
);
}
modifyPlaceholders(obj[k]);
}
}
}
But with the following update, it'll pass:
function modifyPlaceholders(obj, condition) {
for (const k in obj) {
if (typeof obj[k] === 'object') {
try {
for (const c of condition) {
if (obj[k][c]) {
obj[k] = 'DUMMY TEXT';
return;
}
}
} catch (e) {
throw new Error(
`Placeholder with name '${k}' is empty. Please remove it or populate it.`,
);
}
modifyPlaceholders(obj[k], condition);
}
}
}
Where const condition = ['$text', '$openapi', '$asyncapi', '$topic']
Describe Request:
I would like to pass custom definitions (like Kafka topics) to a catalog-info API entity definition but because of hardcoded validator rule it's impossible to do that and pass validation.
Could you please add the possibility to pass
definition
options?Examples:
Validation of this catalog info will fail because of hardcoded tule here:
But with the following update, it'll pass:
Where const condition = ['$text', '$openapi', '$asyncapi', '$topic']
Supporting Documentation Links:
https://github.com/RoadieHQ/roadie-backstage-plugins/blob/0b7f60228b6de7c7d0baa5033aff6b105d258d5b/utils/roadie-backstage-entity-validator/src/validator.js#L39C1-L55C2
The text was updated successfully, but these errors were encountered: