OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
[ x] Have you provided a full/minimal spec to reproduce the issue?
[ x] Have you validated the input using an OpenAPI validator (example)?
[ x] What's the version of OpenAPI Generator used?
[x ] Have you search for related issues/PRs?
[x ] What's the actual output vs expected output?
[ ] [Optional] Bounty to sponsor the fix ([example]
Description
When trying to generate dart-dio source from a json openapi definition that includes a property called "source" or a definition called "URL", it does not compile
create openapi.json with a definition called "URL" and / or a field called "source"
generate dart-dio source
try building the source with mentioned command-line below
Error in BuiltValueGenerator for /openapi/lib/model/url.dart.
Please make the following changes to use built_value serialization:
1. Declare URL.serializer as: static Serializer<URL> get serializer => _$uRLSerializer; got static Serializer<URL> get serializer => _$URLSerializer;
Error in BuiltValueGenerator for abstract class Document implements Built<Document, dynamic>.
Please make the following changes to use BuiltValue:
1. Make field _source public; remove the underscore.
renaming the variables in the dart source like mentioned in the error messages works:
source -> source
$URLSerializer -> _$uRLSerializer (for the instance variable, not the class)
Bug Report Checklist
Description
When trying to generate dart-dio source from a json openapi definition that includes a property called "source" or a definition called "URL", it does not compile
openapi-generator version
MacOS Catalina, openapi-generator 4.2.2
OpenAPI declaration file content or url
Command line used for generation
openapi-generator generate -g dart-dio -i openapi.json -o openapi/
Steps to reproduce
Related issues/PRs
https://github.com/OpenAPITools/openapi-generator/issues/4865
Suggest a fix
renaming the variables in the dart source like mentioned in the error messages works: source -> source $URLSerializer -> _$uRLSerializer (for the instance variable, not the class)