thrift-typescript icon indicating copy to clipboard operation
thrift-typescript copied to clipboard

thrift-typescript doesn't accept maps with the key-value pairs not separated with a comma

Open Aurora12 opened this issue 6 years ago • 1 comments

We have a map definition with newlines for delimiters and thrift-typescript doesn't like that.

const map<i32,string> DATA_TYPE = {
    -4: 'Notice'
    -1: 'BackendException'
    1: 'GetConnectionId'
    2: 'ResolveCountry'
    // ...etc
}
Parse Error:
Message: Closing brace missing from map definition
1093 | const map<i32,string> DATA_TYPE = {
                ^

We are using thrift generators for several languages–Scala, Kotlin, Swift, ObjectiveC–and all of them are perfectly fine with newlines instead of commas. So, I presume, this should be the standard behaviour.

This is probably a minor issue, given that it's easily fixed by adding commas, but so you know.

Aurora12 avatar Jul 30 '19 10:07 Aurora12

Pretty sure this would be an issue with the parser, which is in a separate repo: https://github.com/creditkarma/thrift-parser

hayes avatar Aug 01 '19 20:08 hayes