go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

.api file does not support prefix only with "-"

Open litecy opened this issue 6 months ago • 0 comments

Describe the bug .api file does not support prefix only with "-"

Some of my url prefix is "/-/", it is VALID for http

but i can't use in api file.

To Reproduce Steps to reproduce the behavior, if applicable:

  1. The code is

    
    

@server ( group: main prefix: /-/ ) service trafficredirect { @doc ( summary: "ping" ) @handler PingHandler get /ping (PingReq) returns (PingResp) }

@server ( group: main prefix: /- ) service trafficredirect { @doc ( summary: "ping" ) @handler PingHandler get /ping (PingReq) returns (PingResp) }


2. The error is

syntax error: expected 'IDENT', got '-'


**Expected behavior**

support valid char or char combination in the prefix

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environments (please complete the following information):**
- OS: darwin
- goctl version 1.8.4 darwin/amd64

**More description**
Add any other context about the problem here.

litecy avatar Jun 16 '25 23:06 litecy