Problem: Multiple api installations cause installation of chained mung'd json implementations each is bound to a specific apiSpec in the surrounding ResponseValidator. requests are labelled with a specific apiSpec. One (or more) of the chained implementations will then ResponseValidator.validate against a mismatched ResponseValidator.
Solution is:
OpenApiSpecLoader.load() decorates its returned Spec with a unique serial number
OpenApiContext caches this serial number
applyOpenMetadata stores this serial number in the OpenApiRequestMetadata in req.openapi
ResponseValidator.constructor caches the serial number when it is created
And, to make it all work,
ResponseValidator.validate inside the mung'd json, checks to see if the serial number in req.openapi.serial matches the serial number in the containing ResponseValidator instance.
Problem: Multiple api installations cause installation of chained mung'd json implementations each is bound to a specific apiSpec in the surrounding ResponseValidator. requests are labelled with a specific apiSpec. One (or more) of the chained implementations will then ResponseValidator.validate against a mismatched ResponseValidator.
Solution is:
And, to make it all work,