Skip to content

Commit 57f2505

Browse files
authored
Merge pull request #25 from mtseluiko/fix/fe-missing-extensions
FE: schema extensions handling
2 parents 5783762 + ba6f880 commit 57f2505

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

forward_engineering/helpers/typeHelper.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ function getType(data, key) {
2121
function getTypeProps(data, key) {
2222
const { type, properties, items, required } = data;
2323

24+
const extensions = getExtensions(data.scopesExtensions);
25+
2426
switch (type) {
2527
case 'array': {
2628
const arrayProps = {
@@ -37,7 +39,7 @@ function getTypeProps(data, key) {
3739
};
3840
const arrayChoices = getChoices(data, key);
3941

40-
return Object.assign({}, arrayProps, arrayChoices);
42+
return Object.assign({}, arrayProps, arrayChoices, extensions);
4143
}
4244
case 'object': {
4345
const objectProps = {
@@ -55,7 +57,6 @@ function getTypeProps(data, key) {
5557
xml: getXml(data.xml)
5658
};
5759
const objectChoices = getChoices(data, key);
58-
const extensions = getExtensions(data.scopesExtensions);
5960

6061
return Object.assign({}, objectProps, objectChoices, extensions);
6162
}
@@ -168,7 +169,8 @@ function getPrimitiveTypeProps(data) {
168169
maxLength: data.maxLength,
169170
multipleOf: data.multipleOf,
170171
xml: getXml(data.xml),
171-
example: data.sample
172+
example: data.sample,
173+
...getExtensions(data.scopesExtensions)
172174
};
173175

174176
return addIfTrue(properties, 'nullable', data.nullable);

0 commit comments

Comments
 (0)