1

I have a bunch of APIs that are documented as OpenAPI v3 specs.

Eg: foo.yaml, bar.yaml and baz.yaml

I also have a Web server that displays the specs in the swagger ui, so all my swagger models are easily consumable by devs, designers and so on.

My question: is there an easy way, using the javascript console, to give me a list of the resource paths?

I've had a quick look around the swagger ui source code but couldn't find anything useful, other than the SwaggerUIBundle object.

1 Answer 1

2

The API definition is accessible via ui.specSelectors.specJson(). The value is an Immutable.js Map.

You can use the following code to list all the paths:

let paths = ui.specSelectors.specJson().get("paths")
paths.mapKeys(key => console.log(key))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.