0.0.6
이전 버전에서 오류가 발생할 수 있습니다.
👉 최신 버전(0.0.6 이상) 을 사용해 주세요.
Critical issues have been identified in versions earlier than 0.0.6
.
👉 Please use version 0.0.6 or later.
0.1.0
: 닉네임 설정 기능 추가 / Nickname setting functionality added.
api-link-checker.demo.mov
API Link Checker는 사용자가 설정한 REST API의 연결 여부를 확인하고 관리할 수 있는 라이브러리입니다.
Swagger와 연동하면 특정 REST API를 Swagger 문서의 설명으로 바로 이동할 수 있는 기능도 제공합니다.
REST API 설정 데이터를 로컬 파일 시스템에 JSON 형식으로 저장하여 영구적으로 관리할 수 있습니다.
- REST API 연결 여부 체크: API의 연결 상태를 UI에서 확인 및 관리 가능.
- Swagger 연동: 특정 API를 Swagger 문서로 바로 이동할 수 있는 버튼 제공.
- 데이터 영구 저장: JSON 형식으로 로컬 파일 시스템에 저장하여 데이터베이스 없이도 관리 가능.
- 환경별 파일 경로 지원: Mac, Windows, Linux 등 다양한 운영 체제에서 파일 경로를 유연하게 설정 가능.
- 간단한 UI 제공:
http(s)://{domain}:{port}/api-checker/index.html
에서 API 상태 확인 및 변경 가능.
<dependency>
<groupId>io.github.daeyoung0726</groupId>
<artifactId>api-link-checker</artifactId>
<version>{version}</version>
</dependency>
implementation 'io.github.daeyoung0726:api-link-checker:{version}'
ex) implementation 'io.github.daeyoung0726:api-link-checker:0.0.5'
@EnableApiLinkChecker
애너테이션으로 라이브러리를 활성화합니다.
@SpringBootApplication
@EnableApiLinkChecker
public class MyApplication {
public static void main(String[] args) {
SpringApplication.run(MyApplication.class, args);
}
}
@ApiGroup
을 사용하여 API 그룹을 정의합니다.
@TrackApi
를 사용하여 각 API 메서드에 설명을 추가하고 호출을 추적할 수 있습니다.
@ApiGroup(value = "사용자 API")
@RestController
@RequestMapping("/users")
public class UserController {
@TrackApi(description = "사용자 정보 가져오기")
@GetMapping("/{userId}")
public ResponseEntity<User> getUser(@PathVariable Long userId) {
// 사용자 정보 조회 로직
}
@TrackApi(description = "사용자 등록하기")
@PostMapping("/register")
public ResponseEntity<String> registerUser(@RequestBody UserDto userDto) {
// 사용자 등록 로직
}
}
api:
checker:
storage:
filepath: ${user.home}/{custom-file-name}.json
api.checker.storage.filepath=${user.home}/{custom-file-name}.json
ex) ${user.home}/api-status.json
Mac: /Users/{username}/{custom-file-name}.json
Windows: C:\Users\{username}\{custom-file-name}.json
Linux: /home/{username}/{custom-file-name}.json
http(s)://{domain}:{port}/api-checker/index.html
로 접속하여 API 상태를 확인하고 관리합니다.
Swagger와의 연동을 통해 API 설명 문서로 바로 이동할 수 있습니다.
ex) GET /users (api-link-checker) -> GET /users (swagger-ui)
Spring Security를 사용하는 경우, 다음 경로를 허용해야 합니다:
"/api-checker/**", // UI 리소스 (index.html, script.js, styles.css)
"/v1/api/link/checker/**" // API 요청 (/v1/api/link/checker, /v1/api/link/checker/check, /v1/api/link/checker/swagger-links)
API Link Checker is a library that allows users to monitor and manage the connectivity status of their configured REST APIs.
It also provides integration with Swagger, enabling users to navigate directly to specific API documentation in Swagger.
The configuration data for REST APIs is persistently stored as a JSON file on the local file system.
- Check API Connectivity: Monitor and manage the connectivity status of APIs via a user interface.
- Swagger Integration: Navigate directly to specific API documentation in Swagger through a dedicated button.
- Persistent Data Storage: Manage API data without a database by saving it in JSON format on the local file system.
- Support for Various Environments: Flexible file path configuration for different operating systems such as Mac, Windows, and Linux.
- Simple UI: Access and manage API statuses via
http(s)://{domain}:{port}/api-checker/index.html
.
<dependency>
<groupId>io.github.daeyoung0726</groupId>
<artifactId>api-link-checker</artifactId>
<version>{version}</version>
</dependency>
####Gradle Configuration
implementation 'io.github.daeyoung0726:api-link-checker:{version}'
ex) implementation 'io.github.daeyoung0726:api-link-checker:0.0.5'
Activate the library by adding the @EnableApiLinkChecker
annotation.
@SpringBootApplication
@EnableApiLinkChecker
public class MyApplication {
public static void main(String[] args) {
SpringApplication.run(MyApplication.class, args);
}
}
Define API groups using the @ApiGroup
annotation.
Use the @TrackApi
annotation to add descriptions to individual API methods and track their calls.
@ApiGroup(value = "User API")
@RestController
@RequestMapping("/users")
public class UserController {
@TrackApi(description = "Fetch user details")
@GetMapping("/{userId}")
public ResponseEntity<User> getUser(@PathVariable Long userId) {
// Logic to fetch user details
}
@TrackApi(description = "Register a user")
@PostMapping("/register")
public ResponseEntity<String> registerUser(@RequestBody UserDto userDto) {
// Logic to register a user
}
}
api:
checker:
storage:
filepath: ${user.home}/{custom-file-name}.json
api.checker.storage.filepath=${user.home}/{custom-file-name}.json
ex) ${user.home}/api-status.json
Mac: /Users/{username}/{custom-file-name}.json
Windows: C:\Users\{username}\{custom-file-name}.json
Linux: /home/{username}/{custom-file-name}.json
Access the user interface at http(s)://{domain}:{port}/api-checker/index.html
to monitor and manage API statuses.
Integrate with Swagger to navigate directly to API documentation.
ex): GET /users (api-link-checker) → GET /users (swagger-ui)
When using Spring Security, the following paths must be allowed:
"/api-checker/**", // UI resources (index.html, script.js, styles.css)
"/v1/api/link/checker/**" // API endpoints (link checker, status check, Swagger integration)