@testomatio/mcp 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +10 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -767,19 +767,22 @@ class TestomatioMCPServer {
|
|
|
767
767
|
if (fieldName === 'tags') {
|
|
768
768
|
return value.map(tag => `<tag>${this.escapeXml(tag)}</tag>`).join('');
|
|
769
769
|
}
|
|
770
|
-
if (fieldName === 'labels') {
|
|
771
|
-
return value.map(label => `<label>${this.escapeXml(label)}</label>`).join('');
|
|
772
|
-
}
|
|
773
770
|
if (fieldName === 'tests-ids') {
|
|
774
771
|
return value.map(id => `<test_id>${id}</test_id>`).join('');
|
|
775
772
|
}
|
|
776
|
-
// Default array handling
|
|
777
|
-
|
|
773
|
+
// Default array handling - use field name as tag (e.g., labels -> <label>)
|
|
774
|
+
const singularFieldName = fieldName.endsWith('s') ? fieldName.slice(0, -1) : fieldName;
|
|
775
|
+
return value.map(item => {
|
|
776
|
+
if (typeof item === 'object' && item !== null) {
|
|
777
|
+
return `<${singularFieldName}>${JSON.stringify(item)}</${singularFieldName}>`;
|
|
778
|
+
}
|
|
779
|
+
return `<${singularFieldName}>${this.escapeXml(item)}</${singularFieldName}>`;
|
|
780
|
+
}).join('');
|
|
778
781
|
}
|
|
779
782
|
|
|
780
|
-
// Handle nested objects
|
|
783
|
+
// Handle nested objects - stringify them without escaping
|
|
781
784
|
if (typeof value === 'object') {
|
|
782
|
-
return
|
|
785
|
+
return JSON.stringify(value);
|
|
783
786
|
}
|
|
784
787
|
|
|
785
788
|
// Handle strings that need escaping
|