Skip to content

Commit 56c7996

Browse files
committed
DEVX-639: fixing for inline types
1 parent 89e3711 commit 56c7996

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ctp-validators/src/main/kotlin/com/commercetools/rmf/validators/DiscriminatedSubtypeRule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class DiscriminatedSubtypeRule(severity: RuleSeverity, options: List<RuleOption>
1717
val validationResults: MutableList<Diagnostic> = ArrayList()
1818

1919
val parent = type.type
20-
if (parent != null && (parent as ObjectType).discriminator != null && type.discriminatorValue == null && exclude.contains(type.name).not()) {
20+
if (!type.isInlineType && parent != null && (parent as ObjectType).discriminator != null && type.discriminatorValue == null && exclude.contains(type.name).not()) {
2121
validationResults.add(create(type,
2222
"Discriminator was added to supertype, it should be set to not null for all subtypes. Discriminator is set to null for subtype: {0}, while there is a discriminator for parent type: {1}",
2323
type.name, parent.name))

0 commit comments

Comments
 (0)