Bug #30908
openContent View Filter Rule controller does not support the same parameters for CREATE and UPDATE
Description
Ohai,
looking at app/controllers/katello/api/v2/content_view_filter_rules_controller.rb, I see the following difference between POST /content_view_filters/:content_view_filter_id/rules and PUT /content_view_filters/:content_view_filter_id/rules/:id
@@ -75,15 +75,19 @@ module Katello
N_("Update a filter rule. The parameters included should be based upon the filter type.")
param :content_view_filter_id, :number, :desc => N_("filter identifier"), :required => true
param :id, :number, :desc => N_("rule identifier"), :required => true
- param :name, String, :desc => N_("package, package group, or docker tag: name")
+ param :name, Array, of: [String], :desc => N_("package, package group, or docker tag names")
+ param :uuid, String, :desc => N_("package group: uuid")
param :version, String, :desc => N_("package: version")
param :architecture, String, :desc => N_("package: architecture")
param :min_version, String, :desc => N_("package: minimum version")
param :max_version, String, :desc => N_("package: maximum version")
param :errata_id, String, :desc => N_("erratum: id")
+ param :errata_ids, Array, :desc => N_("erratum: IDs or a select all object")
param :start_date, String, :desc => N_("erratum: start date (YYYY-MM-DD)")
param :end_date, String, :desc => N_("erratum: end date (YYYY-MM-DD)")
param :types, Array, :desc => N_("erratum: types (enhancement, bugfix, security)")
+ param :date_type, String, :desc => N_("erratum: search using the 'Issued On' or 'Updated On' column of the errata. Values are 'issued'/'updated'")
+ param :module_stream_ids, Array, :desc => N_("module stream ids")
def update
update_params = rule_params
update_params[:name] = update_params[:name].first if update_params[:name]
The diff is from todays master (3.18.0), but similar differences can be found in older releases (e.g. 3.12, which I accidentally happen to have at hand).
The discrepancy breaks API clients like foreman-ansible-modules which take the APIdoc as the source of truth what the server accepts.
I have no idea what implications the Array[String] vs String for name have, btw…
Updated by Evgeni Golov over 5 years ago
- Category changed from Backup & Restore to API
Updated by Evgeni Golov over 5 years ago
- Related to Tracker #27680: API bugs that need workarounds in foreman-ansible-modules added
Updated by John Mitsch over 5 years ago
- Status changed from New to Need more information
Thanks Evgeni,
Was this a breakage or has this behavior been present for a while?
Updated by Evgeni Golov over 5 years ago
- Status changed from Need more information to New
as far as I've seen, the level of difference differs (lol), but it's been out of sync for a while now.
Updated by Evgeni Golov over 5 years ago
at least back to 3.15, didn't look further
Updated by Jonathon Turel over 5 years ago
- Category changed from API to Content Views
- Target version set to Katello Backlog
- Triaged changed from No to Yes
Updated by Ian Ballou almost 2 years ago
- Target version deleted (
Katello Backlog)