Boavizta / boaviztapi

🛠 Giving access to BOAVIZTA reference data and methodologies trough a RESTful API
GNU Affero General Public License v3.0
66 stars 23 forks source link

Add warnings and comments in verbose mode #129

Closed da-ekchajzer closed 1 year ago

da-ekchajzer commented 1 year ago

Problem

The values sent by the user may be inconsistent. In this case, it is necessary to inform the user.

In addition, the evaluations we produce are subject to many limitations. For the sake of transparency, it is important to send them back to the user

We propose to add a feature to send warnings to the users to transmit this type of information.

Solution

We could use a state variable warning = [] where we push warnings when they appear during the processing of the request.

Warning could be of this form :

{
"description": "...",
"type": "Input/Methodology"
}

Additional context

See state variables : https://www.starlette.io/requests/#other-state

da-ekchajzer commented 1 year ago

Implemented in the upcoming v0.3