Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Generation fails for a list of enum #305

Closed
mikedigit opened this issue Jan 11, 2022 · 6 comments · Fixed by #314
Closed

[BUG] Generation fails for a list of enum #305

mikedigit opened this issue Jan 11, 2022 · 6 comments · Fixed by #314
Assignees
Labels
bug Something isn't working

Comments

@mikedigit
Copy link

mikedigit commented Jan 11, 2022

In my swagger file I have enums, one of them named CRMAPIPortfolioControllersDtoConsentStatusEnum which maps correctly if used alone but won't if in a List of enum.
To illustrate what I'm saying here is an extract of my *.swagger.dart which creates a chopper call with following signature:

Future<chopper.Response>
v1PortfolioGet(
{bool? sortAsc,
enums.CRMInfrastructureElasticSearchContactSortColumn? sortColumn,
String? from,
String? to,
bool? withArchivedContacts,
String? searchTerm,
enums.ProfileKindEnum? profileKinds,
enums.SourceEnum? sources,
List<CRMAPIPortfolioControllersDtoConsentStatusEnum>? consentStatuses, <-------------- problem here
int? size,
int? page}) {
generatedMapping.putIfAbsent(
CRMDomainReadModelsProfilesPagedDataResult1CRMInfrastructureElasticSearchReadModelsContactReadModel,
() => CRMDomainReadModelsProfilesPagedDataResult1CRMInfrastructureElasticSearchReadModelsContactReadModel
.fromJsonFactory);

As you can see, List<CRMAPIPortfolioControllersDtoConsentStatusEnum> is generated in place of List<enums.CRMAPIPortfolioControllersDtoConsentStatusEnum> which result in an import error.

If I add enums. manually everything works as expected.

Please let me know if you need to know more.

@mikedigit mikedigit added bug Something isn't working Triage needed labels Jan 11, 2022
@Vovanella95
Copy link
Collaborator

Hi @mikedigit

Thanks for raising issue. I will check it.

@Vovanella95
Copy link
Collaborator

Hi again @mikedigit !

Could you please share swagger file (or part of it) with this problem?

@mikedigit
Copy link
Author

May I send this to you through private channels ?

@Vovanella95
Copy link
Collaborator

@mikedigit sure. [email protected]

Also you can share only part of swagger file to avoid privacy issues

@Vovanella95
Copy link
Collaborator

@mikedigit I've fixed your file in latest version (2.3.7+). Please let us know if something wrong

@mikedigit
Copy link
Author

@mikedigit I've fixed your file in latest version (2.3.7+). Please let us know if something wrong

works like a charm thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants