Fix OpenAPI V2 document generation

What does this MR do and why?

The changes introduced in !102241 (merged) let to message: 500 Internal Server Error after running rake gitlab:openapi:generate task.

Screenshots or screen recordings

Before

---
message: 500 Internal Server Error

After

---
info:
  title: GitLab API
  version: v4
swagger: '2.0'
produces:
- application/json
securityDefinitions:
  access_token_header:
    type: apiKey
    name: PRIVATE-TOKEN
    in: header
  access_token_query:
    type: apiKey
    name: private_token
    in: query
host: gitlab.com

How to set up and validate locally

  1. Checkout the branch
  2. Run gitlab:openapi:generate
  3. Open openapi_v2.yaml file and validate there is no 500 Internal Server Error

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading