refactor(samples): move example generation code to samples plugin (#8727)

Refs #8577
This commit is contained in:
Vladimír Gorej
2023-05-30 15:01:15 +02:00
parent ac3b69fb3c
commit 027f53c302
15 changed files with 360 additions and 160 deletions

View File

@@ -20,7 +20,6 @@ import {
isOAS31 as isOAS31Fn,
createOnlyOAS31Selector as createOnlyOAS31SelectorFn,
createSystemSelector as createSystemSelectorFn,
wrapInferSchema,
wrapSampleFromSchema,
wrapSampleFromSchemaGeneric,
wrapCreateXMLExample,
@@ -90,7 +89,6 @@ const OAS31Plugin = ({ getSystem }) => {
}
// 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)