mirror of
https://github.com/VinylDNS/vinyldns
synced 2025-08-31 06:15:49 +00:00
convert response message from json string to json
This commit is contained in:
@@ -214,12 +214,15 @@ class ZoneService(
|
|||||||
responseMessage: String = Source.fromInputStream(inputStream, "UTF-8").mkString
|
responseMessage: String = Source.fromInputStream(inputStream, "UTF-8").mkString
|
||||||
_ <- isValidGenerateZoneConn(responseCode, responseMessage).toResult
|
_ <- isValidGenerateZoneConn(responseCode, responseMessage).toResult
|
||||||
|
|
||||||
|
// Parse response
|
||||||
|
responseJson = parse(responseMessage)
|
||||||
|
|
||||||
// Create response object
|
// Create response object
|
||||||
zoneGenerateResponse = ZoneGenerationResponse(
|
zoneGenerateResponse = ZoneGenerationResponse(
|
||||||
provider = request.provider,
|
provider = request.provider,
|
||||||
responseCode = responseCode,
|
responseCode = responseCode,
|
||||||
status = dnsConnResponse.getResponseMessage,
|
status = dnsConnResponse.getResponseMessage,
|
||||||
message = responseMessage
|
message = responseJson
|
||||||
)
|
)
|
||||||
|
|
||||||
// Save to repository
|
// Save to repository
|
||||||
|
@@ -249,7 +249,7 @@ case class ZoneGenerationResponse(
|
|||||||
provider: String,
|
provider: String,
|
||||||
responseCode: Int,
|
responseCode: Int,
|
||||||
status: String,
|
status: String,
|
||||||
message: String
|
message: JValue
|
||||||
)
|
)
|
||||||
|
|
||||||
case class ZoneGenerationInput(
|
case class ZoneGenerationInput(
|
||||||
|
@@ -224,7 +224,7 @@ trait ProtobufConversions {
|
|||||||
zgr.getProvider,
|
zgr.getProvider,
|
||||||
zgr.getResponseCode.toInt,
|
zgr.getResponseCode.toInt,
|
||||||
zgr.getStatus,
|
zgr.getStatus,
|
||||||
zgr.getMessage
|
parse(zgr.getMessage)
|
||||||
)
|
)
|
||||||
|
|
||||||
def fromPB(rd: VinylDNSProto.RecordData, rt: RecordType): RecordData =
|
def fromPB(rd: VinylDNSProto.RecordData, rt: RecordType): RecordData =
|
||||||
@@ -533,7 +533,7 @@ trait ProtobufConversions {
|
|||||||
.setProvider(zgr.provider)
|
.setProvider(zgr.provider)
|
||||||
.setResponseCode(zgr.responseCode.toLong)
|
.setResponseCode(zgr.responseCode.toLong)
|
||||||
.setStatus(zgr.status)
|
.setStatus(zgr.status)
|
||||||
.setMessage(zgr.message)
|
.setMessage(compact(render(zgr.message)))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
def fromPB(data: VinylDNSProto.User): User =
|
def fromPB(data: VinylDNSProto.User): User =
|
||||||
|
Reference in New Issue
Block a user