Skip to content

Commit 7b157ea

Browse files
authored
FE examples schema property only for 3.1.0+ (#70)
1 parent ea6bbc6 commit 7b157ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

forward_engineering/helpers/typeHelper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function getTypeProps({ data, key, isParentActivated, specVersion }) {
5353
readOnly: data.readOnly || undefined,
5454
writeOnly: data.writeOnly || undefined,
5555
example: parseExample(data.sample) || (!data.examples ? getArrayItemsExample(getArrayItems({ items, prefixItems, specVersion })) : undefined),
56-
examples: data.examples,
56+
...(isTargetVersionJSONSchemaCompatible(specVersion) && { examples: data.examples }),
5757
xml: getXml(data.xml)
5858
};
5959
const arrayChoices = getChoices(data, key, specVersion);
@@ -78,7 +78,7 @@ function getTypeProps({ data, key, isParentActivated, specVersion }) {
7878
readOnly: data.readOnly,
7979
writeOnly: data.writeOnly || undefined,
8080
example: parseExample(data.sample),
81-
examples: data.examples,
81+
...(isTargetVersionJSONSchemaCompatible(specVersion) && { examples: data.examples }),
8282
xml: getXml(data.xml)
8383
};
8484
const objectChoices = getChoices(data, key, specVersion);
@@ -193,7 +193,7 @@ function getPrimitiveTypeProps(data, specVersion) {
193193
readOnly: data.readOnly || undefined,
194194
writeOnly: data.writeOnly || undefined,
195195
example: parseExampleValueByDataType(data.sample, data.type),
196-
examples: data.examples,
196+
...(isTargetVersionJSONSchemaCompatible(specVersion) && { examples: data.examples }),
197197
...getExtensions(data.scopesExtensions)
198198
};
199199

0 commit comments

Comments
 (0)