{
"definitions": {
"Student": {
"description": "A simple student struct",
"type": "struct",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"age": {
"type": "integer"
}
}
}
},
"root": "Student"
}package org.typeschema.dto;
import com.fasterxml.jackson.annotation.*;
@JsonClassDescription("A simple student struct")
public class Student {
@JsonProperty("firstName")
private String firstName;
@JsonProperty("lastName")
private String lastName;
@JsonProperty("age")
private Integer age;
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getFirstName() {
return this.firstName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getLastName() {
return this.lastName;
}
public void setAge(Integer age) {
this.age = age;
}
public Integer getAge() {
return this.age;
}
}
{
"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"
}package org.typeschema.dto;
import com.fasterxml.jackson.annotation.*;
public class Human {
@JsonProperty("firstName")
private String firstName;
@JsonProperty("lastName")
private String lastName;
@JsonProperty("age")
private Integer age;
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getFirstName() {
return this.firstName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getLastName() {
return this.lastName;
}
public void setAge(Integer age) {
this.age = age;
}
public Integer getAge() {
return this.age;
}
}
package org.typeschema.dto;
import com.fasterxml.jackson.annotation.*;
public class Student extends Human {
@JsonProperty("studentId")
private String studentId;
public void setStudentId(String studentId) {
this.studentId = studentId;
}
public String getStudentId() {
return this.studentId;
}
}
{
"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"
}package org.typeschema.dto;
import com.fasterxml.jackson.annotation.*;
@JsonClassDescription("A student struct with an assigned faculty")
public class Student {
@JsonProperty("firstName")
private String firstName;
@JsonProperty("lastName")
private String lastName;
@JsonProperty("age")
private Integer age;
@JsonProperty("faculty")
private Faculty faculty;
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getFirstName() {
return this.firstName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getLastName() {
return this.lastName;
}
public void setAge(Integer age) {
this.age = age;
}
public Integer getAge() {
return this.age;
}
public void setFaculty(Faculty faculty) {
this.faculty = faculty;
}
public Faculty getFaculty() {
return this.faculty;
}
}
package org.typeschema.dto;
import com.fasterxml.jackson.annotation.*;
public class Faculty {
@JsonProperty("name")
private String name;
public void setName(String name) {
this.name = name;
}
public String getName() {
return this.name;
}
}
{
"definitions": {
"Student": {
"type": "struct",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"age": {
"type": "integer"
},
"properties": {
"type": "map",
"schema": {
"type": "string"
}
}
}
}
},
"root": "Student"
}package org.typeschema.dto;
import com.fasterxml.jackson.annotation.*;
public class Student {
@JsonProperty("firstName")
private String firstName;
@JsonProperty("lastName")
private String lastName;
@JsonProperty("age")
private Integer age;
@JsonProperty("properties")
private java.util.Map<String, String> properties;
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getFirstName() {
return this.firstName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getLastName() {
return this.lastName;
}
public void setAge(Integer age) {
this.age = age;
}
public Integer getAge() {
return this.age;
}
public void setProperties(java.util.Map<String, String> properties) {
this.properties = properties;
}
public java.util.Map<String, String> getProperties() {
return this.properties;
}
}
{
"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"
}package org.typeschema.dto;
import com.fasterxml.jackson.annotation.*;
public class Human {
@JsonProperty("firstName")
private String firstName;
@JsonProperty("lastName")
private String lastName;
@JsonProperty("location")
private Location location;
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getFirstName() {
return this.firstName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getLastName() {
return this.lastName;
}
public void setLocation(Location location) {
this.location = location;
}
public Location getLocation() {
return this.location;
}
}
package org.typeschema.dto;
import com.fasterxml.jackson.annotation.*;
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
@JsonSubTypes({
@JsonSubTypes.Type(value = Web.class, name = "web"),
@JsonSubTypes.Type(value = World.class, name = "world"),
})
public abstract class Location {
@JsonProperty("type")
private String type;
public void setType(String type) {
this.type = type;
}
public String getType() {
return this.type;
}
}
package org.typeschema.dto;
import com.fasterxml.jackson.annotation.*;
public class Web extends Location {
@JsonProperty("url")
private String url;
public void setUrl(String url) {
this.url = url;
}
public String getUrl() {
return this.url;
}
}
package org.typeschema.dto;
import com.fasterxml.jackson.annotation.*;
public class World extends Location {
@JsonProperty("lat")
private String lat;
@JsonProperty("long")
private String _long;
public void setLat(String lat) {
this.lat = lat;
}
public String getLat() {
return this.lat;
}
public void setLong(String _long) {
this._long = _long;
}
public String getLong() {
return this._long;
}
}
{
"definitions": {
"Student": {
"type": "struct",
"properties": {
"matricleNumber": {
"type": "integer"
}
}
},
"StudentMap": {
"type": "struct",
"parent": {
"type": "reference",
"target": "Map",
"template": {
"T": "Student"
}
}
},
"Map": {
"type": "struct",
"properties": {
"totalResults": {
"type": "integer"
},
"entries": {
"type": "array",
"schema": {
"type": "generic",
"name": "T"
}
}
}
}
},
"root": "StudentMap"
}package org.typeschema.dto;
import com.fasterxml.jackson.annotation.*;
public class Student {
@JsonProperty("matricleNumber")
private Integer matricleNumber;
public void setMatricleNumber(Integer matricleNumber) {
this.matricleNumber = matricleNumber;
}
public Integer getMatricleNumber() {
return this.matricleNumber;
}
}
package org.typeschema.dto;
import com.fasterxml.jackson.annotation.*;
public class Map<T> {
@JsonProperty("totalResults")
private Integer totalResults;
@JsonProperty("entries")
private java.util.List<T> entries;
public void setTotalResults(Integer totalResults) {
this.totalResults = totalResults;
}
public Integer getTotalResults() {
return this.totalResults;
}
public void setEntries(java.util.List<T> entries) {
this.entries = entries;
}
public java.util.List<T> getEntries() {
return this.entries;
}
}
package org.typeschema.dto;
import com.fasterxml.jackson.annotation.*;
public class StudentMap extends Map<Student> {
}
{
"import": {
"my_ns": "file:///generic.json"
},
"definitions": {
"Faculty": {
"type": "struct",
"properties": {
"description": {
"type": "string"
},
"students": {
"type": "array",
"schema": {
"type": "reference",
"target": "my_ns:StudentMap"
}
}
}
}
},
"root": "Faculty"
}package org.typeschema.dto;
import com.fasterxml.jackson.annotation.*;
public class Faculty {
@JsonProperty("description")
private String description;
@JsonProperty("students")
private java.util.List<StudentMap> students;
public void setDescription(String description) {
this.description = description;
}
public String getDescription() {
return this.description;
}
public void setStudents(java.util.List<StudentMap> students) {
this.students = students;
}
public java.util.List<StudentMap> getStudents() {
return this.students;
}
}