Joli\Jane\OpenApi\JaneOpenApi::generate PHP Method

generate() public method

Generate a list of files
public generate ( string $openApiSpec, string $namespace, string $directory ) : File[]
$openApiSpec string Location of the specification
$namespace string Namespace of the library
$directory string Path for the root directory of the generated files
return Joli\Jane\Generator\File[]
    public function generate($openApiSpec, $namespace, $directory)
    {
        /** @var OpenApi $openApi */
        $context = $this->createContext($openApiSpec, 'Client', $namespace, $directory);
        $files = [];
        $files = array_merge($files, $this->modelGenerator->generate($context->getRootReference(), 'Client', $context));
        $files = array_merge($files, $this->normalizerGenerator->generate($context->getRootReference(), 'Client', $context));
        $clients = $this->clientGenerator->generate($context->getRootReference(), $namespace, $context);
        foreach ($clients as $node) {
            $files[] = new File($directory . DIRECTORY_SEPARATOR . 'Resource' . DIRECTORY_SEPARATOR . $node->stmts[2]->name . '.php', $node, '');
        }
        return $files;
    }