@@ 48-67 (lines=20) @@ | ||
45 | * |
|
46 | * @return Schema |
|
47 | */ |
|
48 | protected function createSchema(\stdClass $definition): Schema |
|
49 | { |
|
50 | // Remove non-JSON-Schema properties |
|
51 | $schemaDefinition = clone $definition; |
|
52 | $swaggerPropertyNames = [ |
|
53 | 'name', |
|
54 | 'in', |
|
55 | 'description', |
|
56 | 'required', |
|
57 | 'allowEmptyValue', |
|
58 | 'collectionFormat' |
|
59 | ]; |
|
60 | foreach ($swaggerPropertyNames as $propertyName) { |
|
61 | if (property_exists($schemaDefinition, $propertyName)) { |
|
62 | unset($schemaDefinition->$propertyName); |
|
63 | } |
|
64 | } |
|
65 | ||
66 | return Schema::get($schemaDefinition); |
|
67 | } |
|
68 | } |
|
69 |
@@ 49-68 (lines=20) @@ | ||
46 | * |
|
47 | * @return Schema |
|
48 | */ |
|
49 | protected function createSchema(\stdClass $definition): Schema |
|
50 | { |
|
51 | // Remove non-JSON-Schema properties |
|
52 | $schemaDefinition = clone $definition; |
|
53 | $swaggerPropertyNames = [ |
|
54 | 'name', |
|
55 | 'in', |
|
56 | 'description', |
|
57 | 'required', |
|
58 | 'allowEmptyValue', |
|
59 | 'collectionFormat' |
|
60 | ]; |
|
61 | foreach ($swaggerPropertyNames as $propertyName) { |
|
62 | if (property_exists($schemaDefinition, $propertyName)) { |
|
63 | unset($schemaDefinition->$propertyName); |
|
64 | } |
|
65 | } |
|
66 | ||
67 | return Schema::get($schemaDefinition); |
|
68 | } |
|
69 | } |
|
70 |