APIRequestBody.schema constructor

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,
    bool isRequired = false}) {
  this.isRequired = isRequired;
  this.content =
      contentTypes.fold<Map<String, APIMediaType?>>({}, (prev, elem) {
    prev[elem] = APIMediaType(schema: schema);
    return prev;
  });
}