You are here

public function TimestampTypeMapper::getMappedValue in Schemata 8

Convert the data definition property to a JSON Schema form.

Parameters

\Drupal\Core\TypedData\DataDefinitionInterface $property: The data definition property.

Return value

mixed The mapped value to represent the property in a JSON Schema schema.

Overrides TypeMapperBase::getMappedValue

File

schemata_json_schema/src/Plugin/schemata_json_schema/type_mapper/TimestampTypeMapper.php, line 19

Class

TimestampTypeMapper
Converts Data Definition properties of timestamp type to JSON Schema.

Namespace

Drupal\schemata_json_schema\Plugin\schemata_json_schema\type_mapper

Code

public function getMappedValue(DataDefinitionInterface $property) {
  $value = parent::getMappedValue($property);
  $value['type'] = 'number';
  $value['format'] = 'utc-millisec';
  return $value;
}