STARIONGROUP/COMET-WebServices-Community-Edition

Implement validation of ParameterValueSets to make sure only correct values can be posted

samatstariongroup opened this issue · 1 comments

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of the COMET Web Services
  • I have searched open and closed issues to ensure it has not already been reported

Description

Currently the server accepts all strings for the various values of a ParameterValueSet. This is now causing issues since some implementations use the long name of an Enumeration instead of the shortname.

Therefore the server cannot trust the API users to send the correct data and validation needs to occur. The following rules apply:

  • the default value "-" is always allowed
  • EnumerationParameterType shall store the data using the shortname (multivalued enums use a | to separate the values)
  • BooleanParameterType shall store "true" or "false", always lowercase.
  • DateParameterType: comply with ISO 8601 and the Date datatype.
  • DateTimeParameterType: ISO 8601 and the DateTime datatype.
  • TextParameterType: anything goes
  • TimeOfDayParameterType: comply with ISO 8601 and the Time datatype.
  • QuantityKind: a string representation of the numerical value

The CDP4-SDK already has the algorithm to check correctness (used in the IME), investigate how this is to be reused

Steps to Reproduce

System Configuration

  • COMET Web Services version:
    • CDP4Common:
    • PostrgreSQL:
    • Other:
  • Environment (Operating system, version and so on):
  • .NET Framework version:
  • Mono version:
  • Additional information:

@samatrhea Should we also validate all ParameterType used in Compound and SampledFunction ParameterType ?