Swagger_Documentation::get_documentation()

Returns an array in the format used by Swagger 2.0.


Return

(array) An array description of a Swagger supported component.


Top ↑

Source

File: src/Event_Automator/Zapier/REST/V1/Documentation/Swagger_Documentation.php

	public function get_documentation() {
		$url = '';
		if ( function_exists( 'tribe_events_rest_url' ) ) {
			$url = tribe_events_rest_url();
		} else if ( function_exists( 'tribe_tickets_rest_url' )  ) {
			$url = tribe_tickets_rest_url();
		}

		$documentation = [
			'openapi'    => $this->open_api_version,
			'info'       => $this->get_api_info(),
			'servers'    => [
				[
					'url' => $url,
				],
			],
			'paths'      => $this->get_paths(),
			'components' => [ 'schemas' => $this->get_definitions() ],
		];

		/**
		 * Filters the Swagger documentation generated for the TEC REST API.
		 *
		 * @since 1.0.0
		 *
		 * @param array<string|mixed>   $documentation An associative PHP array in the format supported by Swagger.
		 * @param Swagger_Documentation $this          This documentation endpoint instance.
		 *
		 * @link  http://swagger.io/
		 */
		$documentation = apply_filters( 'tec_event_automator_rest_swagger_documentation', $documentation, $this );

		return $documentation;
	}

Top ↑

Changelog

Changelog
Version Description
1.0.0 Introduced.