forked from loafle/openapi-generator-original
reverted basePart injection
This commit is contained in:
parent
53721239f4
commit
ae271fb57a
@ -61,7 +61,7 @@ object ScalatraServerGenerator extends BasicScalaGenerator {
|
|||||||
val path = {
|
val path = {
|
||||||
val arr = k._2.toString.split("/")
|
val arr = k._2.toString.split("/")
|
||||||
if (arr.length >= 2) {
|
if (arr.length >= 2) {
|
||||||
mutable += "basePart" -> k._2
|
mutable += "basePart" -> (arr.slice(2, arr.length).mkString("", "/", ""))
|
||||||
"/" + arr.slice(2, arr.length).mkString("", "/", "")
|
"/" + arr.slice(2, arr.length).mkString("", "/", "")
|
||||||
} else
|
} else
|
||||||
k._2.toString
|
k._2.toString
|
||||||
|
@ -14,7 +14,7 @@ class PetApi (implicit val swagger: Swagger) extends ScalatraServlet with Swagge
|
|||||||
summary("Find pet by ID"),
|
summary("Find pet by ID"),
|
||||||
nickname("getPetById"),
|
nickname("getPetById"),
|
||||||
responseClass("Pet"),
|
responseClass("Pet"),
|
||||||
endpoint("/pet.{format}/{petId}"),
|
endpoint("{petId}"),
|
||||||
notes("Returns a pet based on ID"),
|
notes("Returns a pet based on ID"),
|
||||||
parameters(
|
parameters(
|
||||||
Parameter("petId", "ID of pet that needs to be fetched",
|
Parameter("petId", "ID of pet that needs to be fetched",
|
||||||
@ -28,7 +28,7 @@ class PetApi (implicit val swagger: Swagger) extends ScalatraServlet with Swagge
|
|||||||
summary("Add a new pet to the store"),
|
summary("Add a new pet to the store"),
|
||||||
nickname("addPet"),
|
nickname("addPet"),
|
||||||
responseClass("void"),
|
responseClass("void"),
|
||||||
endpoint("/pet.{format}"),
|
endpoint(""),
|
||||||
notes(""),
|
notes(""),
|
||||||
parameters(
|
parameters(
|
||||||
Parameter("body", "Pet object that needs to be added to the store",
|
Parameter("body", "Pet object that needs to be added to the store",
|
||||||
@ -42,7 +42,7 @@ class PetApi (implicit val swagger: Swagger) extends ScalatraServlet with Swagge
|
|||||||
summary("Update an existing pet"),
|
summary("Update an existing pet"),
|
||||||
nickname("updatePet"),
|
nickname("updatePet"),
|
||||||
responseClass("void"),
|
responseClass("void"),
|
||||||
endpoint("/pet.{format}"),
|
endpoint(""),
|
||||||
notes(""),
|
notes(""),
|
||||||
parameters(
|
parameters(
|
||||||
Parameter("body", "Pet object that needs to be updated in the store",
|
Parameter("body", "Pet object that needs to be updated in the store",
|
||||||
@ -56,7 +56,7 @@ class PetApi (implicit val swagger: Swagger) extends ScalatraServlet with Swagge
|
|||||||
summary("Finds Pets by status"),
|
summary("Finds Pets by status"),
|
||||||
nickname("findPetsByStatus"),
|
nickname("findPetsByStatus"),
|
||||||
responseClass("List[Pet]"),
|
responseClass("List[Pet]"),
|
||||||
endpoint("/pet.{format}/findByStatus"),
|
endpoint("findByStatus"),
|
||||||
notes("Multiple status values can be provided with comma seperated strings"),
|
notes("Multiple status values can be provided with comma seperated strings"),
|
||||||
parameters(
|
parameters(
|
||||||
Parameter("status", "Status values that need to be considered for filter",
|
Parameter("status", "Status values that need to be considered for filter",
|
||||||
@ -73,7 +73,7 @@ class PetApi (implicit val swagger: Swagger) extends ScalatraServlet with Swagge
|
|||||||
summary("Finds Pets by tags"),
|
summary("Finds Pets by tags"),
|
||||||
nickname("findPetsByTags"),
|
nickname("findPetsByTags"),
|
||||||
responseClass("List[Pet]"),
|
responseClass("List[Pet]"),
|
||||||
endpoint("/pet.{format}/findByTags"),
|
endpoint("findByTags"),
|
||||||
notes("Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing."),
|
notes("Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing."),
|
||||||
parameters(
|
parameters(
|
||||||
Parameter("tags", "Tags to filter by",
|
Parameter("tags", "Tags to filter by",
|
||||||
|
@ -14,7 +14,7 @@ class StoreApi (implicit val swagger: Swagger) extends ScalatraServlet with Swag
|
|||||||
summary("Find purchase order by ID"),
|
summary("Find purchase order by ID"),
|
||||||
nickname("getOrderById"),
|
nickname("getOrderById"),
|
||||||
responseClass("Order"),
|
responseClass("Order"),
|
||||||
endpoint("/store.{format}/order/{orderId}"),
|
endpoint("order/{orderId}"),
|
||||||
notes("For valid response try integer IDs with value <= 5. Anything above 5 or nonintegers will generate API errors"),
|
notes("For valid response try integer IDs with value <= 5. Anything above 5 or nonintegers will generate API errors"),
|
||||||
parameters(
|
parameters(
|
||||||
Parameter("orderId", "ID of pet that needs to be fetched",
|
Parameter("orderId", "ID of pet that needs to be fetched",
|
||||||
@ -28,7 +28,7 @@ class StoreApi (implicit val swagger: Swagger) extends ScalatraServlet with Swag
|
|||||||
summary("Delete purchase order by ID"),
|
summary("Delete purchase order by ID"),
|
||||||
nickname("deleteOrder"),
|
nickname("deleteOrder"),
|
||||||
responseClass("void"),
|
responseClass("void"),
|
||||||
endpoint("/store.{format}/order/{orderId}"),
|
endpoint("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(
|
||||||
Parameter("orderId", "ID of the order that needs to be deleted",
|
Parameter("orderId", "ID of the order that needs to be deleted",
|
||||||
@ -42,7 +42,7 @@ class StoreApi (implicit val swagger: Swagger) extends ScalatraServlet with Swag
|
|||||||
summary("Place an order for a pet"),
|
summary("Place an order for a pet"),
|
||||||
nickname("placeOrder"),
|
nickname("placeOrder"),
|
||||||
responseClass("void"),
|
responseClass("void"),
|
||||||
endpoint("/store.{format}/order"),
|
endpoint("order"),
|
||||||
notes(""),
|
notes(""),
|
||||||
parameters(
|
parameters(
|
||||||
Parameter("body", "order placed for purchasing the pet",
|
Parameter("body", "order placed for purchasing the pet",
|
||||||
|
@ -14,7 +14,7 @@ class UserApi (implicit val swagger: Swagger) extends ScalatraServlet with Swagg
|
|||||||
summary("Creates list of users with given input array"),
|
summary("Creates list of users with given input array"),
|
||||||
nickname("createUsersWithArrayInput"),
|
nickname("createUsersWithArrayInput"),
|
||||||
responseClass("void"),
|
responseClass("void"),
|
||||||
endpoint("/user.{format}/createWithArray"),
|
endpoint("createWithArray"),
|
||||||
notes(""),
|
notes(""),
|
||||||
parameters(
|
parameters(
|
||||||
Parameter("body", "List of user object",
|
Parameter("body", "List of user object",
|
||||||
@ -28,7 +28,7 @@ class UserApi (implicit val swagger: Swagger) extends ScalatraServlet with Swagg
|
|||||||
summary("Create user"),
|
summary("Create user"),
|
||||||
nickname("createUser"),
|
nickname("createUser"),
|
||||||
responseClass("void"),
|
responseClass("void"),
|
||||||
endpoint("/user.{format}"),
|
endpoint(""),
|
||||||
notes("This can only be done by the logged in user."),
|
notes("This can only be done by the logged in user."),
|
||||||
parameters(
|
parameters(
|
||||||
Parameter("body", "Created user object",
|
Parameter("body", "Created user object",
|
||||||
@ -42,7 +42,7 @@ class UserApi (implicit val swagger: Swagger) extends ScalatraServlet with Swagg
|
|||||||
summary("Creates list of users with given list input"),
|
summary("Creates list of users with given list input"),
|
||||||
nickname("createUsersWithListInput"),
|
nickname("createUsersWithListInput"),
|
||||||
responseClass("void"),
|
responseClass("void"),
|
||||||
endpoint("/user.{format}/createWithList"),
|
endpoint("createWithList"),
|
||||||
notes(""),
|
notes(""),
|
||||||
parameters(
|
parameters(
|
||||||
Parameter("body", "List of user object",
|
Parameter("body", "List of user object",
|
||||||
@ -56,7 +56,7 @@ class UserApi (implicit val swagger: Swagger) extends ScalatraServlet with Swagg
|
|||||||
summary("Updated user"),
|
summary("Updated user"),
|
||||||
nickname("updateUser"),
|
nickname("updateUser"),
|
||||||
responseClass("void"),
|
responseClass("void"),
|
||||||
endpoint("/user.{format}/{username}"),
|
endpoint("{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(
|
||||||
Parameter("username", "name that need to be deleted",
|
Parameter("username", "name that need to be deleted",
|
||||||
@ -74,7 +74,7 @@ class UserApi (implicit val swagger: Swagger) extends ScalatraServlet with Swagg
|
|||||||
summary("Delete user"),
|
summary("Delete user"),
|
||||||
nickname("deleteUser"),
|
nickname("deleteUser"),
|
||||||
responseClass("void"),
|
responseClass("void"),
|
||||||
endpoint("/user.{format}/{username}"),
|
endpoint("{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(
|
||||||
Parameter("username", "The name that needs to be deleted",
|
Parameter("username", "The name that needs to be deleted",
|
||||||
@ -88,7 +88,7 @@ class UserApi (implicit val swagger: Swagger) extends ScalatraServlet with Swagg
|
|||||||
summary("Get user by user name"),
|
summary("Get user by user name"),
|
||||||
nickname("getUserByName"),
|
nickname("getUserByName"),
|
||||||
responseClass("User"),
|
responseClass("User"),
|
||||||
endpoint("/user.{format}/{username}"),
|
endpoint("{username}"),
|
||||||
notes(""),
|
notes(""),
|
||||||
parameters(
|
parameters(
|
||||||
Parameter("username", "The name that needs to be fetched. Use user1 for testing.",
|
Parameter("username", "The name that needs to be fetched. Use user1 for testing.",
|
||||||
@ -102,7 +102,7 @@ class UserApi (implicit val swagger: Swagger) extends ScalatraServlet with Swagg
|
|||||||
summary("Logs user into the system"),
|
summary("Logs user into the system"),
|
||||||
nickname("loginUser"),
|
nickname("loginUser"),
|
||||||
responseClass("String"),
|
responseClass("String"),
|
||||||
endpoint("/user.{format}/login"),
|
endpoint("login"),
|
||||||
notes(""),
|
notes(""),
|
||||||
parameters(
|
parameters(
|
||||||
Parameter("username", "The user name for login",
|
Parameter("username", "The user name for login",
|
||||||
@ -126,7 +126,7 @@ class UserApi (implicit val swagger: Swagger) extends ScalatraServlet with Swagg
|
|||||||
summary("Logs out current logged in user session"),
|
summary("Logs out current logged in user session"),
|
||||||
nickname("logoutUser"),
|
nickname("logoutUser"),
|
||||||
responseClass("void"),
|
responseClass("void"),
|
||||||
endpoint("/user.{format}/logout"),
|
endpoint("logout"),
|
||||||
notes(""),
|
notes(""),
|
||||||
parameters(
|
parameters(
|
||||||
)) {
|
)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user