Skip to content
This repository was archived by the owner on Sep 25, 2020. It is now read-only.
This repository was archived by the owner on Sep 25, 2020. It is now read-only.

Allow optional fields in argument structs #85

@Raynos

Description

@Raynos
$ node benchmarks/tchan-server.js --port 9000 --host 127.0.0.1

assert.js:92
  throw new assert.AssertionError({
        ^
AssertionError: no field of an argument struct may be marked optional including targetLocation of bootstrapEater_args
    at ThriftStruct.link (/home/raynos/uber/marketplace-gateway/node_modules/tchannel/node_modules/thriftrw/struct.js:167:20)
    at Thrift.link (/home/raynos/uber/marketplace-gateway/node_modules/tchannel/node_modules/thriftrw/thrift.js:208:32)
    at new Thrift (/home/raynos/uber/marketplace-gateway/node_modules/tchannel/node_modules/thriftrw/thrift.js:73:10)
    at new TChannelAsThrift (/home/raynos/uber/marketplace-gateway/node_modules/tchannel/as/thrift.js:49:17)
    at TChannelAsThrift (/home/raynos/uber/marketplace-gateway/node_modules/tchannel/as/thrift.js:39:16)
    at new BenchServer (/home/raynos/uber/marketplace-gateway/benchmarks/tchan-server.js:30:39)
    at main (/home/raynos/uber/marketplace-gateway/benchmarks/tchan-server.js:167:18)
    at Object.<anonymous> (/home/raynos/uber/marketplace-gateway/benchmarks/tchan-server.js:162:5)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

We spoke a while back about the semantics of arguments structs and believe we came to the conclusion that an arguments struct should be the same as any other struct.

It would be nice to remove this limitation, it would make porting existing HTTP/JSON interfaces to thrift easier since existing HTTP/JSON interfaces can have empty bodies and with optional fields on the main body.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions