Array of array field in entity type


Is there a way to have a field that is an an array of arrays of doubles in a type? I am trying to do something like below to make an array of coordinate pairs:

entity type GraphType schema name "GRPHTYP" {
  coordinates: [[double]] schema suffix "CRDS"

This code throws an error during provisioning. I have also tried [anyof([double])], which provisions but throws an obscure error during runtime:

“Unexpected token VALUE_NUMBER_FLOAT when expecting START_OBJECT or END_ARRAY in JSON document at 1:65”.


nested arrays are not supported in the type system.
You should instead define something like the following:

type Coordinate2d {
x: double
y: double

entity type GraphType … {
coordinates: [ Coordinate2d ]

of course, what youre doing seems like it should already exist in the platform. Are you trying to achieve some use case or are you just playing around with whats possible?


Highcharts take a data field in this form when the x coordinates are irregular intervals. We were trying to leverage this to pair nicely with the UI component.


@yushi.homma What was the error in the first case?


The error was:
Unable to upsert collection for type GraphType: Map value should be primitive or reference in field coordinates in type GraphType.",targetType:"GraphType",listenerType:"UpdateSchemaListener"}