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

[models] add option to fill default field values #41

Open
petomalina opened this issue Mar 27, 2018 · 1 comment
Open

[models] add option to fill default field values #41

petomalina opened this issue Mar 27, 2018 · 1 comment
Assignees
Labels
enhancement Request for a change or improvement of existing functionality
Projects

Comments

@petomalina
Copy link

It would be awesome if the API client could generate constructor functions which would automatically fill null fields.

E.g:

interface User {
  name: string;
  email: string;
}

and the response from the API would be:

{
  "email": "[email protected]"
}

the client would automatically migrate this model into:

{
  "name": "",
  "email": "[email protected]"
}
@vmasek
Copy link
Member

vmasek commented Mar 27, 2018

in user.model.ts file there would be a function getUser which will take User as an optional parameter. It will return an empty user merged with the user provided in params

@vmasek vmasek self-assigned this Mar 27, 2018
@vmasek vmasek added the enhancement Request for a change or improvement of existing functionality label Mar 27, 2018
@vmasek vmasek added this to the 3.1 milestone Mar 27, 2018
@vmasek vmasek modified the milestones: 3.2, 5.x Sep 1, 2018
@vmasek vmasek added this to Planned in Main board Dec 2, 2020
@vmasek vmasek moved this from Planned to To do in Main board Dec 2, 2020
@vmasek vmasek removed this from the 5.x milestone Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request for a change or improvement of existing functionality
Projects
Status: To do
Development

No branches or pull requests

2 participants