Skip to content

Fix assetIds decoding: return 400 instead of 500 on malformed JSON#511

Open
zrgt wants to merge 1 commit intoeclipse-basyx:developfrom
rwth-iat:fix/b9-asset-id-key-error
Open

Fix assetIds decoding: return 400 instead of 500 on malformed JSON#511
zrgt wants to merge 1 commit intoeclipse-basyx:developfrom
rwth-iat:fix/b9-asset-id-key-error

Conversation

@zrgt
Copy link
Copy Markdown
Contributor

@zrgt zrgt commented May 5, 2026

Fixes #502

Changes

  • Wrap asset_dict["name"] / asset_dict["value"] in a try/except KeyError and raise BadRequest with a descriptive message — client input validation errors must return 4xx, not 5xx
  • Add test_malformed_asset_id_missing_field_returns_400 unit test using Werkzeug test client

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