Skip to content

Commit

Permalink
Update primitive arg types into object types so they are consistent (#3)
Browse files Browse the repository at this point in the history
* Convert number primitive to object in schema
* Convert primitive string to object in schema
* Update generated types
* Update version to 1.0.11
  • Loading branch information
cohansen committed Feb 6, 2023
1 parent 4a0dcce commit a9da712
Show file tree
Hide file tree
Showing 46 changed files with 205 additions and 69 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nasa-jpl/seq-json-schema",
"version": "1.0.10",
"version": "1.0.11",
"license": "MIT",
"type": "module",
"repository": {
Expand Down
42 changes: 39 additions & 3 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
"items": {
"oneOf": [
{
"type": "string"
"$ref": "#/$defs/string_argument"
},
{
"type": "number"
"$ref": "#/$defs/number_argument"
},
{
"type": "boolean"
"$ref": "#/$defs/boolean_argument"
},
{
"$ref": "#/$defs/symbol_argument"
Expand Down Expand Up @@ -398,6 +398,42 @@
"required": ["symbol"],
"type": "object"
},
"string_argument": {
"additionalProperties": false,
"description": "A step argument containing a string.",
"properties": {
"string": {
"description": "The value. The string must be valid.",
"type": "string"
}
},
"required": ["string"],
"type": "object"
},
"number_argument": {
"additionalProperties": false,
"description": "A step argument containing a number.",
"properties": {
"number": {
"description": "The value. The number must be valid.",
"type": "number"
}
},
"required": ["number"],
"type": "object"
},
"boolean_argument": {
"additionalProperties": false,
"description": "A step argument containing a boolean.",
"properties": {
"boolean": {
"description": "The boolean value. The value must be all lowercase.",
"type": "boolean"
}
},
"required": ["boolean"],
"type": "object"
},
"hex_argument": {
"additionalProperties": false,
"description": "A step argument containing an unsigned integer in hexadecimal format.",
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
name='seq-json-schema',
packages=['seq-json-schema'],
url='https://github.com/NASA-AMMOS/seq-json-schema',
version='1.0.10'
version='1.0.11'
)
2 changes: 1 addition & 1 deletion test/invalid-seq-json/activate-extra-property.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"metadata": {},
"steps": [
{
"args": [30, 4.3, true, "test_string"],
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": true }, { "string": "test_string" }],
"description": "Epoch-relative activate step for test.mod into engine 2 with extra property.",
"engine": 2,
"epoch": "TEST_EPOCH",
Expand Down
2 changes: 1 addition & 1 deletion test/invalid-seq-json/activate-missing-sequence.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"metadata": {},
"steps": [
{
"args": [30, 4.3, true, "test_string"],
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": true }, { "string": "test_string" }],
"description": "Epoch-relative activate step for test.mod into engine 2, missing sequence tag.",
"engine": 2,
"epoch": "TEST_EPOCH",
Expand Down
2 changes: 1 addition & 1 deletion test/invalid-seq-json/activate-missing-time.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"metadata": {},
"steps": [
{
"args": [30, 4.3, true, "test_string"],
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": true }, { "string": "test_string" }],
"description": "Epoch-relative activate step for test.mod into engine 2, missing time tag.",
"engine": 2,
"epoch": "TEST_EPOCH",
Expand Down
2 changes: 1 addition & 1 deletion test/invalid-seq-json/activate-missing-type.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"metadata": {},
"steps": [
{
"args": [30, 4.3, true, "test_string"],
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": true }, { "string": "test_string" }],
"description": "Epoch-relative activate step for test.mod into engine 2, missing type tag.",
"engine": 2,
"epoch": "TEST_EPOCH",
Expand Down
2 changes: 1 addition & 1 deletion test/invalid-seq-json/activate-noninteger-engine.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"metadata": {},
"steps": [
{
"args": [30, 4.3, true, "test_string"],
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": true }, { "string": "test_string" }],
"description": "Epoch-relative activate step for test.mod into noninteger engine.",
"engine": 2.5,
"epoch": "TEST_EPOCH",
Expand Down
2 changes: 1 addition & 1 deletion test/invalid-seq-json/activate-nonstring-epoch.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"metadata": {},
"steps": [
{
"args": [30, 4.3, true, "test_string"],
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": true }, { "string": "test_string" }],
"description": "Epoch-relative activate step for test.mod into engine 2 with nonstring epoch.",
"engine": 2,
"epoch": 7,
Expand Down
2 changes: 1 addition & 1 deletion test/invalid-seq-json/activate-nonstring-sequence.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"metadata": {},
"steps": [
{
"args": [30, 4.3, true, "test_string"],
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": true }, { "string": "test_string" }],
"description": "Epoch-relative activate step for test.mod into engine 2 with nonstring sequence.",
"engine": 2,
"epoch": "TEST_EPOCH",
Expand Down
2 changes: 1 addition & 1 deletion test/invalid-seq-json/args-invalid-type.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"metadata": {},
"steps": [
{
"args": 7,
"args": { "number": 7 },
"description": "Epoch-relative activate step for test.mod into engine 2 with invalid arg type.",
"engine": 2,
"epoch": "TEST_EPOCH",
Expand Down
2 changes: 1 addition & 1 deletion test/invalid-seq-json/command-extra-property.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"metadata": {},
"steps": [
{
"args": [30, 4.3, false, "test_string"],
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": false }, { "string": "test_string" }],
"description": "Absolute-timed standard command step with extra property.",
"models": [
{
Expand Down
2 changes: 1 addition & 1 deletion test/invalid-seq-json/command-missing-stem.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"metadata": {},
"steps": [
{
"args": [30, 4.3, false, "test_string"],
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": false }, { "string": "test_string" }],
"description": "Absolute-timed standard command step with missing stem.",
"models": [
{
Expand Down
2 changes: 1 addition & 1 deletion test/invalid-seq-json/command-missing-time.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"metadata": {},
"steps": [
{
"args": [30, 4.3, false, "test_string"],
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": false }, { "string": "test_string" }],
"description": "Absolute-timed standard command step with missing time.",
"models": [
{
Expand Down
2 changes: 1 addition & 1 deletion test/invalid-seq-json/command-missing-type.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"metadata": {},
"steps": [
{
"args": [30, 4.3, false, "test_string"],
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": false }, { "string": "test_string" }],
"description": "Absolute-timed standard command step with missing type.",
"models": [
{
Expand Down
2 changes: 1 addition & 1 deletion test/invalid-seq-json/command-nonarray-models.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"metadata": {},
"steps": [
{
"args": [30, 4.3, false, "test_string"],
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": false }, { "string": "test_string" }],
"description": "Absolute-timed standard command step with nonarray models.",
"models": 7,
"stem": "FAKE_COMMAND1",
Expand Down
2 changes: 1 addition & 1 deletion test/invalid-seq-json/command-nonstring-stem.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"metadata": {},
"steps": [
{
"args": [30, 4.3, false, "test_string"],
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": false }, { "string": "test_string" }],
"description": "Absolute-timed standard command step with nonstring stem.",
"models": [
{
Expand Down
10 changes: 9 additions & 1 deletion test/invalid-seq-json/ground-block-extra-property.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
"metadata": {},
"steps": [
{
"args": ["SEQSTR", "2019-365T00:00:00", "2020-025T00:00:00", "BOTH", "", "", "real_time_cmds"],
"args": [
{ "string": "SEQSTR" },
{ "string": "2019-365T00:00:00" },
{ "string": "2020-025T00:00:00" },
{ "string": "BOTH" },
{ "string": "" },
{ "string": "" },
{ "string": "real_time_cmds" }
],
"description": "Ground activity step with extra property.",
"models": [
{
Expand Down
10 changes: 9 additions & 1 deletion test/invalid-seq-json/ground-block-missing-name.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
"metadata": {},
"steps": [
{
"args": ["SEQSTR", "2019-365T00:00:00", "2020-025T00:00:00", "BOTH", "", "", "real_time_cmds"],
"args": [
{ "string": "SEQSTR" },
{ "string": "2019-365T00:00:00" },
{ "string": "2020-025T00:00:00" },
{ "string": "BOTH" },
{ "string": "" },
{ "string": "" },
{ "string": "real_time_cmds" }
],
"description": "Ground activity step missing name.",
"models": [
{
Expand Down
10 changes: 9 additions & 1 deletion test/invalid-seq-json/ground-block-missing-time.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
"metadata": {},
"steps": [
{
"args": ["SEQSTR", "2019-365T00:00:00", "2020-025T00:00:00", "BOTH", "", "", "real_time_cmds"],
"args": [
"SEQSTR",
{ "string": "2019-365T00:00:00" },
{ "string": "2020-025T00:00:00" },
{ "string": "BOTH" },
{ "string": "" },
{ "string": "" },
{ "string": "real_time_cmds" }
],
"description": "Ground activity step missing time.",
"models": [
{
Expand Down
10 changes: 9 additions & 1 deletion test/invalid-seq-json/ground-block-missing-type.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
"metadata": {},
"steps": [
{
"args": ["SEQSTR", "2019-365T00:00:00", "2020-025T00:00:00", "BOTH", "", "", "real_time_cmds"],
"args": [
{ "string": "SEQSTR" },
{ "string": "2019-365T00:00:00" },
{ "string": "2020-025T00:00:00" },
{ "string": "BOTH" },
{ "string": "" },
{ "string": "" },
{ "string": "real_time_cmds" }
],
"description": "Ground activity step missing type.",
"models": [
{
Expand Down
10 changes: 9 additions & 1 deletion test/invalid-seq-json/ground-block-nonarray-models.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
"metadata": {},
"steps": [
{
"args": ["SEQSTR", "2019-365T00:00:00", "2020-025T00:00:00", "BOTH", "", "", "real_time_cmds"],
"args": [
{ "string": "SEQSTR" },
{ "string": "2019-365T00:00:00" },
{ "string": "2020-025T00:00:00" },
{ "string": "BOTH" },
{ "string": "" },
{ "string": "" },
{ "string": "real_time_cmds" }
],
"description": "Ground activity step with nonarray models field.",
"models": 7,
"name": "SEQTRAN_directive",
Expand Down
10 changes: 9 additions & 1 deletion test/invalid-seq-json/ground-block-nonstring-name.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
"metadata": {},
"steps": [
{
"args": ["SEQSTR", "2019-365T00:00:00", "2020-025T00:00:00", "BOTH", "", "", "real_time_cmds"],
"args": [
{ "string": "SEQSTR" },
{ "string": "2019-365T00:00:00" },
{ "string": "2020-025T00:00:00" },
{ "string": "BOTH" },
{ "string": "" },
{ "string": "" },
{ "string": "real_time_cmds" }
],
"description": "Ground activity step with nonstring name.",
"models": [
{
Expand Down
4 changes: 2 additions & 2 deletions test/invalid-seq-json/ground-event-extra-property.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"steps": [
{
"args": [
"/domops/data/nsyt/189/seq/satf_sct/nsy.orf.f2_seq_eng_nom_htr_off_mod.r1.satf",
"d:/tmp/eng_nom_htr_off.mod"
{ "string": "/domops/data/nsyt/189/seq/satf_sct/nsy.orf.f2_seq_eng_nom_htr_off_mod.r1.satf" },
{ "string": "d:/tmp/eng_nom_htr_off.mod" }
],
"description": "Ground event step with extra property.",
"models": [
Expand Down
4 changes: 2 additions & 2 deletions test/invalid-seq-json/ground-event-missing-name.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"steps": [
{
"args": [
"/domops/data/nsyt/189/seq/satf_sct/nsy.orf.f2_seq_eng_nom_htr_off_mod.r1.satf",
"d:/tmp/eng_nom_htr_off.mod"
{ "string": "/domops/data/nsyt/189/seq/satf_sct/nsy.orf.f2_seq_eng_nom_htr_off_mod.r1.satf" },
{ "string": "d:/tmp/eng_nom_htr_off.mod" }
],
"description": "Ground event step with missing name.",
"models": [
Expand Down
4 changes: 2 additions & 2 deletions test/invalid-seq-json/ground-event-missing-time.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"steps": [
{
"args": [
"/domops/data/nsyt/189/seq/satf_sct/nsy.orf.f2_seq_eng_nom_htr_off_mod.r1.satf",
"d:/tmp/eng_nom_htr_off.mod"
{ "string": "/domops/data/nsyt/189/seq/satf_sct/nsy.orf.f2_seq_eng_nom_htr_off_mod.r1.satf" },
{ "string": "d:/tmp/eng_nom_htr_off.mod" }
],
"description": "Ground event step with missing time.",
"models": [
Expand Down
4 changes: 2 additions & 2 deletions test/invalid-seq-json/ground-event-missing-type.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"steps": [
{
"args": [
"/domops/data/nsyt/189/seq/satf_sct/nsy.orf.f2_seq_eng_nom_htr_off_mod.r1.satf",
"d:/tmp/eng_nom_htr_off.mod"
{ "string": "/domops/data/nsyt/189/seq/satf_sct/nsy.orf.f2_seq_eng_nom_htr_off_mod.r1.satf" },
{ "string": "d:/tmp/eng_nom_htr_off.mod" }
],
"description": "Ground event step with missing type.",
"models": [
Expand Down
4 changes: 2 additions & 2 deletions test/invalid-seq-json/ground-event-nonarray-models.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"steps": [
{
"args": [
"/domops/data/nsyt/189/seq/satf_sct/nsy.orf.f2_seq_eng_nom_htr_off_mod.r1.satf",
"d:/tmp/eng_nom_htr_off.mod"
{ "string": "/domops/data/nsyt/189/seq/satf_sct/nsy.orf.f2_seq_eng_nom_htr_off_mod.r1.satf" },
{ "string": "d:/tmp/eng_nom_htr_off.mod" }
],
"description": "Ground event step with nonarray models.",
"models": 7,
Expand Down
4 changes: 2 additions & 2 deletions test/invalid-seq-json/ground-event-nonstring-name.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"steps": [
{
"args": [
"/domops/data/nsyt/189/seq/satf_sct/nsy.orf.f2_seq_eng_nom_htr_off_mod.r1.satf",
"d:/tmp/eng_nom_htr_off.mod"
{ "string": "/domops/data/nsyt/189/seq/satf_sct/nsy.orf.f2_seq_eng_nom_htr_off_mod.r1.satf" },
{ "string": "d:/tmp/eng_nom_htr_off.mod" }
],
"description": "Ground event step with nonstring name.",
"models": [
Expand Down
2 changes: 1 addition & 1 deletion test/invalid-seq-json/nonstring-description.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"metadata": {},
"steps": [
{
"args": [30, 4.3, false, "test_string"],
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": false }, { "string": "test_string" }],
"description": 7,
"models": [
{
Expand Down
Loading

0 comments on commit a9da712

Please sign in to comment.