validateJSONRPCWebSocketConstraints validates constraints for JSON-RPC WebSocket endpoints
(verr *eval.ValidationErrors)
| 319 | |
| 320 | // validateJSONRPCWebSocketConstraints validates constraints for JSON-RPC WebSocket endpoints |
| 321 | func (svc *HTTPServiceExpr) validateJSONRPCWebSocketConstraints(verr *eval.ValidationErrors) { |
| 322 | for _, e := range svc.HTTPEndpoints { |
| 323 | name := e.MethodExpr.Name |
| 324 | if !e.Headers.IsEmpty() { |
| 325 | verr.Add(e, "JSON-RPC endpoint %q using WebSocket cannot have header mappings", name) |
| 326 | } |
| 327 | if !e.Cookies.IsEmpty() { |
| 328 | verr.Add(e, "JSON-RPC endpoint %q using WebSocket cannot have cookie mappings", name) |
| 329 | } |
| 330 | if !e.Params.IsEmpty() { |
| 331 | verr.Add(e, "JSON-RPC endpoint %q using WebSocket cannot have parameter mappings", name) |
| 332 | } |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | // Finalize initializes the path if no path is set in design. |
| 337 | func (svc *HTTPServiceExpr) Finalize() { |
no test coverage detected