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 default property into response model #188

Open
garrettrathbone opened this issue Jan 11, 2023 · 1 comment
Open

Add default property into response model #188

garrettrathbone opened this issue Jan 11, 2023 · 1 comment

Comments

@garrettrathbone
Copy link

Currently, if a property that is in the model doesn't exist in the returned results set, it returns nothing, regardless of if a default is provided or not. It seems rational to not return a value in the model that doesn't exist, which allows someone to understand what is coming from the API or not. But I think there are benefits to allowing someone to set default on a property and allow the model to return that in the situation that the value wasn't set in the original response. By checking whether a default is set in general, regardless of if it is truthy, falsey, or whatever else, this supports backwards compatibility with the option to 'opt in' to setting a default for a property.

@garrettrathbone
Copy link
Author

Pull Request made here. #187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant