R6API / client

Retroengined client to communicate with the Rainbow 6 Seat Statistical API
MIT License
8 stars 5 forks source link

Client rework with DTO/Serializer #9

Open Korbeil opened 6 years ago

Korbeil commented 6 years ago

Use Symfony Serializer to parse data from API and create DTO for each API endpoint. The idea is to bring a strong typed model with utility functions to be able to access all data easily.

Endpoints to update:

Resources:

stygiansabyss commented 6 years ago

Regarding DTO: I use https://github.com/jenssegers/model when I want things like this, but I do use laravel on my sites. So not sure how you'd feel about that.

General Thoughts: For the DTO, it would be nice to have helper methods to group the constants as well. Something like pve()/pvp() etc.

Korbeil commented 6 years ago

Thanks for commenting !

About the lib you linked, we can't really use it since it's only Laravel-related and I would prefer to make a more generic client. In future we could make bridge to Laravel/Symfony or other frameworks if needed :)

About helpers I totaly agree ! I'll try to make a draft model / serializer with Profile API this week to let you see how you could do this ;)

Korbeil commented 5 years ago

Finally last step to make dev-master clean again :+1: (and unit tests running as they should be :wink:) I only made simple models for all endpoints, there must be some possible improvement (and even more for StatisticApi endpoint)

@stygiansabyss if you want to take a look at all theses and try something you're free to go ! :wink: