Interface for OpenAPI3RouterFactory. <br/> To add an handler, use @see \io\vertx\jphp\ext\web\api\contract\openapi3\OpenAPI3RouterFactory::addHandlerByOperationId<br/> Usage example: <pre> <code>OpenAPI3RouterFactory.create(vertx, "src/resources/spec.yaml", asyncResult -> { if (!asyncResult.succeeded()) { // IO failure or spec invalid</code> else { OpenAPI3RouterFactory routerFactory = asyncResult.result(); routerFactory.addHandlerByOperationId("operation_id", routingContext -> { // Do something }, routingContext -> { // Do something with failure handler }); Router router = routerFactory.getRouter(); } }); } </pre> <br/> Handlers are loaded in this order:<br/> <ol> <li>Body handler (Customizable with </li> <li>Custom global handlers configurable with </li> <li>Global security handlers defined in upper spec level</li> <li>Operation specific security handlers</li> <li>Generated validation handler</li> <li>User handlers or "Not implemented" handler</li> </ol>
package |
Default |
---|
__construct()
addFailureHandlerByOperationId( $arg0, $arg1) : $this
string
callable
$this
this factory
addGlobalHandler( $arg0) : $this
callable
$this
this object
addHandlerByOperationId( $arg0, $arg1) : $this
string
callable
$this
this factory
addSecurityHandler( $arg0, $arg1) : $this
string
callable
$this
addSecuritySchemaScopeValidator( $arg0, $arg1, $arg2) : $this
string
string
callable
$this
this factory
create( $arg0, $arg1, $arg2, $arg3 = null) : void
param $vertx [Vertx]
param $url [string] location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)
param $handler [callable] When specification is loaded, this handler will be called with AsyncResult
Create a new OpenAPI3RouterFactory
param $vertx [Vertx]
param $url [string] location of your spec. It can be an absolute path, a local path or remote url (with HTTP protocol)
param $auth [array] list of authorization values needed to access the remote url. Each item should be json representation of an \AuthorizationValue
param $handler [callable] When specification is loaded, this handler will be called with AsyncResult
Vertx
string
callable | array
callable
getOptions() : \io\vertx\jphp\ext\web\api\contract\RouterFactoryOptions
getRouter() : \io\vertx\jphp\ext\web\Router
getValidationFailureHandler() : callable
callable
mountOperationToEventBus( $arg0, $arg1) : $this
string
string
$this
this factory
mountServiceFromTag( $arg0, $arg1) : $this
The request is handled by the method that matches the operation id. Please give a look at vertx-web-api-service documentation for more informations
string
string
$this
this factory
mountServicesFromExtensions() : $this
$this
this factory
setBodyHandler( $arg0) : $this
BodyHandler
$this
self
setExtraOperationContextPayloadMapper( $arg0) : $this
callable
$this
setNotImplementedFailureHandler( $arg0) : $this
callable
$this
this object
setOptions( $arg0) : $this
array | RouterFactoryOptions
$this
setValidationFailureHandler( $arg0) : $this
callable
$this
this object