JsonSchema<T> constructor

JsonSchema<T>({
  1. String? id,
  2. String? schema,
  3. String? title,
  4. String? description,
  5. num? multipleOf,
  6. num? maximum,
  7. bool? exclusiveMaximum,
  8. num? minimum,
  9. bool? exclusiveMinimum,
  10. int? maxLength,
  11. int? minLength,
  12. Pattern? pattern,
  13. bool? additionalItems,
  14. OpenApiObject<Map>? items,
  15. int? maxItems,
  16. int? minItems,
  17. bool? uniqueItems,
  18. int? maxProperties,
  19. int? minProperties,
  20. List<String>? required,
  21. Map<String, dynamic>? additionalProperties,
  22. bool hasAdditionalProperties = false,
  23. Map<String, JsonSchema>? definitions,
  24. Map<String, OpenApiObject<Map>>? properties,
  25. Map<String, JsonSchema>? patternProperties,
  26. Map<String, dynamic>? dependencies,
  27. List? enumValues,
  28. OpenApiType? type,
  29. List<JsonSchema>? allOf,
  30. List<JsonSchema>? anyOf,
  31. List<JsonSchema>? oneOf,
  32. OpenApiObject<Map>? not,
  33. String? ref,
  34. Object? defaultValue,
})

Creates a JsonSchema with the given parameters.

Implementation

JsonSchema({
  this.id,
  this.schema,
  this.title,
  this.description,
  this.multipleOf,
  this.maximum,
  this.exclusiveMaximum,
  this.minimum,
  this.exclusiveMinimum,
  this.maxLength,
  this.minLength,
  this.pattern,
  this.additionalItems,
  this.items,
  this.maxItems,
  this.minItems,
  this.uniqueItems,
  this.maxProperties,
  this.minProperties,
  this.required,
  this.additionalProperties,
  this.hasAdditionalProperties = false,
  this.definitions,
  this.properties,
  this.patternProperties,
  this.dependencies,
  this.enumValues,
  this.type,
  this.allOf,
  this.anyOf,
  this.oneOf,
  this.not,
  this.ref,
  this.defaultValue,
}) {
  if (dependencies != null) {
    for (final entry in dependencies!.entries) {
      if (entry.value is! JsonSchema && entry.value is! List<String>) {
        throw ArgumentError(
          'Dependencies must be a JsonSchema or a list of strings',
        );
      }
    }
  }
}