Missing schema name or valid chain of suffix

#1

I have the following types:

   entity type TypeA schema name 'TYPA' {
        field1: string
        field2: TypeB
        field3: TypeC
    }

   type TypeB {
        field1: [double]
   }

   type TypeC {
        field1: string
   }

When trying to provision I get the error:
Unable to upsert collection for type TypeA: Array field TypeA.field2.field1 does not specify a schema name or valid chain of suffixes,targetType:“TypeA”,listenerType:“UpdateSchemaListener”

(Note, it does not complain about TypeC)

I’ve tried many different variations of adding schema names but none seem to work. Can somebody explain to me what best practice would be here? And what it’s exactly looking for and why?

0 Likes

#2
entity type TypeA schema name 'TYPA' {
        field1: string
        field2: TypeB schema suffix "F2"
        field3: TypeC schema suffix "F4"
    }

   type TypeB {
        field1: [double] schema suffix "FD"
   }

   type TypeC {
        field1: string
   }

Basically, when you include one type into another type, you can consider that the included type’s fields get added to the including type. All map and array fields of a persistable type need a schema name. In this case, the type A bascially has a field called “field2.field1” which is an array and needs a schema name

(Also, it looks like you have spaces in your field names of typeA?)

1 Like

#3

TypeB.field1 is an array field, so it needs a schema name defined if you want to persist TypeB data. Which you do—despite the fact that TypeB itself is not an entity type—because TypeA is an entity type and has a field field2 of type TypeB

0 Likes

#5

And I’ve also noticed that it’s necessary for all intermediate fields:

entity type TypeA schema name 'TYPA' {
    field1: TypeB schema suffix 'AF'
}

type TypeB {
    field1: TypeC schema suffix 'BF'
}

type TypeC {
    field1: [double] schema suffix 'CF'
}
0 Likes

#6

Yes thats correct. also ‘schema suffix’ is correct

0 Likes