SJSMP / Sjsmp-.Net

SJSMP implementation for .Net
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Add support for arrays and composite types #7

Open mikhail-barg opened 8 years ago

mikhail-barg commented 8 years ago

It might worth upgrading SJSMP into a full-scale RCP-protocol. In that case we need to support not only current primitive types and proposed enums (#5) but also arrays and composite types (structs/classes), and arrays of composite types.

For composite types we might need to specify list of types in a separate section of the schema. Like

types: {
  "rect" : {x: int, y: int, width: int, height: int}
}

For enums we could also use the explicit type declaration like

types: {
  "protocolType": ["http", "https", "ftp", "sftp"]
}

It would solve the naming problem from #5.

For arrays I'd vote for some C-like syntax with int[] or rect[] so these could be declared inplace. Making explicit declaration in the types section would be pretty awkward, I think.