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

Add support for complex intermediate return types in fake method #1850

Closed
ST-DDT opened this issue Feb 16, 2023 · 4 comments · Fixed by #2550
Closed

Add support for complex intermediate return types in fake method #1850

ST-DDT opened this issue Feb 16, 2023 · 4 comments · Fixed by #2550
Assignees
Labels
c: feature Request for new feature m: helpers Something is referring to the helpers module p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Milestone

Comments

@ST-DDT
Copy link
Member

ST-DDT commented Feb 16, 2023

Clear and concise description of the problem

Currently it is not possible to use methods, that return complex objects in the fake method, because it will only display [object].

Suggested solution

Add support for the following syntax:

faker.helpers.fake('{{airline.airport.code}}')

Which should be equivalent to:

faker.airline.airport().code

This should work for both method references and locale data references.

Alternative

No response

Additional context

Ref: #1733 (comment)

@ST-DDT ST-DDT added c: feature Request for new feature p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug m: helpers Something is referring to the helpers module labels Feb 16, 2023
@ST-DDT ST-DDT moved this to Todo in Faker Roadmap Feb 16, 2023
@ghost
Copy link

ghost commented Jul 23, 2023

I would like to work on this issue.

@ST-DDT ST-DDT assigned ghost Jul 23, 2023
@ST-DDT
Copy link
Member Author

ST-DDT commented Jul 23, 2023

Awesome. Thanks for your help.

@ST-DDT
Copy link
Member Author

ST-DDT commented Sep 1, 2023

@inkedtree Could you please give us an update on the progress here?

@ghost
Copy link

ghost commented Sep 4, 2023

@ST-DDT To be honest, there is not much progress so far. Last time I worked on this issue, I thought about where I need to make changes in the code. In the last few weeks I was quite busy. I will try to make a PR this week, if that is okay for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: feature Request for new feature m: helpers Something is referring to the helpers module p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
No open projects
Status: Todo
1 participant