opensensorhub / osh-core

OpenSensorHub Core Modules
http://docs.opensensorhub.org
Mozilla Public License 2.0
32 stars 16 forks source link

[SWAPI] addAllowedInterval not displayed properly in HTML schema #226

Closed csdillard closed 1 year ago

csdillard commented 2 years ago

If a driver uses one of the addAllowedInterval(...) methods to define an output field, then the schema of that field will render with a default toString() in the HTML, like this (note the "[D@..." at the bottom):

Strength
Contains the number of vehicles associated with the JFFT track.
Type : Count
Field Name : strength
Definition : http://sensorml.com/ont/swe/property/Strength
Allowed Values : [D@7df2bf1

This output appears in the schema at a URL like this:

/sensorhub/api/datastreams/24t5vufhrs5ag/schema

Here is the driver code that produces that result:

createCount()
    .definition(STRENGTH_FIELD_DEFINITION)
    .label(STRENGTH_FIELD_LABEL)
    .description(STRENGTH_FIELD_DESCRIPTION)
    .optional(true)
    .addAllowedInterval(STRENGTH_FIELD_MINIMUM, STRENGTH_FIELD_MAXIMUM)
    .build();