Returns the schema endpoint object describing this endpoint's properties.

@return \Muffin\Webservice\Schema
189077
public function getSchema()
    {
        if ($this->_schema === null) {
            $this->_schema = $this->_initializeSchema($this->getWebservice()->describe($this->getName()));
        }

        return $this->_schema;
    }
530373
public function getSchemaFactory()
    {
        if (!$this->schemaFactory) {
            $this->schemaFactory = new LdapObjectSchemaFactory(
                $this->getCache(), $this->getSchemaParser(), $this->config->getEventDispatcher()
            );
        }

        return $this->schemaFactory;
    }
956042
public function getDataSchema()
    {
        $schema = [
            'description' => $this->Description,
            'link' => 'https://addons.silverstripe.org/add-ons/' . $this->Name,
            'linkTitle' => _t(
                __CLASS__ . '.ADDONS_LINK_TITLE',
                'View {package} on addons.silverstripe.org',
                ['package' => $this->Title]
            ),
            'rating'=> (int) $this->Rating
        ];

        $this->extend('updateDataSchema', $schema);

        return $schema;
    }
657909
public function get_item_schema() {
		$schema = array(
			'$schema'              => 'http://json-schema.org/draft-04/schema#',
			'title'                => 'type',
			'type'                 => 'object',
			'properties'           => array(
				'capabilities'     => array(
					'description'  => __( 'All capabilities used by the resource.' ),
					'type'         => 'array',
					'context'      => array( 'edit' ),
					'readonly'     => true,
				),
				'description'      => array(
					'description'  => __( 'A human-readable description of the resource.' ),
					'type'         => 'string',
					'context'      => array( 'view', 'edit' ),
					'readonly'     => true,
				),
				'hierarchical'     => array(
					'description'  => __( 'Whether or not the resource should have children.' ),
					'type'         => 'boolean',
					'context'      => array( 'view', 'edit' ),
					'readonly'     => true,
				),
				'labels'           => array(
					'description'  => __( 'Human-readable labels for the resource for various contexts.' ),
					'type'         => 'object',
					'context'      => array( 'edit' ),
					'readonly'     => true,
				),
				'name'             => array(
					'description'  => __( 'The title for the resource.' ),
					'type'         => 'string',
					'context'      => array( 'view', 'edit', 'embed' ),
					'readonly'     => true,
				),
				'slug'             => array(
					'description'  => __( 'An alphanumeric identifier for the resource.' ),
					'type'         => 'string',
					'context'      => array( 'view', 'edit', 'embed' ),
					'readonly'     => true,
				),
			),
		);
		return $this->add_additional_fields_schema( $schema );
	}
1232057
public function loadSchemaFile(): Schema
    {
        if (!file_exists($this->schemaFile)) {
            return new Schema();
        }

        $content = file_get_contents($this->schemaFile);
        $desc = Yaml::parse($content);
        if (empty($desc)) {
            return new Schema();
        }

        $builder = new SchemaBuilder();
        return $builder->build($desc['schema']);
    }
1281920
private function buildSchemaForEndpoint(string $endpoint)
    {
        $schemaPathAndFilename = $this->endpointsConfiguration[$endpoint]['schema'];
        $content = Files::getFileContents($schemaPathAndFilename);
        $documentNode = Parser::parse($content);
        $this->schemaCache->set(urlencode($endpoint), $documentNode, [md5($schemaPathAndFilename)]);
        return $documentNode;
    }
876298
function getEndpoint() {
        $endpoint = $this->endpointBase;
        if ($this->spaceId) {
            $endpoint .= '/' . $this->spaceId;
        }
        return $endpoint;
    }
443839
public function buildSchemas(): Schemas
    {
        $schemas = new Schemas();
        $xpath = new DOMXPath($this->document);

        // get the http://www.w3.org/2001/XMLSchema-instance namespace (it could not be 'xsi')
        $xsi = $this->document->lookupPrefix('http://www.w3.org/2001/XMLSchema-instance');

        // the namespace is not registered, no need to continue
        if (! $xsi) {
            return $schemas;
        }

        // get all the xsi:schemaLocation attributes in the document
        /** @var \DOMNodeList|false $schemasList */
        $schemasList = $xpath->query("//@$xsi:schemaLocation");

        // schemaLocation attribute not found, no need to continue
        if (false === $schemasList || 0 === $schemasList->length) {
            return $schemas;
        }

        // process every schemaLocation for even parts
        foreach ($schemasList as $node) {
            // get the node content
            $content = $node->nodeValue;
            // get parts without inner spaces
            $parts = array_values(array_filter(explode(' ', $content)));
            $partsCount = count($parts);
            // check that the list count is an even number
            if (0 !== $partsCount % 2) {
                throw new SchemaValidatorException(
                    "The schemaLocation value '" . $content . "' must have even number of URIs"
                );
            }
            // insert the uris pairs into the schemas
            for ($k = 0; $k < $partsCount; $k = $k + 2) {
                $schemas->create($parts[$k], $parts[$k + 1]);
            }
        }

        return $schemas;
    }
380588
public function getSchema()
    {
        if ($this->schema !== null) {
            return $this->schema;
        }
        $response = $this->_sendRawGet($this->_constructUrl(self::SCHEMA_SERVLET));

        $this->schema = $this->schemaParser->parseJson($response->getRawResponse());
        return $this->schema;
    }
431069
public function getEndpoint()
    {
        $basePath = $this->app['config']->get('api.base_path', self::DEFAULT_BASE_PATH);
        $basePath = $this->stripTrailingSlash($basePath);

        // determine the base URL for the API,
        // i.e. https://api.example.com/v1
        $urlBase = $this->app['config']->get('api.url');
        if ($urlBase) {
            $urlBase = $this->stripTrailingSlash($urlBase);
        } else {
            // no base URL was defined so we're going to generate one
            $urlBase = $this->app['base_url'];
            $urlBase = $this->stripTrailingSlash($urlBase).$basePath;
        }

        // get the requested path, strip any trailing '/'
        $path = $this->stripTrailingSlash($this->request->path());

        // strip out the base path (i.e. /api/v1) from the
        // requested path
        if ($basePath) {
            $path = str_replace($basePath, '', $path);
        }

        return $urlBase.$path;
    }
1081033
public function getSchema() {
        if ($this->_schema instanceof Schema) {
            return $this->_schema;

        // Manually defined columns
        // Allows for full schema and key/index support
        } else if ($this->_schema && is_array($this->_schema)) {
            $columns = $this->_schema;

        // Inspect database for columns
        // This approach should only be used for validating columns and types
        } else {
            $columns = $this->getDriver()->describeTable($this->getTable());
        }

        $this->setSchema(new Schema($this->getTable(), $columns));

        return $this->_schema;
    }
615442
protected function getSchema()
    {
        if (file_exists(__DIR__.'/../all.json')) {
            return json_decode(file_get_contents(__DIR__.'/../all.json'), true);
        }

        echo "Getting schema\n";

        $schema = [
            'datatypes' => [],
            'properties' => [],
            'types' => [],
        ];

        $client = new Client(['base_uri' => 'https://schema.org']);
        $response = $client->get('/docs/full.html');
        $crawler = new Crawler($response->getBody()->__toString());

        $dataTypes = $crawler->filter('#datatype_tree a');
        foreach ($dataTypes as $index => $dataType) {
            echo '['.($index + 1).'/'.$dataTypes->count().'] ';
            if (strpos($dataType->getAttribute('class'), 'ext') !== false) {
                echo 'Skipping extension datatype: '.$dataType->textContent."\n";
                continue;
            }

            echo 'Getting datatype: '.$dataType->textContent."\n";
            $schema['datatypes'][$dataType->textContent] = $this->getDataType($client, $dataType->getAttribute('href'));
        }

        $types = $crawler->filter('#thing_tree a');
        foreach ($types as $index => $type) {
            if (!isset($schema['types'][$type->textContent]) && substr($type->getAttribute('href'), 0, 1) !== '#') {
                echo '['.($index + 1).'/'.$types->count().'] ';
                if (strpos($type->getAttribute('class'), 'ext') !== false) {
                    echo 'Skipping extension type: '.$type->textContent."\n";
                    continue;
                }

                echo 'Getting type: '.$type->textContent."\n";
                $schema['types'][$type->textContent] = $this->getType($client, $type->getAttribute('href'));
            }
        }

        $specificProperties = [];
        foreach ($schema['types'] as $type) {
            foreach ($type['specific_properties'] as $specificProperty) {
                if (!isset($schema['properties'][$specificProperty])) {
                    $specificProperties[$specificProperty] = $specificProperty;
                }
            }
        }

        $specificPropertiesCount = count($specificProperties);
        foreach (array_values($specificProperties) as $index => $specificProperty) {
            echo '['.($index + 1).'/'.$specificPropertiesCount.'] Getting property: '.$specificProperty."\n";
            try {
                $schema['properties'][$specificProperty] = $this->getProperty($client, '/'.$specificProperty);
            } catch (\InvalidArgumentException $exception) {
                echo '   Failed: '.$exception->getMessage()."\n";
                echo "   Skipping...\n";
            }
        }

        $enumerationMembers = [];
        foreach ($schema['types'] as $type) {
            foreach ($type['enumeration_members'] as $enumerationMember) {
                if (!isset($schema['types'][$enumerationMember])) {
                    $enumerationMembers[$enumerationMember] = $enumerationMember;
                }
            }
        }

        $enumerationMembersCount = count($enumerationMembers);
        foreach (array_values($enumerationMembers) as $index => $enumerationMember) {
            echo '['.($index + 1).'/'.$enumerationMembersCount.'] Getting extra enumeration member: '.$enumerationMember."\n";
            $schema['types'][$enumerationMember] = $this->getType($client, '/'.$enumerationMember);
        }

        echo "Getting schema done!\n\n";

        file_put_contents(__DIR__.'/../all.json', json_encode($schema));

        return $schema;
    }
656929
function getSchema()
    {
        # Database structure
        $schema = 'CREATE TABLE IF NOT EXISTS ' . $this->table . ' (';
        $sep = PHP_EOL;

        foreach($this->schema as $fld) {
            $schema .= $sep . $fld;
            $sep = ', ' . PHP_EOL;
        }

        $schema .= PHP_EOL . ');' . PHP_EOL;

        # Indecies
        foreach($this->indecies as $index) {
            foreach($index as $type=>$field) {
                $type = strtolower($type);
                switch ($type) {
                    case 'u':
                    case 'unique':
                        $schema .=  'CREATE UNIQUE INDEX ';
                        break;
                    case 'i':
                    case 'index':
                    default:
                        $schema .=  'CREATE INDEX ';
                }
                $schema .=
                    "{$this->table}_{$field}_{$type}" .
                    ' ON ' . $this->table . '(' . $field . ');' . PHP_EOL;
            }
        }

        return $schema;
    }
13285
private function getServiceSchema($service)
    {
        $operation = $service->getOperation();
        $schema = new \stdClass();
        switch (strtolower($service->getMethod())) {
            case "post":
            case "put":
                try {
                    $parameters = $operation->getDocumentObjectProperty('parameters', Parameter\Body::class, true);
                } catch (MissingDocumentPropertyException $e) {
                    // request has no params
                    break;
                }
                foreach ($parameters as $parameter) {
                    /**
                     * there is no schema information available, if $action->parameters[0]->in != 'body'
                     *
                     * @link http://swagger.io/specification/#parameterObject
                     */
                    if ($parameter instanceof Parameter\Body && $parameter->getIn() === 'body') {
                        $ref = $parameter->getDocumentObjectProperty('schema', Reference::class)->getDocument();
                        $schema = $this->resolveSchema($ref);
                        break;
                    }
                }
                break;
            case "get":
                try {
                    $response = $operation->getResponses()->getHttpStatusCode(200);
                } catch (MissingDocumentPropertyException $e) {
                    // no response with status code 200 is defined
                    break;
                }
                $schema = $this->resolveSchema($response->getSchema()->getDocument());
                break;
        }

        return $schema;
    }
12858
protected function buildEndpoint()
    {
        $endpoint = $this->authorization->apiEndpoint . '/tables/' . $this->tableName . '/';

        // If there is a specific record ID, append that to the endpoint
        if ($this->recordID) { $endpoint .= $this->recordID; }

        return $endpoint;
    }
361060
public function getEndpoints()
    {
        $uri = 'endpoints';
        $response = $this->client->getEndpoint()->get($uri);

        $endpoints = [];
        foreach (\GuzzleHttp\json_decode($response->getBody()) as $endpoint) {
            $endpoints[] = new Endpoint($this->client, $endpoint);
        }

        return $endpoints;
    }
664636
public function getSchemas()
    {
        if (count($this->schemas) === 0) {
            $this->schemas['metadata'] = $this->em->getMetadataFactory()->getAllMetadata();
            $this->schemas['fromSchema'] = $this->em->getConnection()->getSchemaManager()->createSchema();
            $this->schemas['toSchema'] = $this->schemaTool->getSchemaFromMetadata($this->schemas['metadata']);
        }

        // cloning schemas is much more ligther than re-generating them for each platform
        return array(
            'fromSchema' => clone $this->schemas['fromSchema'],
            'toSchema' => clone $this->schemas['toSchema'],
            'metadata' => $this->schemas['metadata'],
        );
    }