-
-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REST API - date type mismatch #1276
Comments
Alternatively change the swagger,.json to say
in stead of
Obviously less preferable from a correctness standpoint, but it would not constitute a breaking change. |
I just ran into this issue too. Is there a reason this minor fix has not been implemented in over a year? Also, the breaking change label is still wrong, at least for the solution that fixes swagger to reflect what the API actually does. |
As the output from http://{hostname}:{port}/api/swagger.json is not following the Swagger 2.0 specification: https://swagger.io/specification/v2/ This error should at least be mentioned in the documentation here: |
Fields of type `Date` that are not explicitly serialized with `Iso8601DateSerializer` are automatically serialized as UNIX epoch timestamp in milliseconds. However the OpenAPI spec declared them to be of type `string` in `date-time` format, which is incorrect. Instead of changing the field's actual type, causing a breaking change, provide a type hint to the OpenAPI generator. Fixes DependencyTrack#1276 Fixes DependencyTrack#2591 Signed-off-by: nscuro <nscuro@protonmail.com>
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fields of type `Date` that are not explicitly serialized with `Iso8601DateSerializer` are automatically serialized as UNIX epoch timestamp in milliseconds. However the OpenAPI spec declared them to be of type `string` in `date-time` format, which is incorrect. Instead of changing the field's actual type, causing a breaking change, provide a type hint to the OpenAPI generator. Fixes DependencyTrack#1276 Fixes DependencyTrack#2591 Signed-off-by: nscuro <nscuro@protonmail.com>
Fields of type `Date` that are not explicitly serialized with `Iso8601DateSerializer` are automatically serialized as UNIX epoch timestamp in milliseconds. However the OpenAPI spec declared them to be of type `string` in `date-time` format, which is incorrect. Instead of changing the field's actual type, causing a breaking change, provide a type hint to the OpenAPI generator. Fixes DependencyTrack#1276 Fixes DependencyTrack#2591 Signed-off-by: nscuro <nscuro@protonmail.com>
Current Behavior:
The swagger.json documents ProjectMetrics firstOccurrence and lastOccurrence as string/date-time. The response payload is a unix timestamp in milliseconds since Jan 1 1970. This makes it difficult to autogenerate client code something like openapi-generator. This is likely due to the usage of the
java.util.Date
object instead of the newer JSR310 date types for JSON marshalling.Expected Behavior:
It would be ideal if the REST API matched the response type.
Environment:
The text was updated successfully, but these errors were encountered: