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
9 changes: 6 additions & 3 deletions src/compare.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright 2025 Oxide Computer Company
// Copyright 2026 Oxide Computer Company

use std::collections::BTreeMap;

use anyhow::Context as _;
use indexmap::IndexMap;
use openapiv3::{
MediaType, Operation, Parameter, ParameterSchemaOrContent, ReferenceOr, RequestBody,
Expand Down Expand Up @@ -35,10 +36,12 @@ pub(crate) struct Compare {
impl Compare {
pub fn compare(&mut self, old: &Value, new: &Value) -> anyhow::Result<()> {
let old_context = Context::new(old);
let old_operations = operations(&old_context)?;
let old_operations =
operations(&old_context).context("error deserializing old OpenAPI document")?;

let new_context = Context::new(new);
let new_operations = operations(&new_context)?;
let new_operations =
operations(&new_context).context("error deserializing new OpenAPI document")?;

let SetCompare {
a_unique,
Expand Down
2 changes: 1 addition & 1 deletion src/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub struct OperationInfo<'a> {
pub fn operations<'a>(
context: &Context<'a>,
) -> anyhow::Result<Vec<(OperationKey, OperationInfo<'a>)>> {
let api = OpenAPI::deserialize(context.raw_openapi).unwrap();
let api = OpenAPI::deserialize(context.raw_openapi)?;

let mut out = Vec::new();

Expand Down