I was looking for a similar thing, but how to use the JSON PATH output data from SQL Server in an application. In this case, in Node.JS (although this concept would be adaptable to other languages). Here's a sample of what I came up with:
var {recordset} = await new sql.Request(primary.dbPool)
.input('primaryID', sql.UniqueIdentifier, primaryID)
.query(`SELECT (
SELECT MainTable.*,
(
SELECT SubTable.*
FROM dbo.SubTable AS SubTable WHERE MainTable.Main_RecordID = SubTable.SubTable_Main_RecordID
FOR JSON PATH
) AS [subItems]
FROM dbo.MainTable AS MainTable
WHERE primaryID = @primaryID
FOR JSON PATH, ROOT('mainItems')
) AS jsonResult;`)
let mainItems = JSON.parse(recordset[0].jsonResult).mainItems
console.log(mainItems)
This avoids it being returned as a long string in a UUID field like: 
And is instead something you can use in the application.
FOR JSON AUTOonly applies to SQL Server 2016+