{"id":23227051,"url":"https://github.com/dyadyajora/postman4j-interceptors","last_synced_at":"2026-04-29T19:34:32.873Z","repository":{"id":268312730,"uuid":"903563593","full_name":"dyadyaJora/postman4j-interceptors","owner":"dyadyaJora","description":"Instrument your java http clients in order to log your requests and responses in form of postman collection to reuse them quickly ","archived":false,"fork":false,"pushed_at":"2025-06-02T16:30:04.000Z","size":388,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T07:09:41.783Z","etag":null,"topics":["java","postman","postman-collection"],"latest_commit_sha":null,"homepage":"https://postman4j.jora.dev","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dyadyaJora.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-14T23:23:28.000Z","updated_at":"2025-05-17T18:41:29.000Z","dependencies_parsed_at":"2025-01-02T18:22:37.826Z","dependency_job_id":"c510be18-b8b0-4c8b-930f-2862a268b57a","html_url":"https://github.com/dyadyaJora/postman4j-interceptors","commit_stats":null,"previous_names":["dyadyajora/postman4j-interceptors"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dyadyaJora/postman4j-interceptors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyadyaJora%2Fpostman4j-interceptors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyadyaJora%2Fpostman4j-interceptors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyadyaJora%2Fpostman4j-interceptors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyadyaJora%2Fpostman4j-interceptors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dyadyaJora","download_url":"https://codeload.github.com/dyadyaJora/postman4j-interceptors/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyadyaJora%2Fpostman4j-interceptors/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32441329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T18:12:22.909Z","status":"ssl_error","status_checked_at":"2026-04-29T18:11:33.322Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","postman","postman-collection"],"created_at":"2024-12-19T00:28:13.672Z","updated_at":"2026-04-29T19:34:32.856Z","avatar_url":"https://github.com/dyadyaJora.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Postman4j Interceptors\n\n[![Maven Central Version](https://img.shields.io/maven-central/v/dev.jora.postman4j/postman4j-models)](https://central.sonatype.com/artifact/dev.jora.postman4j/postman4j-models)\n[![Java CI with Gradle](https://github.com/dyadyaJora/postman4j-interceptors/actions/workflows/gradle.yml/badge.svg)](https://github.com/dyadyaJora/postman4j-interceptors/actions/workflows/gradle.yml)\n\n\nThis tool allows you to log your HTTP request chains in the form of a Postman collection, which can be easily reused in the Postman app.\n\nCurrently supported interceptors:\n\n| For                 | Version | module                                                                                                    | postman4j                                                                                                                                                                             |\n|---------------------|---------|-----------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Spring Boot         | 3.4.4   | [spring-interceptor](https://github.com/dyadyaJora/postman4j-interceptors/tree/master/spring-interceptor) | [![Maven Central Version](https://img.shields.io/maven-central/v/dev.jora.postman4j/spring-interceptor)](https://central.sonatype.com/artifact/dev.jora.postman4j/spring-interceptor) \n| Apache HttpClient 5 | 5.3.1   | [hc5-interceptor](https://github.com/dyadyaJora/postman4j-interceptors/tree/master/hc5-interceptor)                                                                                       | [![Maven Central Version](https://img.shields.io/maven-central/v/dev.jora.postman4j/hc5-interceptor)](https://central.sonatype.com/artifact/dev.jora.postman4j/hc5-interceptor)       \n| restassured         | 4.5.1   | [restassured-interceptor](https://github.com/dyadyaJora/postman4j-interceptors/tree/master/restassured-interceptor) | [![Maven Central Version](https://img.shields.io/maven-central/v/dev.jora.postman4j/restassured-interceptor)](https://central.sonatype.com/artifact/dev.jora.postman4j/restassured-interceptor) |\n\n## Overview\n\nThis project provides Java HTTP client instrumentation to log requests and responses as Postman collections, enabling quick reuse.\nThe library supports annotation-based configuration (such as `@UsePostmanCollection`, `@UsePostmanFolderPath`, `@UsePostmanRequest`, and `@UsePostmanResponse`) to seamlessly instrument Java methods for capturing HTTP interactions.\nSimple demo application is available [here](https://github.com/dyadyaJora/demo-spring-postman-interceptor).\n\nThe project includes a module with Java classes for Postman collections, which can be used independently in the `postman4j-models` library.\n\nIn gradle\n```gradle\nimplementation group: 'dev.jora.postman4j', name: 'postman4j-models', version: '0.0.4'\n```\n\nIn maven\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003edev.jora.postman4j\u003c/groupId\u003e\n    \u003cartifactId\u003epostman4j-models\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nCurrently supported two interceptors: apache http client 5 as clientside integration and spring interceptor as serverside.\n\n\u003e Usage of the library with project reactor is not supported yet.\n\n### Apache HttpClient Interceptor\n\n#### Instllation\n\nIn gradle\n```gradle\nimplementation group: 'dev.jora.postman4j', name: 'hc5-interceptor', version: '0.0.4'\n```\n\nIn maven\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003edev.jora.postman4j\u003c/groupId\u003e\n    \u003cartifactId\u003ehc5-interceptor\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### Usages\n\nExample of instrumenting custom function in your java code\n\n```java\n@UsePostmanCollection(\"My Test Collection\")\n@UsePostmanFolderPath(\"Folder #1\")\n@UsePostmanRequest(\"My Request\")\n@UsePostmanResponse(\"My Response\")\npublic static void executeRequest(CloseableHttpClient httpClient, HttpUriRequestBase request) throws IOException {\n    try (CloseableHttpResponse response = httpClient.execute(request)) {\n        System.out.println(response.getCode());\n    }\n}\n```\nExample of generated collection\n\n![img.png](img-hc5.png)\n\n### Spring Interceptor\n\n#### Instllation\n\nIn gradle\n```gradle\nimplementation group: 'dev.jora.postman4j', name: 'spring-interceptor', version: '0.0.4'\n```\n\nIn maven\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003edev.jora.postman4j\u003c/groupId\u003e\n    \u003cartifactId\u003espring-interceptor\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### Usages\n\n\u003e for detailed spring-interceptor setup instruction see [demo-spring-postman-interceptor](https://github.com/dyadyaJora/demo-spring-postman-interceptor)\n\nExample of instrumenting custom controller in your java code\n\n![img.png](img-spring.png)\n\nExample of actuator endpoint output\n\n![image](https://github.com/user-attachments/assets/76ccbf87-accc-43e7-bb93-906346383a20)\n\n\n\n## Settings\n\n| Settings Name            | Allowed Values                                   | Description (Default Value)                                                             |\n|--------------------------|--------------------------------------------------|-----------------------------------------------------------------------------------------|\n| baseCollectionName       | `String`                                         | The default name of the collection (default: `Generated Collection`)                    |\n| baseCollectionDescription| `String`                                         | The default description of the collection (default: `Generated Collection Description`) |\n| schemaVersion            | `V2_1_0`                                         | The schema version of the collection (default: `V2_1_0`)                                |\n| requestResponseMode      | `REQUEST_ONLY` \\| `REQUEST_AND_RESPONSE`         | The mode of the request-response logging (default: `REQUEST_AND_RESPONSE`)              |\n| enableRequestBody        | `boolean`                                        | Whether to log the request body (default: `true`)                                       |\n| enableResponseBody       | `boolean`                                        | Whether to log the response body (default: `true`)                                      |\n| logWhenChanged           | `boolean`                                        | Enable logging of current collection to stdout when changed (default: `false`)          |\n| itemNamingStrategy       | `COUNTER`, `UUID`, `FROM_HEADER`                 | The naming strategy for the items (default: `COUNTER`)                                  |\n| outputLocation           | `CONSOLE`, `FILE`, `BOTH`                        | **(not supported yet)** The output location for the collection (`CONSOLE`)              |\n| selectedStatuses         | `List\u003cInteger\u003e`                                  | The selected statuses to save when filtering responses (default: `empty list`)          |\n| selectedHeaders          | `List\u003cString\u003e`                                   | The selected headers to save when filtering responses (default: `empty list`)           |\n| selectedExceptions       | `List\u003cString\u003e`                                   | The selected exceptions to save when filtering responses (default: `empty list`)        |\n| headerName               | `String`                                         | The header name to use for the request name (default: `null`)                           |\n| customStatusFilter       | `Predicate\u003cInteger\u003e`                             | The custom status filter function to use when filtering responses (default: `null`)     |\n| foldingStrategy          | `NO_FOLDERS`, `ONE_FOLDER_PER_REQUEST`, `CUSTOM` | **(not supported yet)** The folding strategy to use when folding items (`NO_FOLDERS`)   |\n| disableOnActuator        | `boolean`                                        | Whether to disable the interceptor when actuator endpoints are called (default: `true`)            |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyadyajora%2Fpostman4j-interceptors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdyadyajora%2Fpostman4j-interceptors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyadyajora%2Fpostman4j-interceptors/lists"}