Example #1
0
 * Notes: This can only be done by the logged in user.
 * Output-Formats: [application/xml, application/json]
 */
$app->PUT('/user/{username}', function ($request, $response, $args) {
    $body = $request->getParsedBody();
    $response->write('How about implementing updateUser as a PUT method ?');
    return $response;
});
/**
 * DELETE deleteUser
 * Summary: Delete user
 * Notes: This can only be done by the logged in user.
 * Output-Formats: [application/xml, application/json]
 */
$app->DELETE('/user/{username}', function ($request, $response, $args) {
    $response->write('How about implementing deleteUser as a DELETE method ?');
    return $response;
});
/**
 * GET getInventory
 * Summary: Returns pet inventories by status
 * Notes: Returns a map of status codes to quantities
 * Output-Formats: [application/json]
 */
$app->GET('/store/inventory', function ($request, $response, $args) {
    $response->write('How about implementing getInventory as a GET method ?');
    return $response;
});
/**
 * POST placeOrder
 * Summary: Place an order for a pet
 * Notes: 
Example #2
0
<?php

/**
 * Experiment try
 * @version 2.0
 */
require_once __DIR__ . '/vendor/autoload.php';
$app = new Slim\App();
/**
 * DELETE canceljob
 * Summary: Cancel a job
 * Notes: 
 * Output-Formats: [application/json]
 */
$app->DELETE('/jobs/{jobId}?api-version&#x3D;2.0', function ($request, $response, $args) {
    $response->write('How about implementing canceljob as a DELETE method ?');
    return $response;
});
/**
 * POST execute
 * Summary: Execute the web service and get a response synchronously
 * Notes: 
 * Output-Formats: [application/json]
 */
$app->POST('/execute?api-version&#x3D;2.0&amp;format&#x3D;swagger', function ($request, $response, $args) {
    $body = $request->getParsedBody();
    $response->write('How about implementing execute as a POST method ?');
    return $response;
});
/**
 * GET getSwaggerDocument
 * Summary: Get swagger API document for the web service