ObjectSchema constructor

ObjectSchema({
  1. String? title,
  2. String? description,
  3. Map<String, Schema>? properties,
  4. Map<String, Schema>? patternProperties,
  5. List<String>? required,
  6. Object? additionalProperties,
  7. bool? unevaluatedProperties,
  8. StringSchema? propertyNames,
  9. int? minProperties,
  10. int? maxProperties,
})

Implementation

factory ObjectSchema({
  String? title,
  String? description,
  Map<String, Schema>? properties,
  Map<String, Schema>? patternProperties,
  List<String>? required,

  /// Must be one of bool, Schema, or Null
  Object? additionalProperties,
  bool? unevaluatedProperties,
  StringSchema? propertyNames,
  int? minProperties,
  int? maxProperties,
}) => ObjectSchema.fromMap({
  Keys.type: JsonType.object.typeName,
  if (title != null) Keys.title: title,
  if (description != null) Keys.description: description,
  if (properties != null) Keys.properties: properties,
  if (patternProperties != null) Keys.patternProperties: patternProperties,
  if (required != null) Keys.required: required,
  if (additionalProperties != null)
    Keys.additionalProperties: additionalProperties,
  if (unevaluatedProperties != null)
    Keys.unevaluatedProperties: unevaluatedProperties,
  if (propertyNames != null) Keys.propertyNames: propertyNames,
  if (minProperties != null) Keys.minProperties: minProperties,
  if (maxProperties != null) Keys.maxProperties: maxProperties,
});