Skip to content

Reject non-object JSON request bodies cleanly - #3458

Draft
adamtheturtle wants to merge 1 commit into
mainfrom
agent/issue-3391-non-object-json
Draft

Reject non-object JSON request bodies cleanly#3458
adamtheturtle wants to merge 1 commit into
mainfrom
agent/issue-3391-non-object-json

Conversation

@adamtheturtle

Copy link
Copy Markdown
Member

Closes #3391.

What

Reject valid JSON values that are not objects during the common JSON validation step. Expand the existing invalid-JSON integration test across arrays, strings, numbers, null, and booleans.

Why

Downstream validators assume a mapping and previously leaked AttributeError or TypeError, producing exceptions or HTTP 500 responses instead of a VWS error.

Checks

  • Real Vuforia POST /targets cases
  • Mock invalid-JSON regression cases
  • uv run --extra=dev prek run --files src/mock_vws/_services_validators/json_validators.py tests/mock_vws/test_invalid_json.py

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.

A JSON body which is not an object raises an uncaught AttributeError

1 participant