Skip to content

fix(server): return 400 for client AASConstraintViolation and assetIds KeyError (#672) - #685

Open
ShahadatTest wants to merge 1 commit into
eclipse-basyx:mainfrom
ShahadatTest:fix/672-client-400-on-main
Open

ShahadatTest wants to merge 1 commit into
eclipse-basyx:mainfrom
ShahadatTest:fix/672-client-400-on-main

Conversation

@ShahadatTest

Copy link
Copy Markdown

Summary

Two client-error paths escaped as 500:

  1. POST .../submodel-elements/{idShortPath} into a SubmodelElementList — only constraint 22 mapped to 409; other AASConstraintViolations (e.g. AASd-109 value-type mismatch) were re-raised.
  2. Discovery GET /lookup/shells?assetIds=... — missing name/value raised KeyError.

Constraint 22 stays 409. Other constraint IDs and missing assetId fields now return 400 Bad Request.

Fixes #672

Test plan

  • python -m pytest test/interfaces/test_discovery_asset_ids.py test/interfaces/test_submodel_list_constraint.py test/interfaces/test_shells_asset_ids.py::ShellsAssetIdsTest::test_malformed_asset_id_missing_field_returns_400 -q — passed
  • Wrong xs:int Property into an xs:string SubmodelElementList → 400
  • assetIds payload missing name or value → 400

AI disclosure

Written with help from a Cursor Cloud Agent. I reviewed the diff and ran the tests above.

…to 400

Non-22 SubmodelElementList constraint violations and discovery assetIds
payloads missing name/value now return Bad Request instead of 500 (eclipse-basyx#672).
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.

server: Invalid client input returns 500 instead of 400

2 participants