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

Fixes #37824 - Hide taxonomies from parts of api documentation #10322

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/controllers/api/v2/architectures_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module V2
class ArchitecturesController < V2::BaseController
include Foreman::Controller::Parameters::Architecture

hide_taxonomy_options

before_action :find_optional_nested_object
before_action :find_resource, :only => %w{show update destroy}

Expand Down
5 changes: 3 additions & 2 deletions app/controllers/api/v2/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ class BaseController < Api::BaseController
resource_description do
api_version "v2"
app_info N_("Foreman API v2 is currently the default API version.")
param :location_id, Integer, :required => false, :desc => N_("Set the current location context for the request")
param :organization_id, Integer, :required => false, :desc => N_("Set the current organization context for the request")
end

def_param_group :pagination do
Expand Down Expand Up @@ -168,6 +166,9 @@ def render_error(error, options = { })
render options.merge(:template => "api/v2/errors/#{error}",
:layout => 'api/v2/layouts/error_layout')
end

def self.hide_taxonomy_options
end
end
end
end
2 changes: 2 additions & 0 deletions app/controllers/api/v2/external_usergroups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ class ExternalUsergroupsController < V2::BaseController
include Api::Version2
include Foreman::Controller::Parameters::ExternalUsergroup

hide_taxonomy_options

before_action :find_resource, :only => [:show, :update, :destroy, :refresh]
before_action :find_required_nested_object, :only => [:index, :show, :create]
after_action :refresh_external_usergroup, :only => [:create, :update, :destroy]
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/settings_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Api
module V2
class SettingsController < V2::BaseController
hide_taxonomy_options

before_action :find_resource, :only => %w{show update}

def_param_group :setting_params do
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/api/v2/usergroups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module V2
class UsergroupsController < V2::BaseController
include Foreman::Controller::Parameters::Usergroup

hide_taxonomy_options

before_action :find_optional_nested_object
before_action :find_resource, :only => %w{show update destroy}

Expand Down
Loading