@@ -493,6 +493,18 @@ public Route.Set mount(@NonNull Router router) {
493493 return mount ("/" , router );
494494 }
495495
496+ /**
497+ * Mounts and registers a JSON-RPC service at the specified custom path.
498+ *
499+ * <p>This method initializes a JSON-RPC dispatcher for the given path if one does not already
500+ * exist, installs the dispatcher module into the application, and binds the provided {@link
501+ * JsonRpcService} to it. Multiple services can be added to the same path.
502+ *
503+ * @param path The URL path where the JSON-RPC endpoint will be exposed (e.g., "/api/rpc").
504+ * @param service The {@link JsonRpcService} instance containing the RPC methods to expose. Must
505+ * not be null.
506+ * @return This {@link Jooby} instance to allow for method chaining.
507+ */
496508 public Jooby jsonRpc (String path , @ NonNull JsonRpcService service ) {
497509 if (dispatchers == null ) {
498510 dispatchers = new HashMap <>();
@@ -509,6 +521,16 @@ public Jooby jsonRpc(String path, @NonNull JsonRpcService service) {
509521 return this ;
510522 }
511523
524+ /**
525+ * Mounts and registers a JSON-RPC service at the default path {@code "/rpc"}.
526+ *
527+ * <p>This is a convenience method that delegates to {@link #jsonRpc(String, JsonRpcService)}
528+ * using the default endpoint path.
529+ *
530+ * @param service The {@link JsonRpcService} instance containing the RPC methods to expose. Must
531+ * not be null.
532+ * @return This {@link Jooby} instance to allow for method chaining.
533+ */
512534 public Jooby jsonRpc (@ NonNull JsonRpcService service ) {
513535 return jsonRpc ("/rpc" , service );
514536 }
0 commit comments