Skip to content

Partition canonical api spec output #11

Description

@toothlessdev

🧩 Summary

  • 표준화된 api spec 을 key strategy 별로 파티셔닝해서 저장, 조회, 비교 효율성을 개선하는 전략 도입

🎯 Context

  • @patchlogr/oas 에서 openapi 문서를 canonical spec 으로 변환
  • 이때 표준화된 스펙을 하나의 json 형태로 저장, 로드, 비교
    • diff 실행시 전체 spec 을 매번 로드 및 비교 해야함
    • oas 규모가 커질수록 diff 비용 증가
    • 중복제거 정규화 및 캐싱하기 어려움

🛠 Proposed Change

  • ui 로 보여줄때 swagger 에서는 tag[0] 를 기반으로 분류 하기에 tag, domain 별 파티셔닝 전략 채택
  • 각 파티션에 대해 manifest.json sha 256 기반 content addressable storage 형태로 저장 (git 이 이형태로 저장하고 있음)
StrategyKey
by OperationGET /pets, POST /users/:id
by Tag/DomainPets, User, Billing
by Path Prefix/api/v1/pets/*
  • diff pipeline 개선
    • base, head manifest 비교 -> hash 동일시 해당 domain 전체 스킵
    • hash 가 서로 다른 partition 만 diff 수행
    • diff result 를 partition 단위 변환 가능
  • inspector ui 에서 domain, tag 별 탐색 및 필터링 기능
  • s3, blob store 에 저장하고 db 에는 metadata 만 저장

📦 Scope

  • @patchlogr/core
  • @patchlogr/cli
  • @patchlogr/inspector
  • docs, examples
  • tests
  • ci / infra
  • other (아래에 명시)

⚠️ Impact & Risk

  • No Breaking Changes
  • Possible Breaking Changes

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions