/** * Indicates if the given resource listing and list of API declarations * match. * * @param resourceListing * The Swagger resource listing. * @param apiDeclarations * The list of Swagger API declarations. * @throws org.restlet.ext.platform.internal.conversion.TranslationException */ private static void validate(ResourceListing resourceListing, Map<String, ApiDeclaration> apiDeclarations) throws TranslationException { int rlSize = resourceListing.getApis().size(); int adSize = apiDeclarations.size(); if (rlSize < adSize) { throw new TranslationException("file", "Some API declarations are not mapped in your resource listing"); } else if (rlSize > adSize) { throw new TranslationException("file", "Some API declarations are missing"); } } }
/** * Indicates if the given resource listing and list of API declarations * match. * * @param resourceListing * The Swagger resource listing. * @param apiDeclarations * The list of Swagger API declarations. * @throws org.restlet.ext.platform.internal.conversion.TranslationException */ private static void validate(ResourceListing resourceListing, Map<String, ApiDeclaration> apiDeclarations) throws TranslationException { int rlSize = resourceListing.getApis().size(); int adSize = apiDeclarations.size(); if (rlSize < adSize) { throw new TranslationException("file", "Some API declarations are not mapped in your resource listing"); } else if (rlSize > adSize) { throw new TranslationException("file", "Some API declarations are missing"); } } }
/** * Indicates if the given resource listing and list of API declarations * match. * * @param resourceListing * The Swagger resource listing. * @param apiDeclarations * The list of Swagger API declarations. * @throws org.restlet.ext.platform.internal.conversion.TranslationException */ private static void validate(ResourceListing resourceListing, Map<String, ApiDeclaration> apiDeclarations) throws TranslationException { int rlSize = resourceListing.getApis().size(); int adSize = apiDeclarations.size(); if (rlSize < adSize) { throw new TranslationException("file", "Some API declarations are not mapped in your resource listing"); } else if (rlSize > adSize) { throw new TranslationException("file", "Some API declarations are missing"); } } }
/** * Indicates if the given resource listing and list of API declarations * match. * * @param resourceListing * The Swagger resource listing. * @param apiDeclarations * The list of Swagger API declarations. * @throws org.restlet.ext.platform.internal.conversion.TranslationException */ private static void validate(ResourceListing resourceListing, Map<String, ApiDeclaration> apiDeclarations) throws TranslationException { int rlSize = resourceListing.getApis().size(); int adSize = apiDeclarations.size(); if (rlSize < adSize) { throw new TranslationException("file", "Some API declarations are not mapped in your resource listing"); } else if (rlSize > adSize) { throw new TranslationException("file", "Some API declarations are missing"); } } }
LOGGER.log(Level.FINE, "Reading file: " + swaggerUrl); resourceListing = ImportUtils.getAndDeserialize(swaggerUrl, userName, password, ResourceListing.class); for (ResourceListingApi api : resourceListing.getApis()) { LOGGER.log(Level.FINE, "Reading file: " + swaggerUrl + api.getPath()); String basePath = resourceListingFile.getParent(); LOGGER.log(Level.FINE, "Base path: " + basePath); for (ResourceListingApi api : resourceListing.getApis()) { LOGGER.log(Level.FINE, "Reading file " + basePath + api.getPath());
LOGGER.log(Level.FINE, "Reading file: " + swaggerUrl); resourceListing = ImportUtils.getAndDeserialize(swaggerUrl, userName, password, ResourceListing.class); for (ResourceListingApi api : resourceListing.getApis()) { LOGGER.log(Level.FINE, "Reading file: " + swaggerUrl + api.getPath()); String basePath = resourceListingFile.getParent(); LOGGER.log(Level.FINE, "Base path: " + basePath); for (ResourceListingApi api : resourceListing.getApis()) { LOGGER.log(Level.FINE, "Reading file " + basePath + api.getPath());
LOGGER.log(Level.FINE, "Reading file: " + swaggerUrl); resourceListing = ImportUtils.getAndDeserialize(swaggerUrl, userName, password, ResourceListing.class); for (ResourceListingApi api : resourceListing.getApis()) { LOGGER.log(Level.FINE, "Reading file: " + swaggerUrl + api.getPath()); String basePath = resourceListingFile.getParent(); LOGGER.log(Level.FINE, "Base path: " + basePath); for (ResourceListingApi api : resourceListing.getApis()) { LOGGER.log(Level.FINE, "Reading file " + basePath + api.getPath());
LOGGER.log(Level.FINE, "Reading file: " + swaggerUrl); resourceListing = ImportUtils.getAndDeserialize(swaggerUrl, userName, password, ResourceListing.class); for (ResourceListingApi api : resourceListing.getApis()) { LOGGER.log(Level.FINE, "Reading file: " + swaggerUrl + api.getPath()); String basePath = resourceListingFile.getParent(); LOGGER.log(Level.FINE, "Base path: " + basePath); for (ResourceListingApi api : resourceListing.getApis()) { LOGGER.log(Level.FINE, "Reading file " + basePath + api.getPath());
private static void fillSections(Contract contract, ResourceListing listing) { for (ResourceListingApi api : listing.getApis()) { Section section = new Section(); String sectionName = SwaggerUtils.computeSectionName(api.getPath()); section.setName(sectionName); section.setDescription(api.getDescription()); contract.getSections().add(section); } }
private static void fillSections(Contract contract, ResourceListing listing) { for (ResourceListingApi api : listing.getApis()) { Section section = new Section(); String sectionName = SwaggerUtils.computeSectionName(api.getPath()); section.setName(sectionName); section.setDescription(api.getDescription()); contract.getSections().add(section); } }
private static void fillSections(Contract contract, ResourceListing listing) { for (ResourceListingApi api : listing.getApis()) { Section section = new Section(); String sectionName = SwaggerUtils.computeSectionName(api.getPath()); section.setName(sectionName); section.setDescription(api.getDescription()); contract.getSections().add(section); } }
private static void fillSections(Contract contract, ResourceListing listing) { for (ResourceListingApi api : listing.getApis()) { Section section = new Section(); String sectionName = SwaggerUtils.computeSectionName(api.getPath()); section.setName(sectionName); section.setDescription(api.getDescription()); contract.getSections().add(section); } }
List<ResourceListingApi> apis = listing.getApis(); if (apis != null && !apis.isEmpty()) { String key = apis.get(0).getPath();
List<ResourceListingApi> apis = listing.getApis(); if (apis != null && !apis.isEmpty()) { String key = apis.get(0).getPath();
List<ResourceListingApi> apis = listing.getApis(); if (apis != null && !apis.isEmpty()) { String key = apis.get(0).getPath();
List<ResourceListingApi> apis = listing.getApis(); if (apis != null && !apis.isEmpty()) { String key = apis.get(0).getPath();