Skip to content

Conversation

@acoburn
Copy link
Collaborator

@acoburn acoburn commented Jul 2, 2024

There are three significant changes to the ProblemsDetails API in this PR:

  • ProblemDetails::getDetails becomes ProblemDetails::getDetail. This aligns the implementation with the RFC
  • The ProblemDetails.DEFAULT_TYPE value is now a URI (instead of a String)
  • SolidClientException::fromErrorResponse has been refactored.
    • The autocloseable InputStream is now handled in a try-with-resources block to prevent resource leakage
    • The method accepts a response URI so that any relative URIs in the ProblemDetails body can be resolved correctly
    • The method is made package-private, since it is not used outside of the package and I don't see a reason to make it part of the public API
    • The logic has been reworked to remove duplication and simplify the flow considerably

In addition, the compiler arguments are changed from the old-style maven.compiler.source / maven.compiler.target to the new approach maven.compiler.release. This eliminates a troublesome compiler warning.

@acoburn acoburn requested a review from a team as a code owner July 2, 2024 19:04
@acoburn acoburn enabled auto-merge (squash) July 2, 2024 19:16
@acoburn acoburn disabled auto-merge July 2, 2024 19:49
@acoburn acoburn enabled auto-merge (squash) July 2, 2024 20:00
try (final InputStream input = new ByteArrayInputStream(body)) {
final Data pdData = jsonService.fromJson(input, Data.class);
final URI type = Optional.ofNullable(pdData.type)
.map(uri::resolve)
Copy link
Contributor

Choose a reason for hiding this comment

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

The same is required for the instance URI

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in 89c65a3

@inrupt-sonarqube-for-github
Copy link

@acoburn acoburn merged commit acbc518 into main Jul 3, 2024
@acoburn acoburn deleted the JCL-476-problem-details branch July 3, 2024 15:00
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.

3 participants