committed by
Vladimír Gorej
parent
3059a63a0a
commit
ac3b69fb3c
@@ -20,6 +20,12 @@ import {
|
||||
isOAS31 as isOAS31Fn,
|
||||
createOnlyOAS31Selector as createOnlyOAS31SelectorFn,
|
||||
createSystemSelector as createSystemSelectorFn,
|
||||
wrapInferSchema,
|
||||
wrapSampleFromSchema,
|
||||
wrapSampleFromSchemaGeneric,
|
||||
wrapCreateXMLExample,
|
||||
wrapMemoizedSampleFromSchema,
|
||||
wrapMemoizedCreateXMLExample,
|
||||
} from "./fn"
|
||||
import {
|
||||
license as selectLicense,
|
||||
@@ -82,6 +88,15 @@ const OAS31Plugin = ({ getSystem }) => {
|
||||
getProperties,
|
||||
}
|
||||
}
|
||||
// wraps schema generators and make them specific to OpenAPI version
|
||||
if (typeof system.fn.inferSchema === "function") {
|
||||
pluginFn.inferSchema = wrapInferSchema(getSystem)
|
||||
pluginFn.sampleFromSchema = wrapSampleFromSchema(getSystem)
|
||||
pluginFn.sampleFromSchemaGeneric = wrapSampleFromSchemaGeneric(getSystem)
|
||||
pluginFn.createXMLExample = wrapCreateXMLExample(getSystem)
|
||||
pluginFn.memoizedSampleFromSchema = wrapMemoizedSampleFromSchema(getSystem)
|
||||
pluginFn.memoizedCreateXMLExample = wrapMemoizedCreateXMLExample(getSystem)
|
||||
}
|
||||
|
||||
return {
|
||||
fn: pluginFn,
|
||||
|
||||
Reference in New Issue
Block a user