PHP code example of membrane / openapi-reader

1. Go to this page and download the library: Download membrane/openapi-reader library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

membrane / openapi-reader example snippets


$versions = [\Membrane\OpenAPIReader\OpenAPIVersion::Version_3_0];

$reader = new \Membrane\OpenAPIReader\Reader($versions);

// code to instantiate reader... 

$reader->readFromAbsoluteFilePath('~/path/to/my-openapi.yaml');

// code to instantiate reader... 

$fileFormat = \Membrane\OpenAPIReader\FileFormat::Json;

$reader->readFromAbsoluteFilePath('my-openapi', $fileFormat);

// code to instantiate reader... 

$myOpenAPI = '<Insert your OpenAPI Spec here>';
$fileFormat = \Membrane\OpenAPIReader\FileFormat::Json;

$reader->readFromString($myOpenAPI, $fileFormat)