@@ -33,11 +33,10 @@ private function setPaths() /*: void*/
33
33
foreach ($ this ->operations as $ type => $ operationPair ) {
34
34
foreach ($ operationPair as $ operation => $ method ) {
35
35
$ path = "/ $ type/ $ operation " ;
36
- $ operationType = $ operation . ucfirst ($ type );
37
36
$ this ->openapi ->set ("paths| $ path| $ method|tags|0 " , "$ type " );
38
37
$ this ->openapi ->set ("paths| $ path| $ method|operationId " , "$ operation " . "_ " . "$ type " );
39
38
$ this ->openapi ->set ("paths| $ path| $ method|description " , "Request API ' $ operation' status " );
40
- $ this ->openapi ->set ("paths| $ path| $ method|responses|200| \$ref " , "#/components/responses/ $ operationType " );
39
+ $ this ->openapi ->set ("paths| $ path| $ method|responses|200| \$ref " , "#/components/responses/ $ operation - $ type " );
41
40
42
41
}
43
42
}
@@ -47,8 +46,7 @@ private function setComponentSchema() /*: void*/
47
46
{
48
47
foreach ($ this ->operations as $ type => $ operationPair ) {
49
48
foreach ($ operationPair as $ operation => $ method ) {
50
- $ operationType = $ operation . ucfirst ($ type );
51
- $ prefix = "components|schemas| $ operationType " ;
49
+ $ prefix = "components|schemas| $ operation- $ type " ;
52
50
$ this ->openapi ->set ("$ prefix|type " , "object " );
53
51
switch ($ operation ) {
54
52
case 'ping ' :
@@ -67,9 +65,8 @@ private function setComponentResponse() /*: void*/
67
65
{
68
66
foreach ($ this ->operations as $ type => $ operationPair ) {
69
67
foreach ($ operationPair as $ operation => $ method ) {
70
- $ operationType = $ operation . ucfirst ($ type );
71
- $ this ->openapi ->set ("components|responses| $ operationType|description " , "$ operation status record " );
72
- $ this ->openapi ->set ("components|responses| $ operationType|content|application/json|schema| \$ref " , "#/components/schemas/ $ operationType " );
68
+ $ this ->openapi ->set ("components|responses| $ operation- $ type|description " , "$ operation status record " );
69
+ $ this ->openapi ->set ("components|responses| $ operation- $ type|content|application/json|schema| \$ref " , "#/components/schemas/ $ operation- $ type " );
73
70
}
74
71
}
75
72
}
0 commit comments