From 639ea6747bd095fc82a83b2cb98f0267be9231bc Mon Sep 17 00:00:00 2001 From: Jonathan Casey Date: Tue, 7 Nov 2023 16:48:59 +0000 Subject: [PATCH] test(*): snapshot update Signed-off-by: Jonathan Casey --- test/codegen/__snapshots__/codegen.js.snap | 510 ++++++++++----------- 1 file changed, 252 insertions(+), 258 deletions(-) diff --git a/test/codegen/__snapshots__/codegen.js.snap b/test/codegen/__snapshots__/codegen.js.snap index f298c431..26d45a87 100644 --- a/test/codegen/__snapshots__/codegen.js.snap +++ b/test/codegen/__snapshots__/codegen.js.snap @@ -6,7 +6,7 @@ exports[`codegen #formats check we can convert all formats from namespace unvers "value": "@namespace("concerto@1.0.0") protocol MyProtocol { - + record Concept { } @@ -39,7 +39,7 @@ exports[`codegen #formats check we can convert all formats from namespace unvers "value": "@namespace("concerto") protocol MyProtocol { - + record Concept { } @@ -69,7 +69,7 @@ exports[`codegen #formats check we can convert all formats from namespace unvers protocol MyProtocol { import idl "concerto@1.0.0.avdl"; - + enum State { MA, NY, @@ -106,7 +106,7 @@ protocol MyProtocol { import idl "org.acme.hr.base.avdl"; import idl "concerto@1.0.0.avdl"; - + record Company { string name; Address headquarters; @@ -494,7 +494,7 @@ exports[`codegen #formats check we can convert all formats from namespace unvers "value": "// Package concerto_1_0_0 contains domain objects and was generated from Concerto namespace concerto@1.0.0. package concerto_1_0_0 import "time" - + type Concept struct { } type Asset struct { @@ -522,7 +522,7 @@ exports[`codegen #formats check we can convert all formats from namespace unvers "key": "concerto.go", "value": "// Package concerto contains domain objects and was generated from Concerto namespace concerto. package concerto - + type Concept struct { } type Asset struct { @@ -549,7 +549,7 @@ exports[`codegen #formats check we can convert all formats from namespace unvers "value": "// Package org_acme_hr_base contains domain objects and was generated from Concerto namespace org.acme.hr.base. package org_acme_hr_base import "concerto_1_0_0"; - + type State int const ( MA State = 1 + iota @@ -572,12 +572,6 @@ type Address struct { State State \`json:"state"\` ZipCode string \`json:"zipCode"\` Country string \`json:"country"\` - dictionary1 := make(map[string]string) - dictionary2 := make(map[string]time.Time) - dictionary3 := make(map[string]SSN) - dictionary4 := make(map[string]Concept) - dictionary5 := make(map[SSN]string) - dictionary6 := make(map[SSN]Employee) } ", } @@ -591,16 +585,16 @@ package org_acme_hr import "time" import "org_acme_hr_base"; import "concerto_1_0_0"; - + type Company struct { concerto_1_0_0.Concept Name string \`json:"name"\` Headquarters Address \`json:"headquarters"\` - CompanyProperties CompanyProperties \`json:"companyProperties"\` - EmployeeDirectory EmployeeDirectory \`json:"employeeDirectory"\` - EmployeeTShirtSizes EmployeeTShirtSizes \`json:"employeeTShirtSizes"\` - EmployeeProfiles EmployeeProfiles \`json:"employeeProfiles"\` - EmployeeSocialSecurityNumbers EmployeeSocialSecurityNumbers \`json:"employeeSocialSecurityNumbers"\` + companyProperties := make(map[string]string) + employeeDirectory := make(map[SSN]Employee) + employeeTShirtSizes := make(map[SSN]TShirtSizeType) + employeeProfiles := make(map[string]Concept) + employeeSocialSecurityNumbers := make(map[string]SSN) } type Department int const ( @@ -634,7 +628,7 @@ type Person struct { Ssn string \`json:"ssn"\` Height float64 \`json:"height"\` Dob time.Time \`json:"dob"\` - NextOfKin NextOfKin \`json:"nextOfKin"\` + nextOfKin := make(map[KinName]KinTelephone) } type Employee struct { Person @@ -876,7 +870,7 @@ public abstract class Asset extends Concept { public void set$id(String i) { $id = i; } - + // the accessor for the identifying field public String getID() { return this.get$identifier(); @@ -915,7 +909,7 @@ public abstract class Participant extends Concept { public void set$id(String i) { $id = i; } - + // the accessor for the identifying field public String getID() { return this.get$identifier(); @@ -1172,7 +1166,7 @@ import com.fasterxml.jackson.annotation.*; @JsonIgnoreProperties({"id"}) @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "serialNumber") public abstract class Equipment extends Asset { - + // the accessor for the identifying field public String getID() { return this.getSerialNumber(); @@ -1227,7 +1221,7 @@ import com.fasterxml.jackson.annotation.*; @JsonIgnoreProperties({"id"}) @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "serialNumber") public class Laptop extends Equipment { - + // the accessor for the identifying field public String getID() { return this.getSerialNumber(); @@ -1268,7 +1262,7 @@ import com.fasterxml.jackson.annotation.*; @JsonIgnoreProperties({"id"}) @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "email") public abstract class Person extends Participant { - + // the accessor for the identifying field public String getID() { return this.getEmail(); @@ -1363,7 +1357,7 @@ import com.fasterxml.jackson.annotation.*; @JsonIgnoreProperties({"id"}) @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "email") public class Employee extends Person { - + // the accessor for the identifying field public String getID() { return this.getEmail(); @@ -1451,7 +1445,7 @@ import com.fasterxml.jackson.annotation.*; @JsonIgnoreProperties({"id"}) @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "email") public class Contractor extends Person { - + // the accessor for the identifying field public String getID() { return this.getEmail(); @@ -1497,7 +1491,7 @@ import com.fasterxml.jackson.annotation.*; @JsonIgnoreProperties({"id"}) @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "email") public class Manager extends Employee { - + // the accessor for the identifying field public String getID() { return this.getEmail(); @@ -3836,7 +3830,7 @@ exports[`codegen #formats check we can convert all formats from namespace unvers "key": "utils.rs", "value": "use chrono::{ DateTime, TimeZone, Utc }; use serde::{ Deserialize, Serialize, Deserializer, Serializer }; - + pub fn serialize_datetime_option(datetime: &Option>, serializer: S) -> Result where S: Serializer, @@ -3866,7 +3860,7 @@ where let datetime_str = String::deserialize(deserializer)?; Utc.datetime_from_str(&datetime_str, "%Y-%m-%dT%H:%M:%S%.3f%Z").map_err(serde::de::Error::custom) } - + pub fn serialize_datetime(datetime: &chrono::DateTime, serializer: S) -> Result where S: Serializer, @@ -3883,9 +3877,9 @@ exports[`codegen #formats check we can convert all formats from namespace unvers "key": "concerto_1_0_0.rs", "value": "use serde::{ Deserialize, Serialize }; use chrono::{ DateTime, TimeZone, Utc }; - + use crate::utils::*; - + #[derive(Debug, Serialize, Deserialize)] pub struct Concept { #[serde( @@ -3900,7 +3894,7 @@ pub struct Asset { rename = "$class", )] pub _class: String, - + #[serde( rename = "$identifier", )] @@ -3913,7 +3907,7 @@ pub struct Participant { rename = "$class", )] pub _class: String, - + #[serde( rename = "$identifier", )] @@ -3926,7 +3920,7 @@ pub struct Transaction { rename = "$class", )] pub _class: String, - + #[serde( rename = "$timestamp", serialize_with = "serialize_datetime", @@ -3941,7 +3935,7 @@ pub struct Event { rename = "$class", )] pub _class: String, - + #[serde( rename = "$timestamp", serialize_with = "serialize_datetime", @@ -3959,9 +3953,9 @@ exports[`codegen #formats check we can convert all formats from namespace unvers "key": "concerto.rs", "value": "use serde::{ Deserialize, Serialize }; use chrono::{ DateTime, TimeZone, Utc }; - + use crate::utils::*; - + #[derive(Debug, Serialize, Deserialize)] pub struct Concept { #[serde( @@ -3976,7 +3970,7 @@ pub struct Asset { rename = "$class", )] pub _class: String, - + #[serde( rename = "$identifier", )] @@ -3989,7 +3983,7 @@ pub struct Participant { rename = "$class", )] pub _class: String, - + #[serde( rename = "$identifier", )] @@ -4021,10 +4015,10 @@ exports[`codegen #formats check we can convert all formats from namespace unvers "key": "org_acme_hr_base.rs", "value": "use serde::{ Deserialize, Serialize }; use chrono::{ DateTime, TimeZone, Utc }; - + use crate::concerto_1_0_0::*; use crate::utils::*; - + #[derive(Debug, Serialize, Deserialize)] pub enum State { #[allow(non_camel_case_types)] @@ -4057,28 +4051,28 @@ pub struct Address { rename = "$class", )] pub _class: String, - + #[serde( rename = "street", )] pub street: String, - + #[serde( rename = "city", )] pub city: String, - + #[serde( rename = "state", skip_serializing_if = "Option::is_none", )] pub state: Option, - + #[serde( rename = "zipCode", )] pub zip_code: String, - + #[serde( rename = "country", )] @@ -4094,52 +4088,52 @@ exports[`codegen #formats check we can convert all formats from namespace unvers "key": "org_acme_hr.rs", "value": "use serde::{ Deserialize, Serialize }; use chrono::{ DateTime, TimeZone, Utc }; - + use crate::org_acme_hr_base::*; use crate::concerto_1_0_0::*; use crate::utils::*; - + #[derive(Debug, Serialize, Deserialize)] pub struct Company { #[serde( rename = "$class", )] pub _class: String, - + #[serde( rename = "name", )] pub name: String, - + #[serde( rename = "headquarters", )] pub headquarters: Address, - + #[serde( rename = "companyProperties", skip_serializing_if = "Option::is_none", )] pub company_properties: Option, - + #[serde( rename = "employeeDirectory", skip_serializing_if = "Option::is_none", )] pub employee_directory: Option, - + #[serde( rename = "employeeTShirtSizes", skip_serializing_if = "Option::is_none", )] pub employee_t_shirt_sizes: Option, - + #[serde( rename = "employeeProfiles", skip_serializing_if = "Option::is_none", )] pub employee_profiles: Option, - + #[serde( rename = "employeeSocialSecurityNumbers", skip_serializing_if = "Option::is_none", @@ -4169,12 +4163,12 @@ pub struct Equipment { rename = "$class", )] pub _class: String, - + #[serde( rename = "serialNumber", )] pub serial_number: String, - + #[serde( rename = "$identifier", )] @@ -4195,17 +4189,17 @@ pub struct Laptop { rename = "$class", )] pub _class: String, - + #[serde( rename = "make", )] pub make: LaptopMake, - + #[serde( rename = "serialNumber", )] pub serial_number: String, - + #[serde( rename = "$identifier", )] @@ -4218,55 +4212,55 @@ pub struct Person { rename = "$class", )] pub _class: String, - + #[serde( rename = "email", )] pub email: String, - + #[serde( rename = "firstName", )] pub first_name: String, - + #[serde( rename = "lastName", )] pub last_name: String, - + #[serde( rename = "middleNames", skip_serializing_if = "Option::is_none", )] pub middle_names: Option, - + #[serde( rename = "homeAddress", )] pub home_address: Address, - + #[serde( rename = "ssn", )] pub ssn: String, - + #[serde( rename = "height", )] pub height: f64, - + #[serde( rename = "dob", serialize_with = "serialize_datetime", deserialize_with = "deserialize_datetime", )] pub dob: DateTime, - + #[serde( rename = "nextOfKin", )] pub next_of_kin: NextOfKin, - + #[serde( rename = "$identifier", )] @@ -4279,93 +4273,93 @@ pub struct Employee { rename = "$class", )] pub _class: String, - + #[serde( rename = "employeeId", )] pub employee_id: String, - + #[serde( rename = "salary", )] pub salary: u64, - + #[serde( rename = "numDependents", )] pub num_dependents: Integer, - + #[serde( rename = "retired", )] pub retired: bool, - + #[serde( rename = "department", )] pub department: Department, - + #[serde( rename = "officeAddress", )] pub office_address: Address, - + #[serde( rename = "companyAssets", )] pub company_assets: Vec, - + #[serde(rename = "manager")] pub manager: Option, - + #[serde( rename = "email", )] pub email: String, - + #[serde( rename = "firstName", )] pub first_name: String, - + #[serde( rename = "lastName", )] pub last_name: String, - + #[serde( rename = "middleNames", skip_serializing_if = "Option::is_none", )] pub middle_names: Option, - + #[serde( rename = "homeAddress", )] pub home_address: Address, - + #[serde( rename = "ssn", )] pub ssn: String, - + #[serde( rename = "height", )] pub height: f64, - + #[serde( rename = "dob", serialize_with = "serialize_datetime", deserialize_with = "deserialize_datetime", )] pub dob: DateTime, - + #[serde( rename = "nextOfKin", )] pub next_of_kin: NextOfKin, - + #[serde( rename = "$identifier", )] @@ -4378,63 +4372,63 @@ pub struct Contractor { rename = "$class", )] pub _class: String, - + #[serde( rename = "company", )] pub company: Company, - + #[serde(rename = "manager")] pub manager: Option, - + #[serde( rename = "email", )] pub email: String, - + #[serde( rename = "firstName", )] pub first_name: String, - + #[serde( rename = "lastName", )] pub last_name: String, - + #[serde( rename = "middleNames", skip_serializing_if = "Option::is_none", )] pub middle_names: Option, - + #[serde( rename = "homeAddress", )] pub home_address: Address, - + #[serde( rename = "ssn", )] pub ssn: String, - + #[serde( rename = "height", )] pub height: f64, - + #[serde( rename = "dob", serialize_with = "serialize_datetime", deserialize_with = "deserialize_datetime", )] pub dob: DateTime, - + #[serde( rename = "nextOfKin", )] pub next_of_kin: NextOfKin, - + #[serde( rename = "$identifier", )] @@ -4447,96 +4441,96 @@ pub struct Manager { rename = "$class", )] pub _class: String, - + #[serde(rename = "reports")] pub reports: Option>, - + #[serde( rename = "employeeId", )] pub employee_id: String, - + #[serde( rename = "salary", )] pub salary: u64, - + #[serde( rename = "numDependents", )] pub num_dependents: Integer, - + #[serde( rename = "retired", )] pub retired: bool, - + #[serde( rename = "department", )] pub department: Department, - + #[serde( rename = "officeAddress", )] pub office_address: Address, - + #[serde( rename = "companyAssets", )] pub company_assets: Vec, - + #[serde(rename = "manager")] pub manager: Option, - + #[serde( rename = "email", )] pub email: String, - + #[serde( rename = "firstName", )] pub first_name: String, - + #[serde( rename = "lastName", )] pub last_name: String, - + #[serde( rename = "middleNames", skip_serializing_if = "Option::is_none", )] pub middle_names: Option, - + #[serde( rename = "homeAddress", )] pub home_address: Address, - + #[serde( rename = "ssn", )] pub ssn: String, - + #[serde( rename = "height", )] pub height: f64, - + #[serde( rename = "dob", serialize_with = "serialize_datetime", deserialize_with = "deserialize_datetime", )] pub dob: DateTime, - + #[serde( rename = "nextOfKin", )] pub next_of_kin: NextOfKin, - + #[serde( rename = "$identifier", )] @@ -4549,7 +4543,7 @@ pub struct CompanyEvent { rename = "$class", )] pub _class: String, - + #[serde( rename = "$timestamp", serialize_with = "serialize_datetime", @@ -4564,10 +4558,10 @@ pub struct Onboarded { rename = "$class", )] pub _class: String, - + #[serde(rename = "employee")] pub employee: Employee, - + #[serde( rename = "$timestamp", serialize_with = "serialize_datetime", @@ -4582,15 +4576,15 @@ pub struct ChangeOfAddress { rename = "$class", )] pub _class: String, - + #[serde(rename = "Person")] pub person: Person, - + #[serde( rename = "newAddress", )] pub new_address: Address, - + #[serde( rename = "$timestamp", serialize_with = "serialize_datetime", @@ -4648,7 +4642,7 @@ export interface IConcept { $class: string; } -export type ConceptUnion = IAddress | +export type ConceptUnion = IAddress | ICompany; export interface IAsset extends IConcept { @@ -4826,7 +4820,7 @@ export interface IPerson extends IParticipant { nextOfKin: NextOfKin; } -export type PersonUnion = IEmployee | +export type PersonUnion = IEmployee | IContractor; export interface IEmployee extends IPerson { @@ -4982,7 +4976,7 @@ exports[`codegen #formats check we can convert all formats from namespace unvers { "key": "concerto@1.0.0.xsd", "value": " - @@ -5038,7 +5032,7 @@ exports[`codegen #formats check we can convert all formats from namespace unvers { "key": "concerto.xsd", "value": " - @@ -5092,7 +5086,7 @@ exports[`codegen #formats check we can convert all formats from namespace unvers { "key": "org.acme.hr.base.xsd", "value": " - @@ -5138,7 +5132,7 @@ exports[`codegen #formats check we can convert all formats from namespace unvers { "key": "org.acme.hr.xsd", "value": " - @@ -5564,7 +5558,7 @@ exports[`codegen #formats check we can convert all formats from namespace versio "value": "@namespace("concerto@1.0.0") protocol MyProtocol { - + record Concept { } @@ -5597,7 +5591,7 @@ exports[`codegen #formats check we can convert all formats from namespace versio "value": "@namespace("concerto") protocol MyProtocol { - + record Concept { } @@ -5627,7 +5621,7 @@ exports[`codegen #formats check we can convert all formats from namespace versio protocol MyProtocol { import idl "concerto@1.0.0.avdl"; - + enum State { MA, NY, @@ -5664,7 +5658,7 @@ protocol MyProtocol { import idl "org.acme.hr.base@1.0.0.avdl"; import idl "concerto@1.0.0.avdl"; - + record Company { string name; Address headquarters; @@ -6052,7 +6046,7 @@ exports[`codegen #formats check we can convert all formats from namespace versio "value": "// Package concerto_1_0_0 contains domain objects and was generated from Concerto namespace concerto@1.0.0. package concerto_1_0_0 import "time" - + type Concept struct { } type Asset struct { @@ -6080,7 +6074,7 @@ exports[`codegen #formats check we can convert all formats from namespace versio "key": "concerto.go", "value": "// Package concerto contains domain objects and was generated from Concerto namespace concerto. package concerto - + type Concept struct { } type Asset struct { @@ -6107,7 +6101,7 @@ exports[`codegen #formats check we can convert all formats from namespace versio "value": "// Package org_acme_hr_base_1_0_0 contains domain objects and was generated from Concerto namespace org.acme.hr.base@1.0.0. package org_acme_hr_base_1_0_0 import "concerto_1_0_0"; - + type State int const ( MA State = 1 + iota @@ -6143,16 +6137,16 @@ package org_acme_hr_1_0_0 import "time" import "org_acme_hr_base_1_0_0"; import "concerto_1_0_0"; - + type Company struct { concerto_1_0_0.Concept Name string \`json:"name"\` Headquarters Address \`json:"headquarters"\` - CompanyProperties CompanyProperties \`json:"companyProperties"\` - EmployeeDirectory EmployeeDirectory \`json:"employeeDirectory"\` - EmployeeTShirtSizes EmployeeTShirtSizes \`json:"employeeTShirtSizes"\` - EmployeeProfiles EmployeeProfiles \`json:"employeeProfiles"\` - EmployeeSocialSecurityNumbers EmployeeSocialSecurityNumbers \`json:"employeeSocialSecurityNumbers"\` + companyProperties := make(map[string]string) + employeeDirectory := make(map[SSN]Employee) + employeeTShirtSizes := make(map[SSN]TShirtSizeType) + employeeProfiles := make(map[string]Concept) + employeeSocialSecurityNumbers := make(map[string]SSN) } type Department int const ( @@ -6186,7 +6180,7 @@ type Person struct { Ssn string \`json:"ssn"\` Height float64 \`json:"height"\` Dob time.Time \`json:"dob"\` - NextOfKin NextOfKin \`json:"nextOfKin"\` + nextOfKin := make(map[KinName]KinTelephone) } type Employee struct { Person @@ -6428,7 +6422,7 @@ public abstract class Asset extends Concept { public void set$id(String i) { $id = i; } - + // the accessor for the identifying field public String getID() { return this.get$identifier(); @@ -6467,7 +6461,7 @@ public abstract class Participant extends Concept { public void set$id(String i) { $id = i; } - + // the accessor for the identifying field public String getID() { return this.get$identifier(); @@ -6724,7 +6718,7 @@ import com.fasterxml.jackson.annotation.*; @JsonIgnoreProperties({"id"}) @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "serialNumber") public abstract class Equipment extends Asset { - + // the accessor for the identifying field public String getID() { return this.getSerialNumber(); @@ -6779,7 +6773,7 @@ import com.fasterxml.jackson.annotation.*; @JsonIgnoreProperties({"id"}) @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "serialNumber") public class Laptop extends Equipment { - + // the accessor for the identifying field public String getID() { return this.getSerialNumber(); @@ -6820,7 +6814,7 @@ import com.fasterxml.jackson.annotation.*; @JsonIgnoreProperties({"id"}) @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "email") public abstract class Person extends Participant { - + // the accessor for the identifying field public String getID() { return this.getEmail(); @@ -6915,7 +6909,7 @@ import com.fasterxml.jackson.annotation.*; @JsonIgnoreProperties({"id"}) @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "email") public class Employee extends Person { - + // the accessor for the identifying field public String getID() { return this.getEmail(); @@ -7003,7 +6997,7 @@ import com.fasterxml.jackson.annotation.*; @JsonIgnoreProperties({"id"}) @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "email") public class Contractor extends Person { - + // the accessor for the identifying field public String getID() { return this.getEmail(); @@ -7049,7 +7043,7 @@ import com.fasterxml.jackson.annotation.*; @JsonIgnoreProperties({"id"}) @JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "email") public class Manager extends Employee { - + // the accessor for the identifying field public String getID() { return this.getEmail(); @@ -9420,7 +9414,7 @@ exports[`codegen #formats check we can convert all formats from namespace versio "key": "utils.rs", "value": "use chrono::{ DateTime, TimeZone, Utc }; use serde::{ Deserialize, Serialize, Deserializer, Serializer }; - + pub fn serialize_datetime_option(datetime: &Option>, serializer: S) -> Result where S: Serializer, @@ -9450,7 +9444,7 @@ where let datetime_str = String::deserialize(deserializer)?; Utc.datetime_from_str(&datetime_str, "%Y-%m-%dT%H:%M:%S%.3f%Z").map_err(serde::de::Error::custom) } - + pub fn serialize_datetime(datetime: &chrono::DateTime, serializer: S) -> Result where S: Serializer, @@ -9467,9 +9461,9 @@ exports[`codegen #formats check we can convert all formats from namespace versio "key": "concerto_1_0_0.rs", "value": "use serde::{ Deserialize, Serialize }; use chrono::{ DateTime, TimeZone, Utc }; - + use crate::utils::*; - + #[derive(Debug, Serialize, Deserialize)] pub struct Concept { #[serde( @@ -9484,7 +9478,7 @@ pub struct Asset { rename = "$class", )] pub _class: String, - + #[serde( rename = "$identifier", )] @@ -9497,7 +9491,7 @@ pub struct Participant { rename = "$class", )] pub _class: String, - + #[serde( rename = "$identifier", )] @@ -9510,7 +9504,7 @@ pub struct Transaction { rename = "$class", )] pub _class: String, - + #[serde( rename = "$timestamp", serialize_with = "serialize_datetime", @@ -9525,7 +9519,7 @@ pub struct Event { rename = "$class", )] pub _class: String, - + #[serde( rename = "$timestamp", serialize_with = "serialize_datetime", @@ -9543,9 +9537,9 @@ exports[`codegen #formats check we can convert all formats from namespace versio "key": "concerto.rs", "value": "use serde::{ Deserialize, Serialize }; use chrono::{ DateTime, TimeZone, Utc }; - + use crate::utils::*; - + #[derive(Debug, Serialize, Deserialize)] pub struct Concept { #[serde( @@ -9560,7 +9554,7 @@ pub struct Asset { rename = "$class", )] pub _class: String, - + #[serde( rename = "$identifier", )] @@ -9573,7 +9567,7 @@ pub struct Participant { rename = "$class", )] pub _class: String, - + #[serde( rename = "$identifier", )] @@ -9605,10 +9599,10 @@ exports[`codegen #formats check we can convert all formats from namespace versio "key": "org_acme_hr_base_1_0_0.rs", "value": "use serde::{ Deserialize, Serialize }; use chrono::{ DateTime, TimeZone, Utc }; - + use crate::concerto_1_0_0::*; use crate::utils::*; - + #[derive(Debug, Serialize, Deserialize)] pub enum State { #[allow(non_camel_case_types)] @@ -9641,28 +9635,28 @@ pub struct Address { rename = "$class", )] pub _class: String, - + #[serde( rename = "street", )] pub street: String, - + #[serde( rename = "city", )] pub city: String, - + #[serde( rename = "state", skip_serializing_if = "Option::is_none", )] pub state: Option, - + #[serde( rename = "zipCode", )] pub zip_code: String, - + #[serde( rename = "country", )] @@ -9678,52 +9672,52 @@ exports[`codegen #formats check we can convert all formats from namespace versio "key": "org_acme_hr_1_0_0.rs", "value": "use serde::{ Deserialize, Serialize }; use chrono::{ DateTime, TimeZone, Utc }; - + use crate::org_acme_hr_base_1_0_0::*; use crate::concerto_1_0_0::*; use crate::utils::*; - + #[derive(Debug, Serialize, Deserialize)] pub struct Company { #[serde( rename = "$class", )] pub _class: String, - + #[serde( rename = "name", )] pub name: String, - + #[serde( rename = "headquarters", )] pub headquarters: Address, - + #[serde( rename = "companyProperties", skip_serializing_if = "Option::is_none", )] pub company_properties: Option, - + #[serde( rename = "employeeDirectory", skip_serializing_if = "Option::is_none", )] pub employee_directory: Option, - + #[serde( rename = "employeeTShirtSizes", skip_serializing_if = "Option::is_none", )] pub employee_t_shirt_sizes: Option, - + #[serde( rename = "employeeProfiles", skip_serializing_if = "Option::is_none", )] pub employee_profiles: Option, - + #[serde( rename = "employeeSocialSecurityNumbers", skip_serializing_if = "Option::is_none", @@ -9753,12 +9747,12 @@ pub struct Equipment { rename = "$class", )] pub _class: String, - + #[serde( rename = "serialNumber", )] pub serial_number: String, - + #[serde( rename = "$identifier", )] @@ -9779,17 +9773,17 @@ pub struct Laptop { rename = "$class", )] pub _class: String, - + #[serde( rename = "make", )] pub make: LaptopMake, - + #[serde( rename = "serialNumber", )] pub serial_number: String, - + #[serde( rename = "$identifier", )] @@ -9802,55 +9796,55 @@ pub struct Person { rename = "$class", )] pub _class: String, - + #[serde( rename = "email", )] pub email: String, - + #[serde( rename = "firstName", )] pub first_name: String, - + #[serde( rename = "lastName", )] pub last_name: String, - + #[serde( rename = "middleNames", skip_serializing_if = "Option::is_none", )] pub middle_names: Option, - + #[serde( rename = "homeAddress", )] pub home_address: Address, - + #[serde( rename = "ssn", )] pub ssn: String, - + #[serde( rename = "height", )] pub height: f64, - + #[serde( rename = "dob", serialize_with = "serialize_datetime", deserialize_with = "deserialize_datetime", )] pub dob: DateTime, - + #[serde( rename = "nextOfKin", )] pub next_of_kin: NextOfKin, - + #[serde( rename = "$identifier", )] @@ -9863,93 +9857,93 @@ pub struct Employee { rename = "$class", )] pub _class: String, - + #[serde( rename = "employeeId", )] pub employee_id: String, - + #[serde( rename = "salary", )] pub salary: u64, - + #[serde( rename = "numDependents", )] pub num_dependents: Integer, - + #[serde( rename = "retired", )] pub retired: bool, - + #[serde( rename = "department", )] pub department: Department, - + #[serde( rename = "officeAddress", )] pub office_address: Address, - + #[serde( rename = "companyAssets", )] pub company_assets: Vec, - + #[serde(rename = "manager")] pub manager: Option, - + #[serde( rename = "email", )] pub email: String, - + #[serde( rename = "firstName", )] pub first_name: String, - + #[serde( rename = "lastName", )] pub last_name: String, - + #[serde( rename = "middleNames", skip_serializing_if = "Option::is_none", )] pub middle_names: Option, - + #[serde( rename = "homeAddress", )] pub home_address: Address, - + #[serde( rename = "ssn", )] pub ssn: String, - + #[serde( rename = "height", )] pub height: f64, - + #[serde( rename = "dob", serialize_with = "serialize_datetime", deserialize_with = "deserialize_datetime", )] pub dob: DateTime, - + #[serde( rename = "nextOfKin", )] pub next_of_kin: NextOfKin, - + #[serde( rename = "$identifier", )] @@ -9962,63 +9956,63 @@ pub struct Contractor { rename = "$class", )] pub _class: String, - + #[serde( rename = "company", )] pub company: Company, - + #[serde(rename = "manager")] pub manager: Option, - + #[serde( rename = "email", )] pub email: String, - + #[serde( rename = "firstName", )] pub first_name: String, - + #[serde( rename = "lastName", )] pub last_name: String, - + #[serde( rename = "middleNames", skip_serializing_if = "Option::is_none", )] pub middle_names: Option, - + #[serde( rename = "homeAddress", )] pub home_address: Address, - + #[serde( rename = "ssn", )] pub ssn: String, - + #[serde( rename = "height", )] pub height: f64, - + #[serde( rename = "dob", serialize_with = "serialize_datetime", deserialize_with = "deserialize_datetime", )] pub dob: DateTime, - + #[serde( rename = "nextOfKin", )] pub next_of_kin: NextOfKin, - + #[serde( rename = "$identifier", )] @@ -10031,96 +10025,96 @@ pub struct Manager { rename = "$class", )] pub _class: String, - + #[serde(rename = "reports")] pub reports: Option>, - + #[serde( rename = "employeeId", )] pub employee_id: String, - + #[serde( rename = "salary", )] pub salary: u64, - + #[serde( rename = "numDependents", )] pub num_dependents: Integer, - + #[serde( rename = "retired", )] pub retired: bool, - + #[serde( rename = "department", )] pub department: Department, - + #[serde( rename = "officeAddress", )] pub office_address: Address, - + #[serde( rename = "companyAssets", )] pub company_assets: Vec, - + #[serde(rename = "manager")] pub manager: Option, - + #[serde( rename = "email", )] pub email: String, - + #[serde( rename = "firstName", )] pub first_name: String, - + #[serde( rename = "lastName", )] pub last_name: String, - + #[serde( rename = "middleNames", skip_serializing_if = "Option::is_none", )] pub middle_names: Option, - + #[serde( rename = "homeAddress", )] pub home_address: Address, - + #[serde( rename = "ssn", )] pub ssn: String, - + #[serde( rename = "height", )] pub height: f64, - + #[serde( rename = "dob", serialize_with = "serialize_datetime", deserialize_with = "deserialize_datetime", )] pub dob: DateTime, - + #[serde( rename = "nextOfKin", )] pub next_of_kin: NextOfKin, - + #[serde( rename = "$identifier", )] @@ -10133,7 +10127,7 @@ pub struct CompanyEvent { rename = "$class", )] pub _class: String, - + #[serde( rename = "$timestamp", serialize_with = "serialize_datetime", @@ -10148,10 +10142,10 @@ pub struct Onboarded { rename = "$class", )] pub _class: String, - + #[serde(rename = "employee")] pub employee: Employee, - + #[serde( rename = "$timestamp", serialize_with = "serialize_datetime", @@ -10166,15 +10160,15 @@ pub struct ChangeOfAddress { rename = "$class", )] pub _class: String, - + #[serde(rename = "Person")] pub person: Person, - + #[serde( rename = "newAddress", )] pub new_address: Address, - + #[serde( rename = "$timestamp", serialize_with = "serialize_datetime", @@ -10232,7 +10226,7 @@ export interface IConcept { $class: string; } -export type ConceptUnion = IAddress | +export type ConceptUnion = IAddress | ICompany; export interface IAsset extends IConcept { @@ -10410,7 +10404,7 @@ export interface IPerson extends IParticipant { nextOfKin: NextOfKin; } -export type PersonUnion = IEmployee | +export type PersonUnion = IEmployee | IContractor; export interface IEmployee extends IPerson { @@ -10566,7 +10560,7 @@ exports[`codegen #formats check we can convert all formats from namespace versio { "key": "concerto@1.0.0.xsd", "value": " - @@ -10622,7 +10616,7 @@ exports[`codegen #formats check we can convert all formats from namespace versio { "key": "concerto.xsd", "value": " - @@ -10676,7 +10670,7 @@ exports[`codegen #formats check we can convert all formats from namespace versio { "key": "org.acme.hr.base@1.0.0.xsd", "value": " - @@ -10722,7 +10716,7 @@ exports[`codegen #formats check we can convert all formats from namespace versio { "key": "org.acme.hr@1.0.0.xsd", "value": " -