Skip to content

🚀 Add 276 Auto-generated National Assembly APIs#27

Closed
StatPan wants to merge 1 commit into
mainfrom
feat/openapi-integration
Closed

🚀 Add 276 Auto-generated National Assembly APIs#27
StatPan wants to merge 1 commit into
mainfrom
feat/openapi-integration

Conversation

@StatPan

@StatPan StatPan commented Jul 3, 2025

Copy link
Copy Markdown
Collaborator

🚀 국회 API 자동 업데이트

생성일시: 2025-07-03 06:35:53 KST
생성된 API 개수: 276개
자동 생성: GitHub Actions workflow

📊 주요 변경사항

  • 276개 국회 API 자동 생성 및 업데이트
  • OpenAPI 네임스페이스 통합 ()
  • 타입 안전성 완전 보장
  • 자동 파싱 기능 포함
  • Mock 테스트 포함

🔧 사용법

// 기존 API (그대로 유지)
import { Bill, Lawmaker } from 'assembly-ts';

// 새로운 276개 자동생성 API
import { OpenAPI } from 'assembly-ts/openapi';

// 사용 예시
const news = await OpenAPI.NATV_뉴스_의장단();
console.log('뉴스 개수:', news.head.list_total_count);
console.log('첫 번째 뉴스:', news.row[0].COMP_MAIN_TITLE);

const lawmaker = await OpenAPI.국회의원_인적사항({ 
  대수: '22', 
  의원명: '홍길동' 
});

📋 자동생성된 주요 API 목록

  • 📺 NATV 국회방송: 뉴스, 의장단, 프로그램 정보
  • 👥 의원 정보: 인적사항, 선거이력, 위원회 활동
  • 📜 법안 정보: 제안현황, 심사현황, 통과현황
  • 🏛️ 의정활동: 위원회, 본회의, 정책연구
  • 📊 통계 정보: 예산, 정보공개, 행정감사

🧪 테스트 결과

  • 빌드 테스트: 성공
  • 타입 체크: 성공
  • Mock 테스트: 성공
  • 기존 API 호환성: 유지

🤖 자동화 정보

이 PR은 GitHub Actions에 의해 자동으로 생성되었습니다.

  • Workflow: auto-sdk-generation.yml
  • Trigger: Scheduled cron job (매일 9시, 18시)
  • 변화 감지: L1-L3 시스템으로 실제 변화 있을 때만 실행

🔍 상세 로그: GitHub Actions 실행 결과에서 확인 가능
📚 전체 API 목록: src/openapi/functional.ts 파일 참조

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @StatPan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request represents a major expansion of the assembly-ts library, integrating 276 new National Assembly APIs through an automated generation process. It introduces a unified OpenAPI class to provide type-safe and easily consumable access to these new endpoints, enhancing the library's utility and maintaining high code quality through automated testing and clear documentation.

Highlights

  • New API Integration: Introduced 276 new, auto-generated National Assembly APIs, significantly expanding the library's coverage of public data from the Korean National Assembly.
  • Unified OpenAPI Access: A new OpenAPI class has been added, providing a single, type-safe, and automatically parsable entry point to all 276 newly integrated APIs, simplifying their consumption.
  • Automated Generation Workflow: The addition of these APIs is part of an automated SDK generation process, managed by a GitHub Actions workflow (auto-sdk-generation.yml), ensuring regular and consistent updates based on the source data.
  • Comprehensive Testing: New tests have been added to verify the correct generation and functionality of the OpenAPI class, including checks for the exact number of generated methods and their callability, alongside existing build and type checks.
  • Improved Documentation: The README.md has been updated with clear usage examples for the new OpenAPI class, demonstrating how to integrate it with existing library components.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces 276 auto-generated National Assembly APIs. I've provided feedback to improve the clarity of the documentation examples and enhance the effectiveness of the tests.

Comment thread README.md
import { OpenAPI } from '@leginote/assembly-ts';

const openapi = new OpenAPI({ apiKey: 'key' });
await openapi.법률안_심사_및_처리처리의안(params);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For the 법률안_심사_및_처리처리의안 example, consider providing a concrete example of the params variable to improve clarity for new users. This would help them understand how to pass parameters to the auto-generated methods.

Suggested change
await openapi.법률안_심사_및_처리처리의안(params);
await openapi.법률안_심사_및_처리처리의안({ BILL_NO: '2100001' });

Comment on lines +29 to +39
it('should call API methods without errors', async () => {
// 실제 API 호출 대신 mock 처리
const mockResponse = {
head: { list_total_count: 100 },
row: [{ id: 1, title: 'test' }]
};

// 여기서는 메서드가 존재하는지만 확인
expect(openapi.NATV_뉴스_의장단).toBeDefined();
expect(openapi.의원친선협회_임회원_명단).toBeDefined();
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The test should call API methods without errors only checks if the methods are defined, but doesn't verify if they correctly call the underlying callOpenApi function with the right arguments. Consider mocking callOpenApi and asserting it was called correctly to ensure the generated methods are wired up correctly.

it('should call NATV_뉴스_의장단 with correct parameters', async () => {
  const callOpenApiSpy = vi.spyOn(openapi, 'NATV_뉴스_의장단');
  const params = { COMP_MAIN_TITLE: 'test title' };

  await openapi.NATV_뉴스_의장단(params);

  expect(callOpenApiSpy).toHaveBeenCalled();
});

@StatPan StatPan closed this Jul 3, 2025
@StatPan
StatPan deleted the feat/openapi-integration branch July 3, 2025 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant