@Test void testBuild() { OpenApiConfiguration configuration = new OpenApiConfiguration(); SwaggerConfiguration swaggerConfiguration = configuration.build(); assertAll("Swagger is configured correctly", () -> assertTrue(swaggerConfiguration.isPrettyPrint()), () -> assertTrue(swaggerConfiguration.isReadAllResources()), () -> assertTrue(swaggerConfiguration.getResourcePackages() .contains("com.sanctionco.thunder.resources")), () -> assertTrue(swaggerConfiguration.getIgnoredRoutes().contains("/swagger")), () -> assertEquals("users", swaggerConfiguration.getOpenAPI().getTags().get(0).getName()), () -> assertEquals("verify", swaggerConfiguration.getOpenAPI().getTags().get(1).getName()) ); }
@JsonIgnore public SwaggerConfiguration build() { SecurityScheme securityScheme = new SecurityScheme() .name("APIKey") .type(SecurityScheme.Type.HTTP) .scheme("bearer") .bearerFormat("TOKEN"); List<Tag> tags = new ArrayList<>(); tags.add(new Tag().name("users").description("Operations about users")); tags.add(new Tag().name("verify").description("Operations about user verification")); OpenAPI oas = new OpenAPI() .info(new Info() .title(title) .version(version) .description(description) .contact(new Contact().email(contactEmail).name(contact)) .license(new License().name(license).url(licenseUrl))) .externalDocs(new ExternalDocumentation() .description("Full Thunder documentation") .url("https: .tags(tags) .schemaRequirement("APIKey", securityScheme) .security(Collections.singletonList(new SecurityRequirement().addList("APIKey")));; Set<String> exclusions = Collections.singleton("/swagger"); return new SwaggerConfiguration().openAPI(oas) .prettyPrint(true) .readAllResources(true) .ignoredRoutes(exclusions) .resourcePackages(RESOURCES); }
OpenApiConfiguration { @JsonIgnore public SwaggerConfiguration build() { SecurityScheme securityScheme = new SecurityScheme() .name("APIKey") .type(SecurityScheme.Type.HTTP) .scheme("bearer") .bearerFormat("TOKEN"); List<Tag> tags = new ArrayList<>(); tags.add(new Tag().name("users").description("Operations about users")); tags.add(new Tag().name("verify").description("Operations about user verification")); OpenAPI oas = new OpenAPI() .info(new Info() .title(title) .version(version) .description(description) .contact(new Contact().email(contactEmail).name(contact)) .license(new License().name(license).url(licenseUrl))) .externalDocs(new ExternalDocumentation() .description("Full Thunder documentation") .url("https: .tags(tags) .schemaRequirement("APIKey", securityScheme) .security(Collections.singletonList(new SecurityRequirement().addList("APIKey")));; Set<String> exclusions = Collections.singleton("/swagger"); return new SwaggerConfiguration().openAPI(oas) .prettyPrint(true) .readAllResources(true) .ignoredRoutes(exclusions) .resourcePackages(RESOURCES); } }
OpenApiConfiguration { @JsonIgnore public SwaggerConfiguration build() { SecurityScheme securityScheme = new SecurityScheme() .name("APIKey") .type(SecurityScheme.Type.HTTP) .scheme("bearer") .bearerFormat("TOKEN"); List<Tag> tags = new ArrayList<>(); tags.add(new Tag().name("users").description("Operations about users")); tags.add(new Tag().name("verify").description("Operations about user verification")); OpenAPI oas = new OpenAPI() .info(new Info() .title(title) .version(version) .description(description) .contact(new Contact().email(contactEmail).name(contact)) .license(new License().name(license).url(licenseUrl))) .externalDocs(new ExternalDocumentation() .description("Full Thunder documentation") .url("https: .tags(tags) .schemaRequirement("APIKey", securityScheme) .security(Collections.singletonList(new SecurityRequirement().addList("APIKey")));; Set<String> exclusions = Collections.singleton("/swagger"); return new SwaggerConfiguration().openAPI(oas) .prettyPrint(true) .readAllResources(true) .ignoredRoutes(exclusions) .resourcePackages(RESOURCES); } OpenApiConfiguration(); }
OpenApiConfiguration { @JsonIgnore public SwaggerConfiguration build() { SecurityScheme securityScheme = new SecurityScheme() .name("APIKey") .type(SecurityScheme.Type.HTTP) .scheme("bearer") .bearerFormat("TOKEN"); List<Tag> tags = new ArrayList<>(); tags.add(new Tag().name("users").description("Operations about users")); tags.add(new Tag().name("verify").description("Operations about user verification")); OpenAPI oas = new OpenAPI() .info(new Info() .title(title) .version(version) .description(description) .contact(new Contact().email(contactEmail).name(contact)) .license(new License().name(license).url(licenseUrl))) .externalDocs(new ExternalDocumentation() .description("Full Thunder documentation") .url("https: .tags(tags) .schemaRequirement("APIKey", securityScheme) .security(Collections.singletonList(new SecurityRequirement().addList("APIKey")));; Set<String> exclusions = Collections.singleton("/swagger"); return new SwaggerConfiguration().openAPI(oas) .prettyPrint(true) .readAllResources(true) .ignoredRoutes(exclusions) .resourcePackages(RESOURCES); } OpenApiConfiguration(); boolean isEnabled(); String getTitle(); String getVersion(); String getDescription(); String getContact(); String getContactEmail(); @JsonIgnore SwaggerConfiguration build(); }
OpenApiConfiguration { @JsonIgnore public SwaggerConfiguration build() { SecurityScheme securityScheme = new SecurityScheme() .name("APIKey") .type(SecurityScheme.Type.HTTP) .scheme("bearer") .bearerFormat("TOKEN"); List<Tag> tags = new ArrayList<>(); tags.add(new Tag().name("users").description("Operations about users")); tags.add(new Tag().name("verify").description("Operations about user verification")); OpenAPI oas = new OpenAPI() .info(new Info() .title(title) .version(version) .description(description) .contact(new Contact().email(contactEmail).name(contact)) .license(new License().name(license).url(licenseUrl))) .externalDocs(new ExternalDocumentation() .description("Full Thunder documentation") .url("https: .tags(tags) .schemaRequirement("APIKey", securityScheme) .security(Collections.singletonList(new SecurityRequirement().addList("APIKey")));; Set<String> exclusions = Collections.singleton("/swagger"); return new SwaggerConfiguration().openAPI(oas) .prettyPrint(true) .readAllResources(true) .ignoredRoutes(exclusions) .resourcePackages(RESOURCES); } OpenApiConfiguration(); boolean isEnabled(); String getTitle(); String getVersion(); String getDescription(); String getContact(); String getContactEmail(); @JsonIgnore SwaggerConfiguration build();  }