Skip to content
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

ProjectBaseOptions improper uri tag for Skip field #148

Open
xobotyi opened this issue Jul 21, 2023 · 2 comments · May be fixed by #149
Open

ProjectBaseOptions improper uri tag for Skip field #148

xobotyi opened this issue Jul 21, 2023 · 2 comments · May be fixed by #149

Comments

@xobotyi
Copy link
Contributor

xobotyi commented Jul 21, 2023

As for documentation, during request to projects list Skip option has to be passed as S (capital S), instead of lowercased, is it is now.

Source: API docs
Affected version: 3.7+

@andygrunwald
Copy link
Owner

Hey @xobotyi,

I am not sure if this is a bug.

For the endpoint List Projects - 'GET /projects/', it is a capital S. See https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html and

Image

Example code:

opt := &gerrit.ProjectOptions{
	Skip: 1,
	ProjectBaseOptions: gerrit.ProjectBaseOptions{
		Limit: 5,
	},
}
list, _, err := client.Projects.ListProjects(context.Background(), opt)
if err != nil {
	panic(err)
}
for _, project := range *list {
	fmt.Printf("Project: %s\n", project.Name)
}

For the endpoint List Tags -- 'GET /projects/{project-name}/tags/', it is a small s

Image

Example code:

optBase := &gerrit.ProjectBaseOptions{
	Skip:  0,
	Limit: 5,
}
tags, _, err := client.Projects.ListTags(context.Background(), "AhoCorasick", optBase)
if err != nil {
	panic(err)
}
for _, tag := range *tags {
	fmt.Printf("Tag: %s %s\n", tag.Ref, tag.Object)
}

Can you confirm it?

@dmitshur How do you see it?

@andygrunwald
Copy link
Owner

Actually, it also works with an uppercase S. Here, the documentation might be misleading. Sometimes a S and sometimes a s is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants