2
0
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:
nspadaccino
2025-05-21 16:51:05 -04:00
parent 9e859470b0
commit d7f9c3a456
3 changed files with 7 additions and 4 deletions

View File

@@ -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

View File

@@ -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(

View File

@@ -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 =