Repository navigation
fix(server): return 400 for client AASConstraintViolation and assetIds KeyError (#672) - #685
Open
ShahadatTest wants to merge 1 commit into
Open
ShahadatTest wants to merge 1 commit into
ShahadatTest wants to merge 1 commit into
Conversation
…to 400 Non-22 SubmodelElementList constraint violations and discovery assetIds payloads missing name/value now return Bad Request instead of 500 (eclipse-basyx#672).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two client-error paths escaped as 500:
POST .../submodel-elements/{idShortPath}into aSubmodelElementList— only constraint 22 mapped to 409; otherAASConstraintViolations (e.g. AASd-109 value-type mismatch) were re-raised.GET /lookup/shells?assetIds=...— missingname/valueraisedKeyError.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— passedxs:intProperty into anxs:stringSubmodelElementList → 400assetIdspayload missingnameorvalue→ 400AI disclosure
Written with help from a Cursor Cloud Agent. I reviewed the diff and ran the tests above.