Class: API::ProjectTemplates

Inherits:
Grape::API::Instance
  • Object
show all
Includes:
PaginationParams
Defined in:
lib/api/project_templates.rb

Constant Summary collapse

TEMPLATE_TYPES =
%w[dockerfiles gitignores gitlab_ci_ymls licenses metrics_dashboard_ymls issues merge_requests].freeze
TEMPLATE_NAMES_ENDPOINT_REQUIREMENTS =

The regex is needed to ensure a period (e.g. agpl-3.0) isn't confused with a format type. We also need to allow encoded values (e.g. C%2B%2B for C++), so allow % and + as well.

API::NAMESPACE_OR_PROJECT_REQUIREMENTS.merge(name: /[\w%.+-]+/)