anz-bank / sysl-go

Communication library used by SYSL-generated code written in Go.
Apache License 2.0
10 stars 14 forks source link

grpc-client bug, missing call parameter #215

Closed nydrani closed 4 years ago

nydrani commented 4 years ago

https://github.com/anz-bank/sysl-go/blob/auto-generate/codegen/arrai/go.arrai#L44

This arrai transform reads a jsonified sysl file, specifically this kind of structure:

"endpoints": {
  "Hello": 
    "param": [
      {
        "name": "input",
        "type": {
          "typeRef": {
             "ref": {
               "appname": {
                 "part": [
                   "depserver"
                 ]
               },
               "path": [
                 "HelloRequest"
               ]
            }
          }
        }
      }
    ]
}

That is generated from this sysl file

depserver:
    !type HelloRequest:
        Content <: string:
    !type HelloResponse:
        Content <: string:

myserverdep[~gRPC]:
    Hello(input <: depserver.HelloRequest)[~gRPC]:
        return ok <: depserver.HelloResponse

But for another sysl file

myserverdep[~gRPC]:
    Hello(input <: HelloRequest)[~gRPC]:
        return ok <: HelloResponse
    !type HelloRequest:
        Content <: string:
    !type HelloResponse:
        Content <: string:

The path part:

               "path": [
                 "HelloRequest"
               ]

no longer exists with the second sysl file. I'm not quite sure why, but it breaks the arrai transform.

anzdaddy commented 4 years ago

~The output JSON is working as intended. See https://github.com/anz-bank/sysl/issues/1040#issuecomment-684417202 for details.~

~The arr.ai transform will have to accommodate it by inferring appname from its containing app.~

anzdaddy commented 4 years ago

As per the linked issue in my previous comment, I misread the output. This was in fact a problem, but has been fixed as of https://github.com/anz-bank/sysl/releases/tag/v0.221.0.