Skip to content

feat(convert): --force to overwrite existing contracts; commas in messages - #68

Merged
rizukirr merged 1 commit into
mainfrom
convert-force-overwrite
Jul 6, 2026
Merged

feat(convert): --force to overwrite existing contracts; commas in messages#68
rizukirr merged 1 commit into
mainfrom
convert-force-overwrite

Conversation

@rizukirr

@rizukirr rizukirr commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Two changes to apic convert, plus a message-style sweep.

apic convert --postman --force

  • Adds a --force flag that overwrites contracts that already exist.
  • The default is unchanged (it still errors on an existing file), and the error
    now suggests the flag:
$ apic convert --postman MPOS.postman.json
Error: .../verify_otp.json already exists, pass --force to overwrite

$ apic convert --postman MPOS.postman.json --force   # overwrites

Threaded through convert::run / write_contracts; the GUI import keeps the
safe default (never overwrites).

Message style: commas over semicolons and em-dashes

Swept user-facing runtime messages (errors, warnings, status lines, TUI/GUI
labels, and apic read's response-title line) to use commas instead of ; or
, e.g.:

  • already exists; refusing to overwrite -> already exists, pass --force to overwrite
  • No project template found; create will use... -> ..., create will use...
  • unsupported by apic — imported as GET -> unsupported by apic, imported as GET
  • RESPONSE 200 — OK -> RESPONSE 200, OK

Scope is runtime message string literals; clap --help doc comments and code
comments were left alone (say the word if you want those swept too).

Tests

Added an overwrite case to the write_contracts unit test. cargo fmt --all --check and cargo clippy --workspace --all-targets -- -D warnings are clean;
cargo test --workspace passes (258 tests). Smoke-tested the CLI end-to-end
(first import succeeds, re-import errors with the --force hint, --force
overwrites).

…sages

Add `apic convert --postman --force`; the default still errors on an existing
file and now suggests --force. Sweep user-facing messages to use commas instead
of semicolons and em-dashes.
@rizukirr
rizukirr force-pushed the convert-force-overwrite branch from 914a199 to 46815a4 Compare July 6, 2026 17:59
@rizukirr
rizukirr merged commit 234728e into main Jul 6, 2026
4 checks passed
@rizukirr
rizukirr deleted the convert-force-overwrite branch July 6, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant