documentOperationRequestBody method Null safety

  1. @override
APIRequestBody documentOperationRequestBody(
  1. APIDocumentContext context,
  2. Operation operation

Returns a documented request body for operation.

If an operation method binds an Bind.body argument or accepts form data, this method returns a APIRequestBody that describes the bound body type. You may override this method to take an alternative approach or to augment the automatically generated request body documentation.


APIRequestBody documentOperationRequestBody(
    APIDocumentContext context, Operation operation) {
  final body = super.documentOperationRequestBody(context, operation);
  body!.content!["application/x-www-form-urlencoded"]!.schema!.required = [
      .properties!["password"]!.format = "password";
  return body;