private CompletableFuture<AggregatedHttpFile> loadSchemas(
                CompletableFuture<ServiceSpecification> specificationFuture) {
            return files.computeIfAbsent(SCHEMAS_PATH, key -> specificationFuture.thenApply(spec -> {
                try {
                    final ArrayNode jsonSpec = JsonSchemaGenerator.generate(spec);

                    final byte[] content = jsonMapper.writerWithDefaultPrettyPrinter()
                                                     .writeValueAsBytes(jsonSpec);
                    return toFile(content, MediaType.JSON_UTF_8);
                } catch (JsonProcessingException e) {
                    logger.warn("Failed to generate JSON schemas:", e);
                    return toFile("[]".getBytes(), MediaType.JSON_UTF_8);
                }
            }));
        }
Creates a new instance with example HTTP headers and example requests and injected scripts.
core/src/main/java/com/linecorp/armeria/server/docs/DocService.java