[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/Remote/OpenApiDoc/ -> OpenAPIGenerator.php (summary)

(no description)

File Size: 382 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

OpenAPIGenerator:: (11 methods):
  __construct()
  generate()
  getErrorCodes()
  addServers()
  addSecurity()
  addMethods()
  getMethodDefinition()
  getMethodArguments()
  generateExample()
  generateLink()
  typeToSchema()


Class: OpenAPIGenerator  - X-Ref

Generates the OpenAPI documentation for the DokuWiki API

__construct()   X-Ref
OpenAPIGenerator constructor.


generate()   X-Ref
Generate the OpenAPI documentation

return: string JSON encoded OpenAPI specification

getErrorCodes()   X-Ref
Read all error codes used in ApiCore.php

This is useful for the documentation, but also for checking if the error codes are unique

return: array

addServers()   X-Ref
Add the current DokuWiki instance as a server

return: void

addSecurity()   X-Ref
Define the default security schemes

return: void

addMethods()   X-Ref
Add all methods available in the API to the documentation

return: void

getMethodDefinition(string $method, ApiCall $call)   X-Ref
Create the schema definition for a single API method

param: string $method API method name
param: ApiCall $call The call definition
return: array

getMethodArguments($args)   X-Ref
Create the schema definition for the arguments of a single API method

param: array $args The arguments of the method as returned by ApiCall::getArgs()
return: array

generateExample($name, $type)   X-Ref
Generate an example value for the given parameter

param: string $name The parameter's name
param: string $type The parameter's type
return: mixed

generateLink($url)   X-Ref
Generates a markdown link from a dokuwiki.org URL

param: $url
return: mixed|string

typeToSchema(Type $type)   X-Ref
Generate the OpenAPI schema for the given type

param: Type $type
return: array