@@ -200,44 +200,46 @@ public function emitJson(Transaction $transaction): void
200
200
* 4.5.2 Paths for Single Entities
201
201
* @link https://docs.oasis-open.org/odata/odata-openapi/v1.0/cn01/odata-openapi-v1.0-cn01.html#sec_PathsforSingleEntities
202
202
*/
203
- if ($ entityType ->hasKey () && ($ annotations ->supportsRead () || $ annotations ->supportsUpdate () || $ annotations ->supportsDelete ())) {
204
- $ pathItemObject = (object ) [];
205
- $ paths ->{"/ {$ entitySet ->getName ()}/{ {$ entityType ->getKey ()->getName ()}} " } = $ pathItemObject ;
203
+ if ($ entityType ->hasKey ()) {
204
+ if ($ annotations ->supportsRead () || $ annotations ->supportsUpdate () || $ annotations ->supportsDelete ()) {
205
+ $ pathItemObject = (object ) [];
206
+ $ paths ->{"/ {$ entitySet ->getName ()}/{ {$ entityType ->getKey ()->getName ()}} " } = $ pathItemObject ;
206
207
207
- $ pathItemObject ->parameters = [$ this ->generateKeyParameter ($ entitySet )];
208
+ $ pathItemObject ->parameters = [$ this ->generateKeyParameter ($ entitySet )];
208
209
209
- if ($ annotations ->supportsRead ()) {
210
- $ this ->generateReadRoutes ($ pathItemObject , $ entitySet );
211
- }
210
+ if ($ annotations ->supportsRead ()) {
211
+ $ this ->generateReadRoutes ($ pathItemObject , $ entitySet );
212
+ }
212
213
213
- if ($ annotations ->supportsUpdate ()) {
214
- $ this ->generateUpdateRoutes ($ pathItemObject , $ entitySet );
215
- }
214
+ if ($ annotations ->supportsUpdate ()) {
215
+ $ this ->generateUpdateRoutes ($ pathItemObject , $ entitySet );
216
+ }
216
217
217
- if ($ annotations ->supportsDelete ()) {
218
- $ this ->generateDeleteRoutes ($ pathItemObject , $ entitySet );
218
+ if ($ annotations ->supportsDelete ()) {
219
+ $ this ->generateDeleteRoutes ($ pathItemObject , $ entitySet );
220
+ }
219
221
}
220
- }
221
222
222
- foreach ($ entityType ->getNavigationProperties () as $ navigationProperty ) {
223
- $ navigationSet = $ entitySet ->getBindingByNavigationProperty ($ navigationProperty )->getTarget ();
223
+ foreach ($ entityType ->getNavigationProperties () as $ navigationProperty ) {
224
+ $ navigationSet = $ entitySet ->getBindingByNavigationProperty ($ navigationProperty )->getTarget ();
224
225
225
- $ pathItemObject = (object ) [];
226
- $ paths ->{"/ {$ entitySet ->getName ()}/{ {$ entityType ->getKey ()->getName ()}}/ {$ navigationProperty ->getName ()}" } = $ pathItemObject ;
226
+ $ pathItemObject = (object ) [];
227
+ $ paths ->{"/ {$ entitySet ->getName ()}/{ {$ entityType ->getKey ()->getName ()}}/ {$ navigationProperty ->getName ()}" } = $ pathItemObject ;
227
228
228
- /** @var Description $description */
229
- if ($ description = $ navigationProperty ->getAnnotations ()->sliceByClass (Description::class)->first ()) {
230
- $ pathItemObject ->summary = $ description ->toJson ();
231
- }
229
+ /** @var Description $description */
230
+ if ($ description = $ navigationProperty ->getAnnotations ()->sliceByClass (Description::class)->first ()) {
231
+ $ pathItemObject ->summary = $ description ->toJson ();
232
+ }
232
233
233
- $ pathItemObject ->parameters = [$ this ->generateKeyParameter ($ entitySet )];
234
+ $ pathItemObject ->parameters = [$ this ->generateKeyParameter ($ entitySet )];
234
235
235
- if ($ entitySet instanceof QueryInterface) {
236
- $ this ->generateQueryRoutes ($ pathItemObject , $ navigationSet , $ entitySet );
237
- }
236
+ if ($ entitySet instanceof QueryInterface) {
237
+ $ this ->generateQueryRoutes ($ pathItemObject , $ navigationSet , $ entitySet );
238
+ }
238
239
239
- if ($ annotations ->supportsInsert ()) {
240
- $ this ->generateCreateRoutes ($ pathItemObject , $ navigationSet , $ entitySet );
240
+ if ($ annotations ->supportsInsert ()) {
241
+ $ this ->generateCreateRoutes ($ pathItemObject , $ navigationSet , $ entitySet );
242
+ }
241
243
}
242
244
}
243
245
}
@@ -1090,6 +1092,7 @@ protected function uniqueTags(array $tags): array
1090
1092
*
1091
1093
* @param Property|null $property
1092
1094
* @param array $schema
1095
+ *
1093
1096
* @return array
1094
1097
*/
1095
1098
public static function applyProperty (?Property $ property = null , array $ schema = []): array
@@ -1132,4 +1135,4 @@ public static function applyProperty(?Property $property = null, array $schema =
1132
1135
1133
1136
return $ schema ;
1134
1137
}
1135
- }
1138
+ }
0 commit comments