Skip to content

Commit

Permalink
fix(md): serialize instants (#1057)
Browse files Browse the repository at this point in the history
  • Loading branch information
emjburns authored Feb 13, 2020
1 parent 950920e commit 4df4af3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.netflix.spinnaker.gate.model.manageddelivery;

import java.time.Instant;
import java.util.Map;
import lombok.Data;

Expand All @@ -27,9 +26,9 @@ public class ConstraintState {
String artifactVersion;
String type;
String status;
Instant createdAt;
String createdAt;
String judgedBy;
Instant judgedAt;
String judgedAt;
String comment;
Map<String, Object> attributes;
}
1 change: 1 addition & 0 deletions gate-web/gate-web.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies {
implementation "com.squareup.retrofit:retrofit"
implementation "com.squareup.retrofit:converter-jackson"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"

implementation "com.squareup.okhttp:okhttp"
implementation "com.squareup.okhttp:okhttp-urlconnection"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package com.netflix.spinnaker.gate.config
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.dataformat.yaml.YAMLMapper
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
import com.jakewharton.retrofit.Ok3Client
import com.netflix.hystrix.strategy.concurrency.HystrixRequestContext
import com.netflix.spectator.api.Registry
Expand Down Expand Up @@ -153,6 +154,7 @@ class GateConfig extends RedisHttpSessionConfiguration {
ObjectMapper objectMapper = new ObjectMapper()
.enable(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL)
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.registerModule(new JavaTimeModule())

return new JsonHttpMessageConverter(objectMapper)
}
Expand Down Expand Up @@ -226,7 +228,7 @@ class GateConfig extends RedisHttpSessionConfiguration {
}

return new ClouddriverServiceSelector(
new SelectableService(selectors + defaultSelector), dynamicConfigService, contextProvider)
new SelectableService(selectors + defaultSelector), dynamicConfigService, contextProvider)
}

SelectableService selectableService = createClientSelector("clouddriver", ClouddriverService, okHttpClient)
Expand Down Expand Up @@ -315,6 +317,7 @@ class GateConfig extends RedisHttpSessionConfiguration {
ObjectMapper objectMapper = new ObjectMapper()
.enable(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL)
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.registerModule(new JavaTimeModule())

new RestAdapter.Builder()
.setRequestInterceptor(spinnakerRequestInterceptor)
Expand Down

0 comments on commit 4df4af3

Please sign in to comment.