Skip to content

Change the fields getter method to get -> opt of RepositoryApi  #43

Open

Description

@sukeshni

In SearchApi for searchRepositories, I am using Repository for items in reponse, since searchRepositories returns Repositories.
Few fields
For Ex.

  • updated_at
  • size
  • stargazers_count
  • forks_count
    which are required to test but are not included in Repository,
    If we create a new class for items which is list of Repositories it will be redunduncy
    So we should convert the getter methods of class repository so that it can be reused.

Activity

  1. added this to the milestone on May 25, 2015
  2. shunjikonishi commented on May 25, 2015

    @shunjikonishi
    Contributor

    @sukeshni @fanwashere
    How about this?

  3. fanwashere commented on May 25, 2015

    @fanwashere
    Contributor

    @shunjikonishi I am finishing up Issues API. Right after I will double check and implement any missing fields for this issue.

  4. fanwashere commented on May 26, 2015

    @fanwashere
    Contributor

    @sukeshni fix me. I looked at the response and added these fields in. This is not committed, you should add the fields in as you see fit.

    case class Repository(value: JValue) extends AbstractJson(value) {
      def id = get("id").toLong
      def name = get("name")
      def full_name = get("full_name")
    
      lazy val owner = User(value \ "owner")
    
      def `private` = boolean("private")
      def html_url = get("html_url")
      def description = opt("description")
      def fork = boolean("fork")
      def url = get("url")
      //Many types of urls here, I don't think is necessary
    
      def created_at = getDate("created_at")
      def updated_at = getDate("updated_at")
      def pushed_at = dateOpt("pushed_at") //Not sure if this could return null
    
      def homepage = opt("homepage")
      def size = get("size").toLong
      def stargazers_count = get("stargazers_count")
      def language = get("language")
      def has_issues = boolean("has_issues")
      def has_downloads = boolean("has_downloads")
      def has_wiki = boolean("has_wiki")
      def has_pages = boolean("has_pages")
      def forks_count = get("forks_count").toInt
      def mirror_url = opt("mirror_url")
      def open_issues_count = get("open_issues_count").toInt
      def forks = get("forks").toInt
      def open_issues = get("open_issues").toInt
      def watchers = get("watchers").toInt
      def default_branch = get("default_branch")
      def score = get("score").toLong
    
      lazy val permissions = Permissions(value \ "permissions")
    }

    There were a lot of url fields in between that may or may not be necessary. I have only tested a few of the fields so further testing is definitely required.

    Also, I did not noticed any response object called "permission", though I assume that is used in another operation.

  5. sukeshni commented on May 26, 2015

    @sukeshni
    ContributorAuthor

    @fanwashere Thank you for your reply, will add the required fields. Object permission is not in the response, it is used by other operations.

  6. removed their assignment
    on Jun 19, 2015
  7. modified the milestone: on Mar 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions