Installing Swagger UI on z/OS
Before you begin
npm install http-server
–g.Procedure
- Download https://github.com/swagger-api/swagger-ui/archive/master.zip.
- Transfer the zip file to z/OS UNIX System Services and unzip.
- Copy <unpax_filepath>/doeserver/opt/doc/swagger.json to swagger-ui/dist/doe.json.
- Optional: For the Zowe API documentation, copy <zowe_directory>/zlux-app-server/doc/swagger/*.yaml to swagger-ui/dist.
-
In swagger-ui/dist/index.html change
url: "https://petstore.swagger.io/v2/swagger.json",tourl: “doe.json",. - Start Swagger UI.
Example
//DOESWAG PROC
//*
//DOESWAG EXEC PGM=BPXBATSL,REGION=0M,TIME=NOLIMIT,
// PARM='PGM /bin/sh /prefix/swagger-ui/dist/swagger.sh'
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*Sample
shell
script:export _BPXK_AUTOCVT=ON
export _CEE_RUNOPTS='FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)'
export _TAG_REDIR_IN=txt
export _TAG_REDIR_OUT=txt
export _TAG_REDIR_ERR=txt
export NODE_HOME=set to your node home
export PATH=$NODE_HOME/bin:$PATH
cd /prefix/swagger-ui/dist
echo "Starting Swagger Server"
http-server -p 12081 -c-1Note: Modify
–p if you want a different port number. -c-1 disables caching. For
more information about http-server, see https://www.npmjs.com/package/http-server.