From 304d6bc01ba01d02bc59ae71f6ee39d7a203e600 Mon Sep 17 00:00:00 2001 From: Svyatoslav Varpikhovsky Date: Thu, 5 Oct 2023 14:40:26 +0300 Subject: [PATCH 1/2] FRW-6085 Updated documentations --- .../install-the-data-exchange-api.md | 21 ++- ...ow-to-send-request-in-data-exchange-api.md | 142 ++++++++++-------- 2 files changed, 95 insertions(+), 68 deletions(-) diff --git a/docs/scos/dev/feature-integration-guides/202307.0/glue-api/data-exchange-api/install-the-data-exchange-api.md b/docs/scos/dev/feature-integration-guides/202307.0/glue-api/data-exchange-api/install-the-data-exchange-api.md index e4dcb7a0457..27e29851fe0 100644 --- a/docs/scos/dev/feature-integration-guides/202307.0/glue-api/data-exchange-api/install-the-data-exchange-api.md +++ b/docs/scos/dev/feature-integration-guides/202307.0/glue-api/data-exchange-api/install-the-data-exchange-api.md @@ -33,7 +33,7 @@ Install the required features: Install the required modules using Composer: ```bash -composer require spryker/dynamic-entity-backend-api:"^0.1.0" spryker/dynamic-entity-gui:"^0.1.0" --update-with-dependencies +composer require spryker/dynamic-entity-backend-api:"^1.0.0" spryker/dynamic-entity-gui:"^1.0.0" --update-with-dependencies ``` {% info_block warningBox "Verification" %} @@ -181,6 +181,8 @@ Make sure you've triggered the following changes by checking the database: | DATABASE ENTITY | TYPE | | --- | --- | | spy_dynamic_entity_configuration | table | +| spy_dynamic_entity_configuration_relation | table | +| spy_dynamic_entity_configuration_relation_field_mapping | table | Make sure the following transfers have been created: @@ -216,8 +218,21 @@ Make sure the following transfers have been created: | GlueResponse | class | created | src/Generated/Shared/Transfer/GlueResponseTransfer.php | | Pagination | class | created | src/Generated/Shared/Transfer/PaginationTransfer.php | +Make sure that propel entities have been generated successfully by checking their existence. Also, change the generated entity classes to extend from Spryker core classes.\ + +| CLASS PATH | EXTENDS | +| --- | --- | +| src/Generated/Entity/SpyDynamicEntityConfiguration.php | \Spryker\Zed\DynamicEntity\Persistence\Propel\AbstractSpyDynamicEntityConfiguration | +| src/Generated/Entity/SpyDynamicEntityConfigurationQuery.php | \Spryker\Zed\DynamicEntity\Persistence\Propel\AbstractSpyDynamicEntityConfigurationQuery | +| src/Generated/Entity/SpyDynamicEntityConfigurationRelation.php | \Spryker\Zed\DynamicEntity\Persistence\Propel\AbstractSpyDynamicEntityConfigurationRelation | +| src/Generated/Entity/SpyDynamicEntityConfigurationRelationQuery.php | \Spryker\Zed\DynamicEntity\Persistence\Propel\AbstractSpyDynamicEntityConfigurationRelationQuery | +| src/Generated/Entity/SpyDynamicEntityConfigurationRelationFieldMapping.php | \Spryker\Zed\DynamicEntity\Persistence\Propel\AbstractSpyDynamicEntityConfigurationRelationFieldMapping | +| src/Generated/Entity/SpyDynamicEntityConfigurationRelationFieldMappingQuery.php | \Spryker\Zed\DynamicEntity\Persistence\Propel\AbstractSpyDynamicEntityConfigurationRelationFieldMappingQuery | + + {% endinfo_block %} + ### Add translations 1. Append the glossary according to your language configuration: @@ -239,8 +254,8 @@ dynamic_entity.validation.invalid_field_value,"Invalid data value for field: %fi dynamic_entity.validation.invalid_field_value,"Ungültiger Datenwert für das Feld: %fieldName%, Zeilennummer: %rowNumber%. Feldregeln: %validationRules%",de_DE dynamic_entity.validation.required_field_is_missing,"The required field must not be empty. Field: '%fieldName%'",en_US dynamic_entity.validation.required_field_is_missing,"Das erforderlich Feld darf nicht leer sein. Feld: '%fieldName%'",de_DE -dynamic_entity.validation.entity_not_found_or_identifier_is_not_creatable,"Entity not found by identifier, and new identifier can not be persisted. Please update the request.",en_US -dynamic_entity.validation.entity_not_found_or_identifier_is_not_creatable,"Entität konnte anhand der ID nicht gefunden werden, und die neue ID kann nicht dauerhaft gespeichert werden. Bitte aktualisieren Sie die Anfrage.",de_DE +dynamic_entity.validation.entity_not_found_or_identifier_is_not_creatable,"Entity `%identifier%` not found by identifier, and new identifier can not be persisted. Please update the request.",en_US +dynamic_entity.validation.entity_not_found_or_identifier_is_not_creatable,"Entität `%identifier%` konnte anhand der ID nicht gefunden werden, und die neue ID kann nicht dauerhaft gespeichert werden. Bitte aktualisieren Sie die Anfrage.",de_DE dynamic_entity.validation.modification_of_immutable_field_prohibited,"Modification of immutable field `%fieldName%` is prohibited",en_US dynamic_entity.validation.modification_of_immutable_field_prohibited,"Änderung des unveränderlichen Feldes %fieldName% ist nicht zulässig.",de_DE dynamic_entity.validation.missing_identifier,"Incomplete Request - missing identifier",en_US diff --git a/docs/scos/dev/glue-api-guides/202307.0/data-exchange-api/how-to-guides/how-to-send-request-in-data-exchange-api.md b/docs/scos/dev/glue-api-guides/202307.0/data-exchange-api/how-to-guides/how-to-send-request-in-data-exchange-api.md index eedd1ecdaa1..a9d2f4d08e1 100644 --- a/docs/scos/dev/glue-api-guides/202307.0/data-exchange-api/how-to-guides/how-to-send-request-in-data-exchange-api.md +++ b/docs/scos/dev/glue-api-guides/202307.0/data-exchange-api/how-to-guides/how-to-send-request-in-data-exchange-api.md @@ -45,24 +45,26 @@ Authorization: Bearer {your_token} Response sample: ```json -[ - { - "id_country": 2, - "iso2_code": "AD", - "iso3_code": "AND", - "name": "Andorra", - "postal_code_mandatory": true, - "postal_code_regex": "AD\\d{3}" - }, - { - "id_country": 3, - "iso2_code": "AE", - "iso3_code": "ARE", - "name": "United Arab Emirates", - "postal_code_mandatory": false, - "postal_code_regex": null - } -] +{ + "data": [ + { + "id_country": 2, + "iso2_code": "AD", + "iso3_code": "AND", + "name": "Andorra", + "postal_code_mandatory": true, + "postal_code_regex": "AD\\d{3}" + }, + { + "id_country": 3, + "iso2_code": "AE", + "iso3_code": "ARE", + "name": "United Arab Emirates", + "postal_code_mandatory": false, + "postal_code_regex": null + } + ] +} ``` The response contains all the columns from the `spy_country` table that are configured in `spy_dynamic_entity_definition.definition`. Each column is represented using the `fieldVisibleName` as the key, providing a comprehensive view of the table's data in the API response. By default the API `GET` request returns up to 20 records. @@ -81,16 +83,18 @@ Authorization: Bearer {your_token} Response sample: ```json -[ - { - "id_country": 1, - "iso2_code": "AA", - "iso3_code": "UUD", - "name": "Create", - "postal_code_mandatory": false, - "postal_code_regex": null - } -] +{ + "data": [ + { + "id_country": 1, + "iso2_code": "AA", + "iso3_code": "UUD", + "name": "Create", + "postal_code_mandatory": false, + "postal_code_regex": null + } + ] +} ``` {% info_block infoBox %} @@ -111,16 +115,18 @@ Authorization: Bearer {your_token} Response sample: ```json -[ - { - "id_country": 3, - "iso2_code": "AE", - "iso3_code": "ARE", - "name": "United Arab Emirates", - "postal_code_mandatory": false, - "postal_code_regex": null - } -] +{ + "data":[ + { + "id_country": 3, + "iso2_code": "AE", + "iso3_code": "ARE", + "name": "United Arab Emirates", + "postal_code_mandatory": false, + "postal_code_regex": null + } + ] +} ``` @@ -163,14 +169,16 @@ Content-Length: 154 The response payload includes all the specified fields from the request body, along with the ID of the created entity. Response sample: ```json -[ - { - "iso2_code": "WA", - "iso3_code": "WWA", - "name": "FOO", - "id_country": 257 - } -] +{ + "data":[ + { + "iso2_code": "WA", + "iso3_code": "WWA", + "name": "FOO", + "id_country": 257 + } + ] +} ``` @@ -232,14 +240,16 @@ Content-Length: 174 The response payload includes all the specified fields from the request body. Response sample: ```json -[ - { - "iso2_code": "WB", - "iso3_code": "WWB", - "name": "FOO", - "id_country": 1 - } -] +{ + "data":[ + { + "iso2_code": "WB", + "iso3_code": "WWB", + "name": "FOO", + "id_country": 1 + } + ] +} ``` @@ -337,16 +347,18 @@ Content-Length: 263 The response payload includes all touched fields for the provided resource. Response sample: ```json -[ - { - "iso2_code": "WB", - "iso3_code": "WWB", - "name": "FOO", - "postal_code_mandatory": null, - "postal_code_regex": null, - "id_country": 1 - } -] +{ + "data": [ + { + "iso2_code": "WB", + "iso3_code": "WWB", + "name": "FOO", + "postal_code_mandatory": null, + "postal_code_regex": null, + "id_country": 1 + } + ] +} ``` @@ -397,6 +409,6 @@ Bellow you can find a list of error codes that you can receive when sending `GET | 1305 | Invalid data type for field: `field` | The specified field has an incorrect type. Please check the configuration for this field and correct the value. | | 1306 | Invalid data value for field: `field`, row number: `row`. Field rules: `validation rules`. | The error indicates a data row and a field that does not comply with the validation rules in the configuration. Here is an example of the error: `Invalid data value for field: id, row number: 2. Field rules: min: 0, max: 127`. | | 1307 | The required field must not be empty. Field: `field` | The specified field is required according to the configuration. The field was not provided. Please check the data you are sending and try again. | -| 1308 | Entity not found by identifier, and new identifier can not be persisted. Please update the request. | The entity could not be found using the provided identifier, and a new identifier cannot be persisted. Please update your request accordingly or check configuration for identifier field. | +| 1308 |Entity `some field identifier` not found by identifier, and new identifier can not be persisted. Please update the request. | The entity could not be found using the provided identifier, and a new identifier cannot be persisted. Please update your request accordingly or check configuration for identifier field. | | 1309 | Failed to persist the data. Please verify the provided data and try again. Entry is duplicated. | Failed to persist the data. Please verify the provided data and try again. This error may occur if a record with the same information already exists in the database. | | 1310 | Incomplete Request - missing identifier. | The request is incomplete. The identifier is missing. Please check the request and try again. | From 5f3c355b7a2e97423f78067ffa77d373880c7f98 Mon Sep 17 00:00:00 2001 From: Helen Kravchenko Date: Thu, 5 Oct 2023 19:50:23 +0200 Subject: [PATCH 2/2] Update install-the-data-exchange-api.md --- .../glue-api/data-exchange-api/install-the-data-exchange-api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/scos/dev/feature-integration-guides/202307.0/glue-api/data-exchange-api/install-the-data-exchange-api.md b/docs/scos/dev/feature-integration-guides/202307.0/glue-api/data-exchange-api/install-the-data-exchange-api.md index 27e29851fe0..9dea6b59232 100644 --- a/docs/scos/dev/feature-integration-guides/202307.0/glue-api/data-exchange-api/install-the-data-exchange-api.md +++ b/docs/scos/dev/feature-integration-guides/202307.0/glue-api/data-exchange-api/install-the-data-exchange-api.md @@ -218,7 +218,7 @@ Make sure the following transfers have been created: | GlueResponse | class | created | src/Generated/Shared/Transfer/GlueResponseTransfer.php | | Pagination | class | created | src/Generated/Shared/Transfer/PaginationTransfer.php | -Make sure that propel entities have been generated successfully by checking their existence. Also, change the generated entity classes to extend from Spryker core classes.\ +Ensure successful generation of Propel entities by verifying that they exist. Additionally, modify the generated entity classes to extend from Spryker core classes. | CLASS PATH | EXTENDS | | --- | --- |