APIRequestBody.schema constructor Null safety

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

Implementation

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