handle method

void handle(
  1. String operationId,
  2. FakeHandler handler
)

Registers handler for operationId, replacing an earlier one (Design note 3: later tickets add operations this way). Throws an ArgumentError for an operation that is not in openapi.yaml.

Implementation

void handle(String operationId, FakeHandler handler) {
  contract.operation(operationId);
  _handlers[operationId] = handler;
}