Skip to content

Commit

Permalink
Adding new repo endpoint for no particular reason
Browse files Browse the repository at this point in the history
Saw this in my shelved changes. We can put it as part of the API.
Might be useful some day.
  • Loading branch information
dabico committed Jun 21, 2023
1 parent c7a203c commit 213b0d3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/usi/si/seart/controller/GitRepoController.java
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,17 @@ public ResponseEntity<?> getRepoById(
return ResponseEntity.ok(dto);
}

@GetMapping(value = "/{owner}/{repo}", produces = MediaType.APPLICATION_JSON_VALUE)
@Operation(summary = "Retrieve repository information based on its full name.")
public ResponseEntity<?> getRepoByName(
@PathVariable(value = "owner") String owner,
@PathVariable(value = "repo") String repo
) {
GitRepo gitRepo = gitRepoService.getByName(owner + "/" + repo);
GitRepoDto dto = conversionService.convert(gitRepo, GitRepoDto.class);
return ResponseEntity.ok(dto);
}

@GetMapping(value = "/labels", produces = MediaType.APPLICATION_JSON_VALUE)
@Operation(summary = "Retrieve a list of the 500 most popular issue labels mined across projects.")
public ResponseEntity<?> getAllLabels() {
Expand Down

0 comments on commit 213b0d3

Please sign in to comment.