Partner – Moderne – NPI EA (cat=Spring Boot)
announcement - icon

Refactor Java code safely — and automatically — with OpenRewrite.

Refactoring big codebases by hand is slow, risky, and easy to put off. That’s where OpenRewrite comes in. The open-source framework for large-scale, automated code transformations helps teams modernize safely and consistently.

Each month, the creators and maintainers of OpenRewrite at Moderne run live, hands-on training sessions — one for newcomers and one for experienced users. You’ll see how recipes work, how to apply them across projects, and how to modernize code with confidence.

Join the next session, bring your questions, and learn how to automate the kind of work that usually eats your sprint time.

Course – Black Friday 2026 – NPI EA – main – before_post_content
announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 1st December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW

Course – Black Friday 2026 – NPI – main – before_post_content
announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 1st December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW

1. Overview

In this article, we’ll see how to import Swagger APIs to Postman.

2. Swagger and OpenAPI

Swagger is an open-source set of rules, specifications, and tools for developing and describing REST APIs. However, post-2021, OpenAPI refers to the industry-standard specifications, whereas Swagger refers to the tooling.

3. Postman

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration. We can use Postman to test our API without writing any code.

We can use either the standalone app or the browser extension.

4. Application

We can work with any existing application, or we can create a simple application from scratch that exposes REST APIs.

4.1. Maven Dependencies

We need to add a couple of dependencies for using Swagger with the Swagger-UI:

<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger2</artifactId>
    <version>3.0.0</version>
</dependency>
<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger-ui</artifactId>
    <version>3.0.0</version>
</dependency>

4.2. Java Configuration

Swagger can be as easy to configure as:

@Configuration
public class SpringFoxConfig {
    @Bean
    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2)
          .select()
          .apis(RequestHandlerSelectors.any())
          .paths(PathSelectors.any())
          .build();
    }
}

When we start the application, we can check the Swagger-UI and find the REST API description per controller:

Swagger-UI

 

We can also check the API docs that are generated for our REST APIs:

Swagger-API_Docs

5. Importing into Postman

There are multiple ways to import the APIs into Postman, but in most cases, it requires that the Swagger or OpenAPI definition be available in some text format (for example, JSON).

We can open Postman and navigate to the APIs option on the left, then click on Import to see the different options available:

Postman API Import

5.1. Importing File

If we have a Swagger JSON file available, we can import it via the file option in Postman:

Postman API Import File

 

If we have the Swagger-UI link, we can directly use the link to import the API into Postman.

Copy the API link from Swagger-UI as below:

Swagger Copy Link

And import it via the same link from Postman:

Postman API Import Link

 

5.3. Importing via Raw Text

We can also just paste the JSON as raw text to import the APIs:

Postman API Import Raw Text

 

5.4. Importing via Code Repository

To import APIs from repositories, we need to be logged in to Postman. To import from GitHub, as an example, let’s follow the below steps:

  1. Navigate to the Code Repository tab.
  2. Click on GitHub.
  3. Confirm the GitHub account and authorize postmanlabs to access repositories. Once done, return to the Postman application for further steps.
  4. On Postman, select the organization, repository, and branch and click Continue.
  5. Confirm the APIs we need to import and click Import.

6. Conclusion

In this article, we’ve looked into different ways to import our REST APIs into Postman.

Partner – Moderne – NPI EA (tag=Refactoring)
announcement - icon

Modern Java teams move fast — but codebases don’t always keep up. Frameworks change, dependencies drift, and tech debt builds until it starts to drag on delivery. OpenRewrite was built to fix that: an open-source refactoring engine that automates repetitive code changes while keeping developer intent intact.

The monthly training series, led by the creators and maintainers of OpenRewrite at Moderne, walks through real-world migrations and modernization patterns. Whether you’re new to recipes or ready to write your own, you’ll learn practical ways to refactor safely and at scale.

If you’ve ever wished refactoring felt as natural — and as fast — as writing code, this is a good place to start.

Course – Black Friday 2026 – NPI EA – main – after_post_content

announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 1st December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW

Course – Black Friday 2026 – NPI – main – after_post_content

announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 1st December, 2026 at 17:00 Romania time:

>> EXPLORE ACCESS NOW