/** * 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"); } } }
throw new TranslationException("url", "You did not provide any URL"); swagger = Json.mapper().readValue(swaggerFile, Swagger.class); } catch (Exception e) { throw new TranslationException("file", e.getMessage());
throw new TranslationException("url", "You did not provide any URL"); swagger = Json.mapper().readValue(swaggerFile, Swagger.class); } catch (Exception e) { throw new TranslationException("file", e.getMessage());
throw new TranslationException("url", "You did not provide any URL"); swagger = Json.mapper().readValue(swaggerFile, Swagger.class); } catch (Exception e) { throw new TranslationException("file", e.getMessage());
throw new TranslationException("url", "You did not provide any URL"); swagger = Json.mapper().readValue(swaggerFile, Swagger.class); } catch (Exception e) { throw new TranslationException("file", e.getMessage());
throw new TranslationException("url", "You did not provide any URL"); throw new TranslationException("file", e.getMessage());
throw new TranslationException("url", "You did not provide any URL"); throw new TranslationException("file", e.getMessage());
throw new TranslationException("url", "You did not provide any URL"); throw new TranslationException("file", e.getMessage());
throw new TranslationException("url", "You did not provide any URL"); throw new TranslationException("file", e.getMessage());
return definition; } catch (Exception e) { throw new TranslationException( "compliance", "Impossible to read your API definition, check your Swagger specs compliance",
return definition; } catch (Exception e) { throw new TranslationException( "compliance", "Impossible to read your API definition, check your Swagger specs compliance",
return definition; } catch (Exception e) { throw new TranslationException( "compliance", "Impossible to read your API definition, check your Swagger specs compliance",
return definition; } catch (Exception e) { throw new TranslationException( "compliance", "Impossible to read your API definition, check your Swagger specs compliance",
throw new TranslationException("file", "Could not deserialize object at " + url + " as " + clazz.getName(), e);
throw new TranslationException("file", "Could not deserialize object at " + url + " as " + clazz.getName(), e);
return definition; } catch (Exception e) { throw new TranslationException( "compliance", "Impossible to read your API definition, check your Swagger specs compliance",
throw new TranslationException("file", "Could not deserialize object at " + url + " as " + clazz.getName(), e);