Skip to content

Instantly share code, notes, and snippets.

Getting Started

cd `mktemp -d /tmp/codegen.XXXXXXXX`;
git clone https://github.com/swagger-api/swagger-codegen.git;
cd swagger-codegen;
mvn package;

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar meta -o output/myLibrary -n FooBarGen -p com.foo.example.generated;

This is a quick guide on executing the new javascript generator in swagger 2.1.6

Go to a tmp directory

cd `mktemp -d /tmp/swagger-codegen-XXXXXX`;

Download swagger codegen 2.1.6 jar

{
"swagger" : "2.0",
"info" : {
"description" : "foo",
"version" : "v1",
"title" : "foo",
"contact" : {
"name" : "foo",
"url" : "http://www.example.com",
"email" : "example@example.com"
securityDefinitions:
hmac:
algorithm: "sha256"
inputs:
timestamp:
type: "integer"
format: "int64"
uri:
type: "string"
description: "The full URI of the request"
@who
who / test.md
Created December 17, 2015 21:18

this is a quote

this is monospaced

$ wget http://www.igniterealtime.org/projects/openfire/plugins/restAPI.jar -q
$ jar xf restAPI.jar
$ tree
.
├── META-INF
│   └── MANIFEST.MF
├── changelog.html
├── java
│   └── org
│   └── jivesoftware
{
"swagger": "2.0",
"info": {
"version": "0.0.0",
"title": "Simple API"
},
"tags":[{"name":"foo bar"}],
"paths": {
"/": {
"get": {
{
"swagger": "2.0",
"info": {
"version": "0.0.0",
"title": "Simple API"
},
"paths": {
"/": {
"get": {
"operationId":"repro",
{
"swagger": "2.0",
"info": {
"version": "0.0.0",
"title": "Simple API"
},
"host":"api.example.com",
"paths": {
"/api": {
"get": {
#!/bin/bash
TMP=$(mktemp /tmp/svn_revisions_XXXXXXXXXXXX.csv);
echo "Processing ...";
echo "PATH,REVISION" > $TMP;
for svndir in $(find . -name .svn)
do
PARENTDIR=$(dirname $svndir);