objectSchema static method

dynamic objectSchema(
  1. String id
)

Implementation

static dynamic objectSchema(String id) {
  dynamic result;

  if (Enums.all.contains(id) || ColorSchema.id == id) {
    result = {
      r'$ref': id,
    };
  } else {
    result = {
      'anyOf': [
        {
          'type': 'string',
        },
        {
          r'$ref': id,
        },
      ],
    };
  }

  return result;
}