Hi,
I’m currently developing a custom projection and this is how I currently have defined a structure for the Response.
structure AppointmentDetailsResponse {
attribute Latitude Number;
attribute Longitude Number;
attribute DatasetId Text;
attribute Technician Structure(TechnicianResponse);
attribute AdditionalRegion List<Structure(AdditionalRegion)>;
}
There are a few weird behaviors that I’m noticing:
- When I add an extra attribute to this AppointmentDetailsResponse structure (e.g. attribute SomeField) like this:
structure AppointmentDetailsResponse { attribute Latitude Number; attribute Longitude Number; attribute DatasetId Text; attribute SomeField Text; attribute Technician Structure(TechnicianResponse); attribute AdditionalRegion List<Structure(AdditionalRegion)>; }
and if hard code a value to it in the the logicresponse_.some_field := 'TEST'; RETURN response_;
I’m getting this error when I test out the projection:{ "error": { "code": "DATABASE_ERROR", "message": "Database error occurred. Contact administrator.", "details": [ { "code": 17001, "message": "Internal Error: Image is not in 8.1 format" } ] } }
Even if I don’t set this field in the response and leave it blank, I still get this error.
-
The other weird behavior is if I define the “SomeField” attribute at the end of the structure like this
structure AppointmentDetailsResponse { attribute Latitude Number; attribute Longitude Number; attribute DatasetId Text; attribute Technician Structure(TechnicianResponse); attribute AdditionalRegion List<Structure(AdditionalRegion)>; attribute SomeField Text; }
I get a different error message:
{ "error": { "code": "UNEXPECTED", "message": "Unexpected internal server error occurred." } }
As soon as I remove this attribute from the AppointmentDetailsResponse structure, everything works fine again.
Here is the the full code of structure definitions:
structure AppointmentDetailsResponse {
attribute Latitude Number;
attribute Longitude Number;
attribute DatasetId Text;
attribute Technician Structure(TechnicianResponse);
attribute AdditionalRegion List<Structure(AdditionalRegion)>;
attribute SomeField Text;
}
structure AppointmentDetailsRequest {
attribute Task Structure(Task);
attribute SiteId Text;
attribute LanguagePreference Text;
}
structure Task {
attribute City Text;
attribute CountryId Text;
attribute Patch Text;
attribute Postcode Text;
attribute Province Text;
attribute Street Text;
attribute TaskType Text;
attribute Priority Text;
attribute Technician Structure(TechnicianRequest);
}
structure TechnicianRequest {
attribute Id Text;
}
structure TechnicianResponse {
attribute ResourceId Text;
attribute IfsResourceId Text;
}
structure AdditionalRegion {
attribute RegionId Text;
}
structure LocationAddressDetails {
attribute LocationId Text;
attribute Street Text;
attribute Postcode Text;
attribute City Text;
attribute Province Text;
attribute CountryId Text;
}
Any insights would be helpful. Thanks!