nerdishbynature / octokit.swift

A Swift API Client for GitHub and GitHub Enterprise
MIT License
490 stars 126 forks source link

Add methods to get and create labels #80

Closed robmathers closed 5 years ago

robmathers commented 5 years ago

This extends Octokit with three methods to fetch and create labels. .label to get a single label, .labels to get all labels in a repo (paginated), and .postLabel to create a new label in a repo.

I've also added test coverage for all three, along with a test for parsing Label from JSON.

I copied the structure and style based off Issue, so everything should be fairly consistent with the existing code, give or take some naming for the LabelRouter cases.

robmathers commented 5 years ago

Nice work, thanks for the PR!

Pretty much fine with it but Travis Builds on all platforms have a hard time finding stringByAddingPercentEncodingForRFC3986 could you look into it?

Whoops, I left a couple things out when cleaning up the commit history. Force-pushed, should be good now.

pietbrauer commented 5 years ago

Nice, thanks!