Skip to content

Commit a4db997

Browse files
[backend] Keep empty container consistent with empty object_refs (#9831)
1 parent 85f6fa2 commit a4db997

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

opencti-platform/opencti-graphql/src/database/stix-converter.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
INPUT_SRC,
3535
INPUT_SRC_PAYLOAD,
3636
INPUT_VALUES,
37+
objects,
3738
RELATION_GRANTED_TO,
3839
RELATION_OBJECT_MARKING
3940
} from '../schema/stixRefRelationship';
@@ -163,7 +164,8 @@ export const cleanObject = <T>(data: T): T => {
163164
const obj: T = { ...data };
164165
// eslint-disable-next-line no-restricted-syntax
165166
for (const key in data) {
166-
if (isEmptyField(obj[key])) {
167+
// cleanup empty keys except object_refs
168+
if (key !== objects.stixName && isEmptyField(obj[key])) {
167169
delete obj[key];
168170
}
169171
}

0 commit comments

Comments
 (0)