update server generator to use petstore.yaml

This commit is contained in:
wing328 2016-04-15 17:42:18 +08:00
parent 4f84c7d3bc
commit 0982afbca0
17 changed files with 375 additions and 507 deletions

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -l aspnet5 -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -o samples/server/petstore/aspnet5" ags="$@ generate -l aspnet5 -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -o samples/server/petstore/aspnet5"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaInflector -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l inflector -o samples/server/petstore/java-inflector" ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaInflector -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l inflector -o samples/server/petstore/java-inflector"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/scalatra -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l scalatra -o samples/server/petstore/scalatra" ags="$@ generate -t modules/swagger-codegen/src/main/resources/scalatra -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l scalatra -o samples/server/petstore/scalatra"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/silex -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l silex-PHP -o samples/server/petstore/silex" ags="$@ generate -t modules/swagger-codegen/src/main/resources/silex -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l silex-PHP -o samples/server/petstore/silex"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -26,6 +26,6 @@ fi
# if you've executed sbt assembly previously it will use that instead. # if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/slim -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l slim -o samples/server/petstore/slim" ags="$@ generate -t modules/swagger-codegen/src/main/resources/slim -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l slim -o samples/server/petstore/slim"
java $JAVA_OPTS -jar $executable $ags java $JAVA_OPTS -jar $executable $ags

View File

@ -19,23 +19,6 @@ namespace IO.Swagger.Controllers
public class PetApiController : Controller public class PetApiController : Controller
{ {
/// <summary>
/// Update an existing pet
/// </summary>
/// <remarks></remarks>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <response code="400">Invalid ID supplied</response>
/// <response code="404">Pet not found</response>
/// <response code="405">Validation exception</response>
[HttpPut]
[Route("/pet")]
[SwaggerOperation("UpdatePet")]
public void UpdatePet([FromBody]Pet body)
{
throw new NotImplementedException();
}
/// <summary> /// <summary>
/// Add a new pet to the store /// Add a new pet to the store
/// </summary> /// </summary>
@ -51,93 +34,6 @@ namespace IO.Swagger.Controllers
} }
/// <summary>
/// Finds Pets by status
/// </summary>
/// <remarks>Multiple status values can be provided with comma seperated strings</remarks>
/// <param name="status">Status values that need to be considered for filter</param>
/// <response code="200">successful operation</response>
/// <response code="400">Invalid status value</response>
[HttpGet]
[Route("/pet/findByStatus")]
[SwaggerOperation("FindPetsByStatus")]
[SwaggerResponse(200, type: typeof(List<Pet>))]
public IActionResult FindPetsByStatus([FromQuery]List<string> status)
{
string exampleJson = null;
var example = exampleJson != null
? JsonConvert.DeserializeObject<List<Pet>>(exampleJson)
: default(List<Pet>);
return new ObjectResult(example);
}
/// <summary>
/// Finds Pets by tags
/// </summary>
/// <remarks>Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.</remarks>
/// <param name="tags">Tags to filter by</param>
/// <response code="200">successful operation</response>
/// <response code="400">Invalid tag value</response>
[HttpGet]
[Route("/pet/findByTags")]
[SwaggerOperation("FindPetsByTags")]
[SwaggerResponse(200, type: typeof(List<Pet>))]
public IActionResult FindPetsByTags([FromQuery]List<string> tags)
{
string exampleJson = null;
var example = exampleJson != null
? JsonConvert.DeserializeObject<List<Pet>>(exampleJson)
: default(List<Pet>);
return new ObjectResult(example);
}
/// <summary>
/// Find pet by ID
/// </summary>
/// <remarks>Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions</remarks>
/// <param name="petId">ID of pet that needs to be fetched</param>
/// <response code="200">successful operation</response>
/// <response code="400">Invalid ID supplied</response>
/// <response code="404">Pet not found</response>
[HttpGet]
[Route("/pet/{petId}")]
[SwaggerOperation("GetPetById")]
[SwaggerResponse(200, type: typeof(Pet))]
public IActionResult GetPetById([FromRoute]long? petId)
{
string exampleJson = null;
var example = exampleJson != null
? JsonConvert.DeserializeObject<Pet>(exampleJson)
: default(Pet);
return new ObjectResult(example);
}
/// <summary>
/// Updates a pet in the store with form data
/// </summary>
/// <remarks></remarks>
/// <param name="petId">ID of pet that needs to be updated</param>
/// <param name="name">Updated name of the pet</param>
/// <param name="status">Updated status of the pet</param>
/// <response code="405">Invalid input</response>
[HttpPost]
[Route("/pet/{petId}")]
[SwaggerOperation("UpdatePetWithForm")]
public void UpdatePetWithForm([FromRoute]string petId, [FromForm]string name, [FromForm]string status)
{
throw new NotImplementedException();
}
/// <summary> /// <summary>
/// Deletes a pet /// Deletes a pet
/// </summary> /// </summary>
@ -154,6 +50,107 @@ namespace IO.Swagger.Controllers
} }
/// <summary>
/// Finds Pets by status
/// </summary>
/// <remarks>Multiple status values can be provided with comma separated strings</remarks>
/// <param name="status">Status values that need to be considered for filter</param>
/// <response code="200">successful operation</response>
/// <response code="400">Invalid status value</response>
[HttpGet]
[Route("/pet/findByStatus")]
[SwaggerOperation("FindPetsByStatus")]
[SwaggerResponse(200, type: typeof(List<Pet>))]
public IActionResult FindPetsByStatus([FromQuery]List<string> status)
{
string exampleJson = null;
var example = exampleJson != null
? JsonConvert.DeserializeObject<List<Pet>>(exampleJson)
: default(List<Pet>);
return new ObjectResult(example);
}
/// <summary>
/// Finds Pets by tags
/// </summary>
/// <remarks>Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.</remarks>
/// <param name="tags">Tags to filter by</param>
/// <response code="200">successful operation</response>
/// <response code="400">Invalid tag value</response>
[HttpGet]
[Route("/pet/findByTags")]
[SwaggerOperation("FindPetsByTags")]
[SwaggerResponse(200, type: typeof(List<Pet>))]
public IActionResult FindPetsByTags([FromQuery]List<string> tags)
{
string exampleJson = null;
var example = exampleJson != null
? JsonConvert.DeserializeObject<List<Pet>>(exampleJson)
: default(List<Pet>);
return new ObjectResult(example);
}
/// <summary>
/// Find pet by ID
/// </summary>
/// <remarks>Returns a single pet</remarks>
/// <param name="petId">ID of pet to return</param>
/// <response code="200">successful operation</response>
/// <response code="400">Invalid ID supplied</response>
/// <response code="404">Pet not found</response>
[HttpGet]
[Route("/pet/{petId}")]
[SwaggerOperation("GetPetById")]
[SwaggerResponse(200, type: typeof(Pet))]
public IActionResult GetPetById([FromRoute]long? petId)
{
string exampleJson = null;
var example = exampleJson != null
? JsonConvert.DeserializeObject<Pet>(exampleJson)
: default(Pet);
return new ObjectResult(example);
}
/// <summary>
/// Update an existing pet
/// </summary>
/// <remarks></remarks>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <response code="400">Invalid ID supplied</response>
/// <response code="404">Pet not found</response>
/// <response code="405">Validation exception</response>
[HttpPut]
[Route("/pet")]
[SwaggerOperation("UpdatePet")]
public void UpdatePet([FromBody]Pet body)
{
throw new NotImplementedException();
}
/// <summary>
/// Updates a pet in the store with form data
/// </summary>
/// <remarks></remarks>
/// <param name="petId">ID of pet that needs to be updated</param>
/// <param name="name">Updated name of the pet</param>
/// <param name="status">Updated status of the pet</param>
/// <response code="405">Invalid input</response>
[HttpPost]
[Route("/pet/{petId}")]
[SwaggerOperation("UpdatePetWithForm")]
public void UpdatePetWithForm([FromRoute]long? petId, [FromForm]string name, [FromForm]string status)
{
throw new NotImplementedException();
}
/// <summary> /// <summary>
/// uploads an image /// uploads an image
/// </summary> /// </summary>
@ -161,52 +158,19 @@ namespace IO.Swagger.Controllers
/// <param name="petId">ID of pet to update</param> /// <param name="petId">ID of pet to update</param>
/// <param name="additionalMetadata">Additional data to pass to server</param> /// <param name="additionalMetadata">Additional data to pass to server</param>
/// <param name="file">file to upload</param> /// <param name="file">file to upload</param>
/// <response code="0">successful operation</response> /// <response code="200">successful operation</response>
[HttpPost] [HttpPost]
[Route("/pet/{petId}/uploadImage")] [Route("/pet/{petId}/uploadImage")]
[SwaggerOperation("UploadFile")] [SwaggerOperation("UploadFile")]
public void UploadFile([FromRoute]long? petId, [FromForm]string additionalMetadata, [FromForm]Stream file) [SwaggerResponse(200, type: typeof(ApiResponse))]
{ public IActionResult UploadFile([FromRoute]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream file)
throw new NotImplementedException();
}
/// <summary>
/// Fake endpoint to test byte array return by &#39;Find pet by ID&#39;
/// </summary>
/// <remarks>Returns a pet when ID &lt; 10. ID &gt; 10 or nonintegers will simulate API error conditions</remarks>
/// <param name="petId">ID of pet that needs to be fetched</param>
/// <response code="200">successful operation</response>
/// <response code="400">Invalid ID supplied</response>
/// <response code="404">Pet not found</response>
[HttpGet]
[Route("/pet/{petId}/testing_byte_array=true")]
[SwaggerOperation("GetPetByIdWithByteArray")]
[SwaggerResponse(200, type: typeof(byte[]))]
public IActionResult GetPetByIdWithByteArray([FromRoute]long? petId)
{ {
string exampleJson = null; string exampleJson = null;
var example = exampleJson != null var example = exampleJson != null
? JsonConvert.DeserializeObject<byte[]>(exampleJson) ? JsonConvert.DeserializeObject<ApiResponse>(exampleJson)
: default(byte[]); : default(ApiResponse);
return new ObjectResult(example); return new ObjectResult(example);
} }
/// <summary>
/// Fake endpoint to test byte array in body parameter for adding a new pet to the store
/// </summary>
/// <remarks></remarks>
/// <param name="body">Pet object in the form of byte array</param>
/// <response code="405">Invalid input</response>
[HttpPost]
[Route("/pet/testing_byte_array=true")]
[SwaggerOperation("AddPetUsingByteArray")]
public void AddPetUsingByteArray([FromBody]byte[] body)
{
throw new NotImplementedException();
}
} }
} }

View File

@ -19,6 +19,22 @@ namespace IO.Swagger.Controllers
public class StoreApiController : Controller public class StoreApiController : Controller
{ {
/// <summary>
/// Delete purchase order by ID
/// </summary>
/// <remarks>For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors</remarks>
/// <param name="orderId">ID of the order that needs to be deleted</param>
/// <response code="400">Invalid ID supplied</response>
/// <response code="404">Order not found</response>
[HttpDelete]
[Route("/store/order/{orderId}")]
[SwaggerOperation("DeleteOrder")]
public void DeleteOrder([FromRoute]string orderId)
{
throw new NotImplementedException();
}
/// <summary> /// <summary>
/// Returns pet inventories by status /// Returns pet inventories by status
/// </summary> /// </summary>
@ -35,7 +51,29 @@ namespace IO.Swagger.Controllers
var example = exampleJson != null var example = exampleJson != null
? JsonConvert.DeserializeObject<Dictionary<string, int?>>(exampleJson) ? JsonConvert.DeserializeObject<Dictionary<string, int?>>(exampleJson)
: default(Dictionary<string, int?>); : default(Dictionary<string, int?>);
return new ObjectResult(example);
}
/// <summary>
/// Find purchase order by ID
/// </summary>
/// <remarks>For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions</remarks>
/// <param name="orderId">ID of pet that needs to be fetched</param>
/// <response code="200">successful operation</response>
/// <response code="400">Invalid ID supplied</response>
/// <response code="404">Order not found</response>
[HttpGet]
[Route("/store/order/{orderId}")]
[SwaggerOperation("GetOrderById")]
[SwaggerResponse(200, type: typeof(Order))]
public IActionResult GetOrderById([FromRoute]long? orderId)
{
string exampleJson = null;
var example = exampleJson != null
? JsonConvert.DeserializeObject<Order>(exampleJson)
: default(Order);
return new ObjectResult(example); return new ObjectResult(example);
} }
@ -58,48 +96,7 @@ namespace IO.Swagger.Controllers
var example = exampleJson != null var example = exampleJson != null
? JsonConvert.DeserializeObject<Order>(exampleJson) ? JsonConvert.DeserializeObject<Order>(exampleJson)
: default(Order); : default(Order);
return new ObjectResult(example); return new ObjectResult(example);
} }
/// <summary>
/// Find purchase order by ID
/// </summary>
/// <remarks>For valid response try integer IDs with value &lt;= 5 or &gt; 10. Other values will generated exceptions</remarks>
/// <param name="orderId">ID of pet that needs to be fetched</param>
/// <response code="200">successful operation</response>
/// <response code="400">Invalid ID supplied</response>
/// <response code="404">Order not found</response>
[HttpGet]
[Route("/store/order/{orderId}")]
[SwaggerOperation("GetOrderById")]
[SwaggerResponse(200, type: typeof(Order))]
public IActionResult GetOrderById([FromRoute]string orderId)
{
string exampleJson = null;
var example = exampleJson != null
? JsonConvert.DeserializeObject<Order>(exampleJson)
: default(Order);
return new ObjectResult(example);
}
/// <summary>
/// Delete purchase order by ID
/// </summary>
/// <remarks>For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors</remarks>
/// <param name="orderId">ID of the order that needs to be deleted</param>
/// <response code="400">Invalid ID supplied</response>
/// <response code="404">Order not found</response>
[HttpDelete]
[Route("/store/order/{orderId}")]
[SwaggerOperation("DeleteOrder")]
public void DeleteOrder([FromRoute]string orderId)
{
throw new NotImplementedException();
}
} }
} }

View File

@ -64,6 +64,45 @@ namespace IO.Swagger.Controllers
} }
/// <summary>
/// Delete user
/// </summary>
/// <remarks>This can only be done by the logged in user.</remarks>
/// <param name="username">The name that needs to be deleted</param>
/// <response code="400">Invalid username supplied</response>
/// <response code="404">User not found</response>
[HttpDelete]
[Route("/user/{username}")]
[SwaggerOperation("DeleteUser")]
public void DeleteUser([FromRoute]string username)
{
throw new NotImplementedException();
}
/// <summary>
/// Get user by user name
/// </summary>
/// <remarks></remarks>
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param>
/// <response code="200">successful operation</response>
/// <response code="400">Invalid username supplied</response>
/// <response code="404">User not found</response>
[HttpGet]
[Route("/user/{username}")]
[SwaggerOperation("GetUserByName")]
[SwaggerResponse(200, type: typeof(User))]
public IActionResult GetUserByName([FromRoute]string username)
{
string exampleJson = null;
var example = exampleJson != null
? JsonConvert.DeserializeObject<User>(exampleJson)
: default(User);
return new ObjectResult(example);
}
/// <summary> /// <summary>
/// Logs user into the system /// Logs user into the system
/// </summary> /// </summary>
@ -83,7 +122,6 @@ namespace IO.Swagger.Controllers
var example = exampleJson != null var example = exampleJson != null
? JsonConvert.DeserializeObject<string>(exampleJson) ? JsonConvert.DeserializeObject<string>(exampleJson)
: default(string); : default(string);
return new ObjectResult(example); return new ObjectResult(example);
} }
@ -102,30 +140,6 @@ namespace IO.Swagger.Controllers
} }
/// <summary>
/// Get user by user name
/// </summary>
/// <remarks></remarks>
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
/// <response code="200">successful operation</response>
/// <response code="400">Invalid username supplied</response>
/// <response code="404">User not found</response>
[HttpGet]
[Route("/user/{username}")]
[SwaggerOperation("GetUserByName")]
[SwaggerResponse(200, type: typeof(User))]
public IActionResult GetUserByName([FromRoute]string username)
{
string exampleJson = null;
var example = exampleJson != null
? JsonConvert.DeserializeObject<User>(exampleJson)
: default(User);
return new ObjectResult(example);
}
/// <summary> /// <summary>
/// Updated user /// Updated user
/// </summary> /// </summary>
@ -141,21 +155,5 @@ namespace IO.Swagger.Controllers
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
/// <summary>
/// Delete user
/// </summary>
/// <remarks>This can only be done by the logged in user.</remarks>
/// <param name="username">The name that needs to be deleted</param>
/// <response code="400">Invalid username supplied</response>
/// <response code="404">User not found</response>
[HttpDelete]
[Route("/user/{username}")]
[SwaggerOperation("DeleteUser")]
public void DeleteUser([FromRoute]string username)
{
throw new NotImplementedException();
}
} }
} }

View File

@ -27,20 +27,17 @@ namespace IO.Swagger.Models
} }
/// <summary> /// <summary>
/// Gets or Sets Id /// Gets or Sets Id
/// </summary> /// </summary>
public long? Id { get; set; } public long? Id { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Name /// Gets or Sets Name
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }
/// <summary> /// <summary>
/// Returns the string presentation of the object /// Returns the string presentation of the object
/// </summary> /// </summary>
@ -50,8 +47,7 @@ namespace IO.Swagger.Models
var sb = new StringBuilder(); var sb = new StringBuilder();
sb.Append("class Category {\n"); sb.Append("class Category {\n");
sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append("}\n"); sb.Append("}\n");
return sb.ToString(); return sb.ToString();
} }
@ -113,13 +109,10 @@ namespace IO.Swagger.Models
{ {
int hash = 41; int hash = 41;
// Suitable nullity checks etc, of course :) // Suitable nullity checks etc, of course :)
if (this.Id != null) if (this.Id != null)
hash = hash * 59 + this.Id.GetHashCode(); hash = hash * 59 + this.Id.GetHashCode();
if (this.Name != null) if (this.Name != null)
hash = hash * 59 + this.Name.GetHashCode(); hash = hash * 59 + this.Name.GetHashCode();
return hash; return hash;
} }
} }

View File

@ -23,7 +23,7 @@ namespace IO.Swagger.Models
/// <param name="Quantity">Quantity.</param> /// <param name="Quantity">Quantity.</param>
/// <param name="ShipDate">ShipDate.</param> /// <param name="ShipDate">ShipDate.</param>
/// <param name="Status">Order Status.</param> /// <param name="Status">Order Status.</param>
/// <param name="Complete">Complete.</param> /// <param name="Complete">Complete (default to false).</param>
public Order(long? Id = null, long? PetId = null, int? Quantity = null, DateTime? ShipDate = null, string Status = null, bool? Complete = null) public Order(long? Id = null, long? PetId = null, int? Quantity = null, DateTime? ShipDate = null, string Status = null, bool? Complete = null)
{ {
this.Id = Id; this.Id = Id;
@ -31,49 +31,50 @@ namespace IO.Swagger.Models
this.Quantity = Quantity; this.Quantity = Quantity;
this.ShipDate = ShipDate; this.ShipDate = ShipDate;
this.Status = Status; this.Status = Status;
// use default value if no "Complete" provided
if (Complete == null)
{
this.Complete = false;
}
else
{
this.Complete = Complete; this.Complete = Complete;
} }
}
/// <summary> /// <summary>
/// Gets or Sets Id /// Gets or Sets Id
/// </summary> /// </summary>
public long? Id { get; set; } public long? Id { get; set; }
/// <summary> /// <summary>
/// Gets or Sets PetId /// Gets or Sets PetId
/// </summary> /// </summary>
public long? PetId { get; set; } public long? PetId { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Quantity /// Gets or Sets Quantity
/// </summary> /// </summary>
public int? Quantity { get; set; } public int? Quantity { get; set; }
/// <summary> /// <summary>
/// Gets or Sets ShipDate /// Gets or Sets ShipDate
/// </summary> /// </summary>
public DateTime? ShipDate { get; set; } public DateTime? ShipDate { get; set; }
/// <summary> /// <summary>
/// Order Status /// Order Status
/// </summary> /// </summary>
/// <value>Order Status</value> /// <value>Order Status</value>
public string Status { get; set; } public string Status { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Complete /// Gets or Sets Complete
/// </summary> /// </summary>
public bool? Complete { get; set; } public bool? Complete { get; set; }
/// <summary> /// <summary>
/// Returns the string presentation of the object /// Returns the string presentation of the object
/// </summary> /// </summary>
@ -83,12 +84,11 @@ namespace IO.Swagger.Models
var sb = new StringBuilder(); var sb = new StringBuilder();
sb.Append("class Order {\n"); sb.Append("class Order {\n");
sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" PetId: ").Append(PetId).Append("\n"); sb.Append(" PetId: ").Append(PetId).Append("\n");
sb.Append(" Quantity: ").Append(Quantity).Append("\n"); sb.Append(" Quantity: ").Append(Quantity).Append("\n");
sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); sb.Append(" ShipDate: ").Append(ShipDate).Append("\n");
sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" Status: ").Append(Status).Append("\n");
sb.Append(" Complete: ").Append(Complete).Append("\n"); sb.Append(" Complete: ").Append(Complete).Append("\n");
sb.Append("}\n"); sb.Append("}\n");
return sb.ToString(); return sb.ToString();
} }
@ -170,25 +170,18 @@ namespace IO.Swagger.Models
{ {
int hash = 41; int hash = 41;
// Suitable nullity checks etc, of course :) // Suitable nullity checks etc, of course :)
if (this.Id != null) if (this.Id != null)
hash = hash * 59 + this.Id.GetHashCode(); hash = hash * 59 + this.Id.GetHashCode();
if (this.PetId != null) if (this.PetId != null)
hash = hash * 59 + this.PetId.GetHashCode(); hash = hash * 59 + this.PetId.GetHashCode();
if (this.Quantity != null) if (this.Quantity != null)
hash = hash * 59 + this.Quantity.GetHashCode(); hash = hash * 59 + this.Quantity.GetHashCode();
if (this.ShipDate != null) if (this.ShipDate != null)
hash = hash * 59 + this.ShipDate.GetHashCode(); hash = hash * 59 + this.ShipDate.GetHashCode();
if (this.Status != null) if (this.Status != null)
hash = hash * 59 + this.Status.GetHashCode(); hash = hash * 59 + this.Status.GetHashCode();
if (this.Complete != null) if (this.Complete != null)
hash = hash * 59 + this.Complete.GetHashCode(); hash = hash * 59 + this.Complete.GetHashCode();
return hash; return hash;
} }
} }

View File

@ -51,37 +51,31 @@ namespace IO.Swagger.Models
} }
/// <summary> /// <summary>
/// Gets or Sets Id /// Gets or Sets Id
/// </summary> /// </summary>
public long? Id { get; set; } public long? Id { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Category /// Gets or Sets Category
/// </summary> /// </summary>
public Category Category { get; set; } public Category Category { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Name /// Gets or Sets Name
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }
/// <summary> /// <summary>
/// Gets or Sets PhotoUrls /// Gets or Sets PhotoUrls
/// </summary> /// </summary>
public List<string> PhotoUrls { get; set; } public List<string> PhotoUrls { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Tags /// Gets or Sets Tags
/// </summary> /// </summary>
public List<Tag> Tags { get; set; } public List<Tag> Tags { get; set; }
/// <summary> /// <summary>
/// pet status in the store /// pet status in the store
/// </summary> /// </summary>
@ -89,7 +83,6 @@ namespace IO.Swagger.Models
public string Status { get; set; } public string Status { get; set; }
/// <summary> /// <summary>
/// Returns the string presentation of the object /// Returns the string presentation of the object
/// </summary> /// </summary>
@ -99,12 +92,11 @@ namespace IO.Swagger.Models
var sb = new StringBuilder(); var sb = new StringBuilder();
sb.Append("class Pet {\n"); sb.Append("class Pet {\n");
sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Category: ").Append(Category).Append("\n"); sb.Append(" Category: ").Append(Category).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n");
sb.Append(" Tags: ").Append(Tags).Append("\n"); sb.Append(" Tags: ").Append(Tags).Append("\n");
sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append(" Status: ").Append(Status).Append("\n");
sb.Append("}\n"); sb.Append("}\n");
return sb.ToString(); return sb.ToString();
} }
@ -186,25 +178,18 @@ namespace IO.Swagger.Models
{ {
int hash = 41; int hash = 41;
// Suitable nullity checks etc, of course :) // Suitable nullity checks etc, of course :)
if (this.Id != null) if (this.Id != null)
hash = hash * 59 + this.Id.GetHashCode(); hash = hash * 59 + this.Id.GetHashCode();
if (this.Category != null) if (this.Category != null)
hash = hash * 59 + this.Category.GetHashCode(); hash = hash * 59 + this.Category.GetHashCode();
if (this.Name != null) if (this.Name != null)
hash = hash * 59 + this.Name.GetHashCode(); hash = hash * 59 + this.Name.GetHashCode();
if (this.PhotoUrls != null) if (this.PhotoUrls != null)
hash = hash * 59 + this.PhotoUrls.GetHashCode(); hash = hash * 59 + this.PhotoUrls.GetHashCode();
if (this.Tags != null) if (this.Tags != null)
hash = hash * 59 + this.Tags.GetHashCode(); hash = hash * 59 + this.Tags.GetHashCode();
if (this.Status != null) if (this.Status != null)
hash = hash * 59 + this.Status.GetHashCode(); hash = hash * 59 + this.Status.GetHashCode();
return hash; return hash;
} }
} }

View File

@ -27,20 +27,17 @@ namespace IO.Swagger.Models
} }
/// <summary> /// <summary>
/// Gets or Sets Id /// Gets or Sets Id
/// </summary> /// </summary>
public long? Id { get; set; } public long? Id { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Name /// Gets or Sets Name
/// </summary> /// </summary>
public string Name { get; set; } public string Name { get; set; }
/// <summary> /// <summary>
/// Returns the string presentation of the object /// Returns the string presentation of the object
/// </summary> /// </summary>
@ -50,8 +47,7 @@ namespace IO.Swagger.Models
var sb = new StringBuilder(); var sb = new StringBuilder();
sb.Append("class Tag {\n"); sb.Append("class Tag {\n");
sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Name: ").Append(Name).Append("\n"); sb.Append(" Name: ").Append(Name).Append("\n");
sb.Append("}\n"); sb.Append("}\n");
return sb.ToString(); return sb.ToString();
} }
@ -113,13 +109,10 @@ namespace IO.Swagger.Models
{ {
int hash = 41; int hash = 41;
// Suitable nullity checks etc, of course :) // Suitable nullity checks etc, of course :)
if (this.Id != null) if (this.Id != null)
hash = hash * 59 + this.Id.GetHashCode(); hash = hash * 59 + this.Id.GetHashCode();
if (this.Name != null) if (this.Name != null)
hash = hash * 59 + this.Name.GetHashCode(); hash = hash * 59 + this.Name.GetHashCode();
return hash; return hash;
} }
} }

View File

@ -39,49 +39,41 @@ namespace IO.Swagger.Models
} }
/// <summary> /// <summary>
/// Gets or Sets Id /// Gets or Sets Id
/// </summary> /// </summary>
public long? Id { get; set; } public long? Id { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Username /// Gets or Sets Username
/// </summary> /// </summary>
public string Username { get; set; } public string Username { get; set; }
/// <summary> /// <summary>
/// Gets or Sets FirstName /// Gets or Sets FirstName
/// </summary> /// </summary>
public string FirstName { get; set; } public string FirstName { get; set; }
/// <summary> /// <summary>
/// Gets or Sets LastName /// Gets or Sets LastName
/// </summary> /// </summary>
public string LastName { get; set; } public string LastName { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Email /// Gets or Sets Email
/// </summary> /// </summary>
public string Email { get; set; } public string Email { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Password /// Gets or Sets Password
/// </summary> /// </summary>
public string Password { get; set; } public string Password { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Phone /// Gets or Sets Phone
/// </summary> /// </summary>
public string Phone { get; set; } public string Phone { get; set; }
/// <summary> /// <summary>
/// User Status /// User Status
/// </summary> /// </summary>
@ -89,7 +81,6 @@ namespace IO.Swagger.Models
public int? UserStatus { get; set; } public int? UserStatus { get; set; }
/// <summary> /// <summary>
/// Returns the string presentation of the object /// Returns the string presentation of the object
/// </summary> /// </summary>
@ -99,14 +90,13 @@ namespace IO.Swagger.Models
var sb = new StringBuilder(); var sb = new StringBuilder();
sb.Append("class User {\n"); sb.Append("class User {\n");
sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" Username: ").Append(Username).Append("\n"); sb.Append(" Username: ").Append(Username).Append("\n");
sb.Append(" FirstName: ").Append(FirstName).Append("\n"); sb.Append(" FirstName: ").Append(FirstName).Append("\n");
sb.Append(" LastName: ").Append(LastName).Append("\n"); sb.Append(" LastName: ").Append(LastName).Append("\n");
sb.Append(" Email: ").Append(Email).Append("\n"); sb.Append(" Email: ").Append(Email).Append("\n");
sb.Append(" Password: ").Append(Password).Append("\n"); sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" Phone: ").Append(Phone).Append("\n"); sb.Append(" Phone: ").Append(Phone).Append("\n");
sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); sb.Append(" UserStatus: ").Append(UserStatus).Append("\n");
sb.Append("}\n"); sb.Append("}\n");
return sb.ToString(); return sb.ToString();
} }
@ -198,31 +188,22 @@ namespace IO.Swagger.Models
{ {
int hash = 41; int hash = 41;
// Suitable nullity checks etc, of course :) // Suitable nullity checks etc, of course :)
if (this.Id != null) if (this.Id != null)
hash = hash * 59 + this.Id.GetHashCode(); hash = hash * 59 + this.Id.GetHashCode();
if (this.Username != null) if (this.Username != null)
hash = hash * 59 + this.Username.GetHashCode(); hash = hash * 59 + this.Username.GetHashCode();
if (this.FirstName != null) if (this.FirstName != null)
hash = hash * 59 + this.FirstName.GetHashCode(); hash = hash * 59 + this.FirstName.GetHashCode();
if (this.LastName != null) if (this.LastName != null)
hash = hash * 59 + this.LastName.GetHashCode(); hash = hash * 59 + this.LastName.GetHashCode();
if (this.Email != null) if (this.Email != null)
hash = hash * 59 + this.Email.GetHashCode(); hash = hash * 59 + this.Email.GetHashCode();
if (this.Password != null) if (this.Password != null)
hash = hash * 59 + this.Password.GetHashCode(); hash = hash * 59 + this.Password.GetHashCode();
if (this.Phone != null) if (this.Phone != null)
hash = hash * 59 + this.Phone.GetHashCode(); hash = hash * 59 + this.Phone.GetHashCode();
if (this.UserStatus != null) if (this.UserStatus != null)
hash = hash * 59 + this.UserStatus.GetHashCode(); hash = hash * 59 + this.UserStatus.GetHashCode();
return hash; return hash;
} }
} }

View File

@ -11,9 +11,10 @@ import java.util.List;
import io.swagger.model.*; import io.swagger.model.*;
import io.swagger.model.Pet; import io.swagger.model.Pet;
import io.swagger.model.ApiResponse;
import java.io.File; import java.io.File;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-01-19T23:33:17.124+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-04-15T17:39:42.971+08:00")
public class PetController { public class PetController {
/** /**
* Uncomment and implement as you see fit. These operations will map * Uncomment and implement as you see fit. These operations will map
@ -22,13 +23,13 @@ public class PetController {
**/ **/
/* /*
public ResponseContext updatePet(RequestContext request , Pet body) { public ResponseContext addPet(RequestContext request , Pet body) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
} }
*/ */
/* /*
public ResponseContext addPet(RequestContext request , Pet body) { public ResponseContext deletePet(RequestContext request , Long petId, String apiKey) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
} }
*/ */
@ -52,13 +53,13 @@ public class PetController {
*/ */
/* /*
public ResponseContext updatePetWithForm(RequestContext request , String petId, String name, String status) { public ResponseContext updatePet(RequestContext request , Pet body) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
} }
*/ */
/* /*
public ResponseContext deletePet(RequestContext request , Long petId, String apiKey) { public ResponseContext updatePetWithForm(RequestContext request , Long petId, String name, String status) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
} }
*/ */
@ -69,11 +70,5 @@ public class PetController {
} }
*/ */
/*
public ResponseContext getPetByIdWithByteArray(RequestContext request , Long petId) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
}
*/
} }

View File

@ -13,7 +13,7 @@ import io.swagger.model.*;
import java.util.Map; import java.util.Map;
import io.swagger.model.Order; import io.swagger.model.Order;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-01-19T23:33:17.124+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-04-15T17:39:42.971+08:00")
public class StoreController { public class StoreController {
/** /**
* Uncomment and implement as you see fit. These operations will map * Uncomment and implement as you see fit. These operations will map
@ -21,29 +21,29 @@ public class StoreController {
* Code allows you to implement logic incrementally, they are disabled. * Code allows you to implement logic incrementally, they are disabled.
**/ **/
/*
public ResponseContext deleteOrder(RequestContext request , String orderId) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
}
*/
/* /*
public ResponseContext getInventory(RequestContext request ) { public ResponseContext getInventory(RequestContext request ) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
} }
*/ */
/*
public ResponseContext getOrderById(RequestContext request , Long orderId) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
}
*/
/* /*
public ResponseContext placeOrder(RequestContext request , Order body) { public ResponseContext placeOrder(RequestContext request , Order body) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
} }
*/ */
/*
public ResponseContext getOrderById(RequestContext request , String orderId) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
}
*/
/*
public ResponseContext deleteOrder(RequestContext request , String orderId) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
}
*/
} }

View File

@ -11,9 +11,9 @@ import java.util.List;
import io.swagger.model.*; import io.swagger.model.*;
import io.swagger.model.User; import io.swagger.model.User;
import java.util.*; import java.util.List;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-01-19T23:33:17.124+08:00") @javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-04-15T17:39:42.971+08:00")
public class UserController { public class UserController {
/** /**
* Uncomment and implement as you see fit. These operations will map * Uncomment and implement as you see fit. These operations will map
@ -39,6 +39,18 @@ public class UserController {
} }
*/ */
/*
public ResponseContext deleteUser(RequestContext request , String username) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
}
*/
/*
public ResponseContext getUserByName(RequestContext request , String username) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
}
*/
/* /*
public ResponseContext loginUser(RequestContext request , String username, String password) { public ResponseContext loginUser(RequestContext request , String username, String password) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
@ -51,23 +63,11 @@ public class UserController {
} }
*/ */
/*
public ResponseContext getUserByName(RequestContext request , String username) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
}
*/
/* /*
public ResponseContext updateUser(RequestContext request , String username, User body) { public ResponseContext updateUser(RequestContext request , String username, User body) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" ); return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
} }
*/ */
/*
public ResponseContext deleteUser(RequestContext request , String username) {
return new ResponseContext().status(Status.INTERNAL_SERVER_ERROR).entity( "Not implemented" );
}
*/
} }

View File

@ -2,9 +2,9 @@
swagger: "2.0" swagger: "2.0"
info: info:
description: "This is a sample server Petstore server. You can find out more about\ description: "This is a sample server Petstore server. You can find out more about\
\ Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net,\ \ Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\
\ #swagger. For this sample, you can use the api key \"special-key\" to test\ \ For this sample, you can use the api key `special-key` to test the authorization\
\ the authorization filters" \ filters."
version: "1.0.0" version: "1.0.0"
title: "Swagger Petstore" title: "Swagger Petstore"
termsOfService: "http://swagger.io/terms/" termsOfService: "http://swagger.io/terms/"
@ -15,6 +15,19 @@ info:
url: "http://www.apache.org/licenses/LICENSE-2.0.html" url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "petstore.swagger.io" host: "petstore.swagger.io"
basePath: "/v2" basePath: "/v2"
tags:
- name: "pet"
description: "Everything about your Pets"
externalDocs:
description: "Find out more"
url: "http://swagger.io"
- name: "store"
description: "Access to Petstore orders"
- name: "user"
description: "Operations about user"
externalDocs:
description: "Find out more about our store"
url: "http://swagger.io"
schemes: schemes:
- "http" - "http"
paths: paths:
@ -29,13 +42,13 @@ paths:
- "application/json" - "application/json"
- "application/xml" - "application/xml"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- in: "body" - in: "body"
name: "body" name: "body"
description: "Pet object that needs to be added to the store" description: "Pet object that needs to be added to the store"
required: false required: true
schema: schema:
$ref: "#/definitions/Pet" $ref: "#/definitions/Pet"
responses: responses:
@ -57,13 +70,13 @@ paths:
- "application/json" - "application/json"
- "application/xml" - "application/xml"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- in: "body" - in: "body"
name: "body" name: "body"
description: "Pet object that needs to be added to the store" description: "Pet object that needs to be added to the store"
required: false required: true
schema: schema:
$ref: "#/definitions/Pet" $ref: "#/definitions/Pet"
responses: responses:
@ -84,21 +97,25 @@ paths:
tags: tags:
- "pet" - "pet"
summary: "Finds Pets by status" summary: "Finds Pets by status"
description: "Multiple status values can be provided with comma seperated strings" description: "Multiple status values can be provided with comma separated strings"
operationId: "findPetsByStatus" operationId: "findPetsByStatus"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- name: "status" - name: "status"
in: "query" in: "query"
description: "Status values that need to be considered for filter" description: "Status values that need to be considered for filter"
required: false required: true
type: "array" type: "array"
items: items:
type: "string" type: "string"
collectionFormat: "multi"
default: "available" default: "available"
enum:
- "available"
- "pending"
- "sold"
collectionFormat: "csv"
responses: responses:
200: 200:
description: "successful operation" description: "successful operation"
@ -119,21 +136,21 @@ paths:
tags: tags:
- "pet" - "pet"
summary: "Finds Pets by tags" summary: "Finds Pets by tags"
description: "Muliple tags can be provided with comma seperated strings. Use\ description: "Multiple tags can be provided with comma separated strings. Use\
\ tag1, tag2, tag3 for testing." \ tag1, tag2, tag3 for testing."
operationId: "findPetsByTags" operationId: "findPetsByTags"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- name: "tags" - name: "tags"
in: "query" in: "query"
description: "Tags to filter by" description: "Tags to filter by"
required: false required: true
type: "array" type: "array"
items: items:
type: "string" type: "string"
collectionFormat: "multi" collectionFormat: "csv"
responses: responses:
200: 200:
description: "successful operation" description: "successful operation"
@ -154,16 +171,15 @@ paths:
tags: tags:
- "pet" - "pet"
summary: "Find pet by ID" summary: "Find pet by ID"
description: "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate\ description: "Returns a single pet"
\ API error conditions"
operationId: "getPetById" operationId: "getPetById"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- name: "petId" - name: "petId"
in: "path" in: "path"
description: "ID of pet that needs to be fetched" description: "ID of pet to return"
required: true required: true
type: "integer" type: "integer"
format: "int64" format: "int64"
@ -178,9 +194,6 @@ paths:
description: "Pet not found" description: "Pet not found"
security: security:
- api_key: [] - api_key: []
- petstore_auth:
- "write:pets"
- "read:pets"
x-contentType: "application/json" x-contentType: "application/json"
x-accepts: "application/json" x-accepts: "application/json"
post: post:
@ -192,14 +205,15 @@ paths:
consumes: consumes:
- "application/x-www-form-urlencoded" - "application/x-www-form-urlencoded"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- name: "petId" - name: "petId"
in: "path" in: "path"
description: "ID of pet that needs to be updated" description: "ID of pet that needs to be updated"
required: true required: true
type: "string" type: "integer"
format: "int64"
- name: "name" - name: "name"
in: "formData" in: "formData"
description: "Updated name of the pet" description: "Updated name of the pet"
@ -226,12 +240,11 @@ paths:
description: "" description: ""
operationId: "deletePet" operationId: "deletePet"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- name: "api_key" - name: "api_key"
in: "header" in: "header"
description: ""
required: false required: false
type: "string" type: "string"
- name: "petId" - name: "petId"
@ -260,7 +273,6 @@ paths:
- "multipart/form-data" - "multipart/form-data"
produces: produces:
- "application/json" - "application/json"
- "application/xml"
parameters: parameters:
- name: "petId" - name: "petId"
in: "path" in: "path"
@ -279,80 +291,16 @@ paths:
required: false required: false
type: "file" type: "file"
responses: responses:
default: 200:
description: "successful operation" description: "successful operation"
schema:
$ref: "#/definitions/ApiResponse"
security: security:
- petstore_auth: - petstore_auth:
- "write:pets" - "write:pets"
- "read:pets" - "read:pets"
x-contentType: "multipart/form-data" x-contentType: "multipart/form-data"
x-accepts: "application/json" x-accepts: "application/json"
/pet/{petId}?testing_byte_array=true:
get:
tags:
- "pet"
summary: "Fake endpoint to test byte array return by 'Find pet by ID'"
description: "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate\
\ API error conditions"
operationId: "getPetByIdWithByteArray"
produces:
- "application/json"
- "application/xml"
parameters:
- name: "petId"
in: "path"
description: "ID of pet that needs to be fetched"
required: true
type: "integer"
format: "int64"
responses:
200:
description: "successful operation"
schema:
type: "string"
format: "binary"
400:
description: "Invalid ID supplied"
404:
description: "Pet not found"
security:
- api_key: []
- petstore_auth:
- "write:pets"
- "read:pets"
x-contentType: "application/json"
x-accepts: "application/json"
/pet?testing_byte_array=true:
post:
tags:
- "pet"
summary: "Fake endpoint to test byte array in body parameter for adding a new\
\ pet to the store"
description: ""
operationId: "addPetUsingByteArray"
consumes:
- "application/json"
- "application/xml"
produces:
- "application/json"
- "application/xml"
parameters:
- in: "body"
name: "body"
description: "Pet object in the form of byte array"
required: false
schema:
type: "string"
format: "binary"
responses:
405:
description: "Invalid input"
security:
- petstore_auth:
- "write:pets"
- "read:pets"
x-contentType: "application/json"
x-accepts: "application/json"
/store/inventory: /store/inventory:
get: get:
tags: tags:
@ -362,7 +310,6 @@ paths:
operationId: "getInventory" operationId: "getInventory"
produces: produces:
- "application/json" - "application/json"
- "application/xml"
parameters: [] parameters: []
responses: responses:
200: 200:
@ -384,13 +331,13 @@ paths:
description: "" description: ""
operationId: "placeOrder" operationId: "placeOrder"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- in: "body" - in: "body"
name: "body" name: "body"
description: "order placed for purchasing the pet" description: "order placed for purchasing the pet"
required: false required: true
schema: schema:
$ref: "#/definitions/Order" $ref: "#/definitions/Order"
responses: responses:
@ -411,14 +358,17 @@ paths:
\ values will generated exceptions" \ values will generated exceptions"
operationId: "getOrderById" operationId: "getOrderById"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- name: "orderId" - name: "orderId"
in: "path" in: "path"
description: "ID of pet that needs to be fetched" description: "ID of pet that needs to be fetched"
required: true required: true
type: "string" type: "integer"
maximum: 5.0
minimum: 1.0
format: "int64"
responses: responses:
200: 200:
description: "successful operation" description: "successful operation"
@ -438,14 +388,15 @@ paths:
\ above 1000 or nonintegers will generate API errors" \ above 1000 or nonintegers will generate API errors"
operationId: "deleteOrder" operationId: "deleteOrder"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- name: "orderId" - name: "orderId"
in: "path" in: "path"
description: "ID of the order that needs to be deleted" description: "ID of the order that needs to be deleted"
required: true required: true
type: "string" type: "string"
minimum: 1.0
responses: responses:
400: 400:
description: "Invalid ID supplied" description: "Invalid ID supplied"
@ -461,13 +412,13 @@ paths:
description: "This can only be done by the logged in user." description: "This can only be done by the logged in user."
operationId: "createUser" operationId: "createUser"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- in: "body" - in: "body"
name: "body" name: "body"
description: "Created user object" description: "Created user object"
required: false required: true
schema: schema:
$ref: "#/definitions/User" $ref: "#/definitions/User"
responses: responses:
@ -483,13 +434,13 @@ paths:
description: "" description: ""
operationId: "createUsersWithArrayInput" operationId: "createUsersWithArrayInput"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- in: "body" - in: "body"
name: "body" name: "body"
description: "List of user object" description: "List of user object"
required: false required: true
schema: schema:
type: "array" type: "array"
items: items:
@ -507,13 +458,13 @@ paths:
description: "" description: ""
operationId: "createUsersWithListInput" operationId: "createUsersWithListInput"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- in: "body" - in: "body"
name: "body" name: "body"
description: "List of user object" description: "List of user object"
required: false required: true
schema: schema:
type: "array" type: "array"
items: items:
@ -531,24 +482,33 @@ paths:
description: "" description: ""
operationId: "loginUser" operationId: "loginUser"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- name: "username" - name: "username"
in: "query" in: "query"
description: "The user name for login" description: "The user name for login"
required: false required: true
type: "string" type: "string"
- name: "password" - name: "password"
in: "query" in: "query"
description: "The password for login in clear text" description: "The password for login in clear text"
required: false required: true
type: "string" type: "string"
responses: responses:
200: 200:
description: "successful operation" description: "successful operation"
schema: schema:
type: "string" type: "string"
headers:
X-Rate-Limit:
type: "integer"
format: "int32"
description: "calls per hour allowed by the user"
X-Expires-After:
type: "string"
format: "date-time"
description: "date in UTC when toekn expires"
400: 400:
description: "Invalid username/password supplied" description: "Invalid username/password supplied"
x-contentType: "application/json" x-contentType: "application/json"
@ -561,8 +521,8 @@ paths:
description: "" description: ""
operationId: "logoutUser" operationId: "logoutUser"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: [] parameters: []
responses: responses:
default: default:
@ -577,8 +537,8 @@ paths:
description: "" description: ""
operationId: "getUserByName" operationId: "getUserByName"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- name: "username" - name: "username"
in: "path" in: "path"
@ -590,16 +550,6 @@ paths:
description: "successful operation" description: "successful operation"
schema: schema:
$ref: "#/definitions/User" $ref: "#/definitions/User"
examples:
application/json:
id: 1
username: "johnp"
firstName: "John"
lastName: "Public"
email: "johnp@swagger.io"
password: "-secret-"
phone: "0123456789"
userStatus: 0
400: 400:
description: "Invalid username supplied" description: "Invalid username supplied"
404: 404:
@ -613,8 +563,8 @@ paths:
description: "This can only be done by the logged in user." description: "This can only be done by the logged in user."
operationId: "updateUser" operationId: "updateUser"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- name: "username" - name: "username"
in: "path" in: "path"
@ -624,7 +574,7 @@ paths:
- in: "body" - in: "body"
name: "body" name: "body"
description: "Updated user object" description: "Updated user object"
required: false required: true
schema: schema:
$ref: "#/definitions/User" $ref: "#/definitions/User"
responses: responses:
@ -641,8 +591,8 @@ paths:
description: "This can only be done by the logged in user." description: "This can only be done by the logged in user."
operationId: "deleteUser" operationId: "deleteUser"
produces: produces:
- "application/json"
- "application/xml" - "application/xml"
- "application/json"
parameters: parameters:
- name: "username" - name: "username"
in: "path" in: "path"
@ -669,7 +619,45 @@ securityDefinitions:
write:pets: "modify pets in your account" write:pets: "modify pets in your account"
read:pets: "read your pets" read:pets: "read your pets"
definitions: definitions:
Order:
type: "object"
properties:
id:
type: "integer"
format: "int64"
petId:
type: "integer"
format: "int64"
quantity:
type: "integer"
format: "int32"
shipDate:
type: "string"
format: "date-time"
status:
type: "string"
description: "Order Status"
enum:
- "placed"
- "approved"
- "delivered"
complete:
type: "boolean"
default: false
xml:
name: "Order"
Category:
type: "object"
properties:
id:
type: "integer"
format: "int64"
name:
type: "string"
xml:
name: "Category"
User: User:
type: "object"
properties: properties:
id: id:
type: "integer" type: "integer"
@ -692,7 +680,8 @@ definitions:
description: "User Status" description: "User Status"
xml: xml:
name: "User" name: "User"
Category: Tag:
type: "object"
properties: properties:
id: id:
type: "integer" type: "integer"
@ -700,8 +689,9 @@ definitions:
name: name:
type: "string" type: "string"
xml: xml:
name: "Category" name: "Tag"
Pet: Pet:
type: "object"
required: required:
- "name" - "name"
- "photoUrls" - "photoUrls"
@ -737,37 +727,16 @@ definitions:
- "sold" - "sold"
xml: xml:
name: "Pet" name: "Pet"
Tag: ApiResponse:
type: "object"
properties: properties:
id: code:
type: "integer"
format: "int64"
name:
type: "string"
xml:
name: "Tag"
Order:
properties:
id:
type: "integer"
format: "int64"
petId:
type: "integer"
format: "int64"
quantity:
type: "integer" type: "integer"
format: "int32" format: "int32"
shipDate: type:
type: "string" type: "string"
format: "date-time" message:
status:
type: "string" type: "string"
description: "Order Status" externalDocs:
enum: description: "Find out more about Swagger"
- "placed" url: "http://swagger.io"
- "approved"
- "delivered"
complete:
type: "boolean"
xml:
name: "Order"