Skip to content
Permalink
Browse files
SecurityRequirement merge for operations
  • Loading branch information
rmannibucau committed Jul 1, 2018
1 parent 71ba9e1 commit 7d5267e492f00657a33644b32bd79477ba9132b2
Showing 2 changed files with 8 additions and 2 deletions.
@@ -235,6 +235,12 @@ private Operation buildOperation(final OpenAPI api, final AnnotatedMethodElement
.ifPresent(it -> operation.servers(Stream.of(it).map(this::mapServer).collect(toList())));
ofNullable(m.getAnnotation(SecurityScheme.class))
.ifPresent(s -> api.getComponents().addSecurityScheme(s.ref(), mapSecurityScheme(s)));
operation.security(of(Stream.concat(
Stream.of(m.getAnnotationsByType(SecurityRequirement.class)),
Stream.of(m.getDeclaringClass().getAnnotationsByType(SecurityRequirement.class)))
.map(this::mapSecurity).collect(toList()))
.filter(s -> !s.isEmpty())
.orElse(null));
of(m.getAnnotationsByType(Tag.class)).filter(s -> s.length > 0)
.ifPresent(tags -> operation.tags(Stream.of(tags)
.map(it -> of(it.name()).map(tag -> {
@@ -16,9 +16,9 @@
*/
package org.apache.geronimo.microprofile.openapi.test;

import org.eclipse.microprofile.openapi.tck.PetStoreAppTest;
import org.eclipse.microprofile.openapi.tck.AirlinesAppTest;

// not a real test or intended to be,
// just a trick for IDE (this is why it doesn't end with "Test")
// to ensure it is trivial to debug a TCK
public class TckRunner extends PetStoreAppTest {}
public class TckRunner extends AirlinesAppTest {}

0 comments on commit 7d5267e

Please sign in to comment.