Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
499efe61
Commit
499efe61
authored
Jan 30, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
expandSchema: expand everything from BatchAllInOneEmpty
parent
067afa76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
7 deletions
+33
-7
dream/platform/src/jsplumb/jsplumb.js
dream/platform/src/jsplumb/jsplumb.js
+33
-7
No files found.
dream/platform/src/jsplumb/jsplumb.js
View file @
499efe61
...
...
@@ -400,18 +400,41 @@
// references
// XXX this should probably be moved to fieldset ( and not handle
// class_definition here)
var
referenced
,
i
,
expanded_class_definition
=
{
properties
:
class_definition
.
properties
||
{}
};
var
referenced
,
i
,
property
,
class_definition
=
clone
(
class_definition
),
expanded_class_definition
=
clone
(
class_definition
)
||
{
};
if
(
!
expanded_class_definition
.
properties
)
{
expanded_class_definition
.
properties
=
{};
}
// expand direct ref
if
(
class_definition
.
$ref
)
{
referenced
=
expandSchema
(
resolveReference
(
class_definition
.
$ref
,
full_schema
.
class_definition
),
full_schema
);
$
.
extend
(
expanded_class_definition
,
referenced
);
referenced
=
expandSchema
(
resolveReference
(
class_definition
.
$ref
,
full_schema
.
class_definition
),
full_schema
);
$
.
extend
(
expanded_class_definition
,
referenced
);
delete
expanded_class_definition
.
$ref
;
}
// expand ref in properties
for
(
property
in
class_definition
.
properties
)
{
if
(
class_definition
.
properties
.
hasOwnProperty
(
property
))
{
if
(
class_definition
.
properties
[
property
].
$ref
)
{
referenced
=
expandSchema
(
resolveReference
(
class_definition
.
properties
[
property
].
$ref
,
full_schema
.
class_definition
),
full_schema
);
//expanded_class_definition.properties[property] = referenced;
$
.
extend
(
expanded_class_definition
.
properties
[
property
],
referenced
);
delete
expanded_class_definition
.
properties
[
property
].
$ref
;
}
}
}
if
(
class_definition
.
oneOf
)
{
expanded_class_definition
.
oneOf
=
[];
for
(
i
=
0
;
i
<
class_definition
.
oneOf
.
length
;
i
+=
1
)
{
...
...
@@ -431,6 +454,9 @@
}
$
.
extend
(
expanded_class_definition
,
referenced
);
}
if
(
expanded_class_definition
.
allOf
)
{
delete
expanded_class_definition
.
allOf
;
}
}
if
(
expanded_class_definition
.
$ref
)
{
delete
expanded_class_definition
.
$ref
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment