public void addFromSwagger(Service.Builder serviceBuilder, Swagger swagger) { Map<String, String> duplicateOperationIdLookup = Maps.newHashMap(); TreeSet<String> urlPaths = Sets.newTreeSet(swagger.getPaths().keySet()); for (String urlPath : urlPaths) { Path pathObj = swagger.getPath(urlPath); createServiceMethodsFromPath(serviceBuilder, urlPath, pathObj, duplicateOperationIdLookup); } if (isAllowAllMethodsConfigured(swagger, diagCollector)) { Path userDefinedWildCardPathObject = new Path(); if (urlPaths.contains(OpenApiUtils.WILDCARD_URL_PATH)) { userDefinedWildCardPathObject = swagger.getPath(OpenApiUtils.WILDCARD_URL_PATH); } createServiceMethodsFromPath( serviceBuilder, OpenApiUtils.WILDCARD_URL_PATH, getNewWildCardPathObject(userDefinedWildCardPathObject), duplicateOperationIdLookup); } coreApiBuilder.setVersion(swagger.getInfo().getVersion()); if (isDeprecated(swagger)) { coreApiBuilder.addOptions( createBoolOption( ServiceOptions.getDescriptor() .findFieldByNumber(ServiceOptions.DEPRECATED_FIELD_NUMBER) .getFullName(), true)); } serviceBuilder.addApis(coreApiBuilder); }
private ServiceOptions generateServiceOptions(Api api) { ServiceOptions.Builder serviceOptionsBuilder = ServiceOptions.newBuilder(); setOptions(serviceOptionsBuilder, api.getOptionsList(), SERVICE_OPTION_NAME_PREFIX); return serviceOptionsBuilder.build(); }
/** Get the {@code ServiceOptions}, defined in {@code descriptor.proto}. */ public ServiceOptions getOptions() { return proto.getOptions(); }
/** * Get the {@code ServiceOptions}, defined in {@code descriptor.proto}. */ public ServiceOptions getOptions () { return proto.getOptions (); }
public ServiceOptions.Builder getServiceOptions() { return currentScope.getServiceOptions(); }
protected ServiceOptions.Builder getServiceOptions() { throw new RuntimeException(NOT_APPLICABLE_IN_CURRENT_SCOPE); }
@Override protected ServiceOptions.Builder getServiceOptions() { return protoBuilder.getOptionsBuilder(); }