Open deanbiltup opened 2 hours ago
NOTE: by the way, the lib has been super solid!!!!!!! thanks!!! All our apis are used by the angular client and by the server so our apis are 100% the same now so developers can easily read the contracts on either end since it is the same file for both server developer and GUI developer (though we are all full stack anyways).
Ok, I tried deleting entire app to just focus on the api but that became a rabbit hole :( . full object heirarchy is
@JsonObject()
export class FetchProposalsResponse {
//@JsonProperty({ type: ProposalDto })
@JsonProperty()
public proposals?: ProposalDto[]
@JsonProperty()
public hasMoreData?: boolean
@JsonProperty()
public totalSize?: number;
}
@JsonObject()
export class ProposalDto {
@JsonProperty()
public outline?: OutlineDto;
//loaded for customer view only
@JsonProperty({ type: TrainerXrefDto })
public potentialTrainers?: TrainerXrefDto[]
//loaded for trainer view only..
@JsonProperty()
public customer?: CustomerDto
}
/************************************
This should be 1 to 1 with CustomerProposedOutlineDbo
while OutlineVersionDto is 1 to 1 with OutlineVersionDbo
(in case they vary, we do not want to confuse the two)
******************************/
@JsonObject()
export class OutlineDto {
@JsonProperty()
public outlineId?: string;
@JsonProperty()
public title?: string;
@JsonProperty()
public gptVersion?: string;
//fully processed and ready to display outline...
@JsonProperty()
public html?: string;
//original original with special ж, ф, and я characters inside
@JsonProperty()
public markdown?: string;
@JsonProperty()
public durationHours?: number;
@JsonProperty()
public availableStart?: Date;
@JsonProperty()
public availableEnd?: Date;
@JsonProperty({
beforeDeserialize: stringToClassType,
afterSerialize: classTypeToString
})
public trainingType?: ClassTypeEnumDto;
@JsonProperty({
beforeDeserialize: stringToClassSize,
afterSerialize: classSizeToString
})
public numberOfStudents?: ClassSizeEnumDto;
@JsonProperty()
public description?: string;
@JsonProperty()
public prerequisites?: string[];
@JsonProperty()
public learningObjectives?: string[];
@JsonProperty()
public assistantVersionDbId?: string;
@JsonProperty()
public stage?: string;
@JsonProperty()
public created?: Date;
}
@JsonObject()
export class TrainerXrefDto {
@JsonProperty()
public trainer?: TrainerDto;
//TODO(dhiller): FIX to be the enum instead
@JsonProperty()
public stage?: string;
@JsonProperty()
public trainerXrefId?: string;
}
@JsonObject()
export class TrainerDto {
@JsonProperty()
public trainerId?: string;
@JsonProperty()
public commonData? = new CommonUserDataDto();
@JsonProperty()
public accessToken?: string;
@JsonProperty()
public roles?: string[];
@JsonProperty()
public hourlyRate?: number;
@JsonProperty()
public dailyRate?: number;
@JsonProperty()
public halfDayRate?: number;
@JsonProperty()
public username?: string;
@JsonProperty()
public about?: string;
@JsonProperty()
public linkedInUrl?: string;
@JsonProperty()
public githubUrl?: string;
@JsonProperty({ type: SkillDto })
public skills?: SkillDto[];
@JsonProperty()
public profileState?: ProfileState = ProfileState.UNSUBMITTED;
@JsonProperty()
public rating?: number;
}
@JsonObject()
export class CommonUserDataDto {
@JsonProperty()
//probably should merge with MemberDto
public dbUid?: string;
@JsonProperty()
public firstName?: string;
@JsonProperty()
public lastName?: string;
@JsonProperty()
public email?: string;
@JsonProperty()
public avatar?: string;
@JsonProperty()
public status?: string;
@JsonProperty()
public title?: string;
@JsonProperty()
public company?: string;
@JsonProperty()
public phone?: string;
}
@JsonObject()
export class SkillDto {
@JsonProperty()
public skillId?: string;
@JsonProperty()
public name?: string;
}
@JsonObject()
export class CustomerDto {
public customerId?: string;
@JsonProperty()
public commonData? = new CommonUserDataDto();
public roles?: string[];
}
Hi, let me check, but could you provide the payload you try to deserialize so that I can check with real data?
Version
6.0.0
Description
I suspect a cycle but can't find it. In guice, on errors, it would report the cycle, A, B, C, A so you could fix. Perhaps this is a feature request though I think it is more a usability bug costing time every time we hit it. if you have a debug process that would be amazing. I changed my entity to this code adding {type: ProposalDto} and things broke :( ....
Error