This repository has been archived by the owner on Feb 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 265
Proposal for resources #61
Open
onhernandes
wants to merge
20
commits into
mercadolibre:master
Choose a base branch
from
onhernandes:proposal-for-resources
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Proposal for resources #61
onhernandes
wants to merge
20
commits into
mercadolibre:master
from
onhernandes:proposal-for-resources
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…h guzzle instead pure curl
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there. I want to present this new SDK, I don't know if its worth keeping developing, so here I am.
The idea is to give support for resources such as Category, User, Item, etc with custom methods, removing from developers the development of basic things involving the ML's API like validating/dealing with requests, category validation, items validation(pictures, listing types, buying modes, shipping modes, etc), getting data(category, user info, item info, etc) and more.
For now I made just two classes, it supports Users and Categories. Also, there'is some tests I made but they're still in development.
Quick comments:
GuzzleHttp
for requests, its safer and betterResource.php
, which gives some cool methods likefaker()
for generating a genericFaker
instance,validate()
for validating the current object,load()
andfill()
for dealing with the current object properties, etcMeliRequestInterface
(explained below) for making requests and a array for filling the current objectMeli
as a class for making requests is optional, in case of the developer already using other custom class for requests involving DB and etc, the developer just needs to pass a class that implements theMeliRequestInterface
.