Extensions methods for multiple structs of the Openapiv3 library.
This library provides a deref_all
method on the root openapiv3::OpenAPI
data type. This method would inline all the "$ref" in the document.
``` use openapi_utils::SpecExt;
pub fn read
let spec = read(filename).deref_all(); ```
The provided deref
method in the ReferenceOr structure does not really do any dereference, it assumes the structures have been previously dereferenced. deref
is still useful to make your code shorter by just choosing always the deref item instead of checking for references at every spot.
For other method in other structures, please read the documentation of the method.
To use these methods you need to use
the extension structure for the corresponding structure of Openapiv3