Skip to content

Commit cf7aaca

Browse files
authored
feat: add basic XSD and OWL support (#204)
* feat: add basic XSD and OWL support * fix: Doctrine ORM support * fix: MongoDB ODM generator * fix: ConstraintAnnotationGenerator * feat: exclude deprecated properties * feat: OWL cardinality support * fix: detect parent classes * fix: many fixes * feat: stop pluralizing or singularizing property names * fix: add ignored properties * fix: many fixes improving ActivityPub support * feat: add support for types and properties exclusion * fix: various fixes and improvements * fix some tests * fix: tests * fix: cs * fix: better composer.json * fix: some bugs and tests * docs: add changelog
1 parent f077769 commit cf7aaca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+5945
-2544
lines changed

.travis.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,30 @@ cache:
66

77
matrix:
88
include:
9-
- php: '7.4'
9+
- php: '8.0'
1010
env: coverage=1 lint=1
1111
- php: '7.4'
12-
env: deps='low'
1312

1413
before_install:
1514
- phpenv config-rm xdebug.ini || echo "xdebug not available"
1615
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
1716
- export PATH="$PATH:$HOME/.composer/vendor/bin"
1817
- if [[ $coverage = 1 ]]; then mkdir -p build/logs; fi
19-
- if [[ $coverage = 1 ]]; then wget https://github.com/satooshi/php-coveralls/releases/download/v2.2.0/php-coveralls.phar; fi
20-
- if [[ $lint = 1 ]]; then wget https://github.com/phpstan/phpstan/releases/download/0.12.9/phpstan.phar; fi
21-
- wget -O box.phar https://github.com/humbug/box/releases/download/3.8.4/box.phar
18+
- if [[ $coverage = 1 ]]; then wget https://github.com/satooshi/php-coveralls/releases/download/v2.4.3/php-coveralls.phar; fi
19+
- wget -O box.phar https://github.com/humbug/box/releases/download/3.11.1/box.phar
2220
- export BOX_BIN=$(pwd)/box.phar
2321

2422
install:
25-
- if [[ $coverage = 1 ]]; then composer require --dev --no-update 'phpunit/php-code-coverage:^8.0'; fi
26-
- if [[ ! $deps && $TRAVIS_PHP_VERSION = "7.4" ]]; then composer install --prefer-dist --no-progress --no-suggest --ansi; fi
27-
- if [[ $TRAVIS_PHP_VERSION != "7.4" ]]; then composer update --prefer-stable --prefer-dist --no-progress --no-suggest --ansi; fi
23+
- if [[ $coverage = 1 ]]; then composer require --dev --no-update 'phpunit/php-code-coverage:^9.2'; fi
24+
- if [[ ! $deps && $TRAVIS_PHP_VERSION = "8.0" ]]; then composer install --prefer-dist --no-progress --no-suggest --ansi; fi
25+
- if [[ $TRAVIS_PHP_VERSION != "8.0" ]]; then composer update --prefer-stable --prefer-dist --no-progress --no-suggest --ansi; fi
2826
- if [[ $deps = 'low' ]]; then composer update --prefer-dist --no-progress --no-suggest --prefer-stable --prefer-lowest --ansi; fi
2927

3028
script:
3129
- if [[ $coverage = 1 ]]; then phpdbg -qrr vendor/bin/simple-phpunit --coverage-clover build/logs/clover.xml; else vendor/bin/simple-phpunit; fi
3230
- if [[ $lint = 1 ]]; then vendor/bin/php-cs-fixer fix --dry-run --diff --no-ansi; fi
33-
- if [[ $lint = 1 ]]; then php phpstan.phar analyse; fi
34-
- if [[ ! $deps && $TRAVIS_PHP_VERSION = "7.4" ]]; then ./bin/compile; fi
31+
- if [[ $lint = 1 ]]; then vendor/bin/phpstan analyse; fi
32+
- if [[ ! $deps && $TRAVIS_PHP_VERSION = "8.0" ]]; then ./bin/compile; fi
3533

3634
after_success:
3735
- if [[ $coverage = 1 ]]; then travis_retry php php-coveralls.phar; fi
@@ -45,5 +43,5 @@ deploy:
4543
on:
4644
tags: true
4745
repo: api-platform/schema-generator
48-
php: '7.4'
46+
php: '8.0'
4947
condition: "! $deps"

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## 3.0.0
4+
5+
* Support for [the Web Ontology Language (OWL)](https://en.wikipedia.org/wiki/Web_Ontology_Language) (including for [the ActivityStream vocabulary](https://www.w3.org/TR/activitystreams-core/))
6+
* Support for [XML Schema](https://en.wikipedia.org/wiki/XML_Schema_(W3C)) types
7+
* Compatbility with the latest version of Schema.org
8+
* Improved PHP type hints generation (including support for typed properties)
9+
* Improved PHPDoc support
10+
* Upgrade to EasyRDF 1 and Doctrine Inflector 2
11+
* More flexible configuration
12+
* The `generate-types` command has been renamed `generate`
13+
314
## 2.2.2
415

516
* Update to Symfony 5

bin/compile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -eox pipefail
44

55
php "$BOX_BIN" compile;
66

7-
php schema.phar generate-types tmp/ tests/e2e/schema.yml;
7+
php schema.phar generate tmp/ tests/e2e/schema.yml;
88

99
diff tests/e2e/src/App/Entity/Person.php tmp/App/Entity/Person.php;
1010
diff tests/e2e/src/App/Entity/PostalAddress.php tmp/App/Entity/PostalAddress.php;

bin/schema

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ if (file_exists(__DIR__ . '/../../../autoload.php')) {
1818
use Symfony\Component\Console\Application;
1919
use ApiPlatform\SchemaGenerator\Command\ExtractCardinalitiesCommand;
2020
use ApiPlatform\SchemaGenerator\Command\DumpConfigurationCommand;
21-
use ApiPlatform\SchemaGenerator\Command\GenerateTypesCommand;
21+
use ApiPlatform\SchemaGenerator\Command\GenerateCommand;
2222

2323
$application = new Application();
2424
$application->add(new ExtractCardinalitiesCommand());
2525
$application->add(new DumpConfigurationCommand());
26-
$application->add(new GenerateTypesCommand());
26+
$application->add(new GenerateCommand());
2727
$application->run();

box.json.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
],
1010

1111
"directories-bin": [
12-
"data/",
1312
"templates/"
1413
],
1514
"files": [

composer.json

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "library",
44
"description": "Various tools to generate a data model based on Schema.org vocables",
55
"keywords": ["schema.org", "semantic", "model", "doctrine", "symfony", "entity", "enum"],
6-
"homepage": "https://api-platform.com",
6+
"homepage": "https://api-platform.com/docs/schema-generator/",
77
"license": "MIT",
88
"authors": [
99
{
@@ -21,24 +21,26 @@
2121
"php": ">=7.4",
2222
"ext-json": "*",
2323
"doctrine/inflector": "^1.4.3 || ^2.0",
24-
"easyrdf/easyrdf": "dev-master",
24+
"easyrdf/easyrdf": "^1.1",
2525
"friendsofphp/php-cs-fixer": "^2.15",
2626
"league/html-to-markdown": "^4.9",
2727
"psr/log": "^1.0",
28-
"symfony/config": "^5.1",
29-
"symfony/console": "^5.1",
30-
"symfony/yaml": "^5.1",
31-
"symfony/filesystem": "^5.1",
32-
"twig/twig": " ^3.0"
28+
"symfony/config": "^5.2",
29+
"symfony/console": "^5.2",
30+
"symfony/yaml": "^5.2",
31+
"symfony/filesystem": "^5.2",
32+
"twig/twig": "^3.0"
3333
},
3434
"require-dev": {
35-
"api-platform/core": "^2.6",
35+
"api-platform/core": "^2.5",
3636
"doctrine/orm": "^2.7",
3737
"myclabs/php-enum": "^1.7",
38-
"symfony/doctrine-bridge": "^5.1",
39-
"symfony/phpunit-bridge": "^5.1",
40-
"symfony/serializer": "^5.1",
41-
"symfony/validator": "^5.1"
38+
"symfony/doctrine-bridge": "^5.2",
39+
"symfony/phpunit-bridge": "^5.2",
40+
"symfony/serializer": "^5.2",
41+
"symfony/validator": "^5.2",
42+
"phpspec/prophecy-phpunit": "^2.0",
43+
"phpstan/phpstan": "^0.12"
4244
},
4345
"bin": ["bin/schema"],
4446
"minimum-stability": "dev"

0 commit comments

Comments
 (0)