|
13 | 13 | package org.eclipse.ditto.things.service.persistence.actors.strategies.commands;
|
14 | 14 |
|
15 | 15 | import java.util.Optional;
|
| 16 | +import java.util.concurrent.CompletableFuture; |
16 | 17 | import java.util.concurrent.CompletionStage;
|
17 | 18 |
|
18 | 19 | import javax.annotation.Nullable;
|
@@ -71,19 +72,9 @@ protected CompletionStage<DeleteFeatureDesiredProperty> performWotValidation(
|
71 | 72 | @Nullable final Thing previousThing,
|
72 | 73 | @Nullable final Thing previewThing
|
73 | 74 | ) {
|
74 |
| - return wotThingModelValidator.validateFeatureScopedDeletion( |
75 |
| - Optional.ofNullable(previousThing) |
76 |
| - .flatMap(Thing::getDefinition) |
77 |
| - .orElse(null), |
78 |
| - Optional.ofNullable(previousThing) |
79 |
| - .flatMap(Thing::getFeatures) |
80 |
| - .flatMap(f -> f.getFeature(command.getFeatureId())) |
81 |
| - .flatMap(Feature::getDefinition) |
82 |
| - .orElse(null), |
83 |
| - command.getFeatureId(), |
84 |
| - command.getResourcePath(), |
85 |
| - command.getDittoHeaders() |
86 |
| - ).thenApply(aVoid -> command); |
| 75 | + // it is always ok to delete a feature's desired properties - no need to validate for e.g. required properties, |
| 76 | + // as they do not apply for desired properties |
| 77 | + return CompletableFuture.completedFuture(command); |
87 | 78 | }
|
88 | 79 |
|
89 | 80 | private Optional<Feature> extractFeature(final DeleteFeatureDesiredProperty command, final @Nullable Thing thing) {
|
|
0 commit comments