Skip to content

RFE: Backend controller middleware, validation, and exception mapping #5993

Open

Description

@shai-almog

Generated controllers support routing and binding, but unhandled controller exceptions are mapped to a generic 500 response. Applications lack a unified build-time controller-advice/exception-handler facility and reusable controller validation and interception contracts. Security filters already exist and should remain integrated with the request lifecycle.

Requested capability

  • Add generated controller-level and global exception handlers with deterministic precedence and structured status/header/body responses.
  • Provide reusable request/response interception with documented ordering relative to security, binding, controller execution, and error handling.
  • Add a supported build-time validation contract for request fields and parameters, including nested validation and structured field errors.
  • Document how to replace common Servlet/MVC extension points using native backend APIs without requiring a full Servlet container.

Acceptance criteria

  • Controller-local handlers override global handlers according to documented rules, and unmapped errors retain safe generic responses.
  • Validation rejects invalid input before application side effects and reports stable field paths.
  • Interceptors execute completion cleanup on success, denial, binding failure, and handler failure.
  • Authentication/CSRF enforcement cannot be accidentally bypassed by controller interception or error routing.

Current implementation

Validate behavior on the JVM and locally on the packaged ParparVM backend where applicable. This request does not call for native-image or GraalVM CI jobs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions