Skip to content

Action Flows: reconcile validation-error response shape (422 vs 406) #82

Description

@marioserrano09

Summary

Part of #79.

Validation-error responses have two different shapes depending on entry point:

  • Plain REST CRUD writes (client.crud(path).create()/update()): HTTP 422 with an ErrorResult body (RestApiExceptionHandler.handleValidationError).
  • Action-framework path (SaveRemoteAction/SaveFlowRemoteAction via ApplicationMetadataController.executeAction): HTTP 406 wrapped inside an ActionExecutionResponse.

Problem

This was flagged as a latent bug to reconcile before shipping Phase 4 CRUD parity actions, but Phase 4 shipped without addressing it (documented as an explicit open item in the d03b14c5 commit message). Now that SaveRemoteAction exists side by side with plain REST CRUD for the same entity, the same frontend form can hit either shape depending on which path an app wires up — this is a live inconsistency, not a hypothetical one anymore.

Proposed work

  • Pick one shape (422/ErrorResult is the more idiomatic REST convention; the Action-framework's 406/ActionExecutionResponse is more consistent with every other action response).
  • Migrate the other entry point to match, or make ActionExecutionResponse carry an ErrorResult-compatible validation payload if 406 is kept for other reasons.
  • Update SDK error handling (DynamiaApiError) and any Vue-side form error rendering that currently only understands one shape.

References

  • RestApiExceptionHandler.handleValidationError
  • ApplicationMetadataController.executeAction
  • docs/design/SERVER_DRIVEN_ACTION_FLOWS.md §7.6 point 3, §9

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions