[Java] [Kotlin] ignore unsupported schemes instead of throwing exception (#15817)

This commit is contained in:
Tiffany Marrel
2023-06-15 10:50:49 +02:00
committed by GitHub
parent 882b9a8c50
commit 0e212f53f2
17 changed files with 112 additions and 75 deletions

View File

@@ -35,24 +35,30 @@ fun Route.PetApi() {
authenticate("petstore_auth") {
post<Paths.addPet> {
val principal = call.authentication.principal<OAuthAccessTokenResponse>()!!
call.respond(HttpStatusCode.NotImplemented)
}
}
authenticate("petstore_auth") {
delete<Paths.deletePet> {
val principal = call.authentication.principal<OAuthAccessTokenResponse>()!!
call.respond(HttpStatusCode.NotImplemented)
}
}
authenticate("petstore_auth") {
get<Paths.findPetsByStatus> {
val principal = call.authentication.principal<OAuthAccessTokenResponse>()!!
val exampleContentType = "application/json"
val exampleContentString = """[ {
"photoUrls" : [ "photoUrls", "photoUrls" ],
@@ -98,8 +104,10 @@ fun Route.PetApi() {
authenticate("petstore_auth") {
get<Paths.findPetsByTags> {
val principal = call.authentication.principal<OAuthAccessTokenResponse>()!!
val exampleContentType = "application/json"
val exampleContentString = """[ {
"photoUrls" : [ "photoUrls", "photoUrls" ],
@@ -145,8 +153,10 @@ fun Route.PetApi() {
authenticate("api_key") {
get<Paths.getPetById> {
val principal = call.authentication.principal<ApiPrincipal>()!!
val exampleContentType = "application/json"
val exampleContentString = """{
"photoUrls" : [ "photoUrls", "photoUrls" ],
@@ -176,24 +186,30 @@ fun Route.PetApi() {
authenticate("petstore_auth") {
put<Paths.updatePet> {
val principal = call.authentication.principal<OAuthAccessTokenResponse>()!!
call.respond(HttpStatusCode.NotImplemented)
}
}
authenticate("petstore_auth") {
post<Paths.updatePetWithForm> {
val principal = call.authentication.principal<OAuthAccessTokenResponse>()!!
call.respond(HttpStatusCode.NotImplemented)
}
}
authenticate("petstore_auth") {
post<Paths.uploadFile> {
val principal = call.authentication.principal<OAuthAccessTokenResponse>()!!
val exampleContentType = "application/json"
val exampleContentString = """{
"code" : 0,

View File

@@ -38,8 +38,10 @@ fun Route.StoreApi() {
authenticate("api_key") {
get<Paths.getInventory> {
val principal = call.authentication.principal<ApiPrincipal>()!!
call.respond(HttpStatusCode.NotImplemented)
}
}