for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace frictionlessdata\tableschema\Fields;
class GeojsonField extends BaseField
{
protected function validateCastValue($val)
if (is_string($val)) {
try {
$val = json_decode($val);
} catch (\Exception $e) {
throw $this->getValidationException($e->getMessage(), $val);
}
if (!is_object($val)) {
throw $this->getValidationException('must be an object', $val);
if ($this->format() == 'default') {
// this validates the geojson
\GeoJson\GeoJson::jsonUnserialize($val);
return $val;
public static function type()
return 'geojson';