Group Group Group Group Group Group Group Group Group

Can't append Float to pgsql array in Fluent

I have a field defined as

@Field(key: “ante_range”)
var anteRange : [Float]?

in my pgsql schema it appears as

ante_range | double precision[] | | |

So there appear to be no problems. I send a struct that stores the data that I want stored as

anteRange: [minante, minante],

Where both values are Floats
When I run this in an XCT test context, where I’m directly creating the instance, not going through a server call as part of the set up (I don’t want to test routes as part of this), I get

**error: -[AppTests.UserTests testBuildTournament] : failed: caught error: "server: improper binary format in array element 1 (ReadArrayBinary)"**

If I initialize the array as empty, I get no problems. If I then try to append to that array, I cannot.

What is the method to append to Float arrays? In another part of the same ap, I’m appending to a String array without problems, and the code is no different that I can see.

EDIT: I should clarify that the object is being initialized from the context as src:

init(src: CreateTournamentContext) {

and that the assignment line is

self.anteRange = src.anteRange

in the struct, the definition is

var anteRange: Array<Float>

Just to be clear you’re doing anteRange.append(newFloat)?

Does it work if you use @OptionalField?