@VisibleForTesting
    static void createDocumentationFile(
            String title,
            DocumentingRestEndpoint restEndpoint,
            RestAPIVersion apiVersion,
            Path outputFile)
            throws IOException {
        final OpenAPI openApi = createDocumentation(title, restEndpoint, apiVersion);
        Files.deleteIfExists(outputFile);
        Files.write(outputFile, Yaml.pretty(openApi).getBytes(StandardCharsets.UTF_8));
    }
@Test
    void testDuplicateOperationIdsAreRejected(@TempDir Path tmpDir) {
        final Path file = tmpDir.resolve("openapi_spec.yaml");
        assertThatThrownBy(
                        () ->
                                OpenApiSpecGenerator.createDocumentationFile(
                                        "title",
                                        DocumentingRestEndpoint.forRestHandlerSpecifications(
                                                new TestEmptyMessageHeaders("operation1"),
                                                new TestEmptyMessageHeaders("operation1")),
                                        RuntimeRestAPIVersion.V0,
                                        file))
                .isInstanceOf(IllegalStateException.class)
                .hasMessageContaining("Duplicate OperationId");
    }