Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update argument type #8

Merged
merged 1 commit into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.15",
"version": "1.0.16",
"license": "MIT",
"type": "module",
"repository": {
Expand Down
82 changes: 65 additions & 17 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -393,20 +393,36 @@
"additionalProperties": false,
"description": "A step argument referencing a local or global variable, or some other symbolic name known to downstream modeling software (such as CONDITION in SEQGEN)",
"properties": {
"symbol": {
"name": {
"description": "An optional symbol argument name.",
"type": "string"
},
"type": {
"description": "The symbol argument type.",
"const": "symbol"
},
"value": {
"description": "The symbolic name being referenced.",
"type": "string"
}
},
"required": ["symbol"],
"required": ["type", "value"],
"type": "object"
},
"repeat_argument": {
"additionalProperties": false,
"description": "A repeat argument",
"description": "An argument that can be repeated.",
"properties": {
"repeat": {
"description": "A repeat argument, there can be a nested repeat argument inside.",
"name": {
"description": "An optional repeat argument name.",
"type": "string"
},
"type": {
"description": "The repeat argument type.",
"const": "repeat"
},
"value": {
"description": "A repeat argument value, there can be a nested repeat arguments inside.",
"type": "array",
"items": {
"oneOf": [
Expand All @@ -432,56 +448,88 @@
}
}
},
"required": ["repeat"],
"required": ["type", "value"],
"type": "object"
},
"string_argument": {
"additionalProperties": false,
"description": "A step argument containing a string.",
"properties": {
"string": {
"description": "The value. The string must be valid.",
"name": {
"description": "An optional string argument name.",
"type": "string"
},
"type": {
"description": "The string type.",
"const": "string"
},
"value": {
"description": "A valid string value.",
"type": "string"
}
},
"required": ["string"],
"required": ["type", "value"],
"type": "object"
},
"number_argument": {
"additionalProperties": false,
"description": "A step argument containing a number.",
"properties": {
"number": {
"description": "The value. The number must be valid.",
"name": {
"description": "An optional number argument name.",
"type": "string"
},
"type": {
"description": "The number type.",
"const": "number"
},
"value": {
"description": "The number value. The number must be valid.",
"type": "number"
}
},
"required": ["number"],
"required": ["type", "value"],
"type": "object"
},
"boolean_argument": {
"additionalProperties": false,
"description": "A step argument containing a boolean.",
"properties": {
"boolean": {
"name": {
"description": "An optional boolean argument name.",
"type": "string"
},
"type": {
"description": "The boolean type.",
"const": "boolean"
},
"value": {
"description": "The boolean value. The value must be all lowercase.",
"type": "boolean"
}
},
"required": ["boolean"],
"required": ["type", "value"],
"type": "object"
},
"hex_argument": {
"additionalProperties": false,
"description": "A step argument containing an unsigned integer in hexadecimal format.",
"properties": {
"hex": {
"description": "The hexadecimal integer, as a string prefixed with 0x. Digits A-F must be uppercase.",
"name": {
"description": "An optional hex argument name.",
"type": "string"
},
"type": {
"description": "The hex type.",
"const": "hex"
},
"value": {
"description": "The hexadecimal integer value, as a string prefixed with 0x. Digits A-F must be uppercase.",
"pattern": "^0x([0-9A-F])+$",
"type": "string"
}
},
"required": ["hex"],
"required": ["type", "value"],
"type": "object"
},
"variable_declaration": {
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.15'
version='1.0.16'
)
7 changes: 6 additions & 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,12 @@
"metadata": {},
"steps": [
{
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": true }, { "string": "test_string" }],
"args": [
{ "type": "number", "value": 30 },
{ "type": "number", "value": 4.3 },
{ "type": "boolean", "value": true },
{ "type": "string", "value": "test_string" }
],
"description": "Epoch-relative activate step for test.mod into engine 2 with extra property.",
"engine": 2,
"epoch": "TEST_EPOCH",
Expand Down
7 changes: 6 additions & 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,12 @@
"metadata": {},
"steps": [
{
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": true }, { "string": "test_string" }],
"args": [
{ "type": "number", "value": 30 },
{ "type": "number", "value": 4.3 },
{ "type": "boolean", "value": true },
{ "type": "string", "value": "test_string" }
],
"description": "Epoch-relative activate step for test.mod into engine 2, missing sequence tag.",
"engine": 2,
"epoch": "TEST_EPOCH",
Expand Down
7 changes: 6 additions & 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,12 @@
"metadata": {},
"steps": [
{
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": true }, { "string": "test_string" }],
"args": [
{ "type": "number", "value": 30 },
{ "type": "number", "value": 4.3 },
{ "type": "boolean", "value": true },
{ "type": "string", "value": "test_string" }
],
"description": "Epoch-relative activate step for test.mod into engine 2, missing time tag.",
"engine": 2,
"epoch": "TEST_EPOCH",
Expand Down
7 changes: 6 additions & 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,12 @@
"metadata": {},
"steps": [
{
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": true }, { "string": "test_string" }],
"args": [
{ "type": "number", "value": 30 },
{ "type": "number", "value": 4.3 },
{ "type": "boolean", "value": true },
{ "type": "string", "value": "test_string" }
],
"description": "Epoch-relative activate step for test.mod into engine 2, missing type tag.",
"engine": 2,
"epoch": "TEST_EPOCH",
Expand Down
7 changes: 6 additions & 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,12 @@
"metadata": {},
"steps": [
{
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": true }, { "string": "test_string" }],
"args": [
{ "type": "number", "value": 30 },
{ "type": "number", "value": 4.3 },
{ "type": "boolean", "value": true },
{ "type": "string", "value": "test_string" }
],
"description": "Epoch-relative activate step for test.mod into noninteger engine.",
"engine": 2.5,
"epoch": "TEST_EPOCH",
Expand Down
7 changes: 6 additions & 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,12 @@
"metadata": {},
"steps": [
{
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": true }, { "string": "test_string" }],
"args": [
{ "type": "number", "value": 30 },
{ "type": "number", "value": 4.3 },
{ "type": "boolean", "value": true },
{ "type": "string", "value": "test_string" }
],
"description": "Epoch-relative activate step for test.mod into engine 2 with nonstring epoch.",
"engine": 2,
"epoch": 7,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"metadata": {},
"steps": [
{
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": true }, { "string": "test_string" }],
"args": [
{ "type": "number", "value": 30 },
{ "type": "number", "value": 4.3 },
{ "type": "boolean", "value": true },
{ "type": "string", "value": "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": { "number": 7 },
"args": { "type": "number", "value": 7 },
"description": "Epoch-relative activate step for test.mod into engine 2 with invalid arg type.",
"engine": 2,
"epoch": "TEST_EPOCH",
Expand Down
7 changes: 6 additions & 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,12 @@
"metadata": {},
"steps": [
{
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": false }, { "string": "test_string" }],
"args": [
{ "type": "number", "value": 30 },
{ "type": "number", "value": 4.3 },
{ "type": "boolean", "value": false },
{ "type": "string", "value": "test_string" }
],
"description": "Absolute-timed standard command step with extra property.",
"models": [
{
Expand Down
7 changes: 6 additions & 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,12 @@
"metadata": {},
"steps": [
{
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": false }, { "string": "test_string" }],
"args": [
{ "type": "number", "value": 30 },
{ "type": "number", "value": 4.3 },
{ "type": "boolean", "value": false },
{ "type": "string", "value": "test_string" }
],
"description": "Absolute-timed standard command step with missing stem.",
"models": [
{
Expand Down
7 changes: 6 additions & 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,12 @@
"metadata": {},
"steps": [
{
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": false }, { "string": "test_string" }],
"args": [
{ "type": "number", "value": 30 },
{ "type": "number", "value": 4.3 },
{ "type": "boolean", "value": false },
{ "type": "string", "value": "test_string" }
],
"description": "Absolute-timed standard command step with missing time.",
"models": [
{
Expand Down
7 changes: 6 additions & 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,12 @@
"metadata": {},
"steps": [
{
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": false }, { "string": "test_string" }],
"args": [
{ "type": "number", "value": 30 },
{ "type": "number", "value": 4.3 },
{ "type": "boolean", "value": false },
{ "type": "string", "value": "test_string" }
],
"description": "Absolute-timed standard command step with missing type.",
"models": [
{
Expand Down
7 changes: 6 additions & 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,12 @@
"metadata": {},
"steps": [
{
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": false }, { "string": "test_string" }],
"args": [
{ "type": "number", "value": 30 },
{ "type": "number", "value": 4.3 },
{ "type": "boolean", "value": false },
{ "type": "string", "value": "test_string" }
],
"description": "Absolute-timed standard command step with nonarray models.",
"models": 7,
"stem": "FAKE_COMMAND1",
Expand Down
7 changes: 6 additions & 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,12 @@
"metadata": {},
"steps": [
{
"args": [{ "number": 30 }, { "number": 4.3 }, { "boolean": false }, { "string": "test_string" }],
"args": [
{ "type": "number", "value": 30 },
{ "type": "number", "value": 4.3 },
{ "type": "boolean", "value": false },
{ "type": "string", "value": "test_string" }
],
"description": "Absolute-timed standard command step with nonstring stem.",
"models": [
{
Expand Down
14 changes: 7 additions & 7 deletions test/invalid-seq-json/ground-block-extra-property.seq.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"steps": [
{
"args": [
{ "string": "SEQSTR" },
{ "string": "2019-365T00:00:00" },
{ "string": "2020-025T00:00:00" },
{ "string": "BOTH" },
{ "string": "" },
{ "string": "" },
{ "string": "real_time_cmds" }
{ "type": "string", "value": "SEQSTR" },
{ "type": "string", "value": "2019-365T00:00:00" },
{ "type": "string", "value": "2020-025T00:00:00" },
{ "type": "string", "value": "BOTH" },
{ "type": "string", "value": "" },
{ "type": "string", "value": "" },
{ "type": "string", "value": "real_time_cmds" }
],
"description": "Ground activity step with extra property.",
"models": [
Expand Down
Loading