forked from loafle/openapi-generator-original
- Use 'orElse' instead of 'get' to avoid Exception for non required headers - Update samples
This commit is contained in:
committed by
GitHub
parent
0bb9088f3e
commit
85df55b20e
@@ -58,7 +58,7 @@ public class PetApiController extends Controller {
|
||||
|
||||
@ApiAction
|
||||
public CompletionStage<Result> deletePet(Http.Request request, Long petId) throws Exception {
|
||||
String valueapiKey = request.header("api_key").get();
|
||||
String valueapiKey = request.header("api_key").orElse(null);
|
||||
String apiKey;
|
||||
if (valueapiKey != null) {
|
||||
apiKey = valueapiKey;
|
||||
|
||||
Reference in New Issue
Block a user