Skip to content

Change incorrect Entity in Snippet API

Summary

As discussed here, the GET /snippets API endpoint currently uses Entities::PersonalSnippet as the object facade, but the objects could be either a ProjectSnippet or PersonalSnippet type.

We should modify the Entity being used to be a generic Entities::Snippet so it's more clear what is being returned.

Improvements

Making this change will make it more clear / accurately match what is actually being returned at this endpoint, rather than using the incorrect type.

Risks

None that I'm aware

Involved components

  • lib/api/snippets.rb:27
  • lib/api/snippets.rb:33
Edited by Vijay Hawoldar