{
"definitions": {
"Student": {
"description": "A simple student struct",
"type": "struct",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"age": {
"type": "integer"
}
}
}
},
"root": "Student"
}
/**
* A simple student struct
*/
open class Student {
@JsonProperty("firstName") var firstName: String? = null
@JsonProperty("lastName") var lastName: String? = null
@JsonProperty("age") var age: Int? = null
}
{
"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"
}
open class Human {
@JsonProperty("firstName") var firstName: String? = null
@JsonProperty("lastName") var lastName: String? = null
@JsonProperty("age") var age: Int? = null
}
open class Student : Human {
@JsonProperty("studentId") var studentId: String? = null
}
{
"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"
}
/**
* A student struct with an assigned faculty
*/
open class Student {
@JsonProperty("firstName") var firstName: String? = null
@JsonProperty("lastName") var lastName: String? = null
@JsonProperty("age") var age: Int? = null
@JsonProperty("faculty") var faculty: Faculty? = null
}
open class Faculty {
@JsonProperty("name") var name: String? = null
}
{
"definitions": {
"Student": {
"type": "struct",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"age": {
"type": "integer"
},
"properties": {
"type": "map",
"schema": {
"type": "string"
}
}
}
}
},
"root": "Student"
}
open class Student {
@JsonProperty("firstName") var firstName: String? = null
@JsonProperty("lastName") var lastName: String? = null
@JsonProperty("age") var age: Int? = null
@JsonProperty("properties") var properties: Map<String, String>? = null
}
{
"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"
}
open class Human {
@JsonProperty("firstName") var firstName: String? = null
@JsonProperty("lastName") var lastName: String? = null
@JsonProperty("location") var location: Location? = null
}
open abstract class Location {
@JsonProperty("type") var type: String? = null
}
open class Web : Location {
@JsonProperty("url") var url: String? = null
}
open class World : Location {
@JsonProperty("lat") var lat: String? = null
@JsonProperty("long") var long: String? = null
}
{
"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"
}
open class Student {
@JsonProperty("matricleNumber") var matricleNumber: Int? = null
}
open class Map<T> {
@JsonProperty("totalResults") var totalResults: Int? = null
@JsonProperty("entries") var entries: Array<T>? = null
}
open class StudentMap : Map<Student> {
}
{
"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"
}
open class Faculty {
@JsonProperty("description") var description: String? = null
@JsonProperty("students") var students: Array<StudentMap>? = null
}