Skip to content

a template built on top of default swagger codegen Javascript template to works along with webpack build.

Notifications You must be signed in to change notification settings

hasangilak/webpack-swagger-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

use this shell script to simply build your code on top of yaml or json.

#webpack config add this to your webpack config

node: {
    fs: "empty"
}

#package dependency install superagent

npm install --save superagent

use this shell to run the generator. check the shell variables first.

#!/bin/sh

SCRIPT="$0"

while [ -h "$SCRIPT" ] ; do
  ls=`ls -ld "$SCRIPT"`
  link=`expr "$ls" : '.*-> \(.*\)$'`
  if expr "$link" : '/.*' > /dev/null; then
    SCRIPT="$link"
  else
    SCRIPT=`dirname "$SCRIPT"`/"$link"
  fi
done

if [ ! -d "${APP_DIR}" ]; then
  APP_DIR=`dirname "$SCRIPT"`/..
  APP_DIR=`cd "${APP_DIR}"; pwd`
fi

executable="/home/user/work/swagger-codegen-cli.jar"

if [ ! -f "$executable" ]
then
  mvn clean package
fi

rm -rf /home/user/work/front-end/myproject/swagger/webpack-output

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t /home/user/webpack-swagger-template
-i http://swagger.io/myproject.yaml
-l javascript -o /home/user/work/swagger/webpack-output"

java -DappName=PetstoreClient $JAVA_OPTS -jar $executable $ags

About

a template built on top of default swagger codegen Javascript template to works along with webpack build.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published