File tree 2 files changed +10
-7
lines changed
2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -45,18 +45,20 @@ application/ld\+json # The type that indicates linked d
45
45
ConvertFrom-Json
46
46
) {
47
47
if ($jsonObject .' @type' ) {
48
- $schemaType = $jsonObject .' @context' , $jsonObject .' @type' -join ' /'
48
+ $schemaType = $jsonObject .' @context' , $jsonObject .' @type' -ne ' ' - join ' /'
49
49
$jsonObject.pstypenames.insert (0 , $schemaType )
50
- }
51
-
52
- if ($jsonObject .' @graph' ) {
50
+ $jsonObject
51
+ } elseif ($jsonObject .' @graph' ) {
53
52
foreach ($graphObject in $jsonObject .' @graph' ) {
54
- if ($graphObject .' @type' ) {
53
+ if ($graphObject .' @type' ) {
55
54
$graphObject.pstypenames.insert (0 , $graphObject .' @type' )
56
55
}
57
- }
56
+ $graphObject
57
+ }
58
+ } else {
59
+ $jsonObject
58
60
}
59
- $jsonObject
61
+
60
62
}
61
63
}
62
64
}
Original file line number Diff line number Diff line change 1
1
# JSON-LD
2
+
2
3
Get JSON Linked Data with PowerShell
You can’t perform that action at this time.
0 commit comments