Tufin / oasdiff

OpenAPI Diff and Breaking Changes
https://www.oasdiff.com
Apache License 2.0
689 stars 59 forks source link

"Error resolving reference/map key not found" when running oasdiff across the set of files with intensive external refs #504

Open anikitin opened 6 months ago

anikitin commented 6 months ago

I am experimenting with oasdiff in composed mode against OpenAPI files which have many cross-file $refs. I found a strange issue where an error (or errors) appear from time to time. Sometimes it passes without issues, and sometimes it fails with an error like this (could be in different files about different schemas):

Error: failed to load base specs from glob "../api-metadata-specs2/openapi/jws-json-rpc/*-openapi.yml": failed to load "..\\api-metadata-specs2\\openapi\\jws-json-rpc\\jws-billing-openapi.yml": error resolving reference "jws-digitalline-openapi.yml#/components/schemas/PhoneLineAssignment": error resolving reference "jws-extensions-openapi.yml#/components/schemas/ExtensionBriefInfo": map key "ShippingInfo" not found 

I use oasdiff version 1.10.11. The problem can be also reproduced in non-composed mode. It seems to be sourced in kin-openapi. I could not create an isolated test to reproduce. Provided a subset of our OpenAPI files to reproduce to @reuvenharrison privately.

reuvenharrison commented 6 months ago

The error is coming from ResolveRefsIn function in https://github.com/getkin/kin-openapi @fenollp - can we share the files with you privately?

reuvenharrison commented 2 months ago

Hi @anikitin Could you please check if this is resolved by https://github.com/Tufin/oasdiff/pull/575 which is included in the latest release?