Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
<!-- next-header -->
## Unreleased - ReleaseDate

### Fixed

- Previously, a `.json.gitstub` file whose filename hash didn't match its resolved contents (e.g. leftover from a mismerge) crashed `generate` and `check`. These files are now detected and cleaned up like other stale files.

### Changed

- Consistently use "OpenAPI document" everywhere instead of "OpenAPI spec". A number of type names have been changed to use this terminology.
- `VersionedApiDocFileName::path` now always returns paths with a forward slash, including on Windows, matching the `Display` implementation.
- Unparseable local files (e.g. files with merge conflict markers) are now reported inline, within the problem whose fix handles them. The message also includes more information about why the file couldn't be parsed. Previously, the reason appeared only in a separate load-time warning (this warning has been removed).
- A lockstep document that exists but can't be parsed is now reported as stale rather than missing.

## [0.7.2] - 2026-05-20

Expand Down
10 changes: 2 additions & 8 deletions crates/dropshot-api-manager/src/doc_files_generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,7 @@ impl<'a, T: ApiLoad + AsRawFiles> ApiDocFilesBuilder<'a, T> {
/// Record a file as unparseable without attempting to parse it.
///
/// This is used for files that are known to be invalid before attempting
/// JSON parsing (e.g., Git stubs with invalid format). The `reason`
/// error is recorded as a warning.
/// JSON parsing (e.g., Git stubs with invalid format).
///
/// For contexts where unparseable files are allowed (local files), this
/// tracks the file so it can be cleaned up during generate. For other
Expand Down Expand Up @@ -736,12 +735,7 @@ impl<'a, T: ApiLoad + AsRawFiles> ApiDocFilesBuilder<'a, T> {
match T::make_unparseable(file_name.clone(), contents, reason) {
Some(unparseable) => {
// For local files, track the unparseable file so it can be
// cleaned up during generate. Record a warning so the user
// knows about it.
self.load_warning(anyhow!(
"skipping unparseable file {path:?}: {rendered}"
));

// cleaned up during generate.
let version = match file_name.version() {
Some(version) => version.clone(),
None => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-------
Generating OpenAPI documents from API definitions ...
Loading local OpenAPI documents from "<documents dir>" ...
Warning skipping unparseable file "health.json": parsing as JSON: expected value at line 1 column 1
Loading blessed OpenAPI documents from VCS revision "main" path "documents"
-------
Checking 1 OpenAPI document...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-------
Generating OpenAPI documents from API definitions ...
Loading local OpenAPI documents from "<documents dir>" ...
Warning skipping unparseable file "versioned-health/versioned-health-1.0.0-da85d6.json.gitstub": needs to be rewritten to canonical Git stub format with forward slashes and a trailing newline
Loading blessed OpenAPI documents from VCS revision "main" path "documents"
-------
Checking 3 OpenAPI documents...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-------
Generating OpenAPI documents from API definitions ...
Loading local OpenAPI documents from "<documents dir>" ...
Warning skipping unparseable file "versioned-health/versioned-health-3.0.0-05def5.json": parsing as JSON: expected value at line 1 column 1
Loading blessed OpenAPI documents from VCS revision "main" path "documents"
-------
Checking 2 OpenAPI documents...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-------
Generating OpenAPI documents from API definitions ...
Loading local OpenAPI documents from "<documents dir>" ...
Warning skipping unparseable file "versioned-health/versioned-health-2.0.0-ffffff.json.gitstub": resolved contents have hash "511899", but file name has different hash "ffffff"
Loading blessed OpenAPI documents from VCS revision "main" path "documents"
-------
Checking 3 OpenAPI documents...
Expand Down
Loading