Skip to content

Commit

Permalink
Update subtypes of ContainerResource
Browse files Browse the repository at this point in the history
Summary:
When running tests for D22844917, I noticed that VideoContainerResource was not being deserialised correctly as the error message said it was not a subtype of ContainerResource.

This diff corrects the ContainerResource file to add the other subtypes of Container resource, the only exception being BlobbyDataContainerResource - this is because it resides in another module and doing so would introduce a cyclic build dependency. (#916 already flags this). 

Test Plan: Ran ./gradlew build and ./gradlew test

Reviewers: #dtp

Differential Revision: https://phabricator.intern.facebook.com/D22867086
  • Loading branch information
mukul-rathi committed Aug 3, 2020
1 parent caa0be2 commit 802a9fb
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import org.datatransferproject.types.common.models.calendar.CalendarContainerResource;
import org.datatransferproject.types.common.models.mail.MailContainerResource;
import org.datatransferproject.types.common.models.photos.PhotosContainerResource;
import org.datatransferproject.types.common.models.playlists.PlaylistContainerResource;
import org.datatransferproject.types.common.models.social.SocialActivityContainerResource;
import org.datatransferproject.types.common.models.tasks.TaskContainerResource;
import org.datatransferproject.types.common.models.videos.VideosContainerResource;

/**
* A resource that contains data items such as a photo album or song list.
Expand All @@ -16,9 +19,12 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME)
@JsonSubTypes({
@JsonSubTypes.Type(PhotosContainerResource.class),
@JsonSubTypes.Type(VideosContainerResource.class),
@JsonSubTypes.Type(MailContainerResource.class),
@JsonSubTypes.Type(CalendarContainerResource.class),
@JsonSubTypes.Type(TaskContainerResource.class),
@JsonSubTypes.Type(PlaylistContainerResource.class),
@JsonSubTypes.Type(SocialActivityContainerResource.class),
@JsonSubTypes.Type(IdOnlyContainerResource.class)
})
public abstract class ContainerResource extends DataModel {}

0 comments on commit 802a9fb

Please sign in to comment.