REST_Elements_Controller::get_item_schema()

Retrieves the model’s schema, conforming to JSON Schema.

Description

Return

(array) Model schema data.

Source

File: src/db-objects/elements/rest-elements-controller.php

	public function get_item_schema() {
		$schema = parent::get_item_schema();

		$schema['properties']['container_id'] = array(
			'description' => __( 'ID of the container this element belongs to.', 'torro-forms' ),
			'type'        => 'integer',
			'minimum'     => 1,
			'context'     => array( 'view', 'edit', 'embed' ),
			'arg_options' => array(
				'minimum' => 1,
			),
		);

		$schema['properties']['sort'] = array(
			'description' => __( 'Numeric value to determine the order within a list of multiple elements.', 'torro-forms' ),
			'type'        => 'integer',
			'context'     => array( 'view', 'edit', 'embed' ),
		);

		$schema['properties']['type'] = array(
			'description' => __( 'Type of the element.', 'torro-forms' ),
			'type'        => 'string',
			'enum'        => array_keys( $this->manager->types()->get_all() ),
			'context'     => array( 'view', 'edit', 'embed' ),
		);

		return $schema;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.