[go: up one dir, main page]

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

  1. Navigate to an OpenAPI spec file in the repository which has at least 1 path with a parameter of type in: path, e.g.: https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/api/openapi/openapi.yaml
  2. View the rendered version of the file
  3. Click on a path in the rendering to expand it and view details
  4. 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:

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

Screenshot_2024-03-14_at_18.26.07

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 🤖