Add specification format selection to `apiops extract` for feature parity with `Azure/apiops`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- azure, typescript
- Lĩnh vực
- api, cli, documentation
Hướng nghiên cứu
Bắt đầu với entry point apiops extract và đọc docs/commands/extract.md cùng README.md để hiểu hành vi hiện tại của --format. Theo dõi cách các artifact đặc tả được trích xuất được lựa chọn và cách các định dạng export của APIM được biểu diễn. Công việc được xem là hoàn tất khi các loại API được hỗ trợ chấp nhận một định dạng đặc tả rõ ràng, vẫn giữ hành vi tự động khi không cung cấp định dạng, xác thực các trường hợp không được hỗ trợ và ghi lại sự khác biệt cùng hướng dẫn migration.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem or use case
apiops extract currently lets users control the CLI stdout format via --format text|json, but it does not expose a user-facing option to control the exported API specification artifact format itself.
The current docs make this distinction visible:
docs/commands/extract.mddocuments--format <type>only as a global flag for command output (textorjson).- The extract output section describes the artifact tree in general, but there is no documented flag to choose whether an extracted API specification is written as OpenAPI YAML vs JSON when APIM supports both.
This is a migration and usability gap for teams coming from the previous Azure/apiops repository, where specification output format selection was available. In apiops-cli, specification format selection is currently automatic/internal, which makes artifact output less predictable for users who:
- want consistent JSON specs across repositories and environments,
- need JSON for downstream tooling, validation, or transformations,
- want explicit control instead of source-dialect-based auto-selection,
- are migrating existing workflows from
Azure/apiopsand expect the same capability.
The current behavior can also be confusing because --format json sounds like it might affect extracted spec files, but according to the current command documentation it only affects machine-readable command output written to stdout.
Proposed solution
Add a user-facing option to explicitly select the exported API specification artifact format during extraction, while preserving the current automatic behavior as the default.
Suggested behavior:
- Add a dedicated extract flag for specification artifact format selection, for example:
apiops extract --specification-format jsonapiops extract --specification-format yaml
- Scope this flag to API specification artifacts only, not general command output.
- Keep
--format text|jsonunchanged so it continues to mean stdout/log output format only. - When the new specification-format flag is omitted, preserve today's automatic behavior.
- Validate unsupported combinations clearly. For example:
- API types with no specification export should ignore or reject the option with a clear message.
- Formats unsupported by the underlying APIM export path should fail fast with actionable guidance.
- Document the mapping between the new CLI flag and the APIM export formats used internally.
Recommended documentation updates:
- Update
docs/commands/extract.mdto distinguish:--format= stdout format--specification-format= extracted API spec artifact format
- Add examples showing the new flag with
apiops extract - Update migration guidance for users moving from
Azure/apiops - Update artifact format/reference docs so the expected file extension/content is explicit
Suggested acceptance criteria:
- Users can explicitly choose the extracted specification artifact format for supported API types.
- For REST APIs where APIM supports multiple export forms, users can choose JSON vs YAML.
- The selected format controls the written spec artifact consistently.
- Existing extract behavior remains unchanged when the new flag is omitted.
- The docs clearly distinguish stdout formatting from specification artifact formatting.
- Migration documentation calls out this feature as parity with
Azure/apiops.
Relevant current documentation context:
docs/commands/extract.mdshows:--format <type>with valuestextorjson- “Machine-readable JSON output” as stdout behavior
README.mdalso documents--format <type>globally astextorjson- Integration docs already show that the project cares about spec dialect/format fidelity across API types, including:
- REST OpenAPI 3.0 YAML
- REST Swagger 2.0 JSON
- SOAP WSDL
- GraphQL SDL
That existing format awareness makes explicit user selection feel like a natural extension of the current extract model.
Affected command
apiops extract
- Ngôn ngữ chính
- TypeScript
- Star
- 29
- Fork
- 10
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 23
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Azure/apiops-cli
-
type:question
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Azure/apiops-cli#277 ·
-
type:documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 94/100
Azure/apiops-cli#250 ·
-
Documentation P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Azure/apiops-cli#24 · 1 bình luận ·
-
type:bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Azure/apiops-cli#294 ·
-
type:bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Azure/apiops-cli#291 ·
Tất cả issue của Azure/apiops-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
bug v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
modelcontextprotocol/inspector#2458 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
carbon-design-system/ibm-products#9907 ·