APIResponse.schema constructor

APIResponse.schema(
  1. String? description,
  2. APISchemaObject schema, {
  3. Iterable<String> contentTypes = const ["application/json"],
  4. Map<String, APIHeader?>? headers,
})

Implementation

APIResponse.schema(this.description, APISchemaObject schema,
    {Iterable<String> contentTypes: const ["application/json"],
    this.headers}) {
  content = contentTypes.fold<Map<String, APIMediaType?>>({}, (prev, elem) {
    prev[elem] = APIMediaType(schema: schema);
    return prev;
  });
}