diff --git a/modules/api/src/main/scala/vinyldns/api/domain/zone/ZoneService.scala b/modules/api/src/main/scala/vinyldns/api/domain/zone/ZoneService.scala index 3877a530b..50854bb0f 100644 --- a/modules/api/src/main/scala/vinyldns/api/domain/zone/ZoneService.scala +++ b/modules/api/src/main/scala/vinyldns/api/domain/zone/ZoneService.scala @@ -214,12 +214,15 @@ class ZoneService( responseMessage: String = Source.fromInputStream(inputStream, "UTF-8").mkString _ <- isValidGenerateZoneConn(responseCode, responseMessage).toResult + // Parse response + responseJson = parse(responseMessage) + // Create response object zoneGenerateResponse = ZoneGenerationResponse( provider = request.provider, responseCode = responseCode, status = dnsConnResponse.getResponseMessage, - message = responseMessage + message = responseJson ) // Save to repository diff --git a/modules/core/src/main/scala/vinyldns/core/domain/zone/Zone.scala b/modules/core/src/main/scala/vinyldns/core/domain/zone/Zone.scala index 9cb33f9eb..34de13292 100644 --- a/modules/core/src/main/scala/vinyldns/core/domain/zone/Zone.scala +++ b/modules/core/src/main/scala/vinyldns/core/domain/zone/Zone.scala @@ -249,7 +249,7 @@ case class ZoneGenerationResponse( provider: String, responseCode: Int, status: String, - message: String + message: JValue ) case class ZoneGenerationInput( diff --git a/modules/core/src/main/scala/vinyldns/core/protobuf/ProtobufConversions.scala b/modules/core/src/main/scala/vinyldns/core/protobuf/ProtobufConversions.scala index 7e5975f41..7facfa3b5 100644 --- a/modules/core/src/main/scala/vinyldns/core/protobuf/ProtobufConversions.scala +++ b/modules/core/src/main/scala/vinyldns/core/protobuf/ProtobufConversions.scala @@ -224,7 +224,7 @@ trait ProtobufConversions { zgr.getProvider, zgr.getResponseCode.toInt, zgr.getStatus, - zgr.getMessage + parse(zgr.getMessage) ) def fromPB(rd: VinylDNSProto.RecordData, rt: RecordType): RecordData = @@ -533,7 +533,7 @@ trait ProtobufConversions { .setProvider(zgr.provider) .setResponseCode(zgr.responseCode.toLong) .setStatus(zgr.status) - .setMessage(zgr.message) + .setMessage(compact(render(zgr.message))) .build() def fromPB(data: VinylDNSProto.User): User =