private Swagger parse(String filePath) { final Swagger swagger = parser.read(filePath); if (swagger != null && swagger.getPaths() != null) { LOG.info("Parsed Swagger with " + swagger.getPaths().size() + " paths"); } return swagger; }
/** * Returns the representation of the whole resource listing of the Application. * * @return The representation of the whole resource listing of the Application. */ public Representation getSwagger() { Swagger swagger = Swagger2Translator.getSwagger(getDefinition()); swagger.setSwagger(swaggerVersion); JacksonRepresentation<Swagger> swaggerJacksonRepresentation = new JacksonRepresentation<>(swagger); // configure object mapper to not include null values ObjectMapper objectMapper = swaggerJacksonRepresentation.getObjectMapper(); objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); return swaggerJacksonRepresentation; }