Skip to content

Fix 500 on WoT delete of undefined features - #2545

Open
sankalpsthakur wants to merge 1 commit into
eclipse-ditto:masterfrom
sankalpsthakur:fix/2146-wot-delete-undefined-feature
Open

Fix 500 on WoT delete of undefined features#2545
sankalpsthakur wants to merge 1 commit into
eclipse-ditto:masterfrom
sankalpsthakur:fix/2146-wot-delete-undefined-feature

Conversation

@sankalpsthakur

@sankalpsthakur sankalpsthakur commented Sep 5, 2026

Copy link
Copy Markdown

Summary

With strict WoT validation enabled, deleting a feature that is not in the Thing model threw NoSuchElementException in validateFeatureScopedDeletion() and returned HTTP 500.

The method now returns success when the feature is not defined in the model, so extra-feature deletes succeed instead of failing as an ISE.

PATCH of extra features to null still 400 under forbidNonModeledFeatures (strict WoT). That half of #2146 is not in this PR.

Validation

  • Reproduced: validateFeatureDeletionSucceedsForUndefinedFeature completed exceptionally with NoSuchElementException before the guard.
  • mvn -pl wot/validation -am test -Dtest=WotThingModelValidationFeatureLevelTest — 76 tests, 0 failures (Java 25)

Related to #2146

AI/LLM disclosure

  • AI coding tools (including Grok and/or Codex agent-assisted editing) were used to help draft or modify code and this PR description.
  • I reviewed the complete change, understand the reasoning, and ran the reported local tests before submitting.
  • This submission is original work of authorship under the project CLA / contributor terms; AI output was not pasted unreviewed.

validateFeatureScopedDeletion assumed the feature existed in the Thing
model. Deleting an extra feature then ran required-property checks on an
empty path and threw NoSuchElementException (HTTP 500).

Skip validation when the feature is not in the model so those deletes
succeed.

Fixes eclipse-ditto#2146

Signed-off-by: Sankalp Thakur <sankalphimself@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant