Skip to content

Commit 96763b9

Browse files
authored
Fix default values are removed on serialization (#156)
* fix-remove-default-values Signed-off-by: Antonio Mendoza Pérez <antmendoza@gmail.com> * removed-ifObject Signed-off-by: Antonio Mendoza Pérez <antmendoza@gmail.com>
1 parent d6fd5d8 commit 96763b9

File tree

78 files changed

+607
-335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+607
-335
lines changed

examples/browser/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</head>
99
<body>
1010
<!--
11-
Run http-server from the project root then navigate to http://localhost:8080/examples/browser/mermaid.html
11+
Run http-server from the project root then navigate to http://localhost:8080/examples/browser/index.html
1212
-->
1313
<div id="output"></div>
1414
<script src="../../dist/umd/index.umd.js"></script>

examples/browser/mermaid.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</head>
99
<body>
1010
<!--
11-
Run http-server from the project root then navigate to http://localhost:8080/examples/browser/index.html
11+
Run http-server from the project root then navigate to http://localhost:8080/examples/browser/mermaid.html
1212
-->
1313
<div id="mermaid" class="mermaid"></div>
1414
<script src="../../dist/umd/index.umd.js"></script>

src/lib/builders/action-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function actionBuildingFn(data: Specification.Action): () => Specification.Actio
2727
return () => {
2828
const model = new Specification.Action(data);
2929

30-
validate('Action', model);
30+
validate('Action', model.normalize());
3131
return model;
3232
};
3333
}

src/lib/builders/authdef-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function authdefBuildingFn(data: Specification.Authdef): () => Specification.Aut
2727
return () => {
2828
const model = new Specification.Authdef(data);
2929

30-
validate('Authdef', model);
30+
validate('Authdef', model.normalize());
3131
return model;
3232
};
3333
}

src/lib/builders/branch-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function branchBuildingFn(data: Specification.Branch): () => Specification.Branc
2727
return () => {
2828
const model = new Specification.Branch(data);
2929

30-
validate('Branch', model);
30+
validate('Branch', model.normalize());
3131
return model;
3232
};
3333
}

src/lib/builders/callbackstate-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function callbackstateBuildingFn(data: Specification.Callbackstate): () => Speci
3030

3131
setEndValueIfNoTransition(model);
3232

33-
validate('Callbackstate', model);
33+
validate('Callbackstate', model.normalize());
3434
return model;
3535
};
3636
}

src/lib/builders/continueasdef-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function continueasdefBuildingFn(data: Specification.Continueasdef): () => Speci
2727
return () => {
2828
const model = new Specification.Continueasdef(data);
2929

30-
validate('Continueasdef', model);
30+
validate('Continueasdef', model.normalize());
3131
return model;
3232
};
3333
}

src/lib/builders/databasedswitchstate-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function databasedswitchstateBuildingFn(
2929
return () => {
3030
const model = new Specification.Databasedswitchstate(data);
3131

32-
validate('Databasedswitchstate', model);
32+
validate('Databasedswitchstate', model.normalize());
3333
return model;
3434
};
3535
}

src/lib/builders/defaultconditiondef-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function defaultconditiondefBuildingFn(
2929
return () => {
3030
const model = new Specification.Defaultconditiondef(data);
3131

32-
validate('Defaultconditiondef', model);
32+
validate('Defaultconditiondef', model.normalize());
3333
return model;
3434
};
3535
}

src/lib/builders/end-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function endBuildingFn(data: Specification.End): () => Specification.End {
2727
return () => {
2828
const model = new Specification.End(data);
2929

30-
validate('End', model);
30+
validate('End', model.normalize());
3131
return model;
3232
};
3333
}

0 commit comments

Comments
 (0)