Dart package that takes an OpenApi definition file and generates REST clients based on retrofit and data classes for your project.
90
stars
38
forks
source link
Query Params with omitted "required" attribute should be treated as "required": false #103
Closed
MartenNesterudOSD closed 10 months ago
According to the OpenApi spec (2.0, 3.0 and 3.1) the required attribute default value is false. "[...]the property MAY be included and its default value is false."
That is not the case for generated query parameters now.
For instance, this:
Will produce this:
But should produce this:
I think the problem is this line in each of the parametersV* methods in parser.dart:
isRequired: isRequired ?? true,
should be
isRequired: isRequired ?? false,