Swagger UI / Editor as a page - add to my website

I created the YAML file (and the JSON file respectively) manually through the swagger editor .

Now I want to embed a cool, automatically generated page from the swagger editor tool in my website so that users can read and test it (using the "Try this operation" button). My API is available.

I don’t want swagger to generate any code for me, and I don’t need to update its documentation (YAML or anything else) automatically. I will update the static YAML / JSON file whenever needed - manually. Does this option support the chart feature? Is this related to the "Generate Client" in the swagger editor toolbar? I am looking for some html / js / css files that can load a static YAML file and create something similar to the right page of the swagger editor. By the way, I use the Apache web server (not so important).

Thanks!

EDIT: I only look for the client side - some js / css / html that could add the above requirements, I don't mind to generate it again from time to time (whenever I change my YAML file / my REST API)

+4
source share
2 answers

Well, I found the tool I was looking for is swagger-ui . It doesn’t look exactly like the swagger-editor right-hand user interface, but it satisfies my requirements - it parses my JSON file (which I wrote manually as YAML) on the client side on the Internet with only static files (without server-side operation) , for pages only).

Thank you anyway!

EDIT: I found that more people are interested in viewing the editor in the following link

EDIT2: swagger. . :

  • clone repo: git clone http://github.com/itayB/swagger-editor.git
  • cd swagger-editor
  • npm install
  • npm start

: /default.yaml. , .

+5
+1

Source: https://habr.com/ru/post/1619260/


All Articles