|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @file ATTENTION!!! The code below was carefully crafted by a mean machine. |
|
4
|
|
|
* Please consider to NOT put any emotional human-generated modifications as AI will throw them away with no mercy. |
|
5
|
|
|
*/ |
|
6
|
|
|
|
|
7
|
|
|
namespace Swaggest\JsonSchema\SwaggerSchema; |
|
8
|
|
|
|
|
9
|
|
|
use Swaggest\JsonSchema\Constraint\Properties; |
|
10
|
|
|
use Swaggest\JsonSchema\Schema as JsonBasicSchema; |
|
11
|
|
|
use Swaggest\JsonSchema\Structure\ClassStructure; |
|
12
|
|
|
|
|
13
|
|
|
|
|
14
|
|
|
class Oauth2AccessCodeSecurity extends ClassStructure { |
|
15
|
|
|
/** @var string */ |
|
16
|
|
|
public $type; |
|
17
|
|
|
|
|
18
|
|
|
/** @var string */ |
|
19
|
|
|
public $flow; |
|
20
|
|
|
|
|
21
|
|
|
/** @var string[] */ |
|
22
|
|
|
public $scopes; |
|
23
|
|
|
|
|
24
|
|
|
/** @var string */ |
|
25
|
|
|
public $authorizationUrl; |
|
26
|
|
|
|
|
27
|
|
|
/** @var string */ |
|
28
|
|
|
public $tokenUrl; |
|
29
|
|
|
|
|
30
|
|
|
/** @var string */ |
|
31
|
|
|
public $description; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @param Properties|static $properties |
|
35
|
|
|
* @param JsonBasicSchema $ownerSchema |
|
36
|
|
|
*/ |
|
37
|
|
|
public static function setUpProperties($properties, JsonBasicSchema $ownerSchema) |
|
38
|
|
|
{ |
|
39
|
|
|
$properties->type = JsonBasicSchema::string(); |
|
40
|
|
|
$properties->type->enum = array ( |
|
41
|
|
|
0 => 'oauth2', |
|
42
|
|
|
); |
|
43
|
|
|
$properties->flow = JsonBasicSchema::string(); |
|
44
|
|
|
$properties->flow->enum = array ( |
|
45
|
|
|
0 => 'accessCode', |
|
46
|
|
|
); |
|
47
|
|
|
$properties->scopes = JsonBasicSchema::object(); |
|
48
|
|
|
$properties->scopes->additionalProperties = JsonBasicSchema::string(); |
|
49
|
|
|
$properties->authorizationUrl = JsonBasicSchema::string(); |
|
50
|
|
|
$properties->authorizationUrl->format = 'uri'; |
|
51
|
|
|
$properties->tokenUrl = JsonBasicSchema::string(); |
|
52
|
|
|
$properties->tokenUrl->format = 'uri'; |
|
53
|
|
|
$properties->description = JsonBasicSchema::string(); |
|
54
|
|
|
$ownerSchema->type = 'object'; |
|
|
|
|
|
|
55
|
|
|
$ownerSchema->additionalProperties = false; |
|
56
|
|
|
$ownerSchema->patternProperties['^x-'] = new JsonBasicSchema(); |
|
57
|
|
|
$ownerSchema->patternProperties['^x-']->description = 'Any property starting with x- is valid.'; |
|
|
|
|
|
|
58
|
|
|
$ownerSchema->required = array ( |
|
59
|
|
|
0 => 'type', |
|
60
|
|
|
1 => 'flow', |
|
61
|
|
|
2 => 'authorizationUrl', |
|
62
|
|
|
3 => 'tokenUrl', |
|
63
|
|
|
); |
|
64
|
|
|
} |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
|
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..