returns method

RouteEntry returns(
  1. Map<String, Object?> schema, {
  2. String? name,
  3. ResponseShape shape = .item,
  4. int? status,
})

Documents the response: schema is the JSON Schema of one item (for example one resource's toArray), shape says how it is returned ({"data": item}, a collection or one of Laravel's paginators) and name registers it under components/schemas.

Implementation

RouteEntry returns(
  Map<String, Object?> schema, {
  String? name,
  ResponseShape shape = .item,
  int? status,
}) {
  _response = RouteResponse(schema, name: name, shape: shape, status: status);
  return this;
}