Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1.37 KB

File metadata and controls

42 lines (32 loc) · 1.37 KB

API Client

The APIClient is autogenerated using go-swagger. So every file inside swaggerclient folder should not be touched See:

Is generated using the swagger definition: https://devdocs.magento.com/swagger/schemas/latest-2.2.schema.json But since the original Swagger is not Valid unfortunately we needed to modify it:

  • make operationId unique
  • FrameworkAttributeInterface - value can be array not only string (e.g. for product list custom_attributes)

Regenerating:

execute all commands in subdirectory infrastructure/

swagger generate client -f res/latest-2.2.schema.modified.json -t swaggerclient

Magento 2 Local testing

You can use: https://github.com/alexcheng1982/docker-magento2

git clone [email protected]:alexcheng1982/docker-magento2.git
cd docker-magento2
docker-compose up -d
docker ps
docker exec -it docker-magento2_web_1 install-magento
docker exec -it docker-magento2_web_1 install-sampledata
sudo echo "127.0.0.1       local.magento" >> sudo /etc/hosts
open http://local.magento/admin
//login with admin/magentorocks1

Create an integration following: https://devdocs.magento.com/guides/v2.3/get-started/authentication/gs-authentication-token.html And use the Access Token to access the API e.g.: http://local.magento/rest/default/V1/products?searchCriteria