Skip to content

Feature/43153 documentation #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ac6a093
Initial Symfony Install
benhillier May 13, 2019
c5b6136
Add docker configuration
benhillier May 13, 2019
08aa612
Ad docker README reminder
benhillier May 13, 2019
07da6b4
Add Annotations and Ping controller
benhillier May 13, 2019
57befe5
Add code validators
benhillier May 13, 2019
45d13b6
Add list response of Institutions
benhillier May 13, 2019
d84ee52
Add template Institution files
benhillier May 14, 2019
6c55f26
Implement architectural sketch of OpenSkos API
May 20, 2019
781d63f
Merge pull request #1 from antohaby/feature/14209-institutions
benhillier May 22, 2019
4afe5b1
Snapshot. Completed Connection to Jena
benhillier May 24, 2019
a180274
Added Pagination classes and testing
benhillier May 27, 2019
251e350
Added format to 'Pagination', and refactored it to 'ApiRequest'
benhillier May 27, 2019
7a605e0
Formatting
benhillier May 27, 2019
76c8fa2
Added Encoders/Decoders for EasyRDF. Implemented some Content Types
benhillier May 28, 2019
8fc059e
Updated Encoders. Added Unittest of RDF Types
benhillier May 29, 2019
7a424c2
#39331. Refactored Institution collection to TripleSets
benhillier Jun 3, 2019
b9ce9fe
Removed unwanted class I should not have commited
benhillier Jun 3, 2019
a7e076b
Removed unit test I would never be able to get right
benhillier Jun 4, 2019
58b6c95
Split up serialiser unit tests to individual types
benhillier Jun 4, 2019
8b63358
#39335 Sets Level 1 and All sets
benhillier Jun 13, 2019
c6fc84b
#39336 Sets Level 2
benhillier Jun 13, 2019
7ecb263
Merge pull request #2 from picturae/feature/automated-tests
antohaby Jun 14, 2019
e3cbd5e
Refactoring and improvements
Jun 17, 2019
e031375
Refactoring and improvements
Jun 17, 2019
f8257a6
Moved OpenSkos Exceptions to separate namespace
Jun 18, 2019
734e130
Moved Institution Under OpenSkos namespace
Jun 18, 2019
4437a1b
Exteract OpenSkosResource as abstract clas
Jun 18, 2019
b7eba1d
Move SkosResource to VocabularyAwareResource
Jun 18, 2019
82bd7ad
Fix Symfony Configuration
Jun 18, 2019
e79285e
Extract common parts
Jun 19, 2019
992d228
Reimplement sets after the refactoring
benhillier Jun 20, 2019
ee1ce6f
Work on ConceptSchemes
benhillier Jun 25, 2019
3bab5a2
Repaired some anotations
benhillier Jun 25, 2019
fc5bea2
43153 - Added Swagger to the API for automatic generation of document…
SanderPicturae Jun 28, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
COMPOSE_PROJECT_NAME=openskosapi
COMPOSE_FILE=docker/docker-compose.yml
33 changes: 14 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
rsync.sh
application/configs/application.ini
.idea
cache/
.sass-cache/
public/data/export/*
/data/uploads/
/data/solr/
/public/data/icons/
###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/public/bundles/
/var/
/vendor/
/nbproject/
/node_modules/
/public/apidoc/
/apidoc/
/public/oaidoc/
/application/configs/application.ini_backup.dist
/application/configs/application_corrupted.ini
/application/configs/application_backup.ini
/application/configs/custom.ini
/data/solr/data/
api-docs.json
###< symfony/framework-bundle ###

.DS_Store
.idea
###> friendsofphp/php-cs-fixer ###
/.php_cs.cache
###< friendsofphp/php-cs-fixer ###
16 changes: 16 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

$finder = PhpCsFixer\Finder::create()
->exclude(['var', 'vendor'])
->in(__DIR__)
;

return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'strict_param' => true,
'array_syntax' => ['syntax' => 'short'],
'@Symfony' => true,
])
->setFinder($finder)
;
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,36 @@
# OpenSkos-API
Restful API for OpenSkos

## Development

### Installation:

* `composer install`
* `vendor/bin/grumphp git:init` -- grump will make sure that you have no mistakes before commit ;)

### Tests

Test are written using [PHPSpec](https://www.phpspec.net/en/stable/manual/introduction.html)
Run tests by: `vendor/bin/phpspec run`

### Static analyser

To have code strictly typed with nullability checks and etc. [Psalm](https://psalm.dev/) will help.
Run psalm by: `vendor/bin/psalm`

### Development procedure:
* Pull latest master
* Create feature/bug branch `feature/code-and-short-title`
* Commit all needed changes
* Write documentation if needed under `doc/feature-name.md`
* Make sure you're code is covered by tests at least critical parts
* Submit PR to github.
* Wait for Approvals from dev-team and get ready for changes during PR discussion
* ...?
* Profit!

## Swagger / OpenAPI documentation
Run `composer run docs` to generate api-docs.json file to use in Swagger UI

## Docker
TODO
42 changes: 42 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env php
<?php

use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Debug\Debug;

if (false === in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.\PHP_SAPI.' SAPI'.\PHP_EOL;
}

set_time_limit(0);

require dirname(__DIR__).'/vendor/autoload.php';

if (!class_exists(Application::class)) {
throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}

$input = new ArgvInput();
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}

if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
}

require dirname(__DIR__).'/config/bootstrap.php';

if ($_SERVER['APP_DEBUG']) {
umask(0000);

if (class_exists(Debug::class)) {
Debug::enable();
}
}

$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->run($input);
74 changes: 74 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"type": "project",
"license": "proprietary",
"require": {
"php": "^7.3",
"ext-ctype": "*",
"ext-iconv": "*",
"easyrdf/easyrdf": "^0.9.1",
"ml/json-ld": "^1.1",
"sensio/framework-extra-bundle": "^5.3",
"symfony/console": "4.2.*",
"symfony/dotenv": "4.2.*",
"symfony/flex": "^1.1",
"symfony/framework-bundle": "4.2.*",
"symfony/property-access": "4.2.*",
"symfony/serializer": "4.2.*",
"symfony/yaml": "4.2.*",
"zircote/swagger-php": "^3.0"
},
"config": {
"preferred-install": {
"*": "dist"
},
"sort-packages": true
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*"
},
"scripts": {
"docs": "./vendor/bin/openapi --output api-docs.json --bootstrap ./src/Swagger.php src",
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "4.2.*"
}
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.15",
"phpro/grumphp": "^0.15.0",
"phpspec/phpspec": "^5.1",
"phpstan/phpstan": "^0.11.6",
"symfony/profiler-pack": "^1.0",
"vimeo/psalm": "^3.2"
}
}
Loading