Page MenuHomePhabricator

Sourcemap is incorrect in RESTBase help page
Closed, ResolvedPublic

Description

Steps to reproduce:

  • visit the RESTBase help screen, e.g. https://en.wikipedia.org/api/rest_v1/
  • cause an error by putting the wrong URL in the input field
  • explore the error stack trace in Chrome by clicking on the line numbers

The line numbers will be a few lines off. Either the build process that created the sourcemap is not run n every update, or something gets prepended to the final JS file, throwing off the numbers.

Event Timeline

mobrovac subscribed.

cause an error by putting the wrong URL in the input field

Could you elaborate on this? Which input field are you referring to?

cause an error by putting the wrong URL in the input field

Could you elaborate on this? Which input field are you referring to?

My guess would be the spec URL at the top.

Yeah, the field that's initially set to https://en.wikipedia.org/api/rest_v1/?spec. You can e.g. delete the last character and click explore to trigger an error.

Looking at the three custom changes we did on top of upstream in https://github.com/wikimedia/swagger-ui/commits/master, it seems that the build process we ran after each did not update the source map. However, the gulpfile defines "dist" to be part of the default task (see https://github.com/wikimedia/swagger-ui/blob/master/gulpfile.js#L188). Perhaps we "just" forgot to check in the updated source maps? /cc @Pchelolo

mobrovac claimed this task.

We have switched to OpenAPI v3 (together with the accompanying swagger-ui library update), so this should not be an issue any more. Please reopen if that's not the case.