Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

Commit 242e39c

Browse files
authored
Merge pull request #521 from mulesoft/new-version
New version
2 parents 9693935 + 740ff2c commit 242e39c

File tree

7 files changed

+366
-244
lines changed

7 files changed

+366
-244
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"angular": "~1.3.17",
1111
"angular-bootstrap": ">=0.11.0 <0.14.0",
1212
"angular-ui-tree": "2.1.5",
13-
"api-console": "mulesoft/api-console#v3.0.29",
13+
"api-console": "mulesoft/api-console#v3.0.30",
1414
"es5-shim": "~2.3.0",
1515
"file-saver.js": "~1.20150304.1",
1616
"font-awesome": "~4.0.3",

dist/scripts/api-designer-parser.js

Lines changed: 59 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/scripts/api-designer-parser.min.js

Lines changed: 52 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/scripts/api-designer.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,11 @@
16991699
if (astNode && astNode.root() && astNode.root() === astNode) {
17001700
var lastChild = findLastChild(astNode);
17011701
if (lastChild && lastChild.lowLevel() && lastChild.lowLevel().end() <= offset) {
1702-
astNode = lastChild;
1702+
var nodeOff = positionOffset(text, lastChild.lowLevel().start());
1703+
var posOff = positionOffset(text, offset);
1704+
if (nodeOff <= posOff) {
1705+
astNode = lastChild;
1706+
}
17031707
}
17041708
}
17051709
if (!allowNull && !astNode) {
@@ -3095,6 +3099,14 @@
30953099
return new ResolvedProvider(resolver);
30963100
}
30973101
exports.getContentProvider = getContentProvider;
3102+
function positionOffset(text, pos) {
3103+
var lineStart = text.lastIndexOf('\n', pos);
3104+
lineStart = Math.max(0, lineStart);
3105+
var str = text.substring(lineStart, pos);
3106+
var strTrim = str.trim();
3107+
var result = str.indexOf(strTrim);
3108+
return result;
3109+
}
30983110
},
30993111
{
31003112
'../resources/categories.json': 12,
@@ -36385,17 +36397,22 @@
3638536397
}
3638636398
if (oasDef.hasOwnProperty('properties')) {
3638736399
var modelProps = [];
36400+
var required = [];
3638836401
_.entries(oasDef.properties).map(function (_ref) {
3638936402
var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1];
3639036403
if (value) {
3639136404
var prop = _this3._import(value);
3639236405
prop.name = key;
36406+
if (!value.hasOwnProperty('required') || value.required)
36407+
required.push(prop.name);
3639336408
modelProps.push(prop);
3639436409
}
3639536410
});
3639636411
model.properties = modelProps;
3639736412
if (oasDef.hasOwnProperty('required') && _.isArray(oasDef.required)) {
3639836413
model.propsRequired = oasDef.required;
36414+
} else {
36415+
model.propsRequired = required;
3639936416
}
3640036417
}
3640136418
if (oasDef.hasOwnProperty('allOf')) {

dist/scripts/api-designer.min.js

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)