-
Notifications
You must be signed in to change notification settings - Fork 97
added "page" and "per_page" search parameters #105
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
Conversation
hello @dziemba, |
* The number of results per page (max 100). Default: 30 | ||
*/ | ||
@SuppressWarnings("checkstyle:methodname") | ||
Optional<Integer> per_page(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to use the java method naming convention of camelCase names here and instead use the @JsonProperty("per_page")
annotation to make it compatible with github's format. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to use the java method naming convention of camelCase names here and instead use the
@JsonProperty("per_page")
annotation to make it compatible with github's format. WDYT?
I'd like to use camelCase as well, but it turned out that serialization will be broken in this case:
Method::getName, |
Here is the method from Parameters.java:
/**
* Goes through all public methods defined in an interface that extends this interface and calls
* them in the context of the class that called this method, then joins the method name with the
* result it produced using an ampersand (&) as a delimiter.
*
* <p>It works on interfaces with deep inheritance and filters out any methods defined on this
* interface (with the assumption that they come from the same class loader).
*
* @return String of "key=value" joined on &
*/
default String serialize() {
return Arrays.stream(this.getClass().getInterfaces())
...
.filter(method -> !method.getDeclaringClass().equals(Parameters.class))
.collect(
toMap(
Method::getName,
method -> {
...
.sorted((entry1, entry2) -> entry1.getKey().compareTo(entry2.getKey()))
.map(entry -> entry.getKey() + "=" + entry.getValue().get())
.collect(joining("&"));
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying. You're right, since we're not dealing with JSON here at all my suggestion won't work. This is fine as-is then 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I just released this as v0.1.36, which should be available to download in a few hours. |
Hello,
Added page and per_page params
according to https://docs.github.com/en/enterprise-server@3.4/rest/search#search-repositories specification, page and per_page search params are supported