Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

Untracked openapi.json is considered as uncommitted #1865

@Manouchehri

Description

@Manouchehri

Describe the bug

When running commands that specifically define which file to use (e.g. openapi.yaml), having an untracked file (e.g. openapi.json) will cause Optic to bail out thinking it's uncommitted.

dave@mbp corellium-openapi % optic verify openapi.yaml --upload
optic oas verify --upload can only be run in a git repository without uncommitted changes. That ensures reports are properly tagged.
dave@mbp corellium-openapi % git status
On branch main
Your branch is up to date with 'origin/main'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	notes.1.txt
	openapi.json

nothing added to commit but untracked files present (use "git add" to track)

Additional context
Because we're specifically not using openapi.json in my example above, I don't think it's correct to tell the user there's uncommitted changes (which would imply openapi.yaml has uncommitted changes).

It might not be a bad idea to warn the user if they've accidentally put both openapi.yaml and openapi.json in the same directory though.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions