JairusSW / as-json

The only JSON library you'll need for AssemblyScript. SIMD enabled
MIT License
80 stars 16 forks source link

Types inside namespaces cannot be marshalled #79

Closed mangalaman93 closed 5 months ago

mangalaman93 commented 5 months ago

I am getting this error when trying to marshal the Point type that I have defined below.

export namespace postgresql {
  @json
  export class Point {
    X: f64 = 0;
    Y: f64 = 0;

    constructor(X: f64, Y: f64) {
      this.X = X;
      this.Y = Y;
    }
  }
}

The error is

Could not serialize data of type Point. Make sure to add the correct decorators to classes. at ~lib/json-as/assembly/index.ts:251:7
JairusSW commented 5 months ago

Working for me