OpenAPI viewer fails to render specs with path parameters
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
Steps to reproduce
- Navigate to an OpenAPI spec file in the repository which has at least 1 path with a
parameterof typein: path, e.g.: https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/api/openapi/openapi.yaml - View the rendered version of the file
- Click on a path in the rendering to expand it and view details
- Scroll up and down
Example Project
GitLab's OpenAPI spec: https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/api/openapi/openapi.yaml
Minimal example:
-
✅ Working: https://gitlab.com/francoisrose/playground/-/blob/main/openapi/openapi.yaml -
❌ Broken: https://gitlab.com/francoisrose/playground/-/blob/main/openapi/openapi_with_param.yaml
What is the current bug behavior?
The OpenAPI viewer shows the following error:
Unable to render this definition
The provided definition does not specify a valid version field.
Please indicate a valid Swagger or OpenAPI version field. Supported version fields are swagger: "2.0" and those that match openapi: 3.x.y (for example, openapi: 3.1.0).
What is the expected correct behavior?
The OpenAPI viewer should continue to render the spec as expected.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)
Possible fixes
Edited by 🤖 GitLab Bot 🤖
