Make type in ProblemDetail nullable#35294
Conversation
Signed-off-by: Christoph Wagner <cwagner@dimedis.de> Signed-off-by: Christoph <cwagner@dimedis.de>
d92ca1f to
91f2c25
Compare
There was a problem hiding this comment.
Thanks for the suggestion.
The @Nullable on the getter can cause issues for existing code. In 6.2.x we could avoid adding those and simply remove the Assert.notNull. It would put the burden on code setting a null value, but at least make it possible.
For 7.0 in the main branch we can accept the changes as is.
|
@rstoyanchev Thanks for the feedback and the pragmatic approach for 6.2.x vs 7.0! For 7.0, I'd suggest we could go further and remove the default Is that something the team would consider? Shall I add another commit to prepare that change? Cheers, Christoph |
|
That makes sense. Please, add the extra change. |
Signed-off-by: Christoph Wagner <cwagner@dimedis.de>
See gh-35294 Signed-off-by: Christoph Wagner <cwagner@dimedis.de> Signed-off-by: Christoph <cwagner@dimedis.de>
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Spring Framework 7 removed the default "about:blank" value for the ProblemDetail type field (see spring-projects/spring-framework#35294). This change preserves the previous behavior by introducing CamundaProblemDetail with a wrap() method that ensures all error responses include the "about:blank" type value. Changes: - Add CamundaProblemDetail.wrap() method to copy properties from existing ProblemDetail while ensuring type defaults to "about:blank" - Update GlobalControllerExceptionHandler to wrap ProblemDetail instances returned by Spring's exception handlers - Update test classes to use CamundaProblemDetail for expected responses Link: spring-projects/spring-framework#35294
Add an ArchUnit test that ensures org.springframework.http.ProblemDetail is never instantiated directly in the codebase. Instead, io.camunda.gateway.protocol.model.CamundaProblemDetail should be used. Spring Framework 7 removed the default 'about:blank' value for the 'type' field in ProblemDetail (see spring-projects/spring-framework#35294). CamundaProblemDetail restores this default to ensure backward compatibility with API consumers expecting the RFC 9457 compliant 'about:blank' default value. The rule allows imports and type references to ProblemDetail (e.g., for method signatures or type checks) but forbids: - Constructor calls - Factory method calls (forStatus, forStatusAndDetail) The CamundaProblemDetail class itself is exempt as it extends ProblemDetail.
Make ProblemDetail type field nullable to improve JSON serialization
Background
According to RFC 9457 Section 3.1.1 the "type" member is optional and when not present, its value is assumed to be "about:blank". The current Spring implementation explicitly sets this default value, which results in all problem responses containing the unhelpful
"type": "about:blank"field even when no specific problem type is needed.Changes
This change makes the
typefield nullable inProblemDetail:setType(@Nullable URI type)to accept null valuesgetType()to return@Nullable URIAssert.notNull()validation that prevented null typesCompatibility
This change is completely non-breaking. Existing users will not notice any difference in behavior:
typefield is still initialized toBLANK_TYPE("about:blank") by default"type": "about:blank"for existing usage patternsThe only difference is that developers can now optionally set the type to
nullif they want cleaner JSON output without the default "about:blank" value.Benefits
Example
For users who want cleaner output, they can now do:
This change provides more flexibility while maintaining complete backward compatibility.