We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
application/ld+json.GetLexicon()
1 parent 33dc0d8 commit 5eff6a1Copy full SHA for 5eff6a1
Types/JsonLD/GetLexicon.ps1
@@ -0,0 +1,32 @@
1
+
2
+param($graph = $this)
3
4
+$jsonSchema = $this.GetJsonSchema($graph)
5
+if (-not $jsonSchema.'$id') {
6
+ throw "Missing $jsonSchema.$id"
7
+ return
8
+}
9
10
+$domain, $relativePath = $jsonSchema.'$id' -replace '^$' -split '/'
11
+if (-not $domain) { return}
12
+if (-not $relativePath ) { return }
13
+$domain = @($domain -split '\.')
14
+[Array]::Reverse($domain)
15
+$nsid = $domain, $relativePath -join '.'
16
17
18
+$jsonSchema.psobject.properties.Remove('$id')
19
20
+[Ordered]@{
21
+ lexicon = 1
22
+ id = $nsid
23
+ defs = [Ordered]@{
24
+ main = [Ordered]@{
25
+ type = 'record'
26
+ description = $jsonSchema.description
27
+ record = $jsonSchema
28
+ }
29
30
31
32
0 commit comments