Error in JSON schema or in code that handles scheduling in Horde

The fields under “patterns” -- “minTime”, “maxTime”, and “interval”, are all marked as “string” in the documentation and schema files, but supplying a string throws a validation error when Horde ingests the file. It appears that only numbers are accepted. If I’m reading the code correctly, the code for all of those fields looks like it coerces whatever is passed in into numbers and then back to strings (i’m not exactly well versed in CS though, so I’m probably reading it wrong). I’m not sure which one is incorrect, the Horde validator or the JSON schema, but one is disagreeing with the other.

I’m not sure how the validator or schema are generated, but the .md file clearly states:

`minTime` | `string`<br>Time during the day for the first schedule to trigger. Measured in minutes from midnight.
`maxTime` | `string`<br>Time during the day for the last schedule to trigger. Measured in minutes from midnight.
`interval` | `string`<br>Interval between each schedule triggering


and the StreamConfig.json says:

                  "minTime": {
                      "type": "string"
                    },
                    "maxTime": {
                      "type": "string"
                    },
                    "interval": {
                      "type": "string"
                    }


which results in [Image Removed] in editor

Steps to Reproduce
Configure JSON schema in your editor to use //horde/api/v1/schema/types/StreamConfig.json for *.stream.json and load up a stream.json that has scheduling configured such as

            "patterns": \[

              {

                "minTime": 0,

                "interval": 1

              }

            ]

Hello,

The type is a string. Can you provide the full text of the validation error please because the parser for the type does expect the string to be in a specific format.

Thanks

Matthew

Hello,

I will raise a ticket for the team to update the documentation.

Some examples can be found in the unit tests in Engine/Source/Programs/Horde/Plugins/Build/HordeServer.Build.Tests/Jobs/Schedules/SchedulerTests.cs and the parse code can be found in the TimeOfDayJsonConverter.Parse method in Engine/Source/Programs/Shared/EpicGames.Horde/Utilities/TimeOfDayJsonConverter.cs

The interval parsing in IntervalJsonConverter.cs

Could you send me a verbatim copy of your config (redact any project/game specific paths or secrets) and I will test it.

Thanks,

Matthew

If it’s looking for a specific format, that’s not obvious from the code/documentation that is available around it.

Documentation says for min/maxTime: “Time during the day for the first (or last) schedule to trigger. Measured in minutes from midnight.”

Did some further testing, and string numbers are accepted for interval, “60” is accepted (numeric 60 also works, but of course gives squiggles in editor .. not sure that a string makes sense for interval since it seems to be expecting a number of minutes there)

minTime is accepted for “0”, but for non-zero numbers, gives “Unable to parse schedule time value ‘400’” or whatever time is in there.

Based on the documentation and what actually works in there, I’d expect it to be numeric input. Numbers do work for all three fields. Perhaps updating the documentation to describe an expected string format, and the schema to accept [“string”,“number”] ?

edit: after further research, setting string numbers for minTime or interval seems to result in the scheduling failing also, or at least failing to do what is expected - it resulted in the schedules all running at midnight every day, instead of the expected intervals and start times.