APIRequestBody.schema constructor Null safety

APIRequestBody.schema(
  1. APISchemaObject schema,
  2. {Iterable<String> contentTypes = const ["application/json"],
  3. String? description,
  4. bool? required}
)

Implementation

APIRequestBody.schema(APISchemaObject schema,
    {Iterable<String> contentTypes: const ["application/json"],
    this.description,
    bool? required}) {
  this.isRequired = required!;
  this.content = contentTypes.fold({}, (prev, elem) {
    prev![elem] = new APIMediaType(schema: schema);
    return prev;
  });
}