* api/router: avoid unneeded loops and fix path match * if match found in google api path syntax, not try pcre loop * if path is not ending via $ sign, append it to pcre to avoid matching other strings like /api/account/register can be matched to /api/account * api: add tests and validations Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
		
			
				
	
	
		
			25 lines
		
	
	
		
			572 B
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			572 B
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
| syntax = "proto3";
 | |
| 
 | |
| import "google/api/annotations.proto";
 | |
| 
 | |
| service Test {
 | |
| 	rpc Call(Request) returns (Response) {
 | |
|     option (google.api.http) = { post: "/api/v0/test/call/{uuid}"; body:"*"; };
 | |
| 	};
 | |
| 	rpc CallPcre(Request) returns (Response) {
 | |
|     option (google.api.http) = { post: "^/api/v0/test/call/pcre/?$"; body:"*"; };
 | |
| 	};
 | |
| 	rpc CallPcreInvalid(Request) returns (Response) {
 | |
|     option (google.api.http) = { post: "^/api/v0/test/call/pcre/invalid/?"; body:"*"; };
 | |
| 	};
 | |
| }
 | |
| 
 | |
| message Request {
 | |
|   string uuid = 1;
 | |
| 	string name = 2;
 | |
| }
 | |
| 
 | |
| message Response {
 | |
| 	string msg = 1;
 | |
| }
 |