Open tipani86 opened 5 days ago
@tipani86 Hello there! I'm here to help you with bugs, questions, or becoming a contributor. Let's get this issue sorted out together!
The issue you're experiencing with the parameter being interpreted as none
during validation might be related to how Dify handles default values for parameters. If the "default" key is not present in the parameter's schema, the default value is set to None
[1]. This could be causing the parameter to be interpreted as none
regardless of the input you provide.
To address this, ensure that the OpenAPI schema correctly specifies default values for all parameters, or explicitly set the values in your test to avoid relying on defaults. Additionally, verify that the request body is correctly formatted as JSON and that the Content-Type: application/json
header is included in your request [2].
To continue talking to Dosu, mention @dosu.
@tipani86 Hello there! I'm here to help you with bugs, questions, or becoming a contributor. Let's get this issue sorted out together!
The issue you're experiencing with the parameter being interpreted as
none
during validation might be related to how Dify handles default values for parameters. If the "default" key is not present in the parameter's schema, the default value is set toNone
[1]. This could be causing the parameter to be interpreted asnone
regardless of the input you provide.To address this, ensure that the OpenAPI schema correctly specifies default values for all parameters, or explicitly set the values in your test to avoid relying on defaults. Additionally, verify that the request body is correctly formatted as JSON and that the
Content-Type: application/json
header is included in your request [2].To continue talking to Dosu, mention @dosu.
As can be seen in the provided screenshot, I am filling all the parameters (and all of them are mandatory, not optional, per the schema. So there should not be any default values being in use in the actual call that goes out.
Update: For now, I have been able to work around the issue by breaking the inner object of the original field lesson_status
into its component parts (like lesson_name
and passed
) so basically flattened it into the same level as the outer fields. However, this was only because I had access to both sides as the API's developer myself. Had I tried to use some 3rd party API with its field structure locked as such, I would not have been able to work around this issue.
Self Checks
Dify version
0.8.3
Cloud or Self Hosted
Cloud
Steps to reproduce
✔️ Expected Behavior
All parameters pass validation.
❌ Actual Behavior
One parameter, which is in object (dict) format, failed validation. Error message says it shows as
none
. It doesn't matter if I wrote something else in this parameter value (like integer or string), the validation error will always show asnone
, like depicted in the screenshot.