/** * Unsafely gets the HTTP/2 endpoint from the given ServerEndpoints. * * If no HTTP/2 endpoint exists this throws an IllegalArgumentException. */ public static ServerEndpoint getHttp2Endpoint(final ServerEndpoints serverEndpoints) { final scala.collection.Traversable<ServerEndpoint> possibleEndpoints = serverEndpoints.endpoints().filter(func(e->e.expectedHttpVersions().contains("2"))); if (possibleEndpoints.size() != 1) { throw new IllegalArgumentException(String.format( "gRPC client can't automatically find HTTP/2 connection: " + "%s valid endpoints available: %s", possibleEndpoints.size(), serverEndpoints )); } return possibleEndpoints.head(); }
/** * Unsafely gets the HTTP/2 endpoint from the given ServerEndpoints. * * If no HTTP/2 endpoint exists this throws an IllegalArgumentException. */ public static ServerEndpoint getHttp2Endpoint(final ServerEndpoints serverEndpoints) { final scala.collection.Traversable<ServerEndpoint> possibleEndpoints = serverEndpoints.endpoints().filter(func(e -> e.expectedHttpVersions().contains("2"))); if (possibleEndpoints.size() == 0) { throw new IllegalArgumentException(String.format( "gRPC client can't automatically find HTTP/2 connection: " + "no valid endpoints available. %s", serverEndpoints )); } else if (possibleEndpoints.size() == 1) { return possibleEndpoints.head(); } else { // TODO: the decision on which HTTP/2 endpoint to use should be based on config (e.g. maybe the user set // `akka.grpc.client."".use-tls` to false for gRPC so this should return the non-TLS HTTP/2 endpoint on the list. return possibleEndpoints.filter(endpoint -> endpoint.ssl().isDefined()).head(); } }
if (SwaggerSpec.containerTypes().contains(elementsProperty.type())) { LOGGER.debug("Cannot include nested collection schema in swagger docs: {}", schema); return null;