WORK IN PROGRESS - NOT READY FOR USAGE
Appwrite SDK generator is a PHP library for auto generating SDK library for multiple languages or platforms.
The SDK uses predefined language settings and Twig templates to generate code base on different API specs.
Currently the only spec supported is Swagger 2.0, but we intend to add support for more specification in the near future.
You can view examples of generated code libraries in the examples directory.
Install using composer:
composer require appwrite/sdk-generator
Create language and SDK instances and generate code to target directory.
<?php
require_once 'vendor/autoload.php';
use Appwrite\Spec\Swagger2;
use Appwrite\SDK\SDK;
use Appwrite\SDK\Language\PHP;
// Read API specification file (Swagger 2) anc create spec instance
$spec = new Swagger2(file_get_contents('https://appwrite.io/v1/open-api-2.json?extension=1'));
// Create language instance
$lang = new PHP();
$lang // Set language or platform specific options
->setComposerPackage('my-api')
->setComposerVendor('my-company')
;
// Create the SDK object with the language and spec instances
$sdk = new SDK($lang, $spec);
$sdk
->setLogo('https://appwrite.io/v1/images/console.png')
->setLicenseContent('License content here.')
->setVersion('v1.1.0')
;
$sdk->generate(__DIR__ . '/examples/php'); // Generate source code
- OpenAPI 3 (Not Ready)
- Swagger 2
- RAML 1.0 (Not Ready)
- RAML 0.8 (Not Ready)
- Postman 2.0 (Not Ready)
- Postman 1.0 (Not Ready)
- API Blueprint 1A (Not Ready)
Language | Coding Standards | Package Manager | Maintainer |
---|---|---|---|
PHP | PHP FIG | Composer | @eldadfux |
Javascript | NPM Coding Style | NPM, Yarn, Bower | @eldadfux |
NodeJS | NPM Coding Style | NPM, Yarn | @eldadfux |
Ruby | Ruby Style Guide | GEM | @eldadfux |
Python | PEP8 | PIP | @eldadfux |
Dart | Effective Dart | pub tool | @Almoullim |
Go | Effective Go | go get | @panz3r |
CSharp | ? | ||
D | ? | ||
Kotlin | ? | ||
Swift | ? |
All code contributions - including those of people having commit access - must go through a pull request and approved by a core developer before being merged. This is to ensure proper review of all the code.
We truly ❤️ pull requests! If you wish to help, you can learn more about how you can contribute to this project in the contribution guide.
The MIT License (MIT) http://www.opensource.org/licenses/mit-license.php