Skip to content

Add 422 Unprocessable Submission response to /evaluate - #45

Open
m-messer wants to merge 1 commit into
mainfrom
422-unprocessable-submission
Open

m-messer wants to merge 1 commit into
mainfrom
422-unprocessable-submission

Conversation

@m-messer

@m-messer m-messer commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a 422 Unprocessable Submission response to POST /evaluate. An evaluation service returns it when the request is valid but it can't process the submission content, for example an unparseable expression. The body is the standard ErrorResponse with code VALIDATION_ERROR.

At the moment a submission the service can't interpret has to come back as 500 INTERNAL_ERROR, which clients can't tell apart from a real service failure. A separate status lets clients show the learner a fix-your-input message.

Changes:

  • New paths/evaluate/responses/422-UnprocessableSubmission.yml, in the same layout as the other evaluate responses.
  • paths/evaluate/evaluate.yml lists "422" as a response for /evaluate.

Related issue

Mirrors the 422 handling added to the Lambda Feedback evaluation function layer in lambda-feedback/BaseEvalutionFunctionLayer#21.

Scope

  • This pull request is focused on a single concern.
  • The change was started from the latest main branch, or from a fork if direct branch creation is not available.

Validation

  • npm run lint: valid. Its 11 warnings are all already on main; none come from this change.
  • npm run bundle

Notes for reviewers

This only adds a response, so it's backwards compatible: existing services and clients keep working. It reuses the existing VALIDATION_ERROR code rather than adding a new one.

🤖 Generated with Claude Code

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