1. @override
List<APIResponse> documentResponsesForOperation(APIOperation operation)

Returns all APIResponses for operation.

Source

@override
List<APIResponse> documentResponsesForOperation(APIOperation operation) {
  var responses = super.documentResponsesForOperation(operation);
  if (operation.id == APIOperation.idForMethod(this, #create)) {
    responses.addAll([
      new APIResponse()
        ..statusCode = HttpStatus.OK
        ..description = "Successfully exchanged credentials for credentials"
        ..schema = new APISchemaObject(properties: {
          "access_token": new APISchemaObject.string(),
          "token_type": new APISchemaObject.string(),
          "expires_in": new APISchemaObject.int(),
          "refresh_token": new APISchemaObject.string()..required = false
        }),
      new APIResponse()
        ..statusCode = HttpStatus.BAD_REQUEST
        ..description =
            "Missing one or more of: 'client_id', 'username', 'password'."
        ..schema = new APISchemaObject(
            properties: {"error": new APISchemaObject.string()}),
    ]);
  }

  return responses;
}