Skip to content

FDL service RPC signatures should accept qualified nested type names #3517

@VikingDeng

Description

@VikingDeng

Search before asking

  • I had searched in the issues and found no similar issues.

Version

Problem

FDL already supports qualified type names such as Outer.Inner in the normal type system, and schema validation can resolve them correctly.

But in service RPC signatures, the FDL parser currently only accepts a simple identifier for request and response types.

For example, this fails today:

package demo;

message Outer {
    message HelloRequest {}
}

message ReplyEnvelope {
    message HelloReply {}
}

service Greeter {
    rpc SayHello (Outer.HelloRequest) returns (ReplyEnvelope.HelloReply);
}

The parser stops at the . in Outer.HelloRequest.

Why this looks like a bug

  • FDL field/type parsing already accepts qualified names
  • protobuf service parsing already accepts qualified RPC type names
  • FlatBuffers service parsing already accepts qualified RPC type names
  • the existing validator can already resolve qualified nested names

So this looks like a small inconsistency in the FDL service parser rather than an intentional limitation.

Proposed fix

Allow FDL RPC request/response type positions to parse a named type reference such as:

  • Request
  • Outer.Inner
  • Outer.Middle.Inner

This should be limited to parser behavior and regression coverage. No service IR or validator redesign is needed.

Component(s)

Other

Minimal reproduce step

Put this schema in repro.fdl:

package demo;

message Outer {
    message HelloRequest {}
}

message ReplyEnvelope {
    message HelloReply {}
}

service Greeter {
    rpc SayHello (Outer.HelloRequest) returns (ReplyEnvelope.HelloReply);
}
  1. Parse it with the FDL parser.
  2. Parsing fails at the qualified request type Outer.HelloRequest.

What did you expect to see?

I expected the schema to parse successfully, because qualified nested type names like Outer.Inner are already supported in the normal FDL type system, and service RPC signatures should be able to reference those same named types.

What did you see instead?

The parser rejected the RPC signature and stopped at the qualified type name, with an error like:

Expected ')' after request type

So FDL service RPC request/response type positions currently only accept a simple identifier, not a qualified nested type name.

Anything Else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions