-
Notifications
You must be signed in to change notification settings - Fork 4
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
Change the fields getter method to get -> opt of RepositoryApi #43
Comments
@sukeshni @fanwashere |
@shunjikonishi I am finishing up Issues API. Right after I will double check and implement any missing fields for this issue. |
@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. |
@fanwashere Thank you for your reply, will add the required fields. Object permission is not in the response, it is used by other operations. |
In SearchApi for searchRepositories, I am using Repository for items in reponse, since searchRepositories returns Repositories.
Few fields
For Ex.
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.
The text was updated successfully, but these errors were encountered: