Skip to content

Commit

Permalink
PPI-1058 - Adjust OpenAPI schema generation
Browse files Browse the repository at this point in the history
  • Loading branch information
cyl3x committed Jan 24, 2025
1 parent f8a489e commit 23a1c07
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/DevOps/Command/GenerateOpenApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ protected function generateAdminApiSchema(SymfonyStyle $style, Generator $genera
$openApi = $generator->generate([
Util::finder(self::ROOT_DIR . '/src/RestApi'),
Util::finder(self::ROOT_DIR . '/src/Administration'),
Util::finder(self::ROOT_DIR . '/src/Dispute'),
Util::finder(self::ROOT_DIR . '/src/OrdersApi'),
Util::finder(self::ROOT_DIR . '/src/PaymentsApi'),
Util::finder(self::ROOT_DIR . '/src/Pos'),
Expand Down
87 changes: 87 additions & 0 deletions src/Resources/Schema/AdminApi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,93 @@
}
}
},
"/api/paypal/dispute": {
"get": {
"tags": [
"Admin API",
"PayPal"
],
"description": "Loads a list of PayPal disputes",
"operationId": "disputeList",
"parameters": [
{
"parameter": "salesChannelId",
"name": "salesChannelId",
"in": "query",
"description": "ID of the sales channel to which the disputes belong",
"schema": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
}
},
{
"parameter": "disputeStateFilter",
"name": "disputeStateFilter",
"in": "query",
"description": "Filter for dispute state. Separate multiple states with a comma. Must one of these values: Swag\\PayPal\\RestApi\\V1\\Api\\Disputes\\Item::DISPUTE_STATES",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "List of PayPal disputes",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/swag_paypal_v1_disputes"
}
}
}
}
}
}
},
"/api/paypal/dispute/{disputeId}": {
"get": {
"tags": [
"Admin API",
"PayPal"
],
"description": "Loads the dispute details of the given PayPal dispute ID",
"operationId": "disputeDetails",
"parameters": [
{
"parameter": "salesChannelId",
"name": "salesChannelId",
"in": "query",
"description": "ID of the sales channel to which the disputes belong",
"schema": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
}
},
{
"parameter": "disputeId",
"name": "disputeId",
"in": "path",
"description": "ID of the dispute",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Details of the PayPal dispute",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/swag_paypal_v1_disputes_item"
}
}
}
}
}
}
},
"/api/paypal-v2/order/{orderTransactionId}/{paypalOrderId}": {
"get": {
"tags": [
Expand Down
48 changes: 48 additions & 0 deletions src/Resources/app/administration/src/types/openapi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ export interface paths {
/** @description Sets PayPal as the default payment method for a given Saleschannel, or all. */
post: operations["setPayPalAsDefault"];
};
"/api/paypal/dispute": {
/** @description Loads a list of PayPal disputes */
get: operations["disputeList"];
};
"/api/paypal/dispute/{disputeId}": {
/** @description Loads the dispute details of the given PayPal dispute ID */
get: operations["disputeDetails"];
};
"/api/paypal-v2/order/{orderTransactionId}/{paypalOrderId}": {
/** @description Loads the order details of the given PayPal order ID */
get: operations["orderDetails"];
Expand Down Expand Up @@ -1420,6 +1428,46 @@ export interface operations {
};
};
};
/** @description Loads a list of PayPal disputes */
disputeList: {
parameters: {
query?: {
/** @description ID of the sales channel to which the disputes belong */
salesChannelId?: string;
/** @description Filter for dispute state. Separate multiple states with a comma. Must one of these values: Swag\PayPal\RestApi\V1\Api\Disputes\Item::DISPUTE_STATES */
disputeStateFilter?: string;
};
};
responses: {
/** @description List of PayPal disputes */
200: {
content: {
"application/json": components["schemas"]["swag_paypal_v1_disputes"];
};
};
};
};
/** @description Loads the dispute details of the given PayPal dispute ID */
disputeDetails: {
parameters: {
query?: {
/** @description ID of the sales channel to which the disputes belong */
salesChannelId?: string;
};
path: {
/** @description ID of the dispute */
disputeId: string;
};
};
responses: {
/** @description Details of the PayPal dispute */
200: {
content: {
"application/json": components["schemas"]["swag_paypal_v1_disputes_item"];
};
};
};
};
/** @description Loads the order details of the given PayPal order ID */
orderDetails: {
parameters: {
Expand Down

0 comments on commit 23a1c07

Please sign in to comment.