Convert the OpenApi object to a JSON spec file Will overwrite the existing file if it exists
void toJsonFile({required String destination}) { File(destination).writeAsStringSync(_encoder.convert(toJson())); }