Skip to content

Commit

Permalink
Merge pull request #89 from shopware/fix/remove-prefixes-from-openapi…
Browse files Browse the repository at this point in the history
…-schemas

fix: remove prefixes from openapi schemas
  • Loading branch information
cyl3x authored Jan 30, 2025
2 parents 558a485 + 632cc65 commit d0cb467
Show file tree
Hide file tree
Showing 19 changed files with 139 additions and 138 deletions.
6 changes: 3 additions & 3 deletions src/Administration/PayPalPaymentMethodController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public function __construct(
* @phpstan-ignore-next-line
*/
#[OA\Post(
path: '/api/_action/paypal/saleschannel-default',
path: '/_action/paypal/saleschannel-default',
operationId: 'setPayPalAsDefault',
description: 'Sets PayPal as the default payment method for a given Saleschannel, or all.',
description: 'Sets PayPal as the default payment method for a given SalesChannel, or all.',
requestBody: new OA\RequestBody(content: new OA\JsonContent(properties: [new OA\Property(
property: 'salesChannelId',
description: 'The id of the Saleschannel where PayPal should be set as the default payment method. Set to null to set PayPal as default for every Saleschannel.',
description: 'The id of the SalesChannel where PayPal should be set as the default payment method. Set to null to set PayPal as default for every Saleschannel.',
type: 'string',
nullable: true
)])),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getDecorated(): AbstractExpressCreateOrderRoute
}

#[OA\Post(
path: '/store-api/paypal/express/create-order',
path: '/paypal/express/create-order',
operationId: 'createPayPalExpressOrder',
description: 'Creates a PayPal order from the existing cart',
tags: ['Store API', 'PayPal'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function getDecorated(): AbstractExpressPrepareCheckoutRoute
}

#[OA\Post(
path: '/store-api/paypal/express/prepare-checkout',
path: '/paypal/express/prepare-checkout',
operationId: 'preparePayPalExpressCheckout',
description: 'Logs in a guest customer, with the data of a paypal order',
requestBody: new OA\RequestBody(content: new OA\JsonContent(properties: [new OA\Property(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function getDecorated(): AbstractPUIPaymentInstructionsRoute
* @throws ShopwareHttpException
*/
#[OA\Get(
path: '/store-api/paypal/pui/payment-instructions/{transactionId}',
path: '/paypal/pui/payment-instructions/{transactionId}',
operationId: 'getPUIPaymentInstructions',
description: 'Tries to get payment instructions for PUI payments',
tags: ['Store API', 'PayPal'],
Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/SalesChannel/ClearVaultRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function getDecorated(): AbstractClearVaultRoute
}

#[OA\Post(
path: '/store-api/paypal/vault/clear',
path: '/paypal/vault/clear',
operationId: 'paypalVaultClear',
description: 'Clears the vault for the current customer',
requestBody: new OA\RequestBody(content: new OA\JsonContent(properties: [
Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/SalesChannel/CreateOrderRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function getDecorated(): AbstractCreateOrderRoute
* @throws CustomerNotLoggedInException
*/
#[OA\Post(
path: '/store-api/paypal/create-order',
path: '/paypal/create-order',
operationId: 'createPayPalOrder',
description: 'Creates a PayPal order from the existing cart or an order',
requestBody: new OA\RequestBody(content: new OA\JsonContent(properties: [
Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/SalesChannel/MethodEligibilityRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function getDecorated(): AbstractMethodEligibilityRoute
* @phpstan-ignore-next-line
*/
#[OA\Post(
path: '/store-api/paypal/payment-method-eligibility',
path: '/paypal/payment-method-eligibility',
operationId: 'setPaymentMethodEligibility',
description: 'Sets ineligible payment methods to be removed from the session',
requestBody: new OA\RequestBody(content: new OA\JsonContent(properties: [
Expand Down
4 changes: 2 additions & 2 deletions src/Dispute/Administration/DisputeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(
}

#[OA\Get(
path: '/api/paypal/dispute',
path: '/paypal/dispute',
operationId: 'disputeList',
description: 'Loads a list of PayPal disputes',
tags: ['Admin API', 'PayPal'],
Expand Down Expand Up @@ -82,7 +82,7 @@ public function disputeList(Request $request): JsonResponse
}

#[OA\Get(
path: '/api/paypal/dispute/{disputeId}',
path: '/paypal/dispute/{disputeId}',
operationId: 'disputeDetails',
description: 'Loads the dispute details of the given PayPal dispute ID',
tags: ['Admin API', 'PayPal'],
Expand Down
18 changes: 9 additions & 9 deletions src/OrdersApi/Administration/PayPalOrdersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function __construct(
}

#[OA\Get(
path: '/api/paypal-v2/order/{orderTransactionId}/{paypalOrderId}',
path: '/paypal-v2/order/{orderTransactionId}/{paypalOrderId}',
operationId: 'orderDetails',
description: 'Loads the order details of the given PayPal order ID',
tags: ['Admin API', 'PayPal'],
Expand Down Expand Up @@ -104,7 +104,7 @@ public function orderDetails(string $orderTransactionId, string $paypalOrderId,
}

#[OA\Get(
path: '/api/paypal-v2/authorization/{orderTransactionId}/{authorizationId}',
path: '/paypal-v2/authorization/{orderTransactionId}/{authorizationId}',
operationId: 'authorizationDetails',
description: 'Loads the authorization details of the given PayPal authorization ID',
tags: ['Admin API', 'PayPal'],
Expand Down Expand Up @@ -144,7 +144,7 @@ public function authorizationDetails(string $orderTransactionId, string $authori
}

#[OA\Get(
path: '/api/paypal-v2/capture/{orderTransactionId}/{captureId}',
path: '/paypal-v2/capture/{orderTransactionId}/{captureId}',
operationId: 'captureDetails',
description: 'Loads the capture details of the given PayPal capture ID',
tags: ['Admin API', 'PayPal'],
Expand Down Expand Up @@ -184,7 +184,7 @@ public function captureDetails(string $orderTransactionId, string $captureId, Co
}

#[OA\Get(
path: '/api/paypal-v2/refund/{orderTransactionId}/{refundId}',
path: '/paypal-v2/refund/{orderTransactionId}/{refundId}',
operationId: 'refundDetails',
description: 'Loads the refund details of the given PayPal refund ID',
tags: ['Admin API', 'PayPal'],
Expand Down Expand Up @@ -224,7 +224,7 @@ public function refundDetails(string $orderTransactionId, string $refundId, Cont
}

#[OA\Post(
path: '/api/_action/paypal-v2/refund-capture/{orderTransactionId}/{captureId}/{paypalOrderId}',
path: '/_action/paypal-v2/refund-capture/{orderTransactionId}/{captureId}/{paypalOrderId}',
operationId: 'refundCapture',
description: 'Refunds the PayPal capture and sets the state of the Shopware order transaction accordingly',
requestBody: new OA\RequestBody(content: new OA\JsonContent(properties: [
Expand Down Expand Up @@ -267,7 +267,7 @@ public function refundDetails(string $orderTransactionId, string $refundId, Cont
content: new OA\JsonContent(ref: Order\PurchaseUnit\Payments\Refund::class)
)]
)]
#[Route(path: '/api/_action/paypal-v2/refund-capture/{orderTransactionId}/{captureId}/{paypalOrderId}', name: 'api.action.paypal_v2.refund_capture', defaults: ['_acl' => ['order.editor']], methods: ['POST'])]
#[Route(path: '/_action/paypal-v2/refund-capture/{orderTransactionId}/{captureId}/{paypalOrderId}', name: 'api.action.paypal_v2.refund_capture', defaults: ['_acl' => ['order.editor']], methods: ['POST'])]
public function refundCapture(
string $orderTransactionId,
string $captureId,
Expand All @@ -294,7 +294,7 @@ public function refundCapture(
}

#[OA\Post(
path: '/api/_action/paypal-v2/capture-authorization/{orderTransactionId}/{authorizationId}',
path: '/_action/paypal-v2/capture-authorization/{orderTransactionId}/{authorizationId}',
operationId: 'captureAuthorization',
description: 'Captures the PayPal authorization and sets the state of the Shopware order transaction accordingly',
requestBody: new OA\RequestBody(content: new OA\JsonContent(properties: [
Expand Down Expand Up @@ -330,7 +330,7 @@ public function refundCapture(
content: new OA\JsonContent(ref: Order\PurchaseUnit\Payments\Capture::class)
)]
)]
#[Route(path: '/api/_action/paypal-v2/capture-authorization/{orderTransactionId}/{authorizationId}', name: 'api.action.paypal_v2.capture_authorization', defaults: ['_acl' => ['order.editor']], methods: ['POST'])]
#[Route(path: '/_action/paypal-v2/capture-authorization/{orderTransactionId}/{authorizationId}', name: 'api.action.paypal_v2.capture_authorization', defaults: ['_acl' => ['order.editor']], methods: ['POST'])]
public function captureAuthorization(
string $orderTransactionId,
string $authorizationId,
Expand All @@ -353,7 +353,7 @@ public function captureAuthorization(
}

#[OA\Post(
path: '/api/_action/paypal-v2/void-authorization/{orderTransactionId}/{authorizationId}',
path: '/_action/paypal-v2/void-authorization/{orderTransactionId}/{authorizationId}',
operationId: 'voidAuthorization',
description: 'Voids the PayPal authorization and sets the state of the Shopware order transaction accordingly',
requestBody: new OA\RequestBody(content: new OA\JsonContent(properties: [
Expand Down
10 changes: 5 additions & 5 deletions src/PaymentsApi/Administration/PayPalPaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function __construct(
}

#[OA\Get(
path: '/api/paypal/payment-details/{orderId}/{paymentId}',
path: '/paypal/payment-details/{orderId}/{paymentId}',
operationId: 'paymentDetails',
description: 'Loads the Payment details of the given PayPal ID',
tags: ['Admin API', 'PayPal'],
Expand Down Expand Up @@ -128,7 +128,7 @@ public function paymentDetails(string $orderId, string $paymentId, Context $cont
}

#[OA\Get(
path: '/api/paypal/resource-details/{resourceType}/{resourceId}/{orderId}',
path: '/paypal/resource-details/{resourceType}/{resourceId}/{orderId}',
operationId: 'resourceDetails',
description: 'Loads the PayPal resource details of the given resource ID',
tags: ['Admin API', 'PayPal'],
Expand Down Expand Up @@ -200,7 +200,7 @@ public function resourceDetails(Context $context, string $resourceType, string $
* @deprecated tag:v10.0.0 - will be removed without replacement
*/
#[OA\Post(
path: '/api/_action/paypal/refund-payment/{resourceType}/{resourceId}/{orderId}',
path: '/_action/paypal/refund-payment/{resourceType}/{resourceId}/{orderId}',
operationId: 'paypalRefundPayment',
tags: ['Admin Api', 'PayPal'],
parameters: [
Expand Down Expand Up @@ -276,7 +276,7 @@ public function refundPayment(
* @deprecated tag:v10.0.0 - will be removed without replacement
*/
#[OA\Post(
path: '/api/_action/paypal/capture-payment/{resourceType}/{resourceId}/{orderId}',
path: '/_action/paypal/capture-payment/{resourceType}/{resourceId}/{orderId}',
operationId: 'paypalCapturePayment',
tags: ['Admin Api', 'PayPal'],
parameters: [
Expand Down Expand Up @@ -347,7 +347,7 @@ public function capturePayment(
* @deprecated tag:v10.0.0 - will be removed without replacement
*/
#[OA\Post(
path: '/api/_action/paypal/void-payment/{resourceType}/{resourceId}/{orderId}',
path: '/_action/paypal/void-payment/{resourceType}/{resourceId}/{orderId}',
operationId: 'paypalVoidPayment',
tags: ['Admin Api', 'PayPal'],
parameters: [
Expand Down
16 changes: 8 additions & 8 deletions src/Pos/PosSyncController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(
}

#[OA\Post(
path: '/api/_action/paypal/pos/sync/{salesChannelId}/products',
path: '/_action/paypal/pos/sync/{salesChannelId}/products',
operationId: 'posSyncProducts',
tags: ['Admin Api', 'PayPal'],
parameters: [
Expand Down Expand Up @@ -83,7 +83,7 @@ public function syncProducts(string $salesChannelId, Context $context): Response
}

#[OA\Post(
path: '/api/_action/paypal/pos/sync/{salesChannelId}/images',
path: '/_action/paypal/pos/sync/{salesChannelId}/images',
operationId: 'posSyncImages',
tags: ['Admin Api', 'PayPal'],
parameters: [
Expand Down Expand Up @@ -115,7 +115,7 @@ public function syncImages(string $salesChannelId, Context $context): Response
}

#[OA\Post(
path: '/api/_action/paypal/pos/sync/{salesChannelId}/inventory',
path: '/_action/paypal/pos/sync/{salesChannelId}/inventory',
operationId: 'posSyncInventory',
tags: ['Admin Api', 'PayPal'],
parameters: [
Expand Down Expand Up @@ -147,7 +147,7 @@ public function syncInventory(string $salesChannelId, Context $context): Respons
}

#[OA\Post(
path: '/api/_action/paypal/pos/sync/{salesChannelId}',
path: '/_action/paypal/pos/sync/{salesChannelId}',
operationId: 'posSync',
tags: ['Admin Api', 'PayPal'],
parameters: [
Expand Down Expand Up @@ -179,7 +179,7 @@ public function syncAll(string $salesChannelId, Context $context): Response
}

#[OA\Post(
path: '/api/_action/paypal/pos/sync/abort/{runId}',
path: '/_action/paypal/pos/sync/abort/{runId}',
operationId: 'posSyncAbort',
tags: ['Admin Api', 'PayPal'],
parameters: [
Expand All @@ -202,7 +202,7 @@ public function abortSync(string $runId, Context $context): Response
}

#[OA\Post(
path: '/api/_action/paypal/pos/sync/reset/{salesChannelId}',
path: '/_action/paypal/pos/sync/reset/{salesChannelId}',
operationId: 'posSyncReset',
tags: ['Admin Api', 'PayPal'],
parameters: [
Expand All @@ -227,7 +227,7 @@ public function resetSync(string $salesChannelId, Context $context): Response
}

#[OA\Post(
path: '/api/_action/paypal/pos/log/cleanup/{salesChannelId}',
path: '/_action/paypal/pos/log/cleanup/{salesChannelId}',
operationId: 'posSyncCleanup',
tags: ['Admin Api', 'PayPal'],
parameters: [
Expand All @@ -252,7 +252,7 @@ public function cleanUpLog(string $salesChannelId, Context $context): Response
}

#[OA\Get(
path: '/api/paypal/pos/product-log/{salesChannelId}',
path: '/paypal/pos/product-log/{salesChannelId}',
operationId: 'posProductLog',
tags: ['Admin Api', 'PayPal'],
parameters: [
Expand Down
8 changes: 4 additions & 4 deletions src/Pos/Setting/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct(
}

#[OA\Post(
path: '/api/_action/paypal/pos/validate-api-credentials',
path: '/_action/paypal/pos/validate-api-credentials',
operationId: 'posValidateApiCredentials',
requestBody: new OA\RequestBody(content: new OA\JsonContent(properties: [
new OA\Property(
Expand Down Expand Up @@ -87,7 +87,7 @@ public function validateApiCredentials(Request $request, Context $context): Json
}

#[OA\Post(
path: '/api/paypal/pos/fetch-information',
path: '/paypal/pos/fetch-information',
operationId: 'posFetchInformation',
requestBody: new OA\RequestBody(content: new OA\JsonContent(properties: [
new OA\Property(
Expand Down Expand Up @@ -118,7 +118,7 @@ public function fetchInformation(Request $request, Context $context): JsonRespon
}

#[OA\Post(
path: '/api/_action/paypal/pos/clone-product-visibility',
path: '/_action/paypal/pos/clone-product-visibility',
operationId: 'posCloneProductVisibility',
requestBody: new OA\RequestBody(content: new OA\JsonContent(properties: [
new OA\Property(
Expand Down Expand Up @@ -150,7 +150,7 @@ public function cloneProductVisibility(Request $request, Context $context): Resp
}

#[OA\Get(
path: '/api/paypal/pos/product-count',
path: '/paypal/pos/product-count',
operationId: 'posGetProductCounts',
tags: ['Admin Api', 'PayPal'],
parameters: [
Expand Down
6 changes: 3 additions & 3 deletions src/Pos/Webhook/WebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct(
}

#[OA\Post(
path: '/api/_action/paypal/pos/webhook/registration/{salesChannelId}',
path: '/_action/paypal/pos/webhook/registration/{salesChannelId}',
operationId: 'registerPosWebhook',
tags: ['Admin Api', 'SwagPayPalPosWebhook'],
parameters: [new OA\Parameter(
Expand All @@ -67,7 +67,7 @@ public function registerWebhook(string $salesChannelId, Context $context): Respo
}

#[OA\Delete(
path: '/api/_action/paypal/pos/webhook/registration/{salesChannelId}',
path: '/_action/paypal/pos/webhook/registration/{salesChannelId}',
operationId: 'deregisterPosWebhook',
tags: ['Admin Api', 'SwagPayPalPosWebhook'],
parameters: [new OA\Parameter(
Expand All @@ -87,7 +87,7 @@ public function unregisterWebhook(string $salesChannelId, Context $context): Res
}

#[OA\Post(
path: '/api/_action/paypal/pos/webhook/execute/{salesChannelId}',
path: '/_action/paypal/pos/webhook/execute/{salesChannelId}',
operationId: 'executePosWebhook',
requestBody: new OA\RequestBody(content: new OA\JsonContent(ref: Webhook::class)),
tags: ['Admin Api', 'SwagPayPalPosWebhook'],
Expand Down
Loading

0 comments on commit d0cb467

Please sign in to comment.