Skip to content

Commit

Permalink
fix: Adjusts the Time Sample property to the ISO 8601 standard.
Browse files Browse the repository at this point in the history
  • Loading branch information
joaobertholino committed Nov 29, 2024
1 parent 8b38327 commit e3bff68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
import org.springframework.web.bind.annotation.ResponseBody;

import java.net.URI;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
* Global Exception handler for REST controllers.
Expand All @@ -55,7 +57,7 @@ private ProblemDetail detailBuild(Exception ex, HttpStatus status, StringBuffer
detail.setType(URI.create(url.toString()));
detail.setTitle(ex.getClass().getSimpleName());
detail.setDetail(ex.getLocalizedMessage());
detail.setProperty("timestamp", LocalDateTime.now());
detail.setProperty("timestamp", Instant.now());
return detail;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,7 @@ components:
description: The time the error occurred.
type: string
format: date-time
example: '2024-11-23T13:59:21.3820407'
example: '2024-11-23T13:59:21.3820407Z'
readOnly: true
schemaValidationErrors:
title: Schema validation errors
Expand Down

0 comments on commit e3bff68

Please sign in to comment.