-
Notifications
You must be signed in to change notification settings - Fork 441
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
[api] allow POST for /source/<project>/<package>?view=info #17137
base: master
Are you sure you want to change the base?
Conversation
also completing api documentation jsc#OBS-352
@@ -10,19 +10,11 @@ get: | |||
name: view | |||
schema: | |||
type: string | |||
# There are further view points, but this documentation is just for view=info |
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.
Why shouldn't we document, or at least keep, the rest of the options? I see you removed these options:
- cpio
- getmultibuild
- issues
- products
- productrepositories
I see they are still being used in the backend. See:
open-build-service/src/backend/bs_srcserver
Lines 7894 to 7896 in 54cd549
'/source/$project/$package view=getmultibuild' => \&getmultibuildpackages, '/source/$project/$package view=info rev? linkrev? parse:bool? nofilename:bool? repository? arch? withchangesmd5:bool? noexpand:bool? withmetamd5:bool?' => \&getpackagesourceinfo, '/source/$project/$package rev? linkrev? emptylink:bool? deleted:bool? expand:bool? view:? extension:? lastworking:bool? withlinked:bool? meta:bool? product:?' => \&getfilelist, open-build-service/src/backend/bs_srcserver
Line 2992 in 54cd549
if ($view && $view eq 'cpio') { open-build-service/src/backend/bs_srcserver
Line 3005 in 54cd549
if ($view && ($view eq 'products' || $view eq 'productrepositories') ) {
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.
because the cgi parameter set are only valid for this view.
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.
Documenting these two endpoints (view
being info
and view
being other values) in different entries is a compromise between the different outputs returned by the same endpoint.
These lines were added to make a reference between each other endpoint in the documentation:
- the one you propose to remove, and
- this other one (see this endpoint and scroll down until the
view
parameter):
open-build-service/src/api/public/apidocs/paths/source_project_name_package_name.yaml
Line 98 in cbd8fce
See this [other endpoint](<#/Sources - Packages/get_source__project_name___package_name__view_info>) for details.
This makes it easier for documentation users to navigate between both endpoints.
I can understand repeating the values in enum
section could be redundant. I'm fine if those lines are removed.
But please, don't remove the reference in the description field. I helps API users find and relate the documentation they are looking for. By the way, I have never heard from any API user complaining about too much, repetitive, or redundant API documentation.
description: | | ||
Specify which information about a package should be returned. | ||
|
||
* `info`: Show source version, md5sums and build description files, among other information. | ||
* `cpio`, `getmultibuild`, `issues`, `products`, `productrepositories`: | ||
See this [other endpoint](<#/Sources - Files/get_source__project_name___package_name_>) for details. |
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.
Removing this link to the other endpoint will make harder for users to find the endpoint they need. Why do you think removing this section is needed?
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.
because it is off-topic, the entire files only describes the view=info. The description and results are not valid for other views.
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.
Same reason as given above: having a link to the endpoint with the other values that the view parameter can have doesn't harm. On the contrary, it helps users find or relate what they are looking for.
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.
See comments above.
also completing api documentation
jsc#OBS-352