Skip to content

Add payload validation failure factory - #3021

Open
bergundy wants to merge 2 commits into
temporalio:mainfrom
bergundy:payload-validation-error-factory
Open

Add payload validation failure factory#3021
bergundy wants to merge 2 commits into
temporalio:mainfrom
bergundy:payload-validation-error-factory

Conversation

@bergundy

Copy link
Copy Markdown
Member

Summary

  • add io.temporal.common.converter.PayloadValidationException.create
  • return a non-retryable PayloadValidationError ApplicationFailure with violations as one details value
  • replace positive Nexus test constructions with the public factory while retaining retryable compatibility coverage

Testing

  • temporal-sdk Spotless checks
  • PayloadValidationException and PayloadSerializer focused tests
  • OperationInputDeserializationErrorPropagationTest
  • tests run with the repository Temurin 21 toolchain

@bergundy
bergundy requested a review from a team as a code owner August 19, 2026 20:52
@bergundy
bergundy marked this pull request as draft August 19, 2026 21:03
@bergundy
bergundy marked this pull request as ready for review August 19, 2026 21:25
*
* @param details payload validation details
*/
public static ApplicationFailure create(Object details) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a more common pattern for these type of factories in the Java SDK

Suggested change
public static ApplicationFailure create(Object details) {
public static ApplicationFailure newPayloadValidationException(Object details) {

*
* @param details payload validation details
*/
public static ApplicationFailure create(Object details) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public static ApplicationFailure create(Object details) {
public static ApplicationFailure create(Object... details) {

To be consistent with ApplicationFailure

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.

2 participants