Skip to content

Commit e096619

Browse files
committed
swagger schema adapter
1 parent 2dee471 commit e096619

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/Constraint/Type.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
class Type implements Constraint
66
{
7+
// TODO deprecate in favour of JsonSchema::<TYPE> ?
78
const OBJECT = 'object';
89
const STRING = 'string';
910
const INTEGER = 'integer';

src/Util/SwaggerSchemaAdapter.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace Swaggest\JsonSchema\Util;
4+
5+
use Swaggest\JsonSchema\Schema as JsonBasicSchema;
6+
use Swaggest\JsonSchema\SwaggerSchema\Schema;
7+
8+
class SwaggerSchemaAdapter extends JsonBasicSchema
9+
{
10+
public static function convert(Schema $schema)
11+
{
12+
return JsonBasicSchema::import(Schema::export($schema));
13+
}
14+
}

0 commit comments

Comments
 (0)