{
"definitions": {
"Student": {
"description": "A simple student struct",
"type": "struct",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"age": {
"type": "integer"
}
}
}
},
"root": "Student"
}
Imports System.Text.Json.Serialization
' A simple student struct
Public Class Student
<JsonPropertyName("firstName")>
Public Property FirstName As String
<JsonPropertyName("lastName")>
Public Property LastName As String
<JsonPropertyName("age")>
Public Property Age As Integer
End Class
{
"definitions": {
"Human": {
"type": "struct",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"age": {
"type": "integer"
}
}
},
"Student": {
"parent": {
"type": "reference",
"target": "Human"
},
"type": "struct",
"properties": {
"studentId": {
"type": "string"
}
}
}
},
"root": "Student"
}
Imports System.Text.Json.Serialization
Public Class Human
<JsonPropertyName("firstName")>
Public Property FirstName As String
<JsonPropertyName("lastName")>
Public Property LastName As String
<JsonPropertyName("age")>
Public Property Age As Integer
End Class
Imports System.Text.Json.Serialization
Public Class Student
Inherits Human
<JsonPropertyName("studentId")>
Public Property StudentId As String
End Class
{
"definitions": {
"Student": {
"description": "A student struct with an assigned faculty",
"type": "struct",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"age": {
"type": "integer"
},
"faculty": {
"type": "reference",
"target": "Faculty"
}
}
},
"Faculty": {
"type": "struct",
"properties": {
"name": {
"type": "string"
}
}
}
},
"root": "Student"
}
Imports System.Text.Json.Serialization
' A student struct with an assigned faculty
Public Class Student
<JsonPropertyName("firstName")>
Public Property FirstName As String
<JsonPropertyName("lastName")>
Public Property LastName As String
<JsonPropertyName("age")>
Public Property Age As Integer
<JsonPropertyName("faculty")>
Public Property Faculty As Faculty
End Class
Imports System.Text.Json.Serialization
Public Class Faculty
<JsonPropertyName("name")>
Public Property Name As String
End Class
{
"definitions": {
"Student": {
"type": "struct",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"age": {
"type": "integer"
},
"properties": {
"type": "map",
"schema": {
"type": "string"
}
}
}
}
},
"root": "Student"
}
Imports System.Text.Json.Serialization
Public Class Student
<JsonPropertyName("firstName")>
Public Property FirstName As String
<JsonPropertyName("lastName")>
Public Property LastName As String
<JsonPropertyName("age")>
Public Property Age As Integer
<JsonPropertyName("properties")>
Public Property Properties As Dictionary(Of String, String)
End Class
{
"definitions": {
"Human": {
"type": "struct",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"location": {
"type": "reference",
"target": "Location"
}
}
},
"Location": {
"type": "struct",
"base": true,
"properties": {
"type": {
"type": "string"
}
},
"discriminator": "type",
"mapping": {
"Web": "web",
"World": "world"
}
},
"Web": {
"parent": {
"type": "reference",
"target": "Location"
},
"type": "struct",
"properties": {
"url": {
"type": "string"
}
}
},
"World": {
"parent": {
"type": "reference",
"target": "Location"
},
"type": "struct",
"properties": {
"lat": {
"type": "string"
},
"long": {
"type": "string"
}
}
}
},
"root": "Human"
}
Imports System.Text.Json.Serialization
Public Class Human
<JsonPropertyName("firstName")>
Public Property FirstName As String
<JsonPropertyName("lastName")>
Public Property LastName As String
<JsonPropertyName("location")>
Public Property Location As Location
End Class
Imports System.Text.Json.Serialization
Public Class Location
<JsonPropertyName("type")>
Public Property Type As String
End Class
Imports System.Text.Json.Serialization
Public Class Web
Inherits Location
<JsonPropertyName("url")>
Public Property Url As String
End Class
Imports System.Text.Json.Serialization
Public Class World
Inherits Location
<JsonPropertyName("lat")>
Public Property Lat As String
<JsonPropertyName("long")>
Public Property _Long As String
End Class
{
"definitions": {
"Student": {
"type": "object",
"properties": {
"matricleNumber": {
"type": "integer"
}
}
},
"StudentMap": {
"type": "struct",
"parent": {
"type": "reference",
"target": "Map",
"template": {
"T": "Student"
}
}
},
"Map": {
"type": "object",
"properties": {
"totalResults": {
"type": "integer"
},
"entries": {
"type": "array",
"schema": {
"type": "generic",
"name": "T"
}
}
}
}
},
"root": "StudentMap"
}
Imports System.Text.Json.Serialization
Public Class Student
<JsonPropertyName("matricleNumber")>
Public Property MatricleNumber As Integer
End Class
Imports System.Text.Json.Serialization
Public Class Map(Of T)
<JsonPropertyName("totalResults")>
Public Property TotalResults As Integer
<JsonPropertyName("entries")>
Public Property Entries As T()
End Class
Imports System.Text.Json.Serialization
Public Class StudentMap
Inherits Map(Of Student)
End Class
{
"import": {
"my_ns": "file:///generic.json"
},
"definitions": {
"Faculty": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"students": {
"type": "array",
"schema": {
"type": "reference",
"target": "my_ns:StudentMap"
}
}
}
}
},
"root": "Faculty"
}
Imports System.Text.Json.Serialization
Public Class Faculty
<JsonPropertyName("description")>
Public Property Description As String
<JsonPropertyName("students")>
Public Property Students As StudentMap()
End Class