getTags() {
return tags;
@@ -85,7 +85,7 @@ public class Pet {
/**
* pet status in the store
**/
- @ApiModelProperty(required = false, value = "pet status in the store")
+ @ApiModelProperty(value = "pet status in the store")
@JsonProperty("status")
public StatusEnum getStatus() {
return status;
diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Tag.java
index d9bf765477b..b9dddc92f1b 100644
--- a/samples/client/petstore/java/src/main/java/io/swagger/client/model/Tag.java
+++ b/samples/client/petstore/java/src/main/java/io/swagger/client/model/Tag.java
@@ -14,7 +14,7 @@ public class Tag {
/**
**/
- @ApiModelProperty(required = false, value = "")
+ @ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
@@ -26,7 +26,7 @@ public class Tag {
/**
**/
- @ApiModelProperty(required = false, value = "")
+ @ApiModelProperty(value = "")
@JsonProperty("name")
public String getName() {
return name;
diff --git a/samples/client/petstore/java/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/src/main/java/io/swagger/client/model/User.java
index d82288e8c25..9811a7741f9 100644
--- a/samples/client/petstore/java/src/main/java/io/swagger/client/model/User.java
+++ b/samples/client/petstore/java/src/main/java/io/swagger/client/model/User.java
@@ -20,7 +20,7 @@ public class User {
/**
**/
- @ApiModelProperty(required = false, value = "")
+ @ApiModelProperty(value = "")
@JsonProperty("id")
public Long getId() {
return id;
@@ -32,7 +32,7 @@ public class User {
/**
**/
- @ApiModelProperty(required = false, value = "")
+ @ApiModelProperty(value = "")
@JsonProperty("username")
public String getUsername() {
return username;
@@ -44,7 +44,7 @@ public class User {
/**
**/
- @ApiModelProperty(required = false, value = "")
+ @ApiModelProperty(value = "")
@JsonProperty("firstName")
public String getFirstName() {
return firstName;
@@ -56,7 +56,7 @@ public class User {
/**
**/
- @ApiModelProperty(required = false, value = "")
+ @ApiModelProperty(value = "")
@JsonProperty("lastName")
public String getLastName() {
return lastName;
@@ -68,7 +68,7 @@ public class User {
/**
**/
- @ApiModelProperty(required = false, value = "")
+ @ApiModelProperty(value = "")
@JsonProperty("email")
public String getEmail() {
return email;
@@ -80,7 +80,7 @@ public class User {
/**
**/
- @ApiModelProperty(required = false, value = "")
+ @ApiModelProperty(value = "")
@JsonProperty("password")
public String getPassword() {
return password;
@@ -92,7 +92,7 @@ public class User {
/**
**/
- @ApiModelProperty(required = false, value = "")
+ @ApiModelProperty(value = "")
@JsonProperty("phone")
public String getPhone() {
return phone;
@@ -105,7 +105,7 @@ public class User {
/**
* User Status
**/
- @ApiModelProperty(required = false, value = "User Status")
+ @ApiModelProperty(value = "User Status")
@JsonProperty("userStatus")
public Integer getUserStatus() {
return userStatus;
diff --git a/samples/client/petstore/python/client/PetApi.py b/samples/client/petstore/python/client/PetApi.py
index 4b99f62a935..519e2ea777b 100644
--- a/samples/client/petstore/python/client/PetApi.py
+++ b/samples/client/petstore/python/client/PetApi.py
@@ -19,6 +19,7 @@ NOTE: This class is auto generated by the swagger code generator program. Do not
"""
import sys
import os
+import urllib
from models import *
@@ -61,8 +62,8 @@ class PetApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = 'application/json,application/xml';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = 'application/json,application/xml'
@@ -117,8 +118,8 @@ class PetApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = 'application/json,application/xml';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = 'application/json,application/xml'
@@ -173,8 +174,8 @@ class PetApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
if ('status' in params):
@@ -235,8 +236,8 @@ class PetApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
if ('tags' in params):
@@ -297,8 +298,8 @@ class PetApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
@@ -307,6 +308,7 @@ class PetApi(object):
if ('petId' in params):
replacement = str(self.apiClient.toPathValue(params['petId']))
+ replacement = urllib.quote(replacement)
resourcePath = resourcePath.replace('{' + 'petId' + '}',
replacement)
@@ -367,8 +369,8 @@ class PetApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = 'application/x-www-form-urlencoded';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = 'application/x-www-form-urlencoded'
@@ -377,6 +379,7 @@ class PetApi(object):
if ('petId' in params):
replacement = str(self.apiClient.toPathValue(params['petId']))
+ replacement = urllib.quote(replacement)
resourcePath = resourcePath.replace('{' + 'petId' + '}',
replacement)
@@ -434,8 +437,8 @@ class PetApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
@@ -447,6 +450,7 @@ class PetApi(object):
if ('petId' in params):
replacement = str(self.apiClient.toPathValue(params['petId']))
+ replacement = urllib.quote(replacement)
resourcePath = resourcePath.replace('{' + 'petId' + '}',
replacement)
@@ -501,8 +505,8 @@ class PetApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = 'multipart/form-data';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = 'multipart/form-data'
@@ -511,6 +515,7 @@ class PetApi(object):
if ('petId' in params):
replacement = str(self.apiClient.toPathValue(params['petId']))
+ replacement = urllib.quote(replacement)
resourcePath = resourcePath.replace('{' + 'petId' + '}',
replacement)
diff --git a/samples/client/petstore/python/client/StoreApi.py b/samples/client/petstore/python/client/StoreApi.py
index f47a4408cbb..5f7a1b37d7a 100644
--- a/samples/client/petstore/python/client/StoreApi.py
+++ b/samples/client/petstore/python/client/StoreApi.py
@@ -19,6 +19,7 @@ NOTE: This class is auto generated by the swagger code generator program. Do not
"""
import sys
import os
+import urllib
from models import *
@@ -58,8 +59,8 @@ class StoreApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
@@ -117,8 +118,8 @@ class StoreApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
@@ -179,8 +180,8 @@ class StoreApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
@@ -189,6 +190,7 @@ class StoreApi(object):
if ('orderId' in params):
replacement = str(self.apiClient.toPathValue(params['orderId']))
+ replacement = urllib.quote(replacement)
resourcePath = resourcePath.replace('{' + 'orderId' + '}',
replacement)
@@ -243,8 +245,8 @@ class StoreApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
@@ -253,6 +255,7 @@ class StoreApi(object):
if ('orderId' in params):
replacement = str(self.apiClient.toPathValue(params['orderId']))
+ replacement = urllib.quote(replacement)
resourcePath = resourcePath.replace('{' + 'orderId' + '}',
replacement)
diff --git a/samples/client/petstore/python/client/UserApi.py b/samples/client/petstore/python/client/UserApi.py
index a357b785c57..5b54b57f5b0 100644
--- a/samples/client/petstore/python/client/UserApi.py
+++ b/samples/client/petstore/python/client/UserApi.py
@@ -19,6 +19,7 @@ NOTE: This class is auto generated by the swagger code generator program. Do not
"""
import sys
import os
+import urllib
from models import *
@@ -61,8 +62,8 @@ class UserApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
@@ -117,8 +118,8 @@ class UserApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
@@ -173,8 +174,8 @@ class UserApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
@@ -232,8 +233,8 @@ class UserApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
if ('username' in params):
@@ -294,8 +295,8 @@ class UserApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
@@ -347,8 +348,8 @@ class UserApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
@@ -357,6 +358,7 @@ class UserApi(object):
if ('username' in params):
replacement = str(self.apiClient.toPathValue(params['username']))
+ replacement = urllib.quote(replacement)
resourcePath = resourcePath.replace('{' + 'username' + '}',
replacement)
@@ -414,8 +416,8 @@ class UserApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
@@ -424,6 +426,7 @@ class UserApi(object):
if ('username' in params):
replacement = str(self.apiClient.toPathValue(params['username']))
+ replacement = urllib.quote(replacement)
resourcePath = resourcePath.replace('{' + 'username' + '}',
replacement)
@@ -475,8 +478,8 @@ class UserApi(object):
files = {}
bodyParam = None
- headerParams['Accept'] = 'application/json,application/xml';
- headerParams['Content-Type'] = '';
+ headerParams['Accept'] = 'application/json,application/xml'
+ headerParams['Content-Type'] = ''
@@ -485,6 +488,7 @@ class UserApi(object):
if ('username' in params):
replacement = str(self.apiClient.toPathValue(params['username']))
+ replacement = urllib.quote(replacement)
resourcePath = resourcePath.replace('{' + 'username' + '}',
replacement)
diff --git a/samples/client/petstore/python/client/swagger.py b/samples/client/petstore/python/client/swagger.py
index 1cfc60981be..693c9fa6296 100644
--- a/samples/client/petstore/python/client/swagger.py
+++ b/samples/client/petstore/python/client/swagger.py
@@ -28,23 +28,27 @@ class ApiClient(object):
headerValue: a header value to pass when making calls to the API
"""
def __init__(self, host=None, headerName=None, headerValue=None):
- self.headerName = headerName
- self.headerValue = headerValue
+ self.defaultHeaders = {}
+ if (headerName is not None):
+ self.defaultHeaders[headerName] = headerValue
self.host = host
self.cookie = None
self.boundary = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(30))
+ def setDefaultHeader(self, headerName, headerValue):
+ self.defaultHeaders[headerName] = headerValue
+
def callAPI(self, resourcePath, method, queryParams, postData,
headerParams=None, files=None):
url = self.host + resourcePath
- headers = {}
- if headerParams:
- for param, value in headerParams.iteritems():
- headers[param] = ApiClient.sanitizeForSerialization(value)
- if self.headerName:
- headers[self.headerName] = ApiClient.sanitizeForSerialization(self.headerValue)
+ mergedHeaderParams = self.defaultHeaders.copy()
+ mergedHeaderParams.update(headerParams)
+ headers = {}
+ if mergedHeaderParams:
+ for param, value in mergedHeaderParams.iteritems():
+ headers[param] = ApiClient.sanitizeForSerialization(value)
if self.cookie:
headers['Cookie'] = ApiClient.sanitizeForSerialization(self.cookie)
@@ -103,9 +107,9 @@ class ApiClient(object):
string -- quoted value
"""
if type(obj) == list:
- return urllib.quote(','.join(obj))
+ return ','.join(obj)
else:
- return urllib.quote(str(obj))
+ return str(obj)
@staticmethod
def sanitizeForSerialization(obj):
diff --git a/samples/dynamic-html/docs/models/Category.html b/samples/dynamic-html/docs/models/Category.html
index 52e04b2072a..15c6820eead 100644
--- a/samples/dynamic-html/docs/models/Category.html
+++ b/samples/dynamic-html/docs/models/Category.html
@@ -2,13 +2,13 @@
Category
- - name : String
+
- name : String
diff --git a/samples/dynamic-html/docs/models/Order.html b/samples/dynamic-html/docs/models/Order.html
index cea3cef3fd6..82278a470c2 100644
--- a/samples/dynamic-html/docs/models/Order.html
+++ b/samples/dynamic-html/docs/models/Order.html
@@ -2,37 +2,37 @@
Order
- - petId : Long
+
- petId : Long
- - quantity : Integer
+
- quantity : Integer
- - shipDate : Date
+
- shipDate : Date
- - status : String
+
- status : String
Order Status
- - complete : Boolean
+
- complete : Boolean
diff --git a/samples/dynamic-html/docs/models/Pet.html b/samples/dynamic-html/docs/models/Pet.html
index ea50d7f0299..17468477704 100644
--- a/samples/dynamic-html/docs/models/Pet.html
+++ b/samples/dynamic-html/docs/models/Pet.html
@@ -2,13 +2,13 @@
Pet
- - category : Category
+
- category : Category
@@ -26,13 +26,13 @@
- - tags : List
+
- tags : List
- - status : String
+
- status : String
pet status in the store
diff --git a/samples/dynamic-html/docs/models/Tag.html b/samples/dynamic-html/docs/models/Tag.html
index ba0314f1c41..e84b50d73d6 100644
--- a/samples/dynamic-html/docs/models/Tag.html
+++ b/samples/dynamic-html/docs/models/Tag.html
@@ -2,13 +2,13 @@
Tag
- - name : String
+
- name : String
diff --git a/samples/dynamic-html/docs/models/User.html b/samples/dynamic-html/docs/models/User.html
index 41f7e2376f1..c71cf6649d7 100644
--- a/samples/dynamic-html/docs/models/User.html
+++ b/samples/dynamic-html/docs/models/User.html
@@ -2,49 +2,49 @@
User
- - username : String
+
- username : String
- - firstName : String
+
- firstName : String
- - lastName : String
+
- lastName : String
- - email : String
+
- email : String
- - password : String
+
- password : String
- - phone : String
+
- phone : String
- - userStatus : Integer
+
- userStatus : Integer
User Status
diff --git a/samples/html/index.html b/samples/html/index.html
index 4f6ab3da6c9..301c8b288d3 100644
--- a/samples/html/index.html
+++ b/samples/html/index.html
@@ -420,7 +420,7 @@
Example data
Content-Type: application/xml
- not implemented com.wordnik.swagger.models.properties.MapProperty@64e17c9c
+ not implemented com.wordnik.swagger.models.properties.MapProperty@12e335ef
@@ -444,11 +444,11 @@
Example data
Content-Type: application/json
- {\n "id" : 123456789,\n "petId" : 123456789,\n "complete" : true,\n "status" : "aeiou",\n "quantity" : 123,\n "shipDate" : "2015-03-30T01:51:23.181+0000"\n}
+ {\n "id" : 123456789,\n "petId" : 123456789,\n "complete" : true,\n "status" : "aeiou",\n "quantity" : 123,\n "shipDate" : "2015-03-31T23:09:59.239+0000"\n}
Example data
Content-Type: application/xml
- \n 123456\n 123456\n 0\n 2015-03-29T18:51:23.183Z\n string\n true\n
+ \n 123456\n 123456\n 0\n 2015-03-31T16:09:59.242Z\n string\n true\n
@@ -472,11 +472,11 @@
Example data
Content-Type: application/json
- {\n "id" : 123456789,\n "petId" : 123456789,\n "complete" : true,\n "status" : "aeiou",\n "quantity" : 123,\n "shipDate" : "2015-03-30T01:51:23.184+0000"\n}
+ {\n "id" : 123456789,\n "petId" : 123456789,\n "complete" : true,\n "status" : "aeiou",\n "quantity" : 123,\n "shipDate" : "2015-03-31T23:09:59.243+0000"\n}
Example data
Content-Type: application/xml
- \n 123456\n 123456\n 0\n 2015-03-29T18:51:23.185Z\n string\n true\n
+ \n 123456\n 123456\n 0\n 2015-03-31T16:09:59.243Z\n string\n true\n