forked from loafle/openapi-generator-original
Merge pull request #2612 from wing328/server_use_petstore_yaml
Update server generator to use swagger.yaml instead of swagger.json
This commit is contained in:
commit
907664fb6e
@ -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
|
||||||
|
@ -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 -i modules/swagger-codegen/src/test/resources/2_0/petstore.json -l python-flask -o samples/server/petstore/flaskConnexion "
|
ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l python-flask -o samples/server/petstore/flaskConnexion "
|
||||||
|
|
||||||
java $JAVA_OPTS -Dservice -jar $executable $ags
|
java $JAVA_OPTS -Dservice -jar $executable $ags
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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 < 10. ID > 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 'Find pet by ID'
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>Returns a pet when ID < 10. ID > 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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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 < 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 <= 5 or > 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 <= 5 or > 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 < 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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,5 +4,5 @@ import connexion
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app = connexion.App(__name__, specification_dir='./swagger/')
|
app = connexion.App(__name__, specification_dir='./swagger/')
|
||||||
app.add_api('swagger.yaml', arguments={'title': '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. For this sample, you can use the api key \"special-key\" to test the authorization filters'})
|
app.add_api('swagger.yaml', arguments={'title': 'This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.'})
|
||||||
app.run(port=8080)
|
app.run(port=8080)
|
||||||
|
@ -1,29 +1,20 @@
|
|||||||
|
|
||||||
def add_pet(body = None) -> str:
|
def add_pet(body) -> str:
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
def add_pet_using_byte_array(body = None) -> str:
|
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def delete_pet(petId, apiKey = None) -> str:
|
def delete_pet(petId, apiKey = None) -> str:
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def find_pets_by_status(status = None) -> str:
|
def find_pets_by_status(status) -> str:
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def find_pets_by_tags(tags = None) -> str:
|
def find_pets_by_tags(tags) -> str:
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def get_pet_by_id(petId) -> str:
|
def get_pet_by_id(petId) -> str:
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def get_pet_by_id_in_object(petId) -> str:
|
def update_pet(body) -> str:
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
def pet_pet_idtesting_byte_arraytrue_get(petId) -> str:
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
def update_pet(body = None) -> str:
|
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def update_pet_with_form(petId, name = None, status = None) -> str:
|
def update_pet_with_form(petId, name = None, status = None) -> str:
|
||||||
@ -35,28 +26,22 @@ def upload_file(petId, additionalMetadata = None, file = None) -> str:
|
|||||||
def delete_order(orderId) -> str:
|
def delete_order(orderId) -> str:
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def find_orders_by_status(status = None) -> str:
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
def get_inventory() -> str:
|
def get_inventory() -> str:
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def get_inventory_in_object() -> str:
|
|
||||||
return 'do some magic!'
|
|
||||||
|
|
||||||
def get_order_by_id(orderId) -> str:
|
def get_order_by_id(orderId) -> str:
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def place_order(body = None) -> str:
|
def place_order(body) -> str:
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def create_user(body = None) -> str:
|
def create_user(body) -> str:
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def create_users_with_array_input(body = None) -> str:
|
def create_users_with_array_input(body) -> str:
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def create_users_with_list_input(body = None) -> str:
|
def create_users_with_list_input(body) -> str:
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def delete_user(username) -> str:
|
def delete_user(username) -> str:
|
||||||
@ -65,11 +50,11 @@ def delete_user(username) -> str:
|
|||||||
def get_user_by_name(username) -> str:
|
def get_user_by_name(username) -> str:
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def login_user(username = None, password = None) -> str:
|
def login_user(username, password) -> str:
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def logout_user() -> str:
|
def logout_user() -> str:
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
|
||||||
def update_user(username, body = None) -> str:
|
def update_user(username, body) -> str:
|
||||||
return 'do some magic!'
|
return 'do some magic!'
|
||||||
|
@ -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:
|
||||||
@ -87,26 +100,22 @@ paths:
|
|||||||
description: "Multiple status values can be provided with comma separated strings"
|
description: "Multiple status values can be provided with comma separated strings"
|
||||||
operationId: "controllers.default_controller.find_pets_by_status"
|
operationId: "controllers.default_controller.find_pets_by_status"
|
||||||
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 query"
|
description: "Status values that need to be considered for filter"
|
||||||
required: false
|
required: true
|
||||||
type: "array"
|
type: "array"
|
||||||
items:
|
items:
|
||||||
type: "string"
|
type: "string"
|
||||||
enum:
|
|
||||||
- "available"
|
|
||||||
- "pending"
|
|
||||||
- "sold"
|
|
||||||
collectionFormat: "multi"
|
|
||||||
default: "available"
|
default: "available"
|
||||||
enum:
|
enum:
|
||||||
- "available"
|
- "available"
|
||||||
- "pending"
|
- "pending"
|
||||||
- "sold"
|
- "sold"
|
||||||
|
collectionFormat: "csv"
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
@ -127,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: "controllers.default_controller.find_pets_by_tags"
|
operationId: "controllers.default_controller.find_pets_by_tags"
|
||||||
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"
|
||||||
@ -162,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: "controllers.default_controller.get_pet_by_id"
|
operationId: "controllers.default_controller.get_pet_by_id"
|
||||||
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"
|
||||||
@ -186,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-tags:
|
x-tags:
|
||||||
- tag: "pet"
|
- tag: "pet"
|
||||||
post:
|
post:
|
||||||
@ -200,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"
|
||||||
@ -234,12 +240,11 @@ paths:
|
|||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.default_controller.delete_pet"
|
operationId: "controllers.default_controller.delete_pet"
|
||||||
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"
|
||||||
@ -268,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"
|
||||||
@ -286,151 +290,17 @@ paths:
|
|||||||
description: "file to upload"
|
description: "file to upload"
|
||||||
required: false
|
required: false
|
||||||
type: "file"
|
type: "file"
|
||||||
responses:
|
|
||||||
default:
|
|
||||||
description: "successful operation"
|
|
||||||
security:
|
|
||||||
- petstore_auth:
|
|
||||||
- "write:pets"
|
|
||||||
- "read:pets"
|
|
||||||
x-tags:
|
|
||||||
- tag: "pet"
|
|
||||||
/pet/{petId}?response=inline_arbitrary_object:
|
|
||||||
get:
|
|
||||||
tags:
|
|
||||||
- "pet"
|
|
||||||
summary: "Fake endpoint to test inline arbitrary object return by 'Find pet\
|
|
||||||
\ by ID'"
|
|
||||||
description: "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate\
|
|
||||||
\ API error conditions"
|
|
||||||
operationId: "controllers.default_controller.get_pet_by_id_in_object"
|
|
||||||
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:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/definitions/inline_response_200"
|
$ref: "#/definitions/ApiResponse"
|
||||||
400:
|
|
||||||
description: "Invalid ID supplied"
|
|
||||||
404:
|
|
||||||
description: "Pet not found"
|
|
||||||
security:
|
|
||||||
- api_key: []
|
|
||||||
- petstore_auth:
|
|
||||||
- "write:pets"
|
|
||||||
- "read:pets"
|
|
||||||
x-tags:
|
|
||||||
- tag: "pet"
|
|
||||||
/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: "controllers.default_controller.pet_pet_idtesting_byte_arraytrue_get"
|
|
||||||
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-tags:
|
|
||||||
- tag: "pet"
|
|
||||||
/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: "controllers.default_controller.add_pet_using_byte_array"
|
|
||||||
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:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write:pets"
|
- "write:pets"
|
||||||
- "read:pets"
|
- "read:pets"
|
||||||
x-tags:
|
x-tags:
|
||||||
- tag: "pet"
|
- tag: "pet"
|
||||||
/store/findByStatus:
|
|
||||||
get:
|
|
||||||
tags:
|
|
||||||
- "store"
|
|
||||||
summary: "Finds orders by status"
|
|
||||||
description: "A single status value can be provided as a string"
|
|
||||||
operationId: "controllers.default_controller.find_orders_by_status"
|
|
||||||
produces:
|
|
||||||
- "application/json"
|
|
||||||
- "application/xml"
|
|
||||||
parameters:
|
|
||||||
- name: "status"
|
|
||||||
in: "query"
|
|
||||||
description: "Status value that needs to be considered for query"
|
|
||||||
required: false
|
|
||||||
type: "string"
|
|
||||||
default: "placed"
|
|
||||||
enum:
|
|
||||||
- "placed"
|
|
||||||
- "approved"
|
|
||||||
- "delivered"
|
|
||||||
responses:
|
|
||||||
200:
|
|
||||||
description: "successful operation"
|
|
||||||
schema:
|
|
||||||
type: "array"
|
|
||||||
items:
|
|
||||||
$ref: "#/definitions/Order"
|
|
||||||
400:
|
|
||||||
description: "Invalid status value"
|
|
||||||
security:
|
|
||||||
- test_api_client_secret: []
|
|
||||||
test_api_client_id: []
|
|
||||||
x-tags:
|
|
||||||
- tag: "store"
|
|
||||||
/store/inventory:
|
/store/inventory:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
@ -440,7 +310,6 @@ paths:
|
|||||||
operationId: "controllers.default_controller.get_inventory"
|
operationId: "controllers.default_controller.get_inventory"
|
||||||
produces:
|
produces:
|
||||||
- "application/json"
|
- "application/json"
|
||||||
- "application/xml"
|
|
||||||
parameters: []
|
parameters: []
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
@ -454,28 +323,6 @@ paths:
|
|||||||
- api_key: []
|
- api_key: []
|
||||||
x-tags:
|
x-tags:
|
||||||
- tag: "store"
|
- tag: "store"
|
||||||
/store/inventory?response=arbitrary_object:
|
|
||||||
get:
|
|
||||||
tags:
|
|
||||||
- "store"
|
|
||||||
summary: "Fake endpoint to test arbitrary object return by 'Get inventory'"
|
|
||||||
description: "Returns an arbitrary object which is actually a map of status\
|
|
||||||
\ codes to quantities"
|
|
||||||
operationId: "controllers.default_controller.get_inventory_in_object"
|
|
||||||
produces:
|
|
||||||
- "application/json"
|
|
||||||
- "application/xml"
|
|
||||||
parameters: []
|
|
||||||
responses:
|
|
||||||
200:
|
|
||||||
description: "successful operation"
|
|
||||||
schema:
|
|
||||||
type: "object"
|
|
||||||
properties: {}
|
|
||||||
security:
|
|
||||||
- api_key: []
|
|
||||||
x-tags:
|
|
||||||
- tag: "store"
|
|
||||||
/store/order:
|
/store/order:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
@ -484,13 +331,13 @@ paths:
|
|||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.default_controller.place_order"
|
operationId: "controllers.default_controller.place_order"
|
||||||
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:
|
||||||
@ -500,9 +347,6 @@ paths:
|
|||||||
$ref: "#/definitions/Order"
|
$ref: "#/definitions/Order"
|
||||||
400:
|
400:
|
||||||
description: "Invalid Order"
|
description: "Invalid Order"
|
||||||
security:
|
|
||||||
- test_api_client_secret: []
|
|
||||||
test_api_client_id: []
|
|
||||||
x-tags:
|
x-tags:
|
||||||
- tag: "store"
|
- tag: "store"
|
||||||
/store/order/{orderId}:
|
/store/order/{orderId}:
|
||||||
@ -514,14 +358,17 @@ paths:
|
|||||||
\ values will generated exceptions"
|
\ values will generated exceptions"
|
||||||
operationId: "controllers.default_controller.get_order_by_id"
|
operationId: "controllers.default_controller.get_order_by_id"
|
||||||
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"
|
||||||
@ -531,9 +378,6 @@ paths:
|
|||||||
description: "Invalid ID supplied"
|
description: "Invalid ID supplied"
|
||||||
404:
|
404:
|
||||||
description: "Order not found"
|
description: "Order not found"
|
||||||
security:
|
|
||||||
- test_api_key_header: []
|
|
||||||
- test_api_key_query: []
|
|
||||||
x-tags:
|
x-tags:
|
||||||
- tag: "store"
|
- tag: "store"
|
||||||
delete:
|
delete:
|
||||||
@ -544,14 +388,15 @@ paths:
|
|||||||
\ above 1000 or nonintegers will generate API errors"
|
\ above 1000 or nonintegers will generate API errors"
|
||||||
operationId: "controllers.default_controller.delete_order"
|
operationId: "controllers.default_controller.delete_order"
|
||||||
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"
|
||||||
@ -567,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: "controllers.default_controller.create_user"
|
operationId: "controllers.default_controller.create_user"
|
||||||
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:
|
||||||
@ -589,13 +434,13 @@ paths:
|
|||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.default_controller.create_users_with_array_input"
|
operationId: "controllers.default_controller.create_users_with_array_input"
|
||||||
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:
|
||||||
@ -613,13 +458,13 @@ paths:
|
|||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.default_controller.create_users_with_list_input"
|
operationId: "controllers.default_controller.create_users_with_list_input"
|
||||||
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:
|
||||||
@ -637,24 +482,33 @@ paths:
|
|||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.default_controller.login_user"
|
operationId: "controllers.default_controller.login_user"
|
||||||
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-tags:
|
x-tags:
|
||||||
@ -667,8 +521,8 @@ paths:
|
|||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.default_controller.logout_user"
|
operationId: "controllers.default_controller.logout_user"
|
||||||
produces:
|
produces:
|
||||||
- "application/json"
|
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
|
- "application/json"
|
||||||
parameters: []
|
parameters: []
|
||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
@ -683,8 +537,8 @@ paths:
|
|||||||
description: ""
|
description: ""
|
||||||
operationId: "controllers.default_controller.get_user_by_name"
|
operationId: "controllers.default_controller.get_user_by_name"
|
||||||
produces:
|
produces:
|
||||||
- "application/json"
|
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
|
- "application/json"
|
||||||
parameters:
|
parameters:
|
||||||
- name: "username"
|
- name: "username"
|
||||||
in: "path"
|
in: "path"
|
||||||
@ -696,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:
|
||||||
@ -719,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: "controllers.default_controller.update_user"
|
operationId: "controllers.default_controller.update_user"
|
||||||
produces:
|
produces:
|
||||||
- "application/json"
|
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
|
- "application/json"
|
||||||
parameters:
|
parameters:
|
||||||
- name: "username"
|
- name: "username"
|
||||||
in: "path"
|
in: "path"
|
||||||
@ -730,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:
|
||||||
@ -747,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: "controllers.default_controller.delete_user"
|
operationId: "controllers.default_controller.delete_user"
|
||||||
produces:
|
produces:
|
||||||
- "application/json"
|
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
|
- "application/json"
|
||||||
parameters:
|
parameters:
|
||||||
- name: "username"
|
- name: "username"
|
||||||
in: "path"
|
in: "path"
|
||||||
@ -760,33 +604,13 @@ paths:
|
|||||||
description: "Invalid username supplied"
|
description: "Invalid username supplied"
|
||||||
404:
|
404:
|
||||||
description: "User not found"
|
description: "User not found"
|
||||||
security:
|
|
||||||
- test_http_basic: []
|
|
||||||
x-tags:
|
x-tags:
|
||||||
- tag: "user"
|
- tag: "user"
|
||||||
securityDefinitions:
|
securityDefinitions:
|
||||||
test_api_key_header:
|
|
||||||
type: "apiKey"
|
|
||||||
name: "test_api_key_header"
|
|
||||||
in: "header"
|
|
||||||
api_key:
|
api_key:
|
||||||
type: "apiKey"
|
type: "apiKey"
|
||||||
name: "api_key"
|
name: "api_key"
|
||||||
in: "header"
|
in: "header"
|
||||||
test_http_basic:
|
|
||||||
type: "basic"
|
|
||||||
test_api_client_secret:
|
|
||||||
type: "apiKey"
|
|
||||||
name: "x-test_api_client_secret"
|
|
||||||
in: "header"
|
|
||||||
test_api_client_id:
|
|
||||||
type: "apiKey"
|
|
||||||
name: "x-test_api_client_id"
|
|
||||||
in: "header"
|
|
||||||
test_api_key_query:
|
|
||||||
type: "apiKey"
|
|
||||||
name: "test_api_key_query"
|
|
||||||
in: "query"
|
|
||||||
petstore_auth:
|
petstore_auth:
|
||||||
type: "oauth2"
|
type: "oauth2"
|
||||||
authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog"
|
authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog"
|
||||||
@ -795,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"
|
||||||
@ -818,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"
|
||||||
@ -826,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"
|
||||||
@ -863,163 +727,16 @@ definitions:
|
|||||||
- "sold"
|
- "sold"
|
||||||
xml:
|
xml:
|
||||||
name: "Pet"
|
name: "Pet"
|
||||||
Tag:
|
ApiResponse:
|
||||||
properties:
|
|
||||||
id:
|
|
||||||
type: "integer"
|
|
||||||
format: "int64"
|
|
||||||
name:
|
|
||||||
type: "string"
|
|
||||||
xml:
|
|
||||||
name: "Tag"
|
|
||||||
Order:
|
|
||||||
properties:
|
|
||||||
id:
|
|
||||||
type: "integer"
|
|
||||||
format: "int64"
|
|
||||||
readOnly: true
|
|
||||||
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"
|
|
||||||
xml:
|
|
||||||
name: "Order"
|
|
||||||
$special[model.name]:
|
|
||||||
properties:
|
|
||||||
$special[property.name]:
|
|
||||||
type: "integer"
|
|
||||||
format: "int64"
|
|
||||||
xml:
|
|
||||||
name: "$special[model.name]"
|
|
||||||
Return:
|
|
||||||
properties:
|
|
||||||
return:
|
|
||||||
type: "integer"
|
|
||||||
format: "int32"
|
|
||||||
description: "Model for testing reserved words"
|
|
||||||
xml:
|
|
||||||
name: "Return"
|
|
||||||
Name:
|
|
||||||
required:
|
|
||||||
- "name"
|
|
||||||
properties:
|
|
||||||
name:
|
|
||||||
type: "integer"
|
|
||||||
format: "int32"
|
|
||||||
snake_case:
|
|
||||||
type: "integer"
|
|
||||||
format: "int32"
|
|
||||||
readOnly: true
|
|
||||||
description: "Model for testing model name same as property name"
|
|
||||||
xml:
|
|
||||||
name: "Name"
|
|
||||||
200_response:
|
|
||||||
properties:
|
|
||||||
name:
|
|
||||||
type: "integer"
|
|
||||||
format: "int32"
|
|
||||||
description: "Model for testing model name starting with number"
|
|
||||||
xml:
|
|
||||||
name: "Name"
|
|
||||||
Dog:
|
|
||||||
allOf:
|
|
||||||
- $ref: "#/definitions/Animal"
|
|
||||||
- type: "object"
|
|
||||||
properties:
|
|
||||||
breed:
|
|
||||||
type: "string"
|
|
||||||
Cat:
|
|
||||||
allOf:
|
|
||||||
- $ref: "#/definitions/Animal"
|
|
||||||
- type: "object"
|
|
||||||
properties:
|
|
||||||
declawed:
|
|
||||||
type: "boolean"
|
|
||||||
Animal:
|
|
||||||
type: "object"
|
type: "object"
|
||||||
required:
|
|
||||||
- "className"
|
|
||||||
discriminator: "className"
|
|
||||||
properties:
|
properties:
|
||||||
className:
|
code:
|
||||||
type: "string"
|
|
||||||
format_test:
|
|
||||||
type: "object"
|
|
||||||
required:
|
|
||||||
- "number"
|
|
||||||
properties:
|
|
||||||
integer:
|
|
||||||
type: "integer"
|
|
||||||
int32:
|
|
||||||
type: "integer"
|
type: "integer"
|
||||||
format: "int32"
|
format: "int32"
|
||||||
int64:
|
type:
|
||||||
type: "integer"
|
|
||||||
format: "int64"
|
|
||||||
number:
|
|
||||||
type: "number"
|
|
||||||
float:
|
|
||||||
type: "number"
|
|
||||||
format: "float"
|
|
||||||
double:
|
|
||||||
type: "number"
|
|
||||||
format: "double"
|
|
||||||
string:
|
|
||||||
type: "string"
|
type: "string"
|
||||||
byte:
|
message:
|
||||||
type: "string"
|
|
||||||
format: "byte"
|
|
||||||
binary:
|
|
||||||
type: "string"
|
|
||||||
format: "binary"
|
|
||||||
date:
|
|
||||||
type: "string"
|
|
||||||
format: "date"
|
|
||||||
dateTime:
|
|
||||||
type: "string"
|
|
||||||
format: "date-time"
|
|
||||||
password:
|
|
||||||
type: "string"
|
|
||||||
format: "password"
|
|
||||||
inline_response_200:
|
|
||||||
required:
|
|
||||||
- "id"
|
|
||||||
properties:
|
|
||||||
tags:
|
|
||||||
type: "array"
|
|
||||||
items:
|
|
||||||
$ref: "#/definitions/Tag"
|
|
||||||
id:
|
|
||||||
type: "integer"
|
|
||||||
format: "int64"
|
|
||||||
category:
|
|
||||||
type: "object"
|
|
||||||
properties: {}
|
|
||||||
status:
|
|
||||||
type: "string"
|
|
||||||
description: "pet status in the store"
|
|
||||||
enum:
|
|
||||||
- "available"
|
|
||||||
- "pending"
|
|
||||||
- "sold"
|
|
||||||
name:
|
|
||||||
type: "string"
|
|
||||||
example: "doggie"
|
|
||||||
photoUrls:
|
|
||||||
type: "array"
|
|
||||||
items:
|
|
||||||
type: "string"
|
type: "string"
|
||||||
|
externalDocs:
|
||||||
|
description: "Find out more about Swagger"
|
||||||
|
url: "http://swagger.io"
|
||||||
|
@ -2,11 +2,14 @@ controllerPackage: io.swagger.handler
|
|||||||
modelPackage: io.swagger.model
|
modelPackage: io.swagger.model
|
||||||
swaggerUrl: ./src/main/swagger/swagger.yaml
|
swaggerUrl: ./src/main/swagger/swagger.yaml
|
||||||
modelMappings:
|
modelMappings:
|
||||||
User : io.swagger.model.User
|
# to enable explicit mappings, use this syntax:
|
||||||
Category : io.swagger.model.Category
|
DefinitionFromSwaggerSpecification: fully.qualified.path.to.Model
|
||||||
Pet : io.swagger.model.Pet
|
ApiResponse : io.swagger.model.ApiResponse
|
||||||
Tag : io.swagger.model.Tag
|
Category : io.swagger.model.Category
|
||||||
Order : io.swagger.model.Order
|
Order : io.swagger.model.Order
|
||||||
|
Pet : io.swagger.model.Pet
|
||||||
|
Tag : io.swagger.model.Tag
|
||||||
|
User : io.swagger.model.User
|
||||||
|
|
||||||
entityProcessors:
|
entityProcessors:
|
||||||
- json
|
- json
|
||||||
|
@ -19,6 +19,25 @@
|
|||||||
<directory>target</directory>
|
<directory>target</directory>
|
||||||
<finalName>${project.artifactId}-${project.version}</finalName>
|
<finalName>${project.artifactId}-${project.version}</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>build-helper-maven-plugin</artifactId>
|
||||||
|
<version>1.10</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>add-source</id>
|
||||||
|
<phase>generate-sources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>add-source</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<sources>
|
||||||
|
<source>src/gen/java</source>
|
||||||
|
</sources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
<executions>
|
<executions>
|
||||||
@ -78,12 +97,21 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-inflector</artifactId>
|
<artifactId>swagger-inflector</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>${swagger-inflector-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>sonatype-snapshots</id>
|
||||||
|
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
<properties>
|
<properties>
|
||||||
<maven-plugin-version>1.0.0</maven-plugin-version>
|
<maven-plugin-version>1.0.0</maven-plugin-version>
|
||||||
<swagger-core-version>1.5.7</swagger-core-version>
|
<swagger-inflector-version>1.0.4</swagger-inflector-version>
|
||||||
<jetty-version>9.2.9.v20150224</jetty-version>
|
<jetty-version>9.2.9.v20150224</jetty-version>
|
||||||
<logback-version>1.0.1</logback-version>
|
<logback-version>1.0.1</logback-version>
|
||||||
<junit-version>4.8.2</junit-version>
|
<junit-version>4.8.2</junit-version>
|
||||||
|
@ -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:48:04.458+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" );
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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:48:04.458+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" );
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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:48:04.458+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" );
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,87 +0,0 @@
|
|||||||
package io.swagger.model;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-01-19T23:33:17.124+08:00")
|
|
||||||
public class Category {
|
|
||||||
|
|
||||||
private Long id = null;
|
|
||||||
private String name = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("id")
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("name")
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (this == o) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (o == null || getClass() != o.getClass()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Category category = (Category) o;
|
|
||||||
return Objects.equals(id, category.id) &&
|
|
||||||
Objects.equals(name, category.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return Objects.hash(id, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class Category {\n");
|
|
||||||
|
|
||||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
|
||||||
sb.append("}");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert the given object to string with each line indented by 4 spaces
|
|
||||||
* (except the first line).
|
|
||||||
*/
|
|
||||||
private String toIndentedString(Object o) {
|
|
||||||
if (o == null) {
|
|
||||||
return "null";
|
|
||||||
}
|
|
||||||
return o.toString().replace("\n", "\n ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,173 +0,0 @@
|
|||||||
package io.swagger.model;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-01-19T23:33:17.124+08:00")
|
|
||||||
public class Order {
|
|
||||||
|
|
||||||
private Long id = null;
|
|
||||||
private Long petId = null;
|
|
||||||
private Integer quantity = null;
|
|
||||||
private Date shipDate = null;
|
|
||||||
|
|
||||||
|
|
||||||
public enum StatusEnum {
|
|
||||||
PLACED("placed"),
|
|
||||||
APPROVED("approved"),
|
|
||||||
DELIVERED("delivered");
|
|
||||||
|
|
||||||
private String value;
|
|
||||||
|
|
||||||
StatusEnum(String value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@JsonValue
|
|
||||||
public String toString() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private StatusEnum status = null;
|
|
||||||
private Boolean complete = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("id")
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("petId")
|
|
||||||
public Long getPetId() {
|
|
||||||
return petId;
|
|
||||||
}
|
|
||||||
public void setPetId(Long petId) {
|
|
||||||
this.petId = petId;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("quantity")
|
|
||||||
public Integer getQuantity() {
|
|
||||||
return quantity;
|
|
||||||
}
|
|
||||||
public void setQuantity(Integer quantity) {
|
|
||||||
this.quantity = quantity;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("shipDate")
|
|
||||||
public Date getShipDate() {
|
|
||||||
return shipDate;
|
|
||||||
}
|
|
||||||
public void setShipDate(Date shipDate) {
|
|
||||||
this.shipDate = shipDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Order Status
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "Order Status")
|
|
||||||
@JsonProperty("status")
|
|
||||||
public StatusEnum getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
public void setStatus(StatusEnum status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("complete")
|
|
||||||
public Boolean getComplete() {
|
|
||||||
return complete;
|
|
||||||
}
|
|
||||||
public void setComplete(Boolean complete) {
|
|
||||||
this.complete = complete;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (this == o) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (o == null || getClass() != o.getClass()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Order order = (Order) o;
|
|
||||||
return Objects.equals(id, order.id) &&
|
|
||||||
Objects.equals(petId, order.petId) &&
|
|
||||||
Objects.equals(quantity, order.quantity) &&
|
|
||||||
Objects.equals(shipDate, order.shipDate) &&
|
|
||||||
Objects.equals(status, order.status) &&
|
|
||||||
Objects.equals(complete, order.complete);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return Objects.hash(id, petId, quantity, shipDate, status, complete);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class Order {\n");
|
|
||||||
|
|
||||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
|
||||||
sb.append(" petId: ").append(toIndentedString(petId)).append("\n");
|
|
||||||
sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n");
|
|
||||||
sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n");
|
|
||||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
|
||||||
sb.append(" complete: ").append(toIndentedString(complete)).append("\n");
|
|
||||||
sb.append("}");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert the given object to string with each line indented by 4 spaces
|
|
||||||
* (except the first line).
|
|
||||||
*/
|
|
||||||
private String toIndentedString(Object o) {
|
|
||||||
if (o == null) {
|
|
||||||
return "null";
|
|
||||||
}
|
|
||||||
return o.toString().replace("\n", "\n ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,175 +0,0 @@
|
|||||||
package io.swagger.model;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import io.swagger.model.Category;
|
|
||||||
import io.swagger.model.Tag;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-01-19T23:33:17.124+08:00")
|
|
||||||
public class Pet {
|
|
||||||
|
|
||||||
private Long id = null;
|
|
||||||
private Category category = null;
|
|
||||||
private String name = null;
|
|
||||||
private List<String> photoUrls = new ArrayList<String>();
|
|
||||||
private List<Tag> tags = new ArrayList<Tag>();
|
|
||||||
|
|
||||||
|
|
||||||
public enum StatusEnum {
|
|
||||||
AVAILABLE("available"),
|
|
||||||
PENDING("pending"),
|
|
||||||
SOLD("sold");
|
|
||||||
|
|
||||||
private String value;
|
|
||||||
|
|
||||||
StatusEnum(String value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@JsonValue
|
|
||||||
public String toString() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private StatusEnum status = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("id")
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("category")
|
|
||||||
public Category getCategory() {
|
|
||||||
return category;
|
|
||||||
}
|
|
||||||
public void setCategory(Category category) {
|
|
||||||
this.category = category;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(required = true, value = "")
|
|
||||||
@JsonProperty("name")
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(required = true, value = "")
|
|
||||||
@JsonProperty("photoUrls")
|
|
||||||
public List<String> getPhotoUrls() {
|
|
||||||
return photoUrls;
|
|
||||||
}
|
|
||||||
public void setPhotoUrls(List<String> photoUrls) {
|
|
||||||
this.photoUrls = photoUrls;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("tags")
|
|
||||||
public List<Tag> getTags() {
|
|
||||||
return tags;
|
|
||||||
}
|
|
||||||
public void setTags(List<Tag> tags) {
|
|
||||||
this.tags = tags;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* pet status in the store
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "pet status in the store")
|
|
||||||
@JsonProperty("status")
|
|
||||||
public StatusEnum getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
public void setStatus(StatusEnum status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (this == o) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (o == null || getClass() != o.getClass()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Pet pet = (Pet) o;
|
|
||||||
return Objects.equals(id, pet.id) &&
|
|
||||||
Objects.equals(category, pet.category) &&
|
|
||||||
Objects.equals(name, pet.name) &&
|
|
||||||
Objects.equals(photoUrls, pet.photoUrls) &&
|
|
||||||
Objects.equals(tags, pet.tags) &&
|
|
||||||
Objects.equals(status, pet.status);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return Objects.hash(id, category, name, photoUrls, tags, status);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class Pet {\n");
|
|
||||||
|
|
||||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
|
||||||
sb.append(" category: ").append(toIndentedString(category)).append("\n");
|
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
|
||||||
sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n");
|
|
||||||
sb.append(" tags: ").append(toIndentedString(tags)).append("\n");
|
|
||||||
sb.append(" status: ").append(toIndentedString(status)).append("\n");
|
|
||||||
sb.append("}");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert the given object to string with each line indented by 4 spaces
|
|
||||||
* (except the first line).
|
|
||||||
*/
|
|
||||||
private String toIndentedString(Object o) {
|
|
||||||
if (o == null) {
|
|
||||||
return "null";
|
|
||||||
}
|
|
||||||
return o.toString().replace("\n", "\n ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,87 +0,0 @@
|
|||||||
package io.swagger.model;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-01-19T23:33:17.124+08:00")
|
|
||||||
public class Tag {
|
|
||||||
|
|
||||||
private Long id = null;
|
|
||||||
private String name = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("id")
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("name")
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (this == o) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (o == null || getClass() != o.getClass()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Tag tag = (Tag) o;
|
|
||||||
return Objects.equals(id, tag.id) &&
|
|
||||||
Objects.equals(name, tag.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return Objects.hash(id, name);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class Tag {\n");
|
|
||||||
|
|
||||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
|
||||||
sb.append(" name: ").append(toIndentedString(name)).append("\n");
|
|
||||||
sb.append("}");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert the given object to string with each line indented by 4 spaces
|
|
||||||
* (except the first line).
|
|
||||||
*/
|
|
||||||
private String toIndentedString(Object o) {
|
|
||||||
if (o == null) {
|
|
||||||
return "null";
|
|
||||||
}
|
|
||||||
return o.toString().replace("\n", "\n ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,184 +0,0 @@
|
|||||||
package io.swagger.model;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonValue;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaInflectorServerCodegen", date = "2016-01-19T23:33:17.124+08:00")
|
|
||||||
public class User {
|
|
||||||
|
|
||||||
private Long id = null;
|
|
||||||
private String username = null;
|
|
||||||
private String firstName = null;
|
|
||||||
private String lastName = null;
|
|
||||||
private String email = null;
|
|
||||||
private String password = null;
|
|
||||||
private String phone = null;
|
|
||||||
private Integer userStatus = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("id")
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("username")
|
|
||||||
public String getUsername() {
|
|
||||||
return username;
|
|
||||||
}
|
|
||||||
public void setUsername(String username) {
|
|
||||||
this.username = username;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("firstName")
|
|
||||||
public String getFirstName() {
|
|
||||||
return firstName;
|
|
||||||
}
|
|
||||||
public void setFirstName(String firstName) {
|
|
||||||
this.firstName = firstName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("lastName")
|
|
||||||
public String getLastName() {
|
|
||||||
return lastName;
|
|
||||||
}
|
|
||||||
public void setLastName(String lastName) {
|
|
||||||
this.lastName = lastName;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("email")
|
|
||||||
public String getEmail() {
|
|
||||||
return email;
|
|
||||||
}
|
|
||||||
public void setEmail(String email) {
|
|
||||||
this.email = email;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("password")
|
|
||||||
public String getPassword() {
|
|
||||||
return password;
|
|
||||||
}
|
|
||||||
public void setPassword(String password) {
|
|
||||||
this.password = password;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "")
|
|
||||||
@JsonProperty("phone")
|
|
||||||
public String getPhone() {
|
|
||||||
return phone;
|
|
||||||
}
|
|
||||||
public void setPhone(String phone) {
|
|
||||||
this.phone = phone;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* User Status
|
|
||||||
**/
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "User Status")
|
|
||||||
@JsonProperty("userStatus")
|
|
||||||
public Integer getUserStatus() {
|
|
||||||
return userStatus;
|
|
||||||
}
|
|
||||||
public void setUserStatus(Integer userStatus) {
|
|
||||||
this.userStatus = userStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (this == o) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (o == null || getClass() != o.getClass()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
User user = (User) o;
|
|
||||||
return Objects.equals(id, user.id) &&
|
|
||||||
Objects.equals(username, user.username) &&
|
|
||||||
Objects.equals(firstName, user.firstName) &&
|
|
||||||
Objects.equals(lastName, user.lastName) &&
|
|
||||||
Objects.equals(email, user.email) &&
|
|
||||||
Objects.equals(password, user.password) &&
|
|
||||||
Objects.equals(phone, user.phone) &&
|
|
||||||
Objects.equals(userStatus, user.userStatus);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("class User {\n");
|
|
||||||
|
|
||||||
sb.append(" id: ").append(toIndentedString(id)).append("\n");
|
|
||||||
sb.append(" username: ").append(toIndentedString(username)).append("\n");
|
|
||||||
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
|
|
||||||
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
|
|
||||||
sb.append(" email: ").append(toIndentedString(email)).append("\n");
|
|
||||||
sb.append(" password: ").append(toIndentedString(password)).append("\n");
|
|
||||||
sb.append(" phone: ").append(toIndentedString(phone)).append("\n");
|
|
||||||
sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n");
|
|
||||||
sb.append("}");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert the given object to string with each line indented by 4 spaces
|
|
||||||
* (except the first line).
|
|
||||||
*/
|
|
||||||
private String toIndentedString(Object o) {
|
|
||||||
if (o == null) {
|
|
||||||
return "null";
|
|
||||||
}
|
|
||||||
return o.toString().replace("\n", "\n ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -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"
|
|
||||||
|
@ -14,7 +14,7 @@ public interface StoreApi {
|
|||||||
@Path("/store/order/{orderId}")
|
@Path("/store/order/{orderId}")
|
||||||
|
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response deleteOrder(@PathParam("orderId") Long orderId);
|
public Response deleteOrder(@PathParam("orderId") String orderId);
|
||||||
@GET
|
@GET
|
||||||
@Path("/store/inventory")
|
@Path("/store/inventory")
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@ public class ApiResponse {
|
|||||||
|
|
||||||
private String message = null;
|
private String message = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -34,7 +33,6 @@ public class ApiResponse {
|
|||||||
public void setCode(Integer code) {
|
public void setCode(Integer code) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -44,7 +42,6 @@ public class ApiResponse {
|
|||||||
public void setType(String type) {
|
public void setType(String type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -55,7 +52,6 @@ public class ApiResponse {
|
|||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -22,7 +22,6 @@ public class Category {
|
|||||||
|
|
||||||
private String name = null;
|
private String name = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -32,7 +31,6 @@ public class Category {
|
|||||||
public void setId(Long id) {
|
public void setId(Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -43,7 +41,6 @@ public class Category {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -32,7 +32,7 @@ import javax.xml.bind.annotation.XmlType;
|
|||||||
@XmlType(name="Order")
|
@XmlType(name="Order")
|
||||||
@XmlEnum
|
@XmlEnum
|
||||||
public enum Order {
|
public enum Order {
|
||||||
{values=[placed, approved, delivered], enumVars=[{name=PLACED, value=placed}, {name=APPROVED, value=approved}, {name=DELIVERED, value=delivered}]},
|
{values=[placed, approved, delivered], enumVars=[{name=PLACED, value=placed}, {name=APPROVED, value=approved}, {name=DELIVERED, value=delivered}]},
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return name();
|
return name();
|
||||||
@ -47,7 +47,6 @@ public enum Order {
|
|||||||
|
|
||||||
private Boolean complete = false;
|
private Boolean complete = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -57,7 +56,6 @@ public enum Order {
|
|||||||
public void setId(Long id) {
|
public void setId(Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -67,7 +65,6 @@ public enum Order {
|
|||||||
public void setPetId(Long petId) {
|
public void setPetId(Long petId) {
|
||||||
this.petId = petId;
|
this.petId = petId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -77,7 +74,6 @@ public enum Order {
|
|||||||
public void setQuantity(Integer quantity) {
|
public void setQuantity(Integer quantity) {
|
||||||
this.quantity = quantity;
|
this.quantity = quantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -87,7 +83,6 @@ public enum Order {
|
|||||||
public void setShipDate(javax.xml.datatype.XMLGregorianCalendar shipDate) {
|
public void setShipDate(javax.xml.datatype.XMLGregorianCalendar shipDate) {
|
||||||
this.shipDate = shipDate;
|
this.shipDate = shipDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Order Status
|
* Order Status
|
||||||
**/
|
**/
|
||||||
@ -98,7 +93,6 @@ public enum Order {
|
|||||||
public void setStatus(StatusEnum status) {
|
public void setStatus(StatusEnum status) {
|
||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -109,7 +103,6 @@ public enum Order {
|
|||||||
this.complete = complete;
|
this.complete = complete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -38,7 +38,7 @@ import javax.xml.bind.annotation.XmlType;
|
|||||||
@XmlType(name="Pet")
|
@XmlType(name="Pet")
|
||||||
@XmlEnum
|
@XmlEnum
|
||||||
public enum Pet {
|
public enum Pet {
|
||||||
{values=[available, pending, sold], enumVars=[{name=AVAILABLE, value=available}, {name=PENDING, value=pending}, {name=SOLD, value=sold}]},
|
{values=[available, pending, sold], enumVars=[{name=AVAILABLE, value=available}, {name=PENDING, value=pending}, {name=SOLD, value=sold}]},
|
||||||
|
|
||||||
public String value() {
|
public String value() {
|
||||||
return name();
|
return name();
|
||||||
@ -51,7 +51,6 @@ public enum Pet {
|
|||||||
|
|
||||||
private StatusEnum status = null;
|
private StatusEnum status = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -61,7 +60,6 @@ public enum Pet {
|
|||||||
public void setId(Long id) {
|
public void setId(Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -71,7 +69,6 @@ public enum Pet {
|
|||||||
public void setCategory(Category category) {
|
public void setCategory(Category category) {
|
||||||
this.category = category;
|
this.category = category;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -81,7 +78,6 @@ public enum Pet {
|
|||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -91,7 +87,6 @@ public enum Pet {
|
|||||||
public void setPhotoUrls(List<String> photoUrls) {
|
public void setPhotoUrls(List<String> photoUrls) {
|
||||||
this.photoUrls = photoUrls;
|
this.photoUrls = photoUrls;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -101,7 +96,6 @@ public enum Pet {
|
|||||||
public void setTags(List<Tag> tags) {
|
public void setTags(List<Tag> tags) {
|
||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pet status in the store
|
* pet status in the store
|
||||||
**/
|
**/
|
||||||
@ -113,7 +107,6 @@ public enum Pet {
|
|||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -22,7 +22,6 @@ public class Tag {
|
|||||||
|
|
||||||
private String name = null;
|
private String name = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -32,7 +31,6 @@ public class Tag {
|
|||||||
public void setId(Long id) {
|
public void setId(Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -43,7 +41,6 @@ public class Tag {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -34,7 +34,6 @@ public class User {
|
|||||||
|
|
||||||
private Integer userStatus = null;
|
private Integer userStatus = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -44,7 +43,6 @@ public class User {
|
|||||||
public void setId(Long id) {
|
public void setId(Long id) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -54,7 +52,6 @@ public class User {
|
|||||||
public void setUsername(String username) {
|
public void setUsername(String username) {
|
||||||
this.username = username;
|
this.username = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -64,7 +61,6 @@ public class User {
|
|||||||
public void setFirstName(String firstName) {
|
public void setFirstName(String firstName) {
|
||||||
this.firstName = firstName;
|
this.firstName = firstName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -74,7 +70,6 @@ public class User {
|
|||||||
public void setLastName(String lastName) {
|
public void setLastName(String lastName) {
|
||||||
this.lastName = lastName;
|
this.lastName = lastName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -84,7 +79,6 @@ public class User {
|
|||||||
public void setEmail(String email) {
|
public void setEmail(String email) {
|
||||||
this.email = email;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -94,7 +88,6 @@ public class User {
|
|||||||
public void setPassword(String password) {
|
public void setPassword(String password) {
|
||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -104,7 +97,6 @@ public class User {
|
|||||||
public void setPhone(String phone) {
|
public void setPhone(String phone) {
|
||||||
this.phone = phone;
|
this.phone = phone;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User Status
|
* User Status
|
||||||
**/
|
**/
|
||||||
@ -116,7 +108,6 @@ public class User {
|
|||||||
this.userStatus = userStatus;
|
this.userStatus = userStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public class ApiException extends Exception{
|
public class ApiException extends Exception{
|
||||||
private int code;
|
private int code;
|
||||||
public ApiException (int code, String msg) {
|
public ApiException (int code, String msg) {
|
||||||
|
@ -5,7 +5,7 @@ import java.io.IOException;
|
|||||||
import javax.servlet.*;
|
import javax.servlet.*;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public class ApiOriginFilter implements javax.servlet.Filter {
|
public class ApiOriginFilter implements javax.servlet.Filter {
|
||||||
public void doFilter(ServletRequest request, ServletResponse response,
|
public void doFilter(ServletRequest request, ServletResponse response,
|
||||||
FilterChain chain) throws IOException, ServletException {
|
FilterChain chain) throws IOException, ServletException {
|
||||||
|
@ -3,7 +3,7 @@ package io.swagger.api;
|
|||||||
import javax.xml.bind.annotation.XmlTransient;
|
import javax.xml.bind.annotation.XmlTransient;
|
||||||
|
|
||||||
@javax.xml.bind.annotation.XmlRootElement
|
@javax.xml.bind.annotation.XmlRootElement
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public class ApiResponseMessage {
|
public class ApiResponseMessage {
|
||||||
public static final int ERROR = 1;
|
public static final int ERROR = 1;
|
||||||
public static final int WARNING = 2;
|
public static final int WARNING = 2;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public class NotFoundException extends ApiException {
|
public class NotFoundException extends ApiException {
|
||||||
private int code;
|
private int code;
|
||||||
public NotFoundException (int code, String msg) {
|
public NotFoundException (int code, String msg) {
|
||||||
|
@ -5,7 +5,7 @@ import io.swagger.api.PetApiService;
|
|||||||
import io.swagger.api.factories.PetApiServiceFactory;
|
import io.swagger.api.factories.PetApiServiceFactory;
|
||||||
|
|
||||||
import io.swagger.model.Pet;
|
import io.swagger.model.Pet;
|
||||||
import io.swagger.model.InlineResponse200;
|
import io.swagger.model.ApiResponse;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -22,14 +22,14 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
|
|||||||
@Path("/pet")
|
@Path("/pet")
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public class PetApi {
|
public class PetApi {
|
||||||
private final PetApiService delegate = PetApiServiceFactory.getPetApi();
|
private final PetApiService delegate = PetApiServiceFactory.getPetApi();
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
|
|
||||||
@Consumes({ "application/json", "application/xml" })
|
@Consumes({ "application/json", "application/xml" })
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response addPet( Pet body,@Context SecurityContext securityContext)
|
public Response addPet( Pet body,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.addPet(body,securityContext);
|
return delegate.addPet(body,securityContext);
|
||||||
@ -37,7 +37,7 @@ public class PetApi {
|
|||||||
@DELETE
|
@DELETE
|
||||||
@Path("/{petId}")
|
@Path("/{petId}")
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response deletePet( @PathParam("petId") Long petId,@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext)
|
public Response deletePet( @PathParam("petId") Long petId,@HeaderParam("api_key") String apiKey,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.deletePet(petId,apiKey,securityContext);
|
return delegate.deletePet(petId,apiKey,securityContext);
|
||||||
@ -45,7 +45,7 @@ public class PetApi {
|
|||||||
@GET
|
@GET
|
||||||
@Path("/findByStatus")
|
@Path("/findByStatus")
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response findPetsByStatus( @QueryParam("status") List<String> status,@Context SecurityContext securityContext)
|
public Response findPetsByStatus( @QueryParam("status") List<String> status,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.findPetsByStatus(status,securityContext);
|
return delegate.findPetsByStatus(status,securityContext);
|
||||||
@ -53,7 +53,7 @@ public class PetApi {
|
|||||||
@GET
|
@GET
|
||||||
@Path("/findByTags")
|
@Path("/findByTags")
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response findPetsByTags( @QueryParam("tags") List<String> tags,@Context SecurityContext securityContext)
|
public Response findPetsByTags( @QueryParam("tags") List<String> tags,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.findPetsByTags(tags,securityContext);
|
return delegate.findPetsByTags(tags,securityContext);
|
||||||
@ -61,31 +61,15 @@ public class PetApi {
|
|||||||
@GET
|
@GET
|
||||||
@Path("/{petId}")
|
@Path("/{petId}")
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext)
|
public Response getPetById( @PathParam("petId") Long petId,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.getPetById(petId,securityContext);
|
return delegate.getPetById(petId,securityContext);
|
||||||
}
|
}
|
||||||
@GET
|
|
||||||
@Path("/{petId}?response=inline_arbitrary_object")
|
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
|
||||||
public Response getPetByIdInObject( @PathParam("petId") Long petId,@Context SecurityContext securityContext)
|
|
||||||
throws NotFoundException {
|
|
||||||
return delegate.getPetByIdInObject(petId,securityContext);
|
|
||||||
}
|
|
||||||
@GET
|
|
||||||
@Path("/{petId}?testing_byte_array=true")
|
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
|
||||||
public Response petPetIdtestingByteArraytrueGet( @PathParam("petId") Long petId,@Context SecurityContext securityContext)
|
|
||||||
throws NotFoundException {
|
|
||||||
return delegate.petPetIdtestingByteArraytrueGet(petId,securityContext);
|
|
||||||
}
|
|
||||||
@PUT
|
@PUT
|
||||||
|
|
||||||
@Consumes({ "application/json", "application/xml" })
|
@Consumes({ "application/json", "application/xml" })
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response updatePet( Pet body,@Context SecurityContext securityContext)
|
public Response updatePet( Pet body,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.updatePet(body,securityContext);
|
return delegate.updatePet(body,securityContext);
|
||||||
@ -93,15 +77,15 @@ public class PetApi {
|
|||||||
@POST
|
@POST
|
||||||
@Path("/{petId}")
|
@Path("/{petId}")
|
||||||
@Consumes({ "application/x-www-form-urlencoded" })
|
@Consumes({ "application/x-www-form-urlencoded" })
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response updatePetWithForm( @PathParam("petId") String petId,@FormParam("name") String name,@FormParam("status") String status,@Context SecurityContext securityContext)
|
public Response updatePetWithForm( @PathParam("petId") Long petId,@FormParam("name") String name,@FormParam("status") String status,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.updatePetWithForm(petId,name,status,securityContext);
|
return delegate.updatePetWithForm(petId,name,status,securityContext);
|
||||||
}
|
}
|
||||||
@POST
|
@POST
|
||||||
@Path("/{petId}/uploadImage")
|
@Path("/{petId}/uploadImage")
|
||||||
@Consumes({ "multipart/form-data" })
|
@Consumes({ "multipart/form-data" })
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/json" })
|
||||||
public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext)
|
public Response uploadFile(MultipartFormDataInput input, @PathParam("petId") Long petId,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.uploadFile(input,petId,securityContext);
|
return delegate.uploadFile(input,petId,securityContext);
|
||||||
|
@ -6,7 +6,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
|
|||||||
|
|
||||||
|
|
||||||
import io.swagger.model.Pet;
|
import io.swagger.model.Pet;
|
||||||
import io.swagger.model.InlineResponse200;
|
import io.swagger.model.ApiResponse;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -17,37 +17,22 @@ import java.io.InputStream;
|
|||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.SecurityContext;
|
import javax.ws.rs.core.SecurityContext;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public abstract class PetApiService {
|
public abstract class PetApiService {
|
||||||
|
|
||||||
public abstract Response addPet(Pet body,SecurityContext securityContext)
|
public abstract Response addPet(Pet body,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response deletePet(Long petId,String apiKey,SecurityContext securityContext)
|
public abstract Response deletePet(Long petId,String apiKey,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response findPetsByStatus(List<String> status,SecurityContext securityContext)
|
public abstract Response findPetsByStatus(List<String> status,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response findPetsByTags(List<String> tags,SecurityContext securityContext)
|
public abstract Response findPetsByTags(List<String> tags,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response getPetById(Long petId,SecurityContext securityContext)
|
public abstract Response getPetById(Long petId,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response getPetByIdInObject(Long petId,SecurityContext securityContext)
|
|
||||||
throws NotFoundException;
|
|
||||||
|
|
||||||
public abstract Response petPetIdtestingByteArraytrueGet(Long petId,SecurityContext securityContext)
|
|
||||||
throws NotFoundException;
|
|
||||||
|
|
||||||
public abstract Response updatePet(Pet body,SecurityContext securityContext)
|
public abstract Response updatePet(Pet body,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
public abstract Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext)
|
||||||
public abstract Response updatePetWithForm(String petId,String name,String status,SecurityContext securityContext)
|
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext)
|
public abstract Response uploadFile(MultipartFormDataInput input,Long petId,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,8 @@ import io.swagger.model.*;
|
|||||||
import io.swagger.api.StoreApiService;
|
import io.swagger.api.StoreApiService;
|
||||||
import io.swagger.api.factories.StoreApiServiceFactory;
|
import io.swagger.api.factories.StoreApiServiceFactory;
|
||||||
|
|
||||||
import io.swagger.model.Order;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import io.swagger.model.Order;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import io.swagger.api.NotFoundException;
|
import io.swagger.api.NotFoundException;
|
||||||
@ -20,54 +20,38 @@ import javax.ws.rs.*;
|
|||||||
@Path("/store")
|
@Path("/store")
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public class StoreApi {
|
public class StoreApi {
|
||||||
private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi();
|
private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi();
|
||||||
|
|
||||||
@DELETE
|
@DELETE
|
||||||
@Path("/order/{orderId}")
|
@Path("/order/{orderId}")
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response deleteOrder( @PathParam("orderId") String orderId,@Context SecurityContext securityContext)
|
public Response deleteOrder( @PathParam("orderId") String orderId,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.deleteOrder(orderId,securityContext);
|
return delegate.deleteOrder(orderId,securityContext);
|
||||||
}
|
}
|
||||||
@GET
|
@GET
|
||||||
@Path("/findByStatus")
|
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
|
||||||
public Response findOrdersByStatus( @QueryParam("status") String status,@Context SecurityContext securityContext)
|
|
||||||
throws NotFoundException {
|
|
||||||
return delegate.findOrdersByStatus(status,securityContext);
|
|
||||||
}
|
|
||||||
@GET
|
|
||||||
@Path("/inventory")
|
@Path("/inventory")
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/json" })
|
||||||
public Response getInventory(@Context SecurityContext securityContext)
|
public Response getInventory(@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.getInventory(securityContext);
|
return delegate.getInventory(securityContext);
|
||||||
}
|
}
|
||||||
@GET
|
@GET
|
||||||
@Path("/inventory?response=arbitrary_object")
|
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
|
||||||
public Response getInventoryInObject(@Context SecurityContext securityContext)
|
|
||||||
throws NotFoundException {
|
|
||||||
return delegate.getInventoryInObject(securityContext);
|
|
||||||
}
|
|
||||||
@GET
|
|
||||||
@Path("/order/{orderId}")
|
@Path("/order/{orderId}")
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response getOrderById( @PathParam("orderId") String orderId,@Context SecurityContext securityContext)
|
public Response getOrderById( @PathParam("orderId") Long orderId,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.getOrderById(orderId,securityContext);
|
return delegate.getOrderById(orderId,securityContext);
|
||||||
}
|
}
|
||||||
@POST
|
@POST
|
||||||
@Path("/order")
|
@Path("/order")
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response placeOrder( Order body,@Context SecurityContext securityContext)
|
public Response placeOrder( Order body,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.placeOrder(body,securityContext);
|
return delegate.placeOrder(body,securityContext);
|
||||||
|
@ -4,8 +4,8 @@ import io.swagger.api.*;
|
|||||||
import io.swagger.model.*;
|
import io.swagger.model.*;
|
||||||
|
|
||||||
|
|
||||||
import io.swagger.model.Order;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import io.swagger.model.Order;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import io.swagger.api.NotFoundException;
|
import io.swagger.api.NotFoundException;
|
||||||
@ -15,25 +15,14 @@ import java.io.InputStream;
|
|||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.SecurityContext;
|
import javax.ws.rs.core.SecurityContext;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public abstract class StoreApiService {
|
public abstract class StoreApiService {
|
||||||
|
|
||||||
public abstract Response deleteOrder(String orderId,SecurityContext securityContext)
|
public abstract Response deleteOrder(String orderId,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response findOrdersByStatus(String status,SecurityContext securityContext)
|
|
||||||
throws NotFoundException;
|
|
||||||
|
|
||||||
public abstract Response getInventory(SecurityContext securityContext)
|
public abstract Response getInventory(SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
public abstract Response getOrderById(Long orderId,SecurityContext securityContext)
|
||||||
public abstract Response getInventoryInObject(SecurityContext securityContext)
|
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response getOrderById(String orderId,SecurityContext securityContext)
|
|
||||||
throws NotFoundException;
|
|
||||||
|
|
||||||
public abstract Response placeOrder(Order body,SecurityContext securityContext)
|
public abstract Response placeOrder(Order body,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package io.swagger.api;
|
package io.swagger.api;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public class StringUtil {
|
public class StringUtil {
|
||||||
/**
|
/**
|
||||||
* Check if the given array contains the given value (with case-insensitive comparison).
|
* Check if the given array contains the given value (with case-insensitive comparison).
|
||||||
|
@ -20,14 +20,14 @@ import javax.ws.rs.*;
|
|||||||
@Path("/user")
|
@Path("/user")
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public class UserApi {
|
public class UserApi {
|
||||||
private final UserApiService delegate = UserApiServiceFactory.getUserApi();
|
private final UserApiService delegate = UserApiServiceFactory.getUserApi();
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
|
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response createUser( User body,@Context SecurityContext securityContext)
|
public Response createUser( User body,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.createUser(body,securityContext);
|
return delegate.createUser(body,securityContext);
|
||||||
@ -35,7 +35,7 @@ public class UserApi {
|
|||||||
@POST
|
@POST
|
||||||
@Path("/createWithArray")
|
@Path("/createWithArray")
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response createUsersWithArrayInput( List<User> body,@Context SecurityContext securityContext)
|
public Response createUsersWithArrayInput( List<User> body,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.createUsersWithArrayInput(body,securityContext);
|
return delegate.createUsersWithArrayInput(body,securityContext);
|
||||||
@ -43,7 +43,7 @@ public class UserApi {
|
|||||||
@POST
|
@POST
|
||||||
@Path("/createWithList")
|
@Path("/createWithList")
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response createUsersWithListInput( List<User> body,@Context SecurityContext securityContext)
|
public Response createUsersWithListInput( List<User> body,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.createUsersWithListInput(body,securityContext);
|
return delegate.createUsersWithListInput(body,securityContext);
|
||||||
@ -51,7 +51,7 @@ public class UserApi {
|
|||||||
@DELETE
|
@DELETE
|
||||||
@Path("/{username}")
|
@Path("/{username}")
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response deleteUser( @PathParam("username") String username,@Context SecurityContext securityContext)
|
public Response deleteUser( @PathParam("username") String username,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.deleteUser(username,securityContext);
|
return delegate.deleteUser(username,securityContext);
|
||||||
@ -59,7 +59,7 @@ public class UserApi {
|
|||||||
@GET
|
@GET
|
||||||
@Path("/{username}")
|
@Path("/{username}")
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext)
|
public Response getUserByName( @PathParam("username") String username,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.getUserByName(username,securityContext);
|
return delegate.getUserByName(username,securityContext);
|
||||||
@ -67,7 +67,7 @@ public class UserApi {
|
|||||||
@GET
|
@GET
|
||||||
@Path("/login")
|
@Path("/login")
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response loginUser( @QueryParam("username") String username, @QueryParam("password") String password,@Context SecurityContext securityContext)
|
public Response loginUser( @QueryParam("username") String username, @QueryParam("password") String password,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.loginUser(username,password,securityContext);
|
return delegate.loginUser(username,password,securityContext);
|
||||||
@ -75,7 +75,7 @@ public class UserApi {
|
|||||||
@GET
|
@GET
|
||||||
@Path("/logout")
|
@Path("/logout")
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response logoutUser(@Context SecurityContext securityContext)
|
public Response logoutUser(@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.logoutUser(securityContext);
|
return delegate.logoutUser(securityContext);
|
||||||
@ -83,7 +83,7 @@ public class UserApi {
|
|||||||
@PUT
|
@PUT
|
||||||
@Path("/{username}")
|
@Path("/{username}")
|
||||||
|
|
||||||
@Produces({ "application/json", "application/xml" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
public Response updateUser( @PathParam("username") String username, User body,@Context SecurityContext securityContext)
|
public Response updateUser( @PathParam("username") String username, User body,@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.updateUser(username,body,securityContext);
|
return delegate.updateUser(username,body,securityContext);
|
||||||
|
@ -15,31 +15,22 @@ import java.io.InputStream;
|
|||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.SecurityContext;
|
import javax.ws.rs.core.SecurityContext;
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public abstract class UserApiService {
|
public abstract class UserApiService {
|
||||||
|
|
||||||
public abstract Response createUser(User body,SecurityContext securityContext)
|
public abstract Response createUser(User body,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response createUsersWithArrayInput(List<User> body,SecurityContext securityContext)
|
public abstract Response createUsersWithArrayInput(List<User> body,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response createUsersWithListInput(List<User> body,SecurityContext securityContext)
|
public abstract Response createUsersWithListInput(List<User> body,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response deleteUser(String username,SecurityContext securityContext)
|
public abstract Response deleteUser(String username,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response getUserByName(String username,SecurityContext securityContext)
|
public abstract Response getUserByName(String username,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response loginUser(String username,String password,SecurityContext securityContext)
|
public abstract Response loginUser(String username,String password,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response logoutUser(SecurityContext securityContext)
|
public abstract Response logoutUser(SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response updateUser(String username,User body,SecurityContext securityContext)
|
public abstract Response updateUser(String username,User body,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,94 @@
|
|||||||
|
package io.swagger.model;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
|
public class ApiResponse {
|
||||||
|
|
||||||
|
private Integer code = null;
|
||||||
|
private String type = null;
|
||||||
|
private String message = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
**/
|
||||||
|
|
||||||
|
@JsonProperty("code")
|
||||||
|
public Integer getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
public void setCode(Integer code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
**/
|
||||||
|
|
||||||
|
@JsonProperty("type")
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
**/
|
||||||
|
|
||||||
|
@JsonProperty("message")
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (o == null || getClass() != o.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ApiResponse apiResponse = (ApiResponse) o;
|
||||||
|
return Objects.equals(code, apiResponse.code) &&
|
||||||
|
Objects.equals(type, apiResponse.type) &&
|
||||||
|
Objects.equals(message, apiResponse.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(code, type, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("class ApiResponse {\n");
|
||||||
|
|
||||||
|
sb.append(" code: ").append(toIndentedString(code)).append("\n");
|
||||||
|
sb.append(" type: ").append(toIndentedString(type)).append("\n");
|
||||||
|
sb.append(" message: ").append(toIndentedString(message)).append("\n");
|
||||||
|
sb.append("}");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert the given object to string with each line indented by 4 spaces
|
||||||
|
* (except the first line).
|
||||||
|
*/
|
||||||
|
private String toIndentedString(Object o) {
|
||||||
|
if (o == null) {
|
||||||
|
return "null";
|
||||||
|
}
|
||||||
|
return o.toString().replace("\n", "\n ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -8,13 +8,12 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public class Category {
|
public class Category {
|
||||||
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
private String name = null;
|
private String name = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -26,7 +25,6 @@ public class Category {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -39,7 +37,6 @@ public class Category {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
|
@ -9,7 +9,7 @@ import java.util.Date;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public class Order {
|
public class Order {
|
||||||
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
@ -37,8 +37,7 @@ public class Order {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private StatusEnum status = null;
|
private StatusEnum status = null;
|
||||||
private Boolean complete = null;
|
private Boolean complete = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
@ -51,7 +50,6 @@ public class Order {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -63,7 +61,6 @@ public class Order {
|
|||||||
this.petId = petId;
|
this.petId = petId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -75,7 +72,6 @@ public class Order {
|
|||||||
this.quantity = quantity;
|
this.quantity = quantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -87,7 +83,6 @@ public class Order {
|
|||||||
this.shipDate = shipDate;
|
this.shipDate = shipDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Order Status
|
* Order Status
|
||||||
**/
|
**/
|
||||||
@ -100,7 +95,6 @@ public class Order {
|
|||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -113,7 +107,6 @@ public class Order {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
|
@ -11,7 +11,7 @@ import java.util.List;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public class Pet {
|
public class Pet {
|
||||||
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
@ -41,7 +41,6 @@ public class Pet {
|
|||||||
|
|
||||||
private StatusEnum status = null;
|
private StatusEnum status = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -53,7 +52,6 @@ public class Pet {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -65,7 +63,6 @@ public class Pet {
|
|||||||
this.category = category;
|
this.category = category;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -77,7 +74,6 @@ public class Pet {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -89,7 +85,6 @@ public class Pet {
|
|||||||
this.photoUrls = photoUrls;
|
this.photoUrls = photoUrls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -101,7 +96,6 @@ public class Pet {
|
|||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pet status in the store
|
* pet status in the store
|
||||||
**/
|
**/
|
||||||
@ -115,7 +109,6 @@ public class Pet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
|
@ -8,13 +8,12 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public class Tag {
|
public class Tag {
|
||||||
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
private String name = null;
|
private String name = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -26,7 +25,6 @@ public class Tag {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -39,7 +37,6 @@ public class Tag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
|
@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-03-16T14:27:58.108+08:00")
|
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaResteasyServerCodegen", date = "2016-04-15T18:10:39.667+08:00")
|
||||||
public class User {
|
public class User {
|
||||||
|
|
||||||
private Long id = null;
|
private Long id = null;
|
||||||
@ -20,7 +20,6 @@ public class User {
|
|||||||
private String phone = null;
|
private String phone = null;
|
||||||
private Integer userStatus = null;
|
private Integer userStatus = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -32,7 +31,6 @@ public class User {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -44,7 +42,6 @@ public class User {
|
|||||||
this.username = username;
|
this.username = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -56,7 +53,6 @@ public class User {
|
|||||||
this.firstName = firstName;
|
this.firstName = firstName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -68,7 +64,6 @@ public class User {
|
|||||||
this.lastName = lastName;
|
this.lastName = lastName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -80,7 +75,6 @@ public class User {
|
|||||||
this.email = email;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -92,7 +86,6 @@ public class User {
|
|||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
|
|
||||||
@ -104,7 +97,6 @@ public class User {
|
|||||||
this.phone = phone;
|
this.phone = phone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User Status
|
* User Status
|
||||||
**/
|
**/
|
||||||
@ -118,7 +110,6 @@ public class User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
|
@ -51,14 +51,18 @@ public class PetApiServiceImpl extends PetApiService {
|
|||||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* comment out as the method (for testing) does not exit in the original swagger spec
|
||||||
|
* we'll uncomment this code block later if we update the petstore server
|
||||||
@Override
|
@Override
|
||||||
public Response getPetByIdInObject(Long petId,SecurityContext securityContext) throws NotFoundException {
|
public Response getPetByIdInObject(Long petId,SecurityContext securityContext) throws NotFoundException {
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Response updatePetWithForm(String petId,String name,String status,SecurityContext securityContext) throws NotFoundException {
|
public Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext) throws NotFoundException {
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||||
}
|
}
|
||||||
@ -75,11 +79,15 @@ public class PetApiServiceImpl extends PetApiService {
|
|||||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* comment out as the method (for testing) does not exit in the original swagger spec
|
||||||
|
* we'll uncomment this code block later if we update the petstore server
|
||||||
@Override
|
@Override
|
||||||
public Response petPetIdtestingByteArraytrueGet(Long petId,SecurityContext securityContext) throws NotFoundException {
|
public Response petPetIdtestingByteArraytrueGet(Long petId,SecurityContext securityContext) throws NotFoundException {
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,11 +26,15 @@ public class StoreApiServiceImpl extends StoreApiService {
|
|||||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* * comment out as the method (for testing) does not exit in the original swagger spec
|
||||||
|
* * we'll uncomment this code block later if we update the petstore server
|
||||||
@Override
|
@Override
|
||||||
public Response getInventoryInObject(SecurityContext securityContext) throws NotFoundException {
|
public Response getInventoryInObject(SecurityContext securityContext) throws NotFoundException {
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Response placeOrder(Order body,SecurityContext securityContext) throws NotFoundException {
|
public Response placeOrder(Order body,SecurityContext securityContext) throws NotFoundException {
|
||||||
@ -39,7 +43,7 @@ public class StoreApiServiceImpl extends StoreApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Response getOrderById(String orderId,SecurityContext securityContext) throws NotFoundException {
|
public Response getOrderById(Long orderId,SecurityContext securityContext) throws NotFoundException {
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||||
}
|
}
|
||||||
@ -50,11 +54,15 @@ public class StoreApiServiceImpl extends StoreApiService {
|
|||||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* * comment out as the method (for testing) does not exit in the original swagger spec
|
||||||
|
* * we'll uncomment this code block later if we update the petstore server
|
||||||
@Override
|
@Override
|
||||||
public Response findOrdersByStatus(String status, SecurityContext securityContext) throws NotFoundException {
|
public Response findOrdersByStatus(String status, SecurityContext securityContext) throws NotFoundException {
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,8 +62,7 @@ public class PetApi {
|
|||||||
})
|
})
|
||||||
}, tags={ "pet", })
|
}, tags={ "pet", })
|
||||||
@io.swagger.annotations.ApiResponses(value = {
|
@io.swagger.annotations.ApiResponses(value = {
|
||||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class),
|
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid pet value", response = void.class) })
|
||||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Pet not found", response = void.class) })
|
|
||||||
public Response deletePet(
|
public Response deletePet(
|
||||||
@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId,
|
@ApiParam(value = "Pet id to delete",required=true) @PathParam("petId") Long petId,
|
||||||
@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,
|
@ApiParam(value = "" )@HeaderParam("api_key") String apiKey,
|
||||||
@ -94,7 +93,7 @@ public class PetApi {
|
|||||||
@Path("/findByTags")
|
@Path("/findByTags")
|
||||||
|
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Muliple tags can be provided with comma separated strings. Use\ntag1, tag2, tag3 for testing.\n", response = Pet.class, responseContainer = "List", authorizations = {
|
@io.swagger.annotations.ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "List", authorizations = {
|
||||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||||
@ -150,7 +149,7 @@ public class PetApi {
|
|||||||
@Path("/{petId}")
|
@Path("/{petId}")
|
||||||
@Consumes({ "application/x-www-form-urlencoded" })
|
@Consumes({ "application/x-www-form-urlencoded" })
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "null", response = void.class, authorizations = {
|
@io.swagger.annotations.ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = void.class, authorizations = {
|
||||||
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
@io.swagger.annotations.Authorization(value = "petstore_auth", scopes = {
|
||||||
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
@io.swagger.annotations.AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
|
||||||
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
@io.swagger.annotations.AuthorizationScope(scope = "read:pets", description = "read your pets")
|
||||||
|
@ -22,29 +22,20 @@ import javax.ws.rs.core.SecurityContext;
|
|||||||
|
|
||||||
|
|
||||||
public abstract class PetApiService {
|
public abstract class PetApiService {
|
||||||
|
|
||||||
public abstract Response addPet(Pet body,SecurityContext securityContext)
|
public abstract Response addPet(Pet body,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response deletePet(Long petId,String apiKey,SecurityContext securityContext)
|
public abstract Response deletePet(Long petId,String apiKey,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response findPetsByStatus(List<String> status,SecurityContext securityContext)
|
public abstract Response findPetsByStatus(List<String> status,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response findPetsByTags(List<String> tags,SecurityContext securityContext)
|
public abstract Response findPetsByTags(List<String> tags,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response getPetById(Long petId,SecurityContext securityContext)
|
public abstract Response getPetById(Long petId,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response updatePet(Pet body,SecurityContext securityContext)
|
public abstract Response updatePet(Pet body,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext)
|
public abstract Response updatePetWithForm(Long petId,String name,String status,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response uploadFile(Long petId,String additionalMetadata,InputStream inputStream, FormDataContentDisposition fileDetail,SecurityContext securityContext)
|
public abstract Response uploadFile(Long petId,String additionalMetadata,InputStream inputStream, FormDataContentDisposition fileDetail,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,12 +36,12 @@ public class StoreApi {
|
|||||||
@Path("/order/{orderId}")
|
@Path("/order/{orderId}")
|
||||||
|
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with positive integer value.\\ \\ Negative or non-integer values will generate API errors", response = void.class, tags={ "store", })
|
@io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", })
|
||||||
@io.swagger.annotations.ApiResponses(value = {
|
@io.swagger.annotations.ApiResponses(value = {
|
||||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class),
|
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class),
|
||||||
@io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = void.class) })
|
@io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = void.class) })
|
||||||
public Response deleteOrder(
|
public Response deleteOrder(
|
||||||
@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("orderId") Long orderId,
|
@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("orderId") String orderId,
|
||||||
@Context SecurityContext securityContext)
|
@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.deleteOrder(orderId,securityContext);
|
return delegate.deleteOrder(orderId,securityContext);
|
||||||
@ -64,7 +64,7 @@ public class StoreApi {
|
|||||||
@Path("/order/{orderId}")
|
@Path("/order/{orderId}")
|
||||||
|
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value >= 1 and <= 10.\nOther values will generated exceptions\n", response = Order.class, tags={ "store", })
|
@io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", })
|
||||||
@io.swagger.annotations.ApiResponses(value = {
|
@io.swagger.annotations.ApiResponses(value = {
|
||||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class),
|
||||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class),
|
||||||
|
@ -21,17 +21,12 @@ import javax.ws.rs.core.SecurityContext;
|
|||||||
|
|
||||||
|
|
||||||
public abstract class StoreApiService {
|
public abstract class StoreApiService {
|
||||||
|
public abstract Response deleteOrder(String orderId,SecurityContext securityContext)
|
||||||
public abstract Response deleteOrder(Long orderId,SecurityContext securityContext)
|
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response getInventory(SecurityContext securityContext)
|
public abstract Response getInventory(SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response getOrderById(Long orderId,SecurityContext securityContext)
|
public abstract Response getOrderById(Long orderId,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response placeOrder(Order body,SecurityContext securityContext)
|
public abstract Response placeOrder(Order body,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ public class UserApi {
|
|||||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid username supplied", response = User.class),
|
||||||
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) })
|
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = User.class) })
|
||||||
public Response getUserByName(
|
public Response getUserByName(
|
||||||
@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathParam("username") String username,
|
@ApiParam(value = "The name that needs to be fetched. Use user1 for testing. ",required=true) @PathParam("username") String username,
|
||||||
@Context SecurityContext securityContext)
|
@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
return delegate.getUserByName(username,securityContext);
|
return delegate.getUserByName(username,securityContext);
|
||||||
@ -119,7 +119,7 @@ public class UserApi {
|
|||||||
@Path("/logout")
|
@Path("/logout")
|
||||||
|
|
||||||
@Produces({ "application/xml", "application/json" })
|
@Produces({ "application/xml", "application/json" })
|
||||||
@io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "null", response = void.class, tags={ "user", })
|
@io.swagger.annotations.ApiOperation(value = "Logs out current logged in user session", notes = "", response = void.class, tags={ "user", })
|
||||||
@io.swagger.annotations.ApiResponses(value = {
|
@io.swagger.annotations.ApiResponses(value = {
|
||||||
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) })
|
@io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = void.class) })
|
||||||
public Response logoutUser(
|
public Response logoutUser(
|
||||||
@ -136,7 +136,7 @@ public class UserApi {
|
|||||||
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = void.class),
|
@io.swagger.annotations.ApiResponse(code = 400, message = "Invalid user supplied", response = void.class),
|
||||||
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) })
|
@io.swagger.annotations.ApiResponse(code = 404, message = "User not found", response = void.class) })
|
||||||
public Response updateUser(
|
public Response updateUser(
|
||||||
@ApiParam(value = "name that need to be updated",required=true) @PathParam("username") String username,
|
@ApiParam(value = "name that need to be deleted",required=true) @PathParam("username") String username,
|
||||||
@ApiParam(value = "Updated user object" ,required=true) User body,
|
@ApiParam(value = "Updated user object" ,required=true) User body,
|
||||||
@Context SecurityContext securityContext)
|
@Context SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
|
@ -21,29 +21,20 @@ import javax.ws.rs.core.SecurityContext;
|
|||||||
|
|
||||||
|
|
||||||
public abstract class UserApiService {
|
public abstract class UserApiService {
|
||||||
|
|
||||||
public abstract Response createUser(User body,SecurityContext securityContext)
|
public abstract Response createUser(User body,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response createUsersWithArrayInput(List<User> body,SecurityContext securityContext)
|
public abstract Response createUsersWithArrayInput(List<User> body,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response createUsersWithListInput(List<User> body,SecurityContext securityContext)
|
public abstract Response createUsersWithListInput(List<User> body,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response deleteUser(String username,SecurityContext securityContext)
|
public abstract Response deleteUser(String username,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response getUserByName(String username,SecurityContext securityContext)
|
public abstract Response getUserByName(String username,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response loginUser(String username,String password,SecurityContext securityContext)
|
public abstract Response loginUser(String username,String password,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response logoutUser(SecurityContext securityContext)
|
public abstract Response logoutUser(SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
public abstract Response updateUser(String username,User body,SecurityContext securityContext)
|
public abstract Response updateUser(String username,User body,SecurityContext securityContext)
|
||||||
throws NotFoundException;
|
throws NotFoundException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@ public class ApiResponse {
|
|||||||
private String type = null;
|
private String type = null;
|
||||||
private String message = null;
|
private String message = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public ApiResponse code(Integer code) {
|
public ApiResponse code(Integer code) {
|
||||||
@ -34,7 +33,6 @@ public class ApiResponse {
|
|||||||
this.code = code;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public ApiResponse type(String type) {
|
public ApiResponse type(String type) {
|
||||||
@ -52,7 +50,6 @@ public class ApiResponse {
|
|||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public ApiResponse message(String message) {
|
public ApiResponse message(String message) {
|
||||||
@ -71,7 +68,6 @@ public class ApiResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
|
@ -15,7 +15,6 @@ public class Category {
|
|||||||
private Long id = null;
|
private Long id = null;
|
||||||
private String name = null;
|
private String name = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public Category id(Long id) {
|
public Category id(Long id) {
|
||||||
@ -33,7 +32,6 @@ public class Category {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public Category name(String name) {
|
public Category name(String name) {
|
||||||
@ -52,7 +50,6 @@ public class Category {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
|
@ -41,7 +41,6 @@ public class Order {
|
|||||||
private StatusEnum status = null;
|
private StatusEnum status = null;
|
||||||
private Boolean complete = false;
|
private Boolean complete = false;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public Order id(Long id) {
|
public Order id(Long id) {
|
||||||
@ -59,7 +58,6 @@ public class Order {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public Order petId(Long petId) {
|
public Order petId(Long petId) {
|
||||||
@ -77,7 +75,6 @@ public class Order {
|
|||||||
this.petId = petId;
|
this.petId = petId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public Order quantity(Integer quantity) {
|
public Order quantity(Integer quantity) {
|
||||||
@ -95,7 +92,6 @@ public class Order {
|
|||||||
this.quantity = quantity;
|
this.quantity = quantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public Order shipDate(Date shipDate) {
|
public Order shipDate(Date shipDate) {
|
||||||
@ -113,7 +109,6 @@ public class Order {
|
|||||||
this.shipDate = shipDate;
|
this.shipDate = shipDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Order Status
|
* Order Status
|
||||||
**/
|
**/
|
||||||
@ -132,7 +127,6 @@ public class Order {
|
|||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public Order complete(Boolean complete) {
|
public Order complete(Boolean complete) {
|
||||||
@ -151,7 +145,6 @@ public class Order {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
|
@ -44,7 +44,6 @@ public class Pet {
|
|||||||
|
|
||||||
private StatusEnum status = null;
|
private StatusEnum status = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public Pet id(Long id) {
|
public Pet id(Long id) {
|
||||||
@ -62,7 +61,6 @@ public class Pet {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public Pet category(Category category) {
|
public Pet category(Category category) {
|
||||||
@ -80,7 +78,6 @@ public class Pet {
|
|||||||
this.category = category;
|
this.category = category;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public Pet name(String name) {
|
public Pet name(String name) {
|
||||||
@ -98,7 +95,6 @@ public class Pet {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public Pet photoUrls(List<String> photoUrls) {
|
public Pet photoUrls(List<String> photoUrls) {
|
||||||
@ -116,7 +112,6 @@ public class Pet {
|
|||||||
this.photoUrls = photoUrls;
|
this.photoUrls = photoUrls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public Pet tags(List<Tag> tags) {
|
public Pet tags(List<Tag> tags) {
|
||||||
@ -134,7 +129,6 @@ public class Pet {
|
|||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pet status in the store
|
* pet status in the store
|
||||||
**/
|
**/
|
||||||
@ -154,7 +148,6 @@ public class Pet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
|
@ -15,7 +15,6 @@ public class Tag {
|
|||||||
private Long id = null;
|
private Long id = null;
|
||||||
private String name = null;
|
private String name = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public Tag id(Long id) {
|
public Tag id(Long id) {
|
||||||
@ -33,7 +32,6 @@ public class Tag {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public Tag name(String name) {
|
public Tag name(String name) {
|
||||||
@ -52,7 +50,6 @@ public class Tag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
|
@ -21,7 +21,6 @@ public class User {
|
|||||||
private String phone = null;
|
private String phone = null;
|
||||||
private Integer userStatus = null;
|
private Integer userStatus = null;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public User id(Long id) {
|
public User id(Long id) {
|
||||||
@ -39,7 +38,6 @@ public class User {
|
|||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public User username(String username) {
|
public User username(String username) {
|
||||||
@ -57,7 +55,6 @@ public class User {
|
|||||||
this.username = username;
|
this.username = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public User firstName(String firstName) {
|
public User firstName(String firstName) {
|
||||||
@ -75,7 +72,6 @@ public class User {
|
|||||||
this.firstName = firstName;
|
this.firstName = firstName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public User lastName(String lastName) {
|
public User lastName(String lastName) {
|
||||||
@ -93,7 +89,6 @@ public class User {
|
|||||||
this.lastName = lastName;
|
this.lastName = lastName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public User email(String email) {
|
public User email(String email) {
|
||||||
@ -111,7 +106,6 @@ public class User {
|
|||||||
this.email = email;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public User password(String password) {
|
public User password(String password) {
|
||||||
@ -129,7 +123,6 @@ public class User {
|
|||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
**/
|
**/
|
||||||
public User phone(String phone) {
|
public User phone(String phone) {
|
||||||
@ -147,7 +140,6 @@ public class User {
|
|||||||
this.phone = phone;
|
this.phone = phone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User Status
|
* User Status
|
||||||
**/
|
**/
|
||||||
@ -167,7 +159,6 @@ public class User {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) {
|
if (this == o) {
|
||||||
|
@ -15,7 +15,7 @@ public class Bootstrap extends HttpServlet {
|
|||||||
public void init(ServletConfig config) throws ServletException {
|
public void init(ServletConfig config) throws ServletException {
|
||||||
Info info = new Info()
|
Info info = new Info()
|
||||||
.title("Swagger Server")
|
.title("Swagger Server")
|
||||||
.description("This is a sample server Petstore server. You can find out more about\nSwagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\nFor this sample, you can use the api key `special-key` to test the authorization filters.\n")
|
.description("This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.")
|
||||||
.termsOfService("http://swagger.io/terms/")
|
.termsOfService("http://swagger.io/terms/")
|
||||||
.contact(new Contact()
|
.contact(new Contact()
|
||||||
.email("apiteam@swagger.io"))
|
.email("apiteam@swagger.io"))
|
||||||
|
@ -23,7 +23,7 @@ import javax.ws.rs.core.SecurityContext;
|
|||||||
public class StoreApiServiceImpl extends StoreApiService {
|
public class StoreApiServiceImpl extends StoreApiService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Response deleteOrder(Long orderId, SecurityContext securityContext)
|
public Response deleteOrder(String orderId, SecurityContext securityContext)
|
||||||
throws NotFoundException {
|
throws NotFoundException {
|
||||||
// do some magic!
|
// do some magic!
|
||||||
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();
|
||||||
|
@ -1,23 +1,37 @@
|
|||||||
---
|
---
|
||||||
swagger: "2.0"
|
swagger: "2.0"
|
||||||
info:
|
info:
|
||||||
description: "This is a sample server Petstore server.\n\n[Learn about Swagger](http://swagger.io)\
|
description: "This is a sample server Petstore server. You can find out more about\
|
||||||
\ or join the IRC channel `#swagger` on irc.freenode.net.\n\nFor this sample,\
|
\ Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\
|
||||||
\ you can use the api key `special-key` to test the authorization filters\n"
|
\ For this sample, you can use the api key `special-key` to test the authorization\
|
||||||
|
\ 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/"
|
||||||
contact:
|
contact:
|
||||||
name: "apiteam@swagger.io"
|
email: "apiteam@swagger.io"
|
||||||
license:
|
license:
|
||||||
name: "Apache 2.0"
|
name: "Apache 2.0"
|
||||||
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:
|
||||||
/pets:
|
/pet:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
@ -28,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:
|
||||||
@ -42,8 +56,8 @@ paths:
|
|||||||
description: "Invalid input"
|
description: "Invalid input"
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write_pets"
|
- "write:pets"
|
||||||
- "read_pets"
|
- "read:pets"
|
||||||
x-swagger-router-controller: "Pet"
|
x-swagger-router-controller: "Pet"
|
||||||
put:
|
put:
|
||||||
tags:
|
tags:
|
||||||
@ -55,13 +69,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:
|
||||||
@ -73,28 +87,33 @@ paths:
|
|||||||
description: "Validation exception"
|
description: "Validation exception"
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write_pets"
|
- "write:pets"
|
||||||
- "read_pets"
|
- "read:pets"
|
||||||
x-swagger-router-controller: "Pet"
|
x-swagger-router-controller: "Pet"
|
||||||
/pets/findByStatus:
|
/pet/findByStatus:
|
||||||
get:
|
get:
|
||||||
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"
|
||||||
|
enum:
|
||||||
|
- "available"
|
||||||
|
- "pending"
|
||||||
|
- "sold"
|
||||||
|
collectionFormat: "csv"
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
@ -106,29 +125,29 @@ paths:
|
|||||||
description: "Invalid status value"
|
description: "Invalid status value"
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write_pets"
|
- "write:pets"
|
||||||
- "read_pets"
|
- "read:pets"
|
||||||
x-swagger-router-controller: "Pet"
|
x-swagger-router-controller: "Pet"
|
||||||
/pets/findByTags:
|
/pet/findByTags:
|
||||||
get:
|
get:
|
||||||
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"
|
||||||
@ -140,24 +159,23 @@ paths:
|
|||||||
description: "Invalid tag value"
|
description: "Invalid tag value"
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write_pets"
|
- "write:pets"
|
||||||
- "read_pets"
|
- "read:pets"
|
||||||
x-swagger-router-controller: "Pet"
|
x-swagger-router-controller: "Pet"
|
||||||
/pets/{petId}:
|
/pet/{petId}:
|
||||||
get:
|
get:
|
||||||
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"
|
||||||
@ -172,9 +190,6 @@ paths:
|
|||||||
description: "Pet not found"
|
description: "Pet not found"
|
||||||
security:
|
security:
|
||||||
- api_key: []
|
- api_key: []
|
||||||
- petstore_auth:
|
|
||||||
- "write_pets"
|
|
||||||
- "read_pets"
|
|
||||||
x-swagger-router-controller: "Pet"
|
x-swagger-router-controller: "Pet"
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
@ -185,31 +200,32 @@ 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"
|
||||||
required: true
|
required: false
|
||||||
type: "string"
|
type: "string"
|
||||||
- name: "status"
|
- name: "status"
|
||||||
in: "formData"
|
in: "formData"
|
||||||
description: "Updated status of the pet"
|
description: "Updated status of the pet"
|
||||||
required: true
|
required: false
|
||||||
type: "string"
|
type: "string"
|
||||||
responses:
|
responses:
|
||||||
405:
|
405:
|
||||||
description: "Invalid input"
|
description: "Invalid input"
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write_pets"
|
- "write:pets"
|
||||||
- "read_pets"
|
- "read:pets"
|
||||||
x-swagger-router-controller: "Pet"
|
x-swagger-router-controller: "Pet"
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
@ -218,13 +234,12 @@ 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: true
|
|
||||||
type: "string"
|
type: "string"
|
||||||
- name: "petId"
|
- name: "petId"
|
||||||
in: "path"
|
in: "path"
|
||||||
@ -237,10 +252,69 @@ paths:
|
|||||||
description: "Invalid pet value"
|
description: "Invalid pet value"
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write_pets"
|
- "write:pets"
|
||||||
- "read_pets"
|
- "read:pets"
|
||||||
x-swagger-router-controller: "Pet"
|
x-swagger-router-controller: "Pet"
|
||||||
/stores/order:
|
/pet/{petId}/uploadImage:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- "pet"
|
||||||
|
summary: "uploads an image"
|
||||||
|
description: ""
|
||||||
|
operationId: "uploadFile"
|
||||||
|
consumes:
|
||||||
|
- "multipart/form-data"
|
||||||
|
produces:
|
||||||
|
- "application/json"
|
||||||
|
parameters:
|
||||||
|
- name: "petId"
|
||||||
|
in: "path"
|
||||||
|
description: "ID of pet to update"
|
||||||
|
required: true
|
||||||
|
type: "integer"
|
||||||
|
format: "int64"
|
||||||
|
- name: "additionalMetadata"
|
||||||
|
in: "formData"
|
||||||
|
description: "Additional data to pass to server"
|
||||||
|
required: false
|
||||||
|
type: "string"
|
||||||
|
- name: "file"
|
||||||
|
in: "formData"
|
||||||
|
description: "file to upload"
|
||||||
|
required: false
|
||||||
|
type: "file"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: "successful operation"
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ApiResponse"
|
||||||
|
security:
|
||||||
|
- petstore_auth:
|
||||||
|
- "write:pets"
|
||||||
|
- "read:pets"
|
||||||
|
x-swagger-router-controller: "Pet"
|
||||||
|
/store/inventory:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- "store"
|
||||||
|
summary: "Returns pet inventories by status"
|
||||||
|
description: "Returns a map of status codes to quantities"
|
||||||
|
operationId: "getInventory"
|
||||||
|
produces:
|
||||||
|
- "application/json"
|
||||||
|
parameters: []
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: "successful operation"
|
||||||
|
schema:
|
||||||
|
type: "object"
|
||||||
|
additionalProperties:
|
||||||
|
type: "integer"
|
||||||
|
format: "int32"
|
||||||
|
security:
|
||||||
|
- api_key: []
|
||||||
|
x-swagger-router-controller: "Store"
|
||||||
|
/store/order:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "store"
|
- "store"
|
||||||
@ -248,13 +322,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:
|
||||||
@ -265,7 +339,7 @@ paths:
|
|||||||
400:
|
400:
|
||||||
description: "Invalid Order"
|
description: "Invalid Order"
|
||||||
x-swagger-router-controller: "Store"
|
x-swagger-router-controller: "Store"
|
||||||
/stores/order/{orderId}:
|
/store/order/{orderId}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "store"
|
- "store"
|
||||||
@ -274,14 +348,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
|
||||||
|
minimum: 1
|
||||||
|
format: "int64"
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
@ -300,21 +377,22 @@ 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
|
||||||
responses:
|
responses:
|
||||||
400:
|
400:
|
||||||
description: "Invalid ID supplied"
|
description: "Invalid ID supplied"
|
||||||
404:
|
404:
|
||||||
description: "Order not found"
|
description: "Order not found"
|
||||||
x-swagger-router-controller: "Store"
|
x-swagger-router-controller: "Store"
|
||||||
/users:
|
/user:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
@ -322,20 +400,20 @@ 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:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
x-swagger-router-controller: "User"
|
x-swagger-router-controller: "User"
|
||||||
/users/createWithArray:
|
/user/createWithArray:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
@ -343,13 +421,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:
|
||||||
@ -358,7 +436,7 @@ paths:
|
|||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
x-swagger-router-controller: "User"
|
x-swagger-router-controller: "User"
|
||||||
/users/createWithList:
|
/user/createWithList:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
@ -366,13 +444,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:
|
||||||
@ -381,7 +459,7 @@ paths:
|
|||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
x-swagger-router-controller: "User"
|
x-swagger-router-controller: "User"
|
||||||
/users/login:
|
/user/login:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
@ -389,28 +467,37 @@ 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-swagger-router-controller: "User"
|
x-swagger-router-controller: "User"
|
||||||
/users/logout:
|
/user/logout:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
@ -418,14 +505,14 @@ paths:
|
|||||||
description: ""
|
description: ""
|
||||||
operationId: "logoutUser"
|
operationId: "logoutUser"
|
||||||
produces:
|
produces:
|
||||||
- "application/json"
|
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
|
- "application/json"
|
||||||
parameters: []
|
parameters: []
|
||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
x-swagger-router-controller: "User"
|
x-swagger-router-controller: "User"
|
||||||
/users/{username}:
|
/user/{username}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
@ -433,12 +520,12 @@ 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"
|
||||||
description: "The name that needs to be fetched. Use user1 for testing."
|
description: "The name that needs to be fetched. Use user1 for testing. "
|
||||||
required: true
|
required: true
|
||||||
type: "string"
|
type: "string"
|
||||||
responses:
|
responses:
|
||||||
@ -458,8 +545,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"
|
||||||
@ -469,7 +556,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:
|
||||||
@ -485,8 +572,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"
|
||||||
@ -509,9 +596,46 @@ securityDefinitions:
|
|||||||
authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog"
|
authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog"
|
||||||
flow: "implicit"
|
flow: "implicit"
|
||||||
scopes:
|
scopes:
|
||||||
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"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
@ -534,7 +658,9 @@ definitions:
|
|||||||
type: "integer"
|
type: "integer"
|
||||||
format: "int32"
|
format: "int32"
|
||||||
description: "User Status"
|
description: "User Status"
|
||||||
Category:
|
xml:
|
||||||
|
name: "User"
|
||||||
|
Tag:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
@ -542,6 +668,8 @@ definitions:
|
|||||||
format: "int64"
|
format: "int64"
|
||||||
name:
|
name:
|
||||||
type: "string"
|
type: "string"
|
||||||
|
xml:
|
||||||
|
name: "Tag"
|
||||||
Pet:
|
Pet:
|
||||||
type: "object"
|
type: "object"
|
||||||
required:
|
required:
|
||||||
@ -558,40 +686,37 @@ definitions:
|
|||||||
example: "doggie"
|
example: "doggie"
|
||||||
photoUrls:
|
photoUrls:
|
||||||
type: "array"
|
type: "array"
|
||||||
|
xml:
|
||||||
|
name: "photoUrl"
|
||||||
|
wrapped: true
|
||||||
items:
|
items:
|
||||||
type: "string"
|
type: "string"
|
||||||
tags:
|
tags:
|
||||||
type: "array"
|
type: "array"
|
||||||
|
xml:
|
||||||
|
name: "tag"
|
||||||
|
wrapped: true
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/Tag"
|
$ref: "#/definitions/Tag"
|
||||||
status:
|
status:
|
||||||
type: "string"
|
type: "string"
|
||||||
description: "pet status in the store"
|
description: "pet status in the store"
|
||||||
Tag:
|
enum:
|
||||||
|
- "available"
|
||||||
|
- "pending"
|
||||||
|
- "sold"
|
||||||
|
xml:
|
||||||
|
name: "Pet"
|
||||||
|
ApiResponse:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
id:
|
code:
|
||||||
type: "integer"
|
|
||||||
format: "int64"
|
|
||||||
name:
|
|
||||||
type: "string"
|
|
||||||
Order:
|
|
||||||
type: "object"
|
|
||||||
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:
|
||||||
complete:
|
description: "Find out more about Swagger"
|
||||||
type: "boolean"
|
url: "http://swagger.io"
|
||||||
|
@ -33,3 +33,7 @@ module.exports.updatePet = function updatePet (req, res, next) {
|
|||||||
module.exports.updatePetWithForm = function updatePetWithForm (req, res, next) {
|
module.exports.updatePetWithForm = function updatePetWithForm (req, res, next) {
|
||||||
Pet.updatePetWithForm(req.swagger.params, res, next);
|
Pet.updatePetWithForm(req.swagger.params, res, next);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.uploadFile = function uploadFile (req, res, next) {
|
||||||
|
Pet.uploadFile(req.swagger.params, res, next);
|
||||||
|
};
|
||||||
|
@ -12,8 +12,8 @@ exports.addPet = function(args, res, next) {
|
|||||||
exports.deletePet = function(args, res, next) {
|
exports.deletePet = function(args, res, next) {
|
||||||
/**
|
/**
|
||||||
* parameters expected in the args:
|
* parameters expected in the args:
|
||||||
* apiKey (String)
|
|
||||||
* petId (Long)
|
* petId (Long)
|
||||||
|
* apiKey (String)
|
||||||
**/
|
**/
|
||||||
// no response value expected for this operation
|
// no response value expected for this operation
|
||||||
res.end();
|
res.end();
|
||||||
@ -121,7 +121,7 @@ exports.updatePet = function(args, res, next) {
|
|||||||
exports.updatePetWithForm = function(args, res, next) {
|
exports.updatePetWithForm = function(args, res, next) {
|
||||||
/**
|
/**
|
||||||
* parameters expected in the args:
|
* parameters expected in the args:
|
||||||
* petId (String)
|
* petId (Long)
|
||||||
* name (String)
|
* name (String)
|
||||||
* status (String)
|
* status (String)
|
||||||
**/
|
**/
|
||||||
@ -129,3 +129,26 @@ exports.updatePetWithForm = function(args, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.uploadFile = function(args, res, next) {
|
||||||
|
/**
|
||||||
|
* parameters expected in the args:
|
||||||
|
* petId (Long)
|
||||||
|
* additionalMetadata (String)
|
||||||
|
* file (file)
|
||||||
|
**/
|
||||||
|
var examples = {};
|
||||||
|
examples['application/json'] = {
|
||||||
|
"message" : "aeiou",
|
||||||
|
"code" : 123,
|
||||||
|
"type" : "aeiou"
|
||||||
|
};
|
||||||
|
if(Object.keys(examples).length > 0) {
|
||||||
|
res.setHeader('Content-Type', 'application/json');
|
||||||
|
res.end(JSON.stringify(examples[Object.keys(examples)[0]] || {}, null, 2));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
res.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,10 @@ module.exports.deleteOrder = function deleteOrder (req, res, next) {
|
|||||||
Store.deleteOrder(req.swagger.params, res, next);
|
Store.deleteOrder(req.swagger.params, res, next);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports.getInventory = function getInventory (req, res, next) {
|
||||||
|
Store.getInventory(req.swagger.params, res, next);
|
||||||
|
};
|
||||||
|
|
||||||
module.exports.getOrderById = function getOrderById (req, res, next) {
|
module.exports.getOrderById = function getOrderById (req, res, next) {
|
||||||
Store.getOrderById(req.swagger.params, res, next);
|
Store.getOrderById(req.swagger.params, res, next);
|
||||||
};
|
};
|
||||||
|
@ -9,10 +9,28 @@ exports.deleteOrder = function(args, res, next) {
|
|||||||
res.end();
|
res.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.getInventory = function(args, res, next) {
|
||||||
|
/**
|
||||||
|
* parameters expected in the args:
|
||||||
|
**/
|
||||||
|
var examples = {};
|
||||||
|
examples['application/json'] = {
|
||||||
|
"key" : 123
|
||||||
|
};
|
||||||
|
if(Object.keys(examples).length > 0) {
|
||||||
|
res.setHeader('Content-Type', 'application/json');
|
||||||
|
res.end(JSON.stringify(examples[Object.keys(examples)[0]] || {}, null, 2));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
res.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
exports.getOrderById = function(args, res, next) {
|
exports.getOrderById = function(args, res, next) {
|
||||||
/**
|
/**
|
||||||
* parameters expected in the args:
|
* parameters expected in the args:
|
||||||
* orderId (String)
|
* orderId (Long)
|
||||||
**/
|
**/
|
||||||
var examples = {};
|
var examples = {};
|
||||||
examples['application/json'] = {
|
examples['application/json'] = {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "swagger-petstore",
|
"name": "swagger-petstore",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "This is a sample server Petstore server.\n\n[Learn about Swagger](http://swagger.io) or join the IRC channel `#swagger` on irc.freenode.net.\n\nFor this sample, you can use the api key `special-key` to test the authorization filters\n",
|
"description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"swagger"
|
"swagger"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the
|
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the
|
||||||
[swagger-spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This
|
[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This
|
||||||
is an example of building a swagger-enabled scalatra server.
|
is an example of building a swagger-enabled scalatra server.
|
||||||
|
|
||||||
This example uses the [scalatra](http://scalatra.org/) framework. To see how to make this your own, look here:
|
This example uses the [scalatra](http://scalatra.org/) framework. To see how to make this your own, look here:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import com.wordnik.client.api._
|
import com.wordnik.client.api._
|
||||||
import akka.actor.ActorSystem
|
import akka.actor.ActorSystem
|
||||||
import io.swagger.app.{ResourcesApp, SwaggerApp}
|
import io.swagger.app.{ ResourcesApp, SwaggerApp }
|
||||||
import javax.servlet.ServletContext
|
import javax.servlet.ServletContext
|
||||||
import org.scalatra.LifeCycle
|
import org.scalatra.LifeCycle
|
||||||
|
|
||||||
@ -10,9 +10,9 @@ class ScalatraBootstrap extends LifeCycle {
|
|||||||
override def init(context: ServletContext) {
|
override def init(context: ServletContext) {
|
||||||
implicit val system = ActorSystem("appActorSystem")
|
implicit val system = ActorSystem("appActorSystem")
|
||||||
try {
|
try {
|
||||||
context mount (new UserApi, "/User/*")
|
|
||||||
context mount (new PetApi, "/Pet/*")
|
context mount (new PetApi, "/Pet/*")
|
||||||
context mount (new StoreApi, "/Store/*")
|
context mount (new StoreApi, "/Store/*")
|
||||||
|
context mount (new UserApi, "/User/*")
|
||||||
|
|
||||||
context mount (new ResourcesApp, "/api-docs/*")
|
context mount (new ResourcesApp, "/api-docs/*")
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -3,9 +3,9 @@ package io.swagger.app
|
|||||||
import _root_.akka.actor.ActorSystem
|
import _root_.akka.actor.ActorSystem
|
||||||
|
|
||||||
import org.scalatra.swagger.{ ApiInfo, SwaggerWithAuth, Swagger }
|
import org.scalatra.swagger.{ ApiInfo, SwaggerWithAuth, Swagger }
|
||||||
import org.scalatra.swagger.{JacksonSwaggerBase, Swagger}
|
import org.scalatra.swagger.{ JacksonSwaggerBase, Swagger }
|
||||||
import org.scalatra.ScalatraServlet
|
import org.scalatra.ScalatraServlet
|
||||||
import org.json4s.{DefaultFormats, Formats}
|
import org.json4s.{ DefaultFormats, Formats }
|
||||||
|
|
||||||
class ResourcesApp(implicit protected val system: ActorSystem, val swagger: SwaggerApp)
|
class ResourcesApp(implicit protected val system: ActorSystem, val swagger: SwaggerApp)
|
||||||
extends ScalatraServlet with JacksonSwaggerBase {
|
extends ScalatraServlet with JacksonSwaggerBase {
|
||||||
@ -17,7 +17,7 @@ class ResourcesApp(implicit protected val system: ActorSystem, val swagger: Swag
|
|||||||
val port = request.getServerPort
|
val port = request.getServerPort
|
||||||
val h = request.getServerName
|
val h = request.getServerName
|
||||||
val prot = if (port == 443) "https" else "http"
|
val prot = if (port == 443) "https" else "http"
|
||||||
val (proto, host) = if (port != 80 && port != 443) ("http", h+":"+port.toString) else (prot, h)
|
val (proto, host) = if (port != 80 && port != 443) ("http", h + ":" + port.toString) else (prot, h)
|
||||||
"%s://%s%s%s".format(
|
"%s://%s%s%s".format(
|
||||||
proto,
|
proto,
|
||||||
host,
|
host,
|
||||||
@ -31,7 +31,7 @@ class SwaggerApp extends Swagger(apiInfo = ApiSwagger.apiInfo, apiVersion = "1.0
|
|||||||
object ApiSwagger {
|
object ApiSwagger {
|
||||||
val apiInfo = ApiInfo(
|
val apiInfo = ApiInfo(
|
||||||
"""Swagger Petstore""",
|
"""Swagger Petstore""",
|
||||||
"""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. For this sample, you can use the api key \"special-key\" to test the authorization filters""",
|
"""This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.""",
|
||||||
"""""",
|
"""""",
|
||||||
"""apiteam@swagger.io""",
|
"""apiteam@swagger.io""",
|
||||||
"""Apache 2.0""",
|
"""Apache 2.0""",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.wordnik.client.api
|
package com.wordnik.client.api
|
||||||
|
|
||||||
import com.wordnik.client.model.Pet
|
import com.wordnik.client.model.Pet
|
||||||
|
import com.wordnik.client.model.ApiResponse
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@ -29,156 +30,16 @@ class PetApi (implicit val swagger: Swagger) extends ScalatraServlet
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
val updatePetOperation = (apiOperation[Unit]("updatePet")
|
|
||||||
summary "Update an existing pet"
|
|
||||||
parameters(bodyParam[Pet]("body").description("").optional)
|
|
||||||
)
|
|
||||||
|
|
||||||
put("/pet",operation(updatePetOperation)) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bodyParam[Pet]("body").description("").optional
|
|
||||||
|
|
||||||
println("body: " + body)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val addPetOperation = (apiOperation[Unit]("addPet")
|
val addPetOperation = (apiOperation[Unit]("addPet")
|
||||||
summary "Add a new pet to the store"
|
summary "Add a new pet to the store"
|
||||||
parameters(bodyParam[Pet]("body").description("").optional)
|
parameters(bodyParam[Pet]("body").description(""))
|
||||||
)
|
)
|
||||||
|
|
||||||
post("/pet",operation(addPetOperation)) {
|
post("/pet",operation(addPetOperation)) {
|
||||||
|
|
||||||
|
|
||||||
|
bodyParam[Pet]("body").description("")
|
||||||
|
|
||||||
bodyParam[Pet]("body").description("").optional
|
|
||||||
|
|
||||||
println("body: " + body)
|
println("body: " + body)
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val findPetsByStatusOperation = (apiOperation[List[Pet]]("findPetsByStatus")
|
|
||||||
summary "Finds Pets by status"
|
|
||||||
parameters(queryParam[List[String]]("status").description("").optional.defaultValue(available))
|
|
||||||
)
|
|
||||||
|
|
||||||
get("/pet/findByStatus",operation(findPetsByStatusOperation)) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val statusString = params.getAs[String]("status")
|
|
||||||
val status = if("multi".equals("default")) {
|
|
||||||
statusString match {
|
|
||||||
case Some(str) => str.split(",")
|
|
||||||
case None => List()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
List()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("status: " + status)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val findPetsByTagsOperation = (apiOperation[List[Pet]]("findPetsByTags")
|
|
||||||
summary "Finds Pets by tags"
|
|
||||||
parameters(queryParam[List[String]]("tags").description("").optional)
|
|
||||||
)
|
|
||||||
|
|
||||||
get("/pet/findByTags",operation(findPetsByTagsOperation)) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val tagsString = params.getAs[String]("tags")
|
|
||||||
val tags = if("multi".equals("default")) {
|
|
||||||
tagsString match {
|
|
||||||
case Some(str) => str.split(",")
|
|
||||||
case None => List()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
List()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("tags: " + tags)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val getPetByIdOperation = (apiOperation[Pet]("getPetById")
|
|
||||||
summary "Find pet by ID"
|
|
||||||
parameters(pathParam[Long]("petId").description(""))
|
|
||||||
)
|
|
||||||
|
|
||||||
get("/pet/{petId}",operation(getPetByIdOperation)) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val petId = params.getOrElse("petId", halt(400))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("petId: " + petId)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val updatePetWithFormOperation = (apiOperation[Unit]("updatePetWithForm")
|
|
||||||
summary "Updates a pet in the store with form data"
|
|
||||||
parameters(pathParam[String]("petId").description(""),
|
|
||||||
formParam[String]("name").description("").optional,
|
|
||||||
formParam[String]("status").description("").optional)
|
|
||||||
)
|
|
||||||
|
|
||||||
post("/pet/{petId}",operation(updatePetWithFormOperation)) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val petId = params.getOrElse("petId", halt(400))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("petId: " + petId)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val name = params.getAs[String]("name")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("name: " + name)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val status = params.getAs[String]("status")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("status: " + status)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -192,27 +53,123 @@ bodyParam[Pet]("body").description("").optional
|
|||||||
delete("/pet/{petId}",operation(deletePetOperation)) {
|
delete("/pet/{petId}",operation(deletePetOperation)) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val petId = params.getOrElse("petId", halt(400))
|
val petId = params.getOrElse("petId", halt(400))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("petId: " + petId)
|
println("petId: " + petId)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val apiKey = request.getHeader("apiKey")
|
val apiKey = request.getHeader("apiKey")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("apiKey: " + apiKey)
|
println("apiKey: " + apiKey)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val uploadFileOperation = (apiOperation[Unit]("uploadFile")
|
val findPetsByStatusOperation = (apiOperation[List[Pet]]("findPetsByStatus")
|
||||||
|
summary "Finds Pets by status"
|
||||||
|
parameters(queryParam[List[String]]("status").description(""))
|
||||||
|
)
|
||||||
|
|
||||||
|
get("/pet/findByStatus",operation(findPetsByStatusOperation)) {
|
||||||
|
|
||||||
|
|
||||||
|
val statusString = params.getAs[String]("status")
|
||||||
|
val status = if("csv".equals("default")) {
|
||||||
|
statusString match {
|
||||||
|
case Some(str) => str.split(",")
|
||||||
|
case None => List()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
List()
|
||||||
|
|
||||||
|
|
||||||
|
println("status: " + status)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
val findPetsByTagsOperation = (apiOperation[List[Pet]]("findPetsByTags")
|
||||||
|
summary "Finds Pets by tags"
|
||||||
|
parameters(queryParam[List[String]]("tags").description(""))
|
||||||
|
)
|
||||||
|
|
||||||
|
get("/pet/findByTags",operation(findPetsByTagsOperation)) {
|
||||||
|
|
||||||
|
|
||||||
|
val tagsString = params.getAs[String]("tags")
|
||||||
|
val tags = if("csv".equals("default")) {
|
||||||
|
tagsString match {
|
||||||
|
case Some(str) => str.split(",")
|
||||||
|
case None => List()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
List()
|
||||||
|
|
||||||
|
|
||||||
|
println("tags: " + tags)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
val getPetByIdOperation = (apiOperation[Pet]("getPetById")
|
||||||
|
summary "Find pet by ID"
|
||||||
|
parameters(pathParam[Long]("petId").description(""))
|
||||||
|
)
|
||||||
|
|
||||||
|
get("/pet/{petId}",operation(getPetByIdOperation)) {
|
||||||
|
|
||||||
|
|
||||||
|
val petId = params.getOrElse("petId", halt(400))
|
||||||
|
|
||||||
|
println("petId: " + petId)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
val updatePetOperation = (apiOperation[Unit]("updatePet")
|
||||||
|
summary "Update an existing pet"
|
||||||
|
parameters(bodyParam[Pet]("body").description(""))
|
||||||
|
)
|
||||||
|
|
||||||
|
put("/pet",operation(updatePetOperation)) {
|
||||||
|
|
||||||
|
|
||||||
|
bodyParam[Pet]("body").description("")
|
||||||
|
println("body: " + body)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
val updatePetWithFormOperation = (apiOperation[Unit]("updatePetWithForm")
|
||||||
|
summary "Updates a pet in the store with form data"
|
||||||
|
parameters(pathParam[Long]("petId").description(""),
|
||||||
|
formParam[String]("name").description("").optional,
|
||||||
|
formParam[String]("status").description("").optional)
|
||||||
|
)
|
||||||
|
|
||||||
|
post("/pet/{petId}",operation(updatePetWithFormOperation)) {
|
||||||
|
|
||||||
|
|
||||||
|
val petId = params.getOrElse("petId", halt(400))
|
||||||
|
|
||||||
|
println("petId: " + petId)
|
||||||
|
|
||||||
|
|
||||||
|
val name = params.getAs[String]("name")
|
||||||
|
|
||||||
|
println("name: " + name)
|
||||||
|
|
||||||
|
|
||||||
|
val status = params.getAs[String]("status")
|
||||||
|
|
||||||
|
println("status: " + status)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
val uploadFileOperation = (apiOperation[ApiResponse]("uploadFile")
|
||||||
summary "uploads an image"
|
summary "uploads an image"
|
||||||
parameters(pathParam[Long]("petId").description(""),
|
parameters(pathParam[Long]("petId").description(""),
|
||||||
formParam[String]("additionalMetadata").description("").optional,
|
formParam[String]("additionalMetadata").description("").optional,
|
||||||
@ -222,26 +179,16 @@ bodyParam[Pet]("body").description("").optional
|
|||||||
post("/pet/{petId}/uploadImage",operation(uploadFileOperation)) {
|
post("/pet/{petId}/uploadImage",operation(uploadFileOperation)) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val petId = params.getOrElse("petId", halt(400))
|
val petId = params.getOrElse("petId", halt(400))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("petId: " + petId)
|
println("petId: " + petId)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val additionalMetadata = params.getAs[String]("additionalMetadata")
|
val additionalMetadata = params.getAs[String]("additionalMetadata")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("additionalMetadata: " + additionalMetadata)
|
println("additionalMetadata: " + additionalMetadata)
|
||||||
|
|
||||||
val file = fileParams("file")
|
val file = fileParams("file")
|
||||||
|
|
||||||
println("file: " + file)
|
println("file: " + file)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -9,11 +9,11 @@ import org.scalatra.swagger._
|
|||||||
import org.json4s._
|
import org.json4s._
|
||||||
import org.json4s.JsonDSL._
|
import org.json4s.JsonDSL._
|
||||||
import org.scalatra.json.{ JValueResult, JacksonJsonSupport }
|
import org.scalatra.json.{ JValueResult, JacksonJsonSupport }
|
||||||
import org.scalatra.servlet.{FileUploadSupport, MultipartConfig, SizeConstraintExceededException}
|
import org.scalatra.servlet.{ FileUploadSupport, MultipartConfig, SizeConstraintExceededException }
|
||||||
|
|
||||||
import scala.collection.JavaConverters._
|
import scala.collection.JavaConverters._
|
||||||
|
|
||||||
class StoreApi (implicit val swagger: Swagger) extends ScalatraServlet
|
class StoreApi(implicit val swagger: Swagger) extends ScalatraServlet
|
||||||
with FileUploadSupport
|
with FileUploadSupport
|
||||||
with JacksonJsonSupport
|
with JacksonJsonSupport
|
||||||
with SwaggerSupport {
|
with SwaggerSupport {
|
||||||
@ -27,70 +27,47 @@ class StoreApi (implicit val swagger: Swagger) extends ScalatraServlet
|
|||||||
response.headers += ("Access-Control-Allow-Origin" -> "*")
|
response.headers += ("Access-Control-Allow-Origin" -> "*")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val deleteOrderOperation = (apiOperation[Unit]("deleteOrder")
|
||||||
|
summary "Delete purchase order by ID"
|
||||||
|
parameters (pathParam[String]("orderId").description(""))
|
||||||
|
)
|
||||||
|
|
||||||
|
delete("/store/order/{orderId}", operation(deleteOrderOperation)) {
|
||||||
|
|
||||||
|
val orderId = params.getOrElse("orderId", halt(400))
|
||||||
|
|
||||||
|
println("orderId: " + orderId)
|
||||||
|
}
|
||||||
|
|
||||||
val getInventoryOperation = (apiOperation[Map[String, Int]]("getInventory")
|
val getInventoryOperation = (apiOperation[Map[String, Int]]("getInventory")
|
||||||
summary "Returns pet inventories by status"
|
summary "Returns pet inventories by status"
|
||||||
parameters()
|
parameters ()
|
||||||
)
|
)
|
||||||
|
|
||||||
get("/store/inventory",operation(getInventoryOperation)) {
|
get("/store/inventory", operation(getInventoryOperation)) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val placeOrderOperation = (apiOperation[Order]("placeOrder")
|
|
||||||
summary "Place an order for a pet"
|
|
||||||
parameters(bodyParam[Order]("body").description("").optional)
|
|
||||||
)
|
|
||||||
|
|
||||||
post("/store/order",operation(placeOrderOperation)) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bodyParam[Order]("body").description("").optional
|
|
||||||
|
|
||||||
println("body: " + body)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val getOrderByIdOperation = (apiOperation[Order]("getOrderById")
|
val getOrderByIdOperation = (apiOperation[Order]("getOrderById")
|
||||||
summary "Find purchase order by ID"
|
summary "Find purchase order by ID"
|
||||||
parameters(pathParam[String]("orderId").description(""))
|
parameters (pathParam[Long]("orderId").description(""))
|
||||||
)
|
)
|
||||||
|
|
||||||
get("/store/order/{orderId}",operation(getOrderByIdOperation)) {
|
get("/store/order/{orderId}", operation(getOrderByIdOperation)) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val orderId = params.getOrElse("orderId", halt(400))
|
val orderId = params.getOrElse("orderId", halt(400))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("orderId: " + orderId)
|
println("orderId: " + orderId)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val placeOrderOperation = (apiOperation[Order]("placeOrder")
|
||||||
|
summary "Place an order for a pet"
|
||||||
val deleteOrderOperation = (apiOperation[Unit]("deleteOrder")
|
parameters (bodyParam[Order]("body").description(""))
|
||||||
summary "Delete purchase order by ID"
|
|
||||||
parameters(pathParam[String]("orderId").description(""))
|
|
||||||
)
|
)
|
||||||
|
|
||||||
delete("/store/order/{orderId}",operation(deleteOrderOperation)) {
|
post("/store/order", operation(placeOrderOperation)) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val orderId = params.getOrElse("orderId", halt(400))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("orderId: " + orderId)
|
|
||||||
|
|
||||||
|
bodyParam[Order]("body").description("")
|
||||||
|
println("body: " + body)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -9,11 +9,11 @@ import org.scalatra.swagger._
|
|||||||
import org.json4s._
|
import org.json4s._
|
||||||
import org.json4s.JsonDSL._
|
import org.json4s.JsonDSL._
|
||||||
import org.scalatra.json.{ JValueResult, JacksonJsonSupport }
|
import org.scalatra.json.{ JValueResult, JacksonJsonSupport }
|
||||||
import org.scalatra.servlet.{FileUploadSupport, MultipartConfig, SizeConstraintExceededException}
|
import org.scalatra.servlet.{ FileUploadSupport, MultipartConfig, SizeConstraintExceededException }
|
||||||
|
|
||||||
import scala.collection.JavaConverters._
|
import scala.collection.JavaConverters._
|
||||||
|
|
||||||
class UserApi (implicit val swagger: Swagger) extends ScalatraServlet
|
class UserApi(implicit val swagger: Swagger) extends ScalatraServlet
|
||||||
with FileUploadSupport
|
with FileUploadSupport
|
||||||
with JacksonJsonSupport
|
with JacksonJsonSupport
|
||||||
with SwaggerSupport {
|
with SwaggerSupport {
|
||||||
@ -27,165 +27,102 @@ class UserApi (implicit val swagger: Swagger) extends ScalatraServlet
|
|||||||
response.headers += ("Access-Control-Allow-Origin" -> "*")
|
response.headers += ("Access-Control-Allow-Origin" -> "*")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
val createUserOperation = (apiOperation[Unit]("createUser")
|
val createUserOperation = (apiOperation[Unit]("createUser")
|
||||||
summary "Create user"
|
summary "Create user"
|
||||||
parameters(bodyParam[User]("body").description("").optional)
|
parameters (bodyParam[User]("body").description(""))
|
||||||
)
|
)
|
||||||
|
|
||||||
post("/user",operation(createUserOperation)) {
|
post("/user", operation(createUserOperation)) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bodyParam[User]("body").description("").optional
|
|
||||||
|
|
||||||
|
bodyParam[User]("body").description("")
|
||||||
println("body: " + body)
|
println("body: " + body)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val createUsersWithArrayInputOperation = (apiOperation[Unit]("createUsersWithArrayInput")
|
val createUsersWithArrayInputOperation = (apiOperation[Unit]("createUsersWithArrayInput")
|
||||||
summary "Creates list of users with given input array"
|
summary "Creates list of users with given input array"
|
||||||
parameters(bodyParam[List[User]]("body").description("").optional)
|
parameters (bodyParam[List[User]]("body").description(""))
|
||||||
)
|
)
|
||||||
|
|
||||||
post("/user/createWithArray",operation(createUsersWithArrayInputOperation)) {
|
post("/user/createWithArray", operation(createUsersWithArrayInputOperation)) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bodyParam[List[User]]("body").description("").optional
|
|
||||||
|
|
||||||
|
bodyParam[List[User]]("body").description("")
|
||||||
println("body: " + body)
|
println("body: " + body)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val createUsersWithListInputOperation = (apiOperation[Unit]("createUsersWithListInput")
|
val createUsersWithListInputOperation = (apiOperation[Unit]("createUsersWithListInput")
|
||||||
summary "Creates list of users with given input array"
|
summary "Creates list of users with given input array"
|
||||||
parameters(bodyParam[List[User]]("body").description("").optional)
|
parameters (bodyParam[List[User]]("body").description(""))
|
||||||
)
|
)
|
||||||
|
|
||||||
post("/user/createWithList",operation(createUsersWithListInputOperation)) {
|
post("/user/createWithList", operation(createUsersWithListInputOperation)) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bodyParam[List[User]]("body").description("").optional
|
|
||||||
|
|
||||||
|
bodyParam[List[User]]("body").description("")
|
||||||
println("body: " + body)
|
println("body: " + body)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val loginUserOperation = (apiOperation[String]("loginUser")
|
|
||||||
summary "Logs user into the system"
|
|
||||||
parameters(queryParam[String]("username").description("").optional,
|
|
||||||
queryParam[String]("password").description("").optional)
|
|
||||||
)
|
|
||||||
|
|
||||||
get("/user/login",operation(loginUserOperation)) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val username = params.getAs[String]("username")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("username: " + username)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val password = params.getAs[String]("password")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("password: " + password)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val logoutUserOperation = (apiOperation[Unit]("logoutUser")
|
|
||||||
summary "Logs out current logged in user session"
|
|
||||||
parameters()
|
|
||||||
)
|
|
||||||
|
|
||||||
get("/user/logout",operation(logoutUserOperation)) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val getUserByNameOperation = (apiOperation[User]("getUserByName")
|
|
||||||
summary "Get user by user name"
|
|
||||||
parameters(pathParam[String]("username").description(""))
|
|
||||||
)
|
|
||||||
|
|
||||||
get("/user/{username}",operation(getUserByNameOperation)) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val username = params.getOrElse("username", halt(400))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("username: " + username)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val updateUserOperation = (apiOperation[Unit]("updateUser")
|
|
||||||
summary "Updated user"
|
|
||||||
parameters(pathParam[String]("username").description(""),
|
|
||||||
bodyParam[User]("body").description("").optional)
|
|
||||||
)
|
|
||||||
|
|
||||||
put("/user/{username}",operation(updateUserOperation)) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val username = params.getOrElse("username", halt(400))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
println("username: " + username)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bodyParam[User]("body").description("").optional
|
|
||||||
|
|
||||||
println("body: " + body)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val deleteUserOperation = (apiOperation[Unit]("deleteUser")
|
val deleteUserOperation = (apiOperation[Unit]("deleteUser")
|
||||||
summary "Delete user"
|
summary "Delete user"
|
||||||
parameters(pathParam[String]("username").description(""))
|
parameters (pathParam[String]("username").description(""))
|
||||||
)
|
)
|
||||||
|
|
||||||
delete("/user/{username}",operation(deleteUserOperation)) {
|
delete("/user/{username}", operation(deleteUserOperation)) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val username = params.getOrElse("username", halt(400))
|
val username = params.getOrElse("username", halt(400))
|
||||||
|
|
||||||
|
println("username: " + username)
|
||||||
|
}
|
||||||
|
|
||||||
|
val getUserByNameOperation = (apiOperation[User]("getUserByName")
|
||||||
|
summary "Get user by user name"
|
||||||
|
parameters (pathParam[String]("username").description(""))
|
||||||
|
)
|
||||||
|
|
||||||
|
get("/user/{username}", operation(getUserByNameOperation)) {
|
||||||
|
|
||||||
|
val username = params.getOrElse("username", halt(400))
|
||||||
|
|
||||||
|
println("username: " + username)
|
||||||
|
}
|
||||||
|
|
||||||
|
val loginUserOperation = (apiOperation[String]("loginUser")
|
||||||
|
summary "Logs user into the system"
|
||||||
|
parameters (queryParam[String]("username").description(""),
|
||||||
|
queryParam[String]("password").description(""))
|
||||||
|
)
|
||||||
|
|
||||||
|
get("/user/login", operation(loginUserOperation)) {
|
||||||
|
|
||||||
|
val username = params.getAs[String]("username")
|
||||||
|
|
||||||
println("username: " + username)
|
println("username: " + username)
|
||||||
|
|
||||||
|
val password = params.getAs[String]("password")
|
||||||
|
|
||||||
|
println("password: " + password)
|
||||||
|
}
|
||||||
|
|
||||||
|
val logoutUserOperation = (apiOperation[Unit]("logoutUser")
|
||||||
|
summary "Logs out current logged in user session"
|
||||||
|
parameters ()
|
||||||
|
)
|
||||||
|
|
||||||
|
get("/user/logout", operation(logoutUserOperation)) {
|
||||||
|
}
|
||||||
|
|
||||||
|
val updateUserOperation = (apiOperation[Unit]("updateUser")
|
||||||
|
summary "Updated user"
|
||||||
|
parameters (pathParam[String]("username").description(""),
|
||||||
|
bodyParam[User]("body").description(""))
|
||||||
|
)
|
||||||
|
|
||||||
|
put("/user/{username}", operation(updateUserOperation)) {
|
||||||
|
|
||||||
|
val username = params.getOrElse("username", halt(400))
|
||||||
|
|
||||||
|
println("username: " + username)
|
||||||
|
|
||||||
|
bodyParam[User]("body").description("")
|
||||||
|
println("body: " + body)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,8 +1,5 @@
|
|||||||
package com.wordnik.client.model
|
package com.wordnik.client.model
|
||||||
|
|
||||||
|
case class Category(
|
||||||
|
id: Option[Long],
|
||||||
case class Category (
|
name: Option[String])
|
||||||
id: Long,
|
|
||||||
name: String
|
|
||||||
)
|
|
||||||
|
@ -2,12 +2,10 @@ package com.wordnik.client.model
|
|||||||
|
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
|
|
||||||
|
case class Order(
|
||||||
case class Order (
|
id: Option[Long],
|
||||||
id: Long,
|
petId: Option[Long],
|
||||||
petId: Long,
|
quantity: Option[Int],
|
||||||
quantity: Int,
|
shipDate: Option[Date],
|
||||||
shipDate: Date,
|
status: Option[String], // Order Status
|
||||||
status: String,
|
complete: Option[Boolean])
|
||||||
complete: Boolean
|
|
||||||
)
|
|
||||||
|
@ -3,12 +3,11 @@ package com.wordnik.client.model
|
|||||||
import com.wordnik.client.model.Category
|
import com.wordnik.client.model.Category
|
||||||
import com.wordnik.client.model.Tag
|
import com.wordnik.client.model.Tag
|
||||||
|
|
||||||
|
case class Pet(
|
||||||
case class Pet (
|
id: Option[Long],
|
||||||
id: Long,
|
category: Option[Category],
|
||||||
category: Category,
|
|
||||||
name: String,
|
name: String,
|
||||||
photoUrls: List[String],
|
photoUrls: List[String],
|
||||||
tags: List[Tag],
|
tags: Option[List[Tag]],
|
||||||
status: String
|
status: Option[String] // pet status in the store
|
||||||
)
|
)
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
package com.wordnik.client.model
|
package com.wordnik.client.model
|
||||||
|
|
||||||
|
case class Tag(
|
||||||
|
id: Option[Long],
|
||||||
case class Tag (
|
name: Option[String])
|
||||||
id: Long,
|
|
||||||
name: String
|
|
||||||
)
|
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
package com.wordnik.client.model
|
package com.wordnik.client.model
|
||||||
|
|
||||||
|
case class User(
|
||||||
|
id: Option[Long],
|
||||||
case class User (
|
username: Option[String],
|
||||||
id: Long,
|
firstName: Option[String],
|
||||||
username: String,
|
lastName: Option[String],
|
||||||
firstName: String,
|
email: Option[String],
|
||||||
lastName: String,
|
password: Option[String],
|
||||||
email: String,
|
phone: Option[String],
|
||||||
password: String,
|
userStatus: Option[Int] // User Status
|
||||||
phone: String,
|
)
|
||||||
userStatus: Int
|
|
||||||
)
|
|
||||||
|
@ -8,85 +8,6 @@ use Silex\Application;
|
|||||||
$app = new Silex\Application();
|
$app = new Silex\Application();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->POST('/user', function(Application $app, Request $request) {
|
|
||||||
|
|
||||||
|
|
||||||
return new Response('How about implementing createUser as a POST method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->POST('/user/createWithArray', function(Application $app, Request $request) {
|
|
||||||
|
|
||||||
|
|
||||||
return new Response('How about implementing createUsersWithArrayInput as a POST method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->POST('/user/createWithList', function(Application $app, Request $request) {
|
|
||||||
|
|
||||||
|
|
||||||
return new Response('How about implementing createUsersWithListInput as a POST method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->GET('/user/login', function(Application $app, Request $request) {
|
|
||||||
$username = $request->get('username'); $password = $request->get('password');
|
|
||||||
|
|
||||||
return new Response('How about implementing loginUser as a GET method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->GET('/user/logout', function(Application $app, Request $request) {
|
|
||||||
|
|
||||||
|
|
||||||
return new Response('How about implementing logoutUser as a GET method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->GET('/user/{username}', function(Application $app, Request $request, $username) {
|
|
||||||
|
|
||||||
|
|
||||||
return new Response('How about implementing getUserByName as a GET method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->PUT('/user/{username}', function(Application $app, Request $request, $username) {
|
|
||||||
|
|
||||||
|
|
||||||
return new Response('How about implementing updateUser as a PUT method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->DELETE('/user/{username}', function(Application $app, Request $request, $username) {
|
|
||||||
|
|
||||||
|
|
||||||
return new Response('How about implementing deleteUser as a DELETE method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->PUT('/pet', function(Application $app, Request $request) {
|
|
||||||
|
|
||||||
|
|
||||||
return new Response('How about implementing updatePet as a PUT method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->POST('/pet', function(Application $app, Request $request) {
|
$app->POST('/pet', function(Application $app, Request $request) {
|
||||||
|
|
||||||
|
|
||||||
@ -94,39 +15,6 @@ $app->POST('/pet', function(Application $app, Request $request) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->GET('/pet/findByStatus', function(Application $app, Request $request) {
|
|
||||||
$status = $request->get('status');
|
|
||||||
|
|
||||||
return new Response('How about implementing findPetsByStatus as a GET method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->GET('/pet/findByTags', function(Application $app, Request $request) {
|
|
||||||
$tags = $request->get('tags');
|
|
||||||
|
|
||||||
return new Response('How about implementing findPetsByTags as a GET method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->GET('/pet/{petId}', function(Application $app, Request $request, $pet_id) {
|
|
||||||
|
|
||||||
|
|
||||||
return new Response('How about implementing getPetById as a GET method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->POST('/pet/{petId}', function(Application $app, Request $request, $pet_id) {
|
|
||||||
|
|
||||||
$name = $request->get('name'); $status = $request->get('status');
|
|
||||||
return new Response('How about implementing updatePetWithForm as a POST method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->DELETE('/pet/{petId}', function(Application $app, Request $request, $pet_id) {
|
$app->DELETE('/pet/{petId}', function(Application $app, Request $request, $pet_id) {
|
||||||
|
|
||||||
|
|
||||||
@ -134,6 +22,40 @@ $app->DELETE('/pet/{petId}', function(Application $app, Request $request, $pet_i
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->GET('/pet/findByStatus', function(Application $app, Request $request) {
|
||||||
|
$status = $request->get('status');
|
||||||
|
|
||||||
|
return new Response('How about implementing findPetsByStatus as a GET method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->GET('/pet/findByTags', function(Application $app, Request $request) {
|
||||||
|
$tags = $request->get('tags');
|
||||||
|
|
||||||
|
return new Response('How about implementing findPetsByTags as a GET method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->GET('/pet/{petId}', function(Application $app, Request $request, $pet_id) {
|
||||||
|
|
||||||
|
|
||||||
|
return new Response('How about implementing getPetById as a GET method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->PUT('/pet', function(Application $app, Request $request) {
|
||||||
|
|
||||||
|
|
||||||
|
return new Response('How about implementing updatePet as a PUT method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->POST('/pet/{petId}', function(Application $app, Request $request, $pet_id) {
|
||||||
|
|
||||||
|
$name = $request->get('name'); $status = $request->get('status');
|
||||||
|
return new Response('How about implementing updatePetWithForm as a POST method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$app->POST('/pet/{petId}/uploadImage', function(Application $app, Request $request, $pet_id) {
|
$app->POST('/pet/{petId}/uploadImage', function(Application $app, Request $request, $pet_id) {
|
||||||
|
|
||||||
@ -142,51 +64,6 @@ $app->POST('/pet/{petId}/uploadImage', function(Application $app, Request $reque
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->GET('/pet/{petId}?testing_byte_array=true', function(Application $app, Request $request, $pet_id) {
|
|
||||||
|
|
||||||
|
|
||||||
return new Response('How about implementing getPetByIdWithByteArray as a GET method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->POST('/pet?testing_byte_array=true', function(Application $app, Request $request) {
|
|
||||||
|
|
||||||
|
|
||||||
return new Response('How about implementing addPetUsingByteArray as a POST method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->GET('/store/inventory', function(Application $app, Request $request) {
|
|
||||||
|
|
||||||
|
|
||||||
return new Response('How about implementing getInventory as a GET method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->POST('/store/order', function(Application $app, Request $request) {
|
|
||||||
|
|
||||||
|
|
||||||
return new Response('How about implementing placeOrder as a POST method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->GET('/store/order/{orderId}', function(Application $app, Request $request, $order_id) {
|
|
||||||
|
|
||||||
|
|
||||||
return new Response('How about implementing getOrderById as a GET method ?');
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->DELETE('/store/order/{orderId}', function(Application $app, Request $request, $order_id) {
|
$app->DELETE('/store/order/{orderId}', function(Application $app, Request $request, $order_id) {
|
||||||
|
|
||||||
|
|
||||||
@ -194,7 +71,81 @@ $app->DELETE('/store/order/{orderId}', function(Application $app, Request $reque
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->GET('/store/inventory', function(Application $app, Request $request) {
|
||||||
|
|
||||||
|
|
||||||
|
return new Response('How about implementing getInventory as a GET method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->GET('/store/order/{orderId}', function(Application $app, Request $request, $order_id) {
|
||||||
|
|
||||||
|
|
||||||
|
return new Response('How about implementing getOrderById as a GET method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->POST('/store/order', function(Application $app, Request $request) {
|
||||||
|
|
||||||
|
|
||||||
|
return new Response('How about implementing placeOrder as a POST method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->POST('/user', function(Application $app, Request $request) {
|
||||||
|
|
||||||
|
|
||||||
|
return new Response('How about implementing createUser as a POST method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->POST('/user/createWithArray', function(Application $app, Request $request) {
|
||||||
|
|
||||||
|
|
||||||
|
return new Response('How about implementing createUsersWithArrayInput as a POST method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->POST('/user/createWithList', function(Application $app, Request $request) {
|
||||||
|
|
||||||
|
|
||||||
|
return new Response('How about implementing createUsersWithListInput as a POST method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->DELETE('/user/{username}', function(Application $app, Request $request, $username) {
|
||||||
|
|
||||||
|
|
||||||
|
return new Response('How about implementing deleteUser as a DELETE method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->GET('/user/{username}', function(Application $app, Request $request, $username) {
|
||||||
|
|
||||||
|
|
||||||
|
return new Response('How about implementing getUserByName as a GET method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->GET('/user/login', function(Application $app, Request $request) {
|
||||||
|
$username = $request->get('username'); $password = $request->get('password');
|
||||||
|
|
||||||
|
return new Response('How about implementing loginUser as a GET method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->GET('/user/logout', function(Application $app, Request $request) {
|
||||||
|
|
||||||
|
|
||||||
|
return new Response('How about implementing logoutUser as a GET method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$app->PUT('/user/{username}', function(Application $app, Request $request, $username) {
|
||||||
|
|
||||||
|
|
||||||
|
return new Response('How about implementing updateUser as a PUT method ?');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$app->run();
|
$app->run();
|
||||||
|
@ -1,25 +1,20 @@
|
|||||||
require 'json'
|
require 'json'
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('POST', '/v2/pets', {
|
MyApp.add_route('POST', '/v2/pet', {
|
||||||
"resourcePath" => "/Pet",
|
"resourcePath" => "/Pet",
|
||||||
"summary" => "Add a new pet to the store",
|
"summary" => "Add a new pet to the store",
|
||||||
"nickname" => "add_pet",
|
"nickname" => "add_pet",
|
||||||
"responseClass" => "void",
|
"responseClass" => "void",
|
||||||
"endpoint" => "/pets",
|
"endpoint" => "/pet",
|
||||||
"notes" => "",
|
"notes" => "",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"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",
|
||||||
"dataType" => "Pet",
|
"dataType" => "Pet",
|
||||||
"paramType" => "body",
|
"paramType" => "body",
|
||||||
}
|
}
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
@ -28,32 +23,26 @@ MyApp.add_route('POST', '/v2/pets', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('DELETE', '/v2/pets/{petId}', {
|
MyApp.add_route('DELETE', '/v2/pet/{petId}', {
|
||||||
"resourcePath" => "/Pet",
|
"resourcePath" => "/Pet",
|
||||||
"summary" => "Deletes a pet",
|
"summary" => "Deletes a pet",
|
||||||
"nickname" => "delete_pet",
|
"nickname" => "delete_pet",
|
||||||
"responseClass" => "void",
|
"responseClass" => "void",
|
||||||
"endpoint" => "/pets/{petId}",
|
"endpoint" => "/pet/{petId}",
|
||||||
"notes" => "",
|
"notes" => "",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "pet_id",
|
"name" => "pet_id",
|
||||||
"description" => "Pet id to delete",
|
"description" => "Pet id to delete",
|
||||||
"dataType" => "int",
|
"dataType" => "int",
|
||||||
"paramType" => "path",
|
"paramType" => "path",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "api_key",
|
"name" => "api_key",
|
||||||
"description" => "",
|
"description" => "",
|
||||||
"dataType" => "string",
|
"dataType" => "string",
|
||||||
"paramType" => "header",
|
"paramType" => "header",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
@ -62,28 +51,23 @@ MyApp.add_route('DELETE', '/v2/pets/{petId}', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('GET', '/v2/pets/findByStatus', {
|
MyApp.add_route('GET', '/v2/pet/findByStatus', {
|
||||||
"resourcePath" => "/Pet",
|
"resourcePath" => "/Pet",
|
||||||
"summary" => "Finds Pets by status",
|
"summary" => "Finds Pets by status",
|
||||||
"nickname" => "find_pets_by_status",
|
"nickname" => "find_pets_by_status",
|
||||||
"responseClass" => "array[Pet]",
|
"responseClass" => "array[Pet]",
|
||||||
"endpoint" => "/pets/findByStatus",
|
"endpoint" => "/pet/findByStatus",
|
||||||
"notes" => "Multiple status values can be provided with comma seperated strings",
|
"notes" => "Multiple status values can be provided with comma separated strings",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "status",
|
"name" => "status",
|
||||||
"description" => "Status values that need to be considered for filter",
|
"description" => "Status values that need to be considered for filter",
|
||||||
"dataType" => "array[string]",
|
"dataType" => "array[string]",
|
||||||
"paramType" => "query",
|
"paramType" => "query",
|
||||||
"collectionFormat" => "multi",
|
"collectionFormat" => "csv",
|
||||||
"allowableValues" => "",
|
"allowableValues" => "",
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
@ -92,28 +76,23 @@ MyApp.add_route('GET', '/v2/pets/findByStatus', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('GET', '/v2/pets/findByTags', {
|
MyApp.add_route('GET', '/v2/pet/findByTags', {
|
||||||
"resourcePath" => "/Pet",
|
"resourcePath" => "/Pet",
|
||||||
"summary" => "Finds Pets by tags",
|
"summary" => "Finds Pets by tags",
|
||||||
"nickname" => "find_pets_by_tags",
|
"nickname" => "find_pets_by_tags",
|
||||||
"responseClass" => "array[Pet]",
|
"responseClass" => "array[Pet]",
|
||||||
"endpoint" => "/pets/findByTags",
|
"endpoint" => "/pet/findByTags",
|
||||||
"notes" => "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.",
|
"notes" => "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "tags",
|
"name" => "tags",
|
||||||
"description" => "Tags to filter by",
|
"description" => "Tags to filter by",
|
||||||
"dataType" => "array[string]",
|
"dataType" => "array[string]",
|
||||||
"paramType" => "query",
|
"paramType" => "query",
|
||||||
"collectionFormat" => "multi",
|
"collectionFormat" => "csv",
|
||||||
"allowableValues" => "",
|
"allowableValues" => "",
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
@ -122,25 +101,20 @@ MyApp.add_route('GET', '/v2/pets/findByTags', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('GET', '/v2/pets/{petId}', {
|
MyApp.add_route('GET', '/v2/pet/{petId}', {
|
||||||
"resourcePath" => "/Pet",
|
"resourcePath" => "/Pet",
|
||||||
"summary" => "Find pet by ID",
|
"summary" => "Find pet by ID",
|
||||||
"nickname" => "get_pet_by_id",
|
"nickname" => "get_pet_by_id",
|
||||||
"responseClass" => "Pet",
|
"responseClass" => "Pet",
|
||||||
"endpoint" => "/pets/{petId}",
|
"endpoint" => "/pet/{petId}",
|
||||||
"notes" => "Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions",
|
"notes" => "Returns a single pet",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "pet_id",
|
"name" => "pet_id",
|
||||||
"description" => "ID of pet that needs to be fetched",
|
"description" => "ID of pet to return",
|
||||||
"dataType" => "int",
|
"dataType" => "int",
|
||||||
"paramType" => "path",
|
"paramType" => "path",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
@ -149,25 +123,20 @@ MyApp.add_route('GET', '/v2/pets/{petId}', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('PUT', '/v2/pets', {
|
MyApp.add_route('PUT', '/v2/pet', {
|
||||||
"resourcePath" => "/Pet",
|
"resourcePath" => "/Pet",
|
||||||
"summary" => "Update an existing pet",
|
"summary" => "Update an existing pet",
|
||||||
"nickname" => "update_pet",
|
"nickname" => "update_pet",
|
||||||
"responseClass" => "void",
|
"responseClass" => "void",
|
||||||
"endpoint" => "/pets",
|
"endpoint" => "/pet",
|
||||||
"notes" => "",
|
"notes" => "",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"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",
|
||||||
"dataType" => "Pet",
|
"dataType" => "Pet",
|
||||||
"paramType" => "body",
|
"paramType" => "body",
|
||||||
}
|
}
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
@ -176,25 +145,42 @@ MyApp.add_route('PUT', '/v2/pets', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('POST', '/v2/pets/{petId}', {
|
MyApp.add_route('POST', '/v2/pet/{petId}', {
|
||||||
"resourcePath" => "/Pet",
|
"resourcePath" => "/Pet",
|
||||||
"summary" => "Updates a pet in the store with form data",
|
"summary" => "Updates a pet in the store with form data",
|
||||||
"nickname" => "update_pet_with_form",
|
"nickname" => "update_pet_with_form",
|
||||||
"responseClass" => "void",
|
"responseClass" => "void",
|
||||||
"endpoint" => "/pets/{petId}",
|
"endpoint" => "/pet/{petId}",
|
||||||
"notes" => "",
|
"notes" => "",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "pet_id",
|
"name" => "pet_id",
|
||||||
"description" => "ID of pet that needs to be updated",
|
"description" => "ID of pet that needs to be updated",
|
||||||
"dataType" => "string",
|
"dataType" => "int",
|
||||||
|
"paramType" => "path",
|
||||||
|
},
|
||||||
|
]}) do
|
||||||
|
cross_origin
|
||||||
|
# the guts live here
|
||||||
|
|
||||||
|
{"message" => "yes, it worked"}.to_json
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
MyApp.add_route('POST', '/v2/pet/{petId}/uploadImage', {
|
||||||
|
"resourcePath" => "/Pet",
|
||||||
|
"summary" => "uploads an image",
|
||||||
|
"nickname" => "upload_file",
|
||||||
|
"responseClass" => "ApiResponse",
|
||||||
|
"endpoint" => "/pet/{petId}/uploadImage",
|
||||||
|
"notes" => "",
|
||||||
|
"parameters" => [
|
||||||
|
{
|
||||||
|
"name" => "pet_id",
|
||||||
|
"description" => "ID of pet to update",
|
||||||
|
"dataType" => "int",
|
||||||
"paramType" => "path",
|
"paramType" => "path",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
|
@ -1,25 +1,20 @@
|
|||||||
require 'json'
|
require 'json'
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('DELETE', '/v2/stores/order/{orderId}', {
|
MyApp.add_route('DELETE', '/v2/store/order/{orderId}', {
|
||||||
"resourcePath" => "/Store",
|
"resourcePath" => "/Store",
|
||||||
"summary" => "Delete purchase order by ID",
|
"summary" => "Delete purchase order by ID",
|
||||||
"nickname" => "delete_order",
|
"nickname" => "delete_order",
|
||||||
"responseClass" => "void",
|
"responseClass" => "void",
|
||||||
"endpoint" => "/stores/order/{orderId}",
|
"endpoint" => "/store/order/{orderId}",
|
||||||
"notes" => "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
|
"notes" => "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "order_id",
|
"name" => "order_id",
|
||||||
"description" => "ID of the order that needs to be deleted",
|
"description" => "ID of the order that needs to be deleted",
|
||||||
"dataType" => "string",
|
"dataType" => "string",
|
||||||
"paramType" => "path",
|
"paramType" => "path",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
@ -28,25 +23,36 @@ MyApp.add_route('DELETE', '/v2/stores/order/{orderId}', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('GET', '/v2/stores/order/{orderId}', {
|
MyApp.add_route('GET', '/v2/store/inventory', {
|
||||||
|
"resourcePath" => "/Store",
|
||||||
|
"summary" => "Returns pet inventories by status",
|
||||||
|
"nickname" => "get_inventory",
|
||||||
|
"responseClass" => "map[string,int]",
|
||||||
|
"endpoint" => "/store/inventory",
|
||||||
|
"notes" => "Returns a map of status codes to quantities",
|
||||||
|
"parameters" => [
|
||||||
|
]}) do
|
||||||
|
cross_origin
|
||||||
|
# the guts live here
|
||||||
|
|
||||||
|
{"message" => "yes, it worked"}.to_json
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
MyApp.add_route('GET', '/v2/store/order/{orderId}', {
|
||||||
"resourcePath" => "/Store",
|
"resourcePath" => "/Store",
|
||||||
"summary" => "Find purchase order by ID",
|
"summary" => "Find purchase order by ID",
|
||||||
"nickname" => "get_order_by_id",
|
"nickname" => "get_order_by_id",
|
||||||
"responseClass" => "Order",
|
"responseClass" => "Order",
|
||||||
"endpoint" => "/stores/order/{orderId}",
|
"endpoint" => "/store/order/{orderId}",
|
||||||
"notes" => "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions",
|
"notes" => "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "order_id",
|
"name" => "order_id",
|
||||||
"description" => "ID of pet that needs to be fetched",
|
"description" => "ID of pet that needs to be fetched",
|
||||||
"dataType" => "string",
|
"dataType" => "int",
|
||||||
"paramType" => "path",
|
"paramType" => "path",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
@ -55,25 +61,20 @@ MyApp.add_route('GET', '/v2/stores/order/{orderId}', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('POST', '/v2/stores/order', {
|
MyApp.add_route('POST', '/v2/store/order', {
|
||||||
"resourcePath" => "/Store",
|
"resourcePath" => "/Store",
|
||||||
"summary" => "Place an order for a pet",
|
"summary" => "Place an order for a pet",
|
||||||
"nickname" => "place_order",
|
"nickname" => "place_order",
|
||||||
"responseClass" => "Order",
|
"responseClass" => "Order",
|
||||||
"endpoint" => "/stores/order",
|
"endpoint" => "/store/order",
|
||||||
"notes" => "",
|
"notes" => "",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "body",
|
"name" => "body",
|
||||||
"description" => "order placed for purchasing the pet",
|
"description" => "order placed for purchasing the pet",
|
||||||
"dataType" => "Order",
|
"dataType" => "Order",
|
||||||
"paramType" => "body",
|
"paramType" => "body",
|
||||||
}
|
}
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
|
@ -1,25 +1,20 @@
|
|||||||
require 'json'
|
require 'json'
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('POST', '/v2/users', {
|
MyApp.add_route('POST', '/v2/user', {
|
||||||
"resourcePath" => "/User",
|
"resourcePath" => "/User",
|
||||||
"summary" => "Create user",
|
"summary" => "Create user",
|
||||||
"nickname" => "create_user",
|
"nickname" => "create_user",
|
||||||
"responseClass" => "void",
|
"responseClass" => "void",
|
||||||
"endpoint" => "/users",
|
"endpoint" => "/user",
|
||||||
"notes" => "This can only be done by the logged in user.",
|
"notes" => "This can only be done by the logged in user.",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "body",
|
"name" => "body",
|
||||||
"description" => "Created user object",
|
"description" => "Created user object",
|
||||||
"dataType" => "User",
|
"dataType" => "User",
|
||||||
"paramType" => "body",
|
"paramType" => "body",
|
||||||
}
|
}
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
@ -28,25 +23,20 @@ MyApp.add_route('POST', '/v2/users', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('POST', '/v2/users/createWithArray', {
|
MyApp.add_route('POST', '/v2/user/createWithArray', {
|
||||||
"resourcePath" => "/User",
|
"resourcePath" => "/User",
|
||||||
"summary" => "Creates list of users with given input array",
|
"summary" => "Creates list of users with given input array",
|
||||||
"nickname" => "create_users_with_array_input",
|
"nickname" => "create_users_with_array_input",
|
||||||
"responseClass" => "void",
|
"responseClass" => "void",
|
||||||
"endpoint" => "/users/createWithArray",
|
"endpoint" => "/user/createWithArray",
|
||||||
"notes" => "",
|
"notes" => "",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "body",
|
"name" => "body",
|
||||||
"description" => "List of user object",
|
"description" => "List of user object",
|
||||||
"dataType" => "array[User]",
|
"dataType" => "array[User]",
|
||||||
"paramType" => "body",
|
"paramType" => "body",
|
||||||
}
|
}
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
@ -55,25 +45,20 @@ MyApp.add_route('POST', '/v2/users/createWithArray', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('POST', '/v2/users/createWithList', {
|
MyApp.add_route('POST', '/v2/user/createWithList', {
|
||||||
"resourcePath" => "/User",
|
"resourcePath" => "/User",
|
||||||
"summary" => "Creates list of users with given input array",
|
"summary" => "Creates list of users with given input array",
|
||||||
"nickname" => "create_users_with_list_input",
|
"nickname" => "create_users_with_list_input",
|
||||||
"responseClass" => "void",
|
"responseClass" => "void",
|
||||||
"endpoint" => "/users/createWithList",
|
"endpoint" => "/user/createWithList",
|
||||||
"notes" => "",
|
"notes" => "",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "body",
|
"name" => "body",
|
||||||
"description" => "List of user object",
|
"description" => "List of user object",
|
||||||
"dataType" => "array[User]",
|
"dataType" => "array[User]",
|
||||||
"paramType" => "body",
|
"paramType" => "body",
|
||||||
}
|
}
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
@ -82,25 +67,20 @@ MyApp.add_route('POST', '/v2/users/createWithList', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('DELETE', '/v2/users/{username}', {
|
MyApp.add_route('DELETE', '/v2/user/{username}', {
|
||||||
"resourcePath" => "/User",
|
"resourcePath" => "/User",
|
||||||
"summary" => "Delete user",
|
"summary" => "Delete user",
|
||||||
"nickname" => "delete_user",
|
"nickname" => "delete_user",
|
||||||
"responseClass" => "void",
|
"responseClass" => "void",
|
||||||
"endpoint" => "/users/{username}",
|
"endpoint" => "/user/{username}",
|
||||||
"notes" => "This can only be done by the logged in user.",
|
"notes" => "This can only be done by the logged in user.",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "username",
|
"name" => "username",
|
||||||
"description" => "The name that needs to be deleted",
|
"description" => "The name that needs to be deleted",
|
||||||
"dataType" => "string",
|
"dataType" => "string",
|
||||||
"paramType" => "path",
|
"paramType" => "path",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
@ -109,25 +89,20 @@ MyApp.add_route('DELETE', '/v2/users/{username}', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('GET', '/v2/users/{username}', {
|
MyApp.add_route('GET', '/v2/user/{username}', {
|
||||||
"resourcePath" => "/User",
|
"resourcePath" => "/User",
|
||||||
"summary" => "Get user by user name",
|
"summary" => "Get user by user name",
|
||||||
"nickname" => "get_user_by_name",
|
"nickname" => "get_user_by_name",
|
||||||
"responseClass" => "User",
|
"responseClass" => "User",
|
||||||
"endpoint" => "/users/{username}",
|
"endpoint" => "/user/{username}",
|
||||||
"notes" => "",
|
"notes" => "",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "username",
|
"name" => "username",
|
||||||
"description" => "The name that needs to be fetched. Use user1 for testing.",
|
"description" => "The name that needs to be fetched. Use user1 for testing. ",
|
||||||
"dataType" => "string",
|
"dataType" => "string",
|
||||||
"paramType" => "path",
|
"paramType" => "path",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
@ -136,15 +111,14 @@ MyApp.add_route('GET', '/v2/users/{username}', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('GET', '/v2/users/login', {
|
MyApp.add_route('GET', '/v2/user/login', {
|
||||||
"resourcePath" => "/User",
|
"resourcePath" => "/User",
|
||||||
"summary" => "Logs user into the system",
|
"summary" => "Logs user into the system",
|
||||||
"nickname" => "login_user",
|
"nickname" => "login_user",
|
||||||
"responseClass" => "string",
|
"responseClass" => "string",
|
||||||
"endpoint" => "/users/login",
|
"endpoint" => "/user/login",
|
||||||
"notes" => "",
|
"notes" => "",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "username",
|
"name" => "username",
|
||||||
"description" => "The user name for login",
|
"description" => "The user name for login",
|
||||||
@ -154,7 +128,6 @@ MyApp.add_route('GET', '/v2/users/login', {
|
|||||||
"allowableValues" => "",
|
"allowableValues" => "",
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "password",
|
"name" => "password",
|
||||||
"description" => "The password for login in clear text",
|
"description" => "The password for login in clear text",
|
||||||
@ -164,10 +137,6 @@ MyApp.add_route('GET', '/v2/users/login', {
|
|||||||
"allowableValues" => "",
|
"allowableValues" => "",
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
@ -176,18 +145,14 @@ MyApp.add_route('GET', '/v2/users/login', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('GET', '/v2/users/logout', {
|
MyApp.add_route('GET', '/v2/user/logout', {
|
||||||
"resourcePath" => "/User",
|
"resourcePath" => "/User",
|
||||||
"summary" => "Logs out current logged in user session",
|
"summary" => "Logs out current logged in user session",
|
||||||
"nickname" => "logout_user",
|
"nickname" => "logout_user",
|
||||||
"responseClass" => "void",
|
"responseClass" => "void",
|
||||||
"endpoint" => "/users/logout",
|
"endpoint" => "/user/logout",
|
||||||
"notes" => "",
|
"notes" => "",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
@ -196,32 +161,26 @@ MyApp.add_route('GET', '/v2/users/logout', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
MyApp.add_route('PUT', '/v2/users/{username}', {
|
MyApp.add_route('PUT', '/v2/user/{username}', {
|
||||||
"resourcePath" => "/User",
|
"resourcePath" => "/User",
|
||||||
"summary" => "Updated user",
|
"summary" => "Updated user",
|
||||||
"nickname" => "update_user",
|
"nickname" => "update_user",
|
||||||
"responseClass" => "void",
|
"responseClass" => "void",
|
||||||
"endpoint" => "/users/{username}",
|
"endpoint" => "/user/{username}",
|
||||||
"notes" => "This can only be done by the logged in user.",
|
"notes" => "This can only be done by the logged in user.",
|
||||||
"parameters" => [
|
"parameters" => [
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "username",
|
"name" => "username",
|
||||||
"description" => "name that need to be deleted",
|
"description" => "name that need to be deleted",
|
||||||
"dataType" => "string",
|
"dataType" => "string",
|
||||||
"paramType" => "path",
|
"paramType" => "path",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"name" => "body",
|
"name" => "body",
|
||||||
"description" => "Updated user object",
|
"description" => "Updated user object",
|
||||||
"dataType" => "User",
|
"dataType" => "User",
|
||||||
"paramType" => "body",
|
"paramType" => "body",
|
||||||
}
|
}
|
||||||
|
|
||||||
]}) do
|
]}) do
|
||||||
cross_origin
|
cross_origin
|
||||||
# the guts live here
|
# the guts live here
|
||||||
|
@ -1,23 +1,37 @@
|
|||||||
---
|
---
|
||||||
swagger: "2.0"
|
swagger: "2.0"
|
||||||
info:
|
info:
|
||||||
description: "This is a sample server Petstore server.\n\n[Learn about Swagger](http://swagger.io)\
|
description: "This is a sample server Petstore server. You can find out more about\
|
||||||
\ or join the IRC channel `#swagger` on irc.freenode.net.\n\nFor this sample,\
|
\ Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\
|
||||||
\ you can use the api key `special-key` to test the authorization filters\n"
|
\ For this sample, you can use the api key `special-key` to test the authorization\
|
||||||
|
\ filters."
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
title: "Swagger Petstore"
|
title: "Swagger Petstore"
|
||||||
termsOfService: "http://helloreverb.com/terms/"
|
termsOfService: "http://swagger.io/terms/"
|
||||||
contact:
|
contact:
|
||||||
name: "apiteam@swagger.io"
|
email: "apiteam@swagger.io"
|
||||||
license:
|
license:
|
||||||
name: "Apache 2.0"
|
name: "Apache 2.0"
|
||||||
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:
|
||||||
/pets:
|
/pet:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
@ -28,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:
|
||||||
@ -42,8 +56,8 @@ paths:
|
|||||||
description: "Invalid input"
|
description: "Invalid input"
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write_pets"
|
- "write:pets"
|
||||||
- "read_pets"
|
- "read:pets"
|
||||||
put:
|
put:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
@ -54,13 +68,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:
|
||||||
@ -72,27 +86,32 @@ paths:
|
|||||||
description: "Validation exception"
|
description: "Validation exception"
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write_pets"
|
- "write:pets"
|
||||||
- "read_pets"
|
- "read:pets"
|
||||||
/pets/findByStatus:
|
/pet/findByStatus:
|
||||||
get:
|
get:
|
||||||
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"
|
||||||
|
enum:
|
||||||
|
- "available"
|
||||||
|
- "pending"
|
||||||
|
- "sold"
|
||||||
|
collectionFormat: "csv"
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
@ -104,28 +123,28 @@ paths:
|
|||||||
description: "Invalid status value"
|
description: "Invalid status value"
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write_pets"
|
- "write:pets"
|
||||||
- "read_pets"
|
- "read:pets"
|
||||||
/pets/findByTags:
|
/pet/findByTags:
|
||||||
get:
|
get:
|
||||||
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"
|
||||||
@ -137,23 +156,22 @@ paths:
|
|||||||
description: "Invalid tag value"
|
description: "Invalid tag value"
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write_pets"
|
- "write:pets"
|
||||||
- "read_pets"
|
- "read:pets"
|
||||||
/pets/{petId}:
|
/pet/{petId}:
|
||||||
get:
|
get:
|
||||||
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"
|
||||||
@ -168,9 +186,6 @@ paths:
|
|||||||
description: "Pet not found"
|
description: "Pet not found"
|
||||||
security:
|
security:
|
||||||
- api_key: []
|
- api_key: []
|
||||||
- petstore_auth:
|
|
||||||
- "write_pets"
|
|
||||||
- "read_pets"
|
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
@ -180,31 +195,32 @@ 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"
|
||||||
required: true
|
required: false
|
||||||
type: "string"
|
type: "string"
|
||||||
- name: "status"
|
- name: "status"
|
||||||
in: "formData"
|
in: "formData"
|
||||||
description: "Updated status of the pet"
|
description: "Updated status of the pet"
|
||||||
required: true
|
required: false
|
||||||
type: "string"
|
type: "string"
|
||||||
responses:
|
responses:
|
||||||
405:
|
405:
|
||||||
description: "Invalid input"
|
description: "Invalid input"
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write_pets"
|
- "write:pets"
|
||||||
- "read_pets"
|
- "read:pets"
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- "pet"
|
- "pet"
|
||||||
@ -212,13 +228,12 @@ 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: true
|
|
||||||
type: "string"
|
type: "string"
|
||||||
- name: "petId"
|
- name: "petId"
|
||||||
in: "path"
|
in: "path"
|
||||||
@ -231,9 +246,66 @@ paths:
|
|||||||
description: "Invalid pet value"
|
description: "Invalid pet value"
|
||||||
security:
|
security:
|
||||||
- petstore_auth:
|
- petstore_auth:
|
||||||
- "write_pets"
|
- "write:pets"
|
||||||
- "read_pets"
|
- "read:pets"
|
||||||
/stores/order:
|
/pet/{petId}/uploadImage:
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- "pet"
|
||||||
|
summary: "uploads an image"
|
||||||
|
description: ""
|
||||||
|
operationId: "uploadFile"
|
||||||
|
consumes:
|
||||||
|
- "multipart/form-data"
|
||||||
|
produces:
|
||||||
|
- "application/json"
|
||||||
|
parameters:
|
||||||
|
- name: "petId"
|
||||||
|
in: "path"
|
||||||
|
description: "ID of pet to update"
|
||||||
|
required: true
|
||||||
|
type: "integer"
|
||||||
|
format: "int64"
|
||||||
|
- name: "additionalMetadata"
|
||||||
|
in: "formData"
|
||||||
|
description: "Additional data to pass to server"
|
||||||
|
required: false
|
||||||
|
type: "string"
|
||||||
|
- name: "file"
|
||||||
|
in: "formData"
|
||||||
|
description: "file to upload"
|
||||||
|
required: false
|
||||||
|
type: "file"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: "successful operation"
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/ApiResponse"
|
||||||
|
security:
|
||||||
|
- petstore_auth:
|
||||||
|
- "write:pets"
|
||||||
|
- "read:pets"
|
||||||
|
/store/inventory:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- "store"
|
||||||
|
summary: "Returns pet inventories by status"
|
||||||
|
description: "Returns a map of status codes to quantities"
|
||||||
|
operationId: "getInventory"
|
||||||
|
produces:
|
||||||
|
- "application/json"
|
||||||
|
parameters: []
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: "successful operation"
|
||||||
|
schema:
|
||||||
|
type: "object"
|
||||||
|
additionalProperties:
|
||||||
|
type: "integer"
|
||||||
|
format: "int32"
|
||||||
|
security:
|
||||||
|
- api_key: []
|
||||||
|
/store/order:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "store"
|
- "store"
|
||||||
@ -241,13 +313,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:
|
||||||
@ -257,7 +329,7 @@ paths:
|
|||||||
$ref: "#/definitions/Order"
|
$ref: "#/definitions/Order"
|
||||||
400:
|
400:
|
||||||
description: "Invalid Order"
|
description: "Invalid Order"
|
||||||
/stores/order/{orderId}:
|
/store/order/{orderId}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "store"
|
- "store"
|
||||||
@ -266,14 +338,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"
|
||||||
@ -291,20 +366,21 @@ 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"
|
||||||
404:
|
404:
|
||||||
description: "Order not found"
|
description: "Order not found"
|
||||||
/users:
|
/user:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
@ -312,19 +388,19 @@ 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:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
/users/createWithArray:
|
/user/createWithArray:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
@ -332,13 +408,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:
|
||||||
@ -346,7 +422,7 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
/users/createWithList:
|
/user/createWithList:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
@ -354,13 +430,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:
|
||||||
@ -368,7 +444,7 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
/users/login:
|
/user/login:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
@ -376,27 +452,36 @@ 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"
|
||||||
/users/logout:
|
/user/logout:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
@ -404,13 +489,13 @@ paths:
|
|||||||
description: ""
|
description: ""
|
||||||
operationId: "logoutUser"
|
operationId: "logoutUser"
|
||||||
produces:
|
produces:
|
||||||
- "application/json"
|
|
||||||
- "application/xml"
|
- "application/xml"
|
||||||
|
- "application/json"
|
||||||
parameters: []
|
parameters: []
|
||||||
responses:
|
responses:
|
||||||
default:
|
default:
|
||||||
description: "successful operation"
|
description: "successful operation"
|
||||||
/users/{username}:
|
/user/{username}:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- "user"
|
- "user"
|
||||||
@ -418,12 +503,12 @@ 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"
|
||||||
description: "The name that needs to be fetched. Use user1 for testing."
|
description: "The name that needs to be fetched. Use user1 for testing. "
|
||||||
required: true
|
required: true
|
||||||
type: "string"
|
type: "string"
|
||||||
responses:
|
responses:
|
||||||
@ -442,8 +527,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"
|
||||||
@ -453,7 +538,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:
|
||||||
@ -468,8 +553,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"
|
||||||
@ -491,9 +576,46 @@ securityDefinitions:
|
|||||||
authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog"
|
authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog"
|
||||||
flow: "implicit"
|
flow: "implicit"
|
||||||
scopes:
|
scopes:
|
||||||
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"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
@ -516,7 +638,9 @@ definitions:
|
|||||||
type: "integer"
|
type: "integer"
|
||||||
format: "int32"
|
format: "int32"
|
||||||
description: "User Status"
|
description: "User Status"
|
||||||
Category:
|
xml:
|
||||||
|
name: "User"
|
||||||
|
Tag:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
@ -524,6 +648,8 @@ definitions:
|
|||||||
format: "int64"
|
format: "int64"
|
||||||
name:
|
name:
|
||||||
type: "string"
|
type: "string"
|
||||||
|
xml:
|
||||||
|
name: "Tag"
|
||||||
Pet:
|
Pet:
|
||||||
type: "object"
|
type: "object"
|
||||||
required:
|
required:
|
||||||
@ -540,40 +666,37 @@ definitions:
|
|||||||
example: "doggie"
|
example: "doggie"
|
||||||
photoUrls:
|
photoUrls:
|
||||||
type: "array"
|
type: "array"
|
||||||
|
xml:
|
||||||
|
name: "photoUrl"
|
||||||
|
wrapped: true
|
||||||
items:
|
items:
|
||||||
type: "string"
|
type: "string"
|
||||||
tags:
|
tags:
|
||||||
type: "array"
|
type: "array"
|
||||||
|
xml:
|
||||||
|
name: "tag"
|
||||||
|
wrapped: true
|
||||||
items:
|
items:
|
||||||
$ref: "#/definitions/Tag"
|
$ref: "#/definitions/Tag"
|
||||||
status:
|
status:
|
||||||
type: "string"
|
type: "string"
|
||||||
description: "pet status in the store"
|
description: "pet status in the store"
|
||||||
Tag:
|
enum:
|
||||||
|
- "available"
|
||||||
|
- "pending"
|
||||||
|
- "sold"
|
||||||
|
xml:
|
||||||
|
name: "Pet"
|
||||||
|
ApiResponse:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
id:
|
code:
|
||||||
type: "integer"
|
|
||||||
format: "int64"
|
|
||||||
name:
|
|
||||||
type: "string"
|
|
||||||
Order:
|
|
||||||
type: "object"
|
|
||||||
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:
|
||||||
complete:
|
description: "Find out more about Swagger"
|
||||||
type: "boolean"
|
url: "http://swagger.io"
|
||||||
|
@ -9,11 +9,205 @@ require_once __DIR__ . '/vendor/autoload.php';
|
|||||||
$app = new Slim\App();
|
$app = new Slim\App();
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST addPet
|
||||||
|
* Summary: Add a new pet to the store
|
||||||
|
* Notes:
|
||||||
|
* Output-Formats: [application/xml, application/json]
|
||||||
|
*/
|
||||||
|
$app->POST('/pet', function($request, $response, $args) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$body = $request->getParsedBody();
|
||||||
|
$response->write('How about implementing addPet as a POST method ?');
|
||||||
|
return $response;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DELETE deletePet
|
||||||
|
* Summary: Deletes a pet
|
||||||
|
* Notes:
|
||||||
|
* Output-Formats: [application/xml, application/json]
|
||||||
|
*/
|
||||||
|
$app->DELETE('/pet/{petId}', function($request, $response, $args) {
|
||||||
|
$headers = $request->getHeaders();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$response->write('How about implementing deletePet as a DELETE method ?');
|
||||||
|
return $response;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET findPetsByStatus
|
||||||
|
* Summary: Finds Pets by status
|
||||||
|
* Notes: Multiple status values can be provided with comma separated strings
|
||||||
|
* Output-Formats: [application/xml, application/json]
|
||||||
|
*/
|
||||||
|
$app->GET('/pet/findByStatus', function($request, $response, $args) {
|
||||||
|
|
||||||
|
$queryParams = $request->getQueryParams();
|
||||||
|
$status = $queryParams['status'];
|
||||||
|
|
||||||
|
|
||||||
|
$response->write('How about implementing findPetsByStatus as a GET method ?');
|
||||||
|
return $response;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET findPetsByTags
|
||||||
|
* Summary: Finds Pets by tags
|
||||||
|
* Notes: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
* Output-Formats: [application/xml, application/json]
|
||||||
|
*/
|
||||||
|
$app->GET('/pet/findByTags', function($request, $response, $args) {
|
||||||
|
|
||||||
|
$queryParams = $request->getQueryParams();
|
||||||
|
$tags = $queryParams['tags'];
|
||||||
|
|
||||||
|
|
||||||
|
$response->write('How about implementing findPetsByTags as a GET method ?');
|
||||||
|
return $response;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET getPetById
|
||||||
|
* Summary: Find pet by ID
|
||||||
|
* Notes: Returns a single pet
|
||||||
|
* Output-Formats: [application/xml, application/json]
|
||||||
|
*/
|
||||||
|
$app->GET('/pet/{petId}', function($request, $response, $args) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$response->write('How about implementing getPetById as a GET method ?');
|
||||||
|
return $response;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PUT updatePet
|
||||||
|
* Summary: Update an existing pet
|
||||||
|
* Notes:
|
||||||
|
* Output-Formats: [application/xml, application/json]
|
||||||
|
*/
|
||||||
|
$app->PUT('/pet', function($request, $response, $args) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$body = $request->getParsedBody();
|
||||||
|
$response->write('How about implementing updatePet as a PUT method ?');
|
||||||
|
return $response;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST updatePetWithForm
|
||||||
|
* Summary: Updates a pet in the store with form data
|
||||||
|
* Notes:
|
||||||
|
* Output-Formats: [application/xml, application/json]
|
||||||
|
*/
|
||||||
|
$app->POST('/pet/{petId}', function($request, $response, $args) {
|
||||||
|
|
||||||
|
|
||||||
|
$name = $args['name']; $status = $args['status'];
|
||||||
|
|
||||||
|
$response->write('How about implementing updatePetWithForm as a POST method ?');
|
||||||
|
return $response;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST uploadFile
|
||||||
|
* Summary: uploads an image
|
||||||
|
* Notes:
|
||||||
|
* Output-Formats: [application/json]
|
||||||
|
*/
|
||||||
|
$app->POST('/pet/{petId}/uploadImage', function($request, $response, $args) {
|
||||||
|
|
||||||
|
|
||||||
|
$additionalMetadata = $args['additionalMetadata']; $file = $args['file'];
|
||||||
|
|
||||||
|
$response->write('How about implementing uploadFile as a POST method ?');
|
||||||
|
return $response;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DELETE deleteOrder
|
||||||
|
* Summary: Delete purchase order by ID
|
||||||
|
* Notes: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
|
* Output-Formats: [application/xml, application/json]
|
||||||
|
*/
|
||||||
|
$app->DELETE('/store/order/{orderId}', function($request, $response, $args) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$response->write('How about implementing deleteOrder as a DELETE method ?');
|
||||||
|
return $response;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET getInventory
|
||||||
|
* Summary: Returns pet inventories by status
|
||||||
|
* Notes: Returns a map of status codes to quantities
|
||||||
|
* Output-Formats: [application/json]
|
||||||
|
*/
|
||||||
|
$app->GET('/store/inventory', function($request, $response, $args) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$response->write('How about implementing getInventory as a GET method ?');
|
||||||
|
return $response;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET getOrderById
|
||||||
|
* Summary: Find purchase order by ID
|
||||||
|
* Notes: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||||
|
* Output-Formats: [application/xml, application/json]
|
||||||
|
*/
|
||||||
|
$app->GET('/store/order/{orderId}', function($request, $response, $args) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$response->write('How about implementing getOrderById as a GET method ?');
|
||||||
|
return $response;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POST placeOrder
|
||||||
|
* Summary: Place an order for a pet
|
||||||
|
* Notes:
|
||||||
|
* Output-Formats: [application/xml, application/json]
|
||||||
|
*/
|
||||||
|
$app->POST('/store/order', function($request, $response, $args) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$body = $request->getParsedBody();
|
||||||
|
$response->write('How about implementing placeOrder as a POST method ?');
|
||||||
|
return $response;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POST createUser
|
* POST createUser
|
||||||
* Summary: Create user
|
* Summary: Create user
|
||||||
* Notes: This can only be done by the logged in user.
|
* Notes: This can only be done by the logged in user.
|
||||||
* Output-Formats: [application/json, application/xml]
|
* Output-Formats: [application/xml, application/json]
|
||||||
*/
|
*/
|
||||||
$app->POST('/user', function($request, $response, $args) {
|
$app->POST('/user', function($request, $response, $args) {
|
||||||
|
|
||||||
@ -29,7 +223,7 @@ $app->POST('/user', function($request, $response, $args) {
|
|||||||
* POST createUsersWithArrayInput
|
* POST createUsersWithArrayInput
|
||||||
* Summary: Creates list of users with given input array
|
* Summary: Creates list of users with given input array
|
||||||
* Notes:
|
* Notes:
|
||||||
* Output-Formats: [application/json, application/xml]
|
* Output-Formats: [application/xml, application/json]
|
||||||
*/
|
*/
|
||||||
$app->POST('/user/createWithArray', function($request, $response, $args) {
|
$app->POST('/user/createWithArray', function($request, $response, $args) {
|
||||||
|
|
||||||
@ -45,7 +239,7 @@ $app->POST('/user/createWithArray', function($request, $response, $args) {
|
|||||||
* POST createUsersWithListInput
|
* POST createUsersWithListInput
|
||||||
* Summary: Creates list of users with given input array
|
* Summary: Creates list of users with given input array
|
||||||
* Notes:
|
* Notes:
|
||||||
* Output-Formats: [application/json, application/xml]
|
* Output-Formats: [application/xml, application/json]
|
||||||
*/
|
*/
|
||||||
$app->POST('/user/createWithList', function($request, $response, $args) {
|
$app->POST('/user/createWithList', function($request, $response, $args) {
|
||||||
|
|
||||||
@ -57,11 +251,43 @@ $app->POST('/user/createWithList', function($request, $response, $args) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DELETE deleteUser
|
||||||
|
* Summary: Delete user
|
||||||
|
* Notes: This can only be done by the logged in user.
|
||||||
|
* Output-Formats: [application/xml, application/json]
|
||||||
|
*/
|
||||||
|
$app->DELETE('/user/{username}', function($request, $response, $args) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$response->write('How about implementing deleteUser as a DELETE method ?');
|
||||||
|
return $response;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GET getUserByName
|
||||||
|
* Summary: Get user by user name
|
||||||
|
* Notes:
|
||||||
|
* Output-Formats: [application/xml, application/json]
|
||||||
|
*/
|
||||||
|
$app->GET('/user/{username}', function($request, $response, $args) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$response->write('How about implementing getUserByName as a GET method ?');
|
||||||
|
return $response;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GET loginUser
|
* GET loginUser
|
||||||
* Summary: Logs user into the system
|
* Summary: Logs user into the system
|
||||||
* Notes:
|
* Notes:
|
||||||
* Output-Formats: [application/json, application/xml]
|
* Output-Formats: [application/xml, application/json]
|
||||||
*/
|
*/
|
||||||
$app->GET('/user/login', function($request, $response, $args) {
|
$app->GET('/user/login', function($request, $response, $args) {
|
||||||
|
|
||||||
@ -78,7 +304,7 @@ $app->GET('/user/login', function($request, $response, $args) {
|
|||||||
* GET logoutUser
|
* GET logoutUser
|
||||||
* Summary: Logs out current logged in user session
|
* Summary: Logs out current logged in user session
|
||||||
* Notes:
|
* Notes:
|
||||||
* Output-Formats: [application/json, application/xml]
|
* Output-Formats: [application/xml, application/json]
|
||||||
*/
|
*/
|
||||||
$app->GET('/user/logout', function($request, $response, $args) {
|
$app->GET('/user/logout', function($request, $response, $args) {
|
||||||
|
|
||||||
@ -90,27 +316,11 @@ $app->GET('/user/logout', function($request, $response, $args) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET getUserByName
|
|
||||||
* Summary: Get user by user name
|
|
||||||
* Notes:
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->GET('/user/{username}', function($request, $response, $args) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$response->write('How about implementing getUserByName as a GET method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PUT updateUser
|
* PUT updateUser
|
||||||
* Summary: Updated user
|
* Summary: Updated user
|
||||||
* Notes: This can only be done by the logged in user.
|
* Notes: This can only be done by the logged in user.
|
||||||
* Output-Formats: [application/json, application/xml]
|
* Output-Formats: [application/xml, application/json]
|
||||||
*/
|
*/
|
||||||
$app->PUT('/user/{username}', function($request, $response, $args) {
|
$app->PUT('/user/{username}', function($request, $response, $args) {
|
||||||
|
|
||||||
@ -122,247 +332,5 @@ $app->PUT('/user/{username}', function($request, $response, $args) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DELETE deleteUser
|
|
||||||
* Summary: Delete user
|
|
||||||
* Notes: This can only be done by the logged in user.
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->DELETE('/user/{username}', function($request, $response, $args) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$response->write('How about implementing deleteUser as a DELETE method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PUT updatePet
|
|
||||||
* Summary: Update an existing pet
|
|
||||||
* Notes:
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->PUT('/pet', function($request, $response, $args) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$body = $request->getParsedBody();
|
|
||||||
$response->write('How about implementing updatePet as a PUT method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST addPet
|
|
||||||
* Summary: Add a new pet to the store
|
|
||||||
* Notes:
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->POST('/pet', function($request, $response, $args) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$body = $request->getParsedBody();
|
|
||||||
$response->write('How about implementing addPet as a POST method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET findPetsByStatus
|
|
||||||
* Summary: Finds Pets by status
|
|
||||||
* Notes: Multiple status values can be provided with comma seperated strings
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->GET('/pet/findByStatus', function($request, $response, $args) {
|
|
||||||
|
|
||||||
$queryParams = $request->getQueryParams();
|
|
||||||
$status = $queryParams['status'];
|
|
||||||
|
|
||||||
|
|
||||||
$response->write('How about implementing findPetsByStatus as a GET method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET findPetsByTags
|
|
||||||
* Summary: Finds Pets by tags
|
|
||||||
* Notes: Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->GET('/pet/findByTags', function($request, $response, $args) {
|
|
||||||
|
|
||||||
$queryParams = $request->getQueryParams();
|
|
||||||
$tags = $queryParams['tags'];
|
|
||||||
|
|
||||||
|
|
||||||
$response->write('How about implementing findPetsByTags as a GET method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET getPetById
|
|
||||||
* Summary: Find pet by ID
|
|
||||||
* Notes: Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->GET('/pet/{petId}', function($request, $response, $args) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$response->write('How about implementing getPetById as a GET method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST updatePetWithForm
|
|
||||||
* Summary: Updates a pet in the store with form data
|
|
||||||
* Notes:
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->POST('/pet/{petId}', function($request, $response, $args) {
|
|
||||||
|
|
||||||
|
|
||||||
$name = $args['name']; $status = $args['status'];
|
|
||||||
|
|
||||||
$response->write('How about implementing updatePetWithForm as a POST method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DELETE deletePet
|
|
||||||
* Summary: Deletes a pet
|
|
||||||
* Notes:
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->DELETE('/pet/{petId}', function($request, $response, $args) {
|
|
||||||
$headers = $request->getHeaders();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$response->write('How about implementing deletePet as a DELETE method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST uploadFile
|
|
||||||
* Summary: uploads an image
|
|
||||||
* Notes:
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->POST('/pet/{petId}/uploadImage', function($request, $response, $args) {
|
|
||||||
|
|
||||||
|
|
||||||
$additionalMetadata = $args['additionalMetadata']; $file = $args['file'];
|
|
||||||
|
|
||||||
$response->write('How about implementing uploadFile as a POST method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET getPetByIdWithByteArray
|
|
||||||
* Summary: Fake endpoint to test byte array return by 'Find pet by ID'
|
|
||||||
* Notes: Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->GET('/pet/{petId}?testing_byte_array=true', function($request, $response, $args) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$response->write('How about implementing getPetByIdWithByteArray as a GET method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST addPetUsingByteArray
|
|
||||||
* Summary: Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
|
||||||
* Notes:
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->POST('/pet?testing_byte_array=true', function($request, $response, $args) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$body = $request->getParsedBody();
|
|
||||||
$response->write('How about implementing addPetUsingByteArray as a POST method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET getInventory
|
|
||||||
* Summary: Returns pet inventories by status
|
|
||||||
* Notes: Returns a map of status codes to quantities
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->GET('/store/inventory', function($request, $response, $args) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$response->write('How about implementing getInventory as a GET method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* POST placeOrder
|
|
||||||
* Summary: Place an order for a pet
|
|
||||||
* Notes:
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->POST('/store/order', function($request, $response, $args) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$body = $request->getParsedBody();
|
|
||||||
$response->write('How about implementing placeOrder as a POST method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GET getOrderById
|
|
||||||
* Summary: Find purchase order by ID
|
|
||||||
* Notes: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->GET('/store/order/{orderId}', function($request, $response, $args) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$response->write('How about implementing getOrderById as a GET method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DELETE deleteOrder
|
|
||||||
* Summary: Delete purchase order by ID
|
|
||||||
* Notes: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
|
||||||
* Output-Formats: [application/json, application/xml]
|
|
||||||
*/
|
|
||||||
$app->DELETE('/store/order/{orderId}', function($request, $response, $args) {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$response->write('How about implementing deleteOrder as a DELETE method ?');
|
|
||||||
return $response;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$app->run();
|
$app->run();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user