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

Check the format of the data submitted to the stats endpoint. #8

Open
cedricbonhomme opened this issue Mar 5, 2021 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@cedricbonhomme
Copy link
Member

It would be safer to check the format of stats sent to Stats Service. The function to check the format is already implemented, partly.

This would prevent the processors from failing when trying to evaluate stats based on data with some missing properties.

Example:

[
    {
        "anr": "0a3ca941-35e1-42f7-8003-9b7bfa03cc2d",
        "type": "vulnerability",
        "date": "2021-03-05",
        "data": [
     {
        "averageRate": "3",
        "count": 1,
        "label1": "Mauvais dimensionnement des dispositifs de secours énergie (onduleur, batteries...)",
        "label2": "Incorrect sizing of emergency power supply equipment (inverter, batteries, etc.)",
        "label3": "Schlechte Dimensionierung der Notversorgungseinheiten (Wechselrichter, Batterien usw.)",
        "label4": "Verkeerde dimensionering van de noodvoedingssystemen (omzetter, batterijen ...)",
        "maxRisk": 6,
        "uuid": "69fc280e-4591-11e9-9173-0800277f0571"
      }
        ]
    }
]

It will check the format of the value of the data field.
For example if the key "uuid" is missing, the stats must not be accepted. Else the processors.

@cedricbonhomme cedricbonhomme added the enhancement New feature or request label Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant