Skip to content

[fix][fn] Return descriptive errors for unknown JSON properties - #26441

Open
zgzyq wants to merge 1 commit into
apache:masterfrom
zgzyq:fix-18253-descriptive-invalid-json
Open

[fix][fn] Return descriptive errors for unknown JSON properties#26441
zgzyq wants to merge 1 commit into
apache:masterfrom
zgzyq:fix-18253-descriptive-invalid-json

Conversation

@zgzyq

@zgzyq zgzyq commented Sep 1, 2026

Copy link
Copy Markdown

Fixes #18253

Motivation

The Functions Worker APIs return a generic HTTP 400 response when a multipart JSON configuration contains an unknown property. Pulsar already has an UnrecognizedPropertyExceptionMapper that produces a descriptive error, but the Functions Worker resource configurations do not register it.

Modifications

  • Register UnrecognizedPropertyExceptionMapper for the Functions Worker V2 APIs.
  • Register UnrecognizedPropertyExceptionMapper for the Functions Worker V3 APIs.
  • Add a regression test covering both resource sets.

Verifying this change

This change added tests and can be verified as follows:

  • ./gradlew :pulsar-functions:pulsar-functions-worker:test --tests "org.apache.pulsar.functions.worker.rest.ResourcesTest" -PtestRetryCount=0
  • ./gradlew :pulsar-functions:pulsar-functions-worker:checkstyleMain :pulsar-functions:pulsar-functions-worker:checkstyleTest

Does this pull request potentially affect one of the following parts:

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

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.

[pulsar-functions-worker][api] returns non-descriptive Jersey error when sending invalid json

1 participant