Closed theoolee closed 10 months ago
And I think the return type of the request method is better to be Future<HttpResponse\<T>> rather than Future\<T>.
Send a part of the diagram to make it easier to understand what the error is
Send a part of the diagram to make it easier to understand what the error is
swagger is here, and you can find a model named AppointmentCalendarPeriodDate
, which is generated to a class with single additionalProperties
, properties defined in swagger were missing.
In the parseDataClasses
method of swagger_parser/lib/src/parser/parser.dart
, the AppointmentCalendarPeriodDate
model is added two times to the dataClasses, and one is with parameters, the other is without parameters.
The side effect of _findType
changes _objectClasses
and all the classes in it are added to dataClasses
at line 636, which causes the repetition.
The type of property appointmentCalendarPeriodDate
is a ref of AppointmentCalendarPeriodDate
model, when parsing this property, a wrong AppointmentCalendarPeriodDate
is added to _objectClasses
, and the real AppointmentCalendarPeriodDate
in the dataClasses
will be covered later.
{
"AppointmentCalendarDate": {
"type": "object",
"properties": {
"appointmentCalendarPeriodDate": {
"type": "object",
"description": "",
"allowEmptyValue": false,
"additionalProperties": {
"$ref": "#/definitions/AppointmentCalendarPeriodDate"
}
}
}
}
Maybe is't not easy to be fixed. But is there a way to access the raw value of the json? Otherwise there would be no way to get the response data.