Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"List my articles" endpoints, serializations to different Article types #4

Merged

Conversation

andyhaskell
Copy link
Contributor

This PR makes the following additions to the Go client:

  • Add methods for "list my articles" endpoints (/articles/me/*) for listing the authenticated user's articles
  • Add convenience methods to the /articles endpoints for listing articles by tag and user so these functionalities can be used without filling out a struct
  • Define types for the variations on the Article type for the list endpoints, POST/PUT payloads

These methods provide more specific sets of query parameters to the
list articles endpoint to make these use cases simpler to work with.
These endpoints are called at /api/articles/me/* to retrieve articles
made by the caller.
@VictorAvelar
Copy link
Owner

@andyhaskell thanks for your PR, would you mind adding some tests and fixing the existing ones, please?

This is so that the different serializations for these endpoints are
reflected.
The new error handling in json.Unmarshal on the List method caused this
test to error, so to fix the test coverage, this commit has the mock
list articles endpoint return a JSON response for the client to
unmarshal,
@andyhaskell
Copy link
Contributor Author

Sounds great, just fixed the new tests, so I'll work on some tests for the new endpoints I added

Additionally, add test coverage for convenience methods on /articles
endpoints, ArticleUpdate deserialization on POST and PUT endpoints
@VictorAvelar
Copy link
Owner

@andyhaskell is everything ready from your side? I would like to merge your PR.

@VictorAvelar VictorAvelar merged commit a2c6081 into VictorAvelar:master Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants