Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Resource parameter default values #760

Open
rspremulli-sf opened this issue Jul 3, 2021 · 0 comments
Open

Resource parameter default values #760

rspremulli-sf opened this issue Jul 3, 2021 · 0 comments

Comments

@rspremulli-sf
Copy link

Would like to be able to define a default value for a resource parameter so that if it is not passed, it will be defaulted. Use case: a trait that has a standard min/max/default value, but that can be overridden if necessary. For example, a trait that adds query parameters to a list api. this would have query parameters for offset and limit. Limit would have a default value for the number of returned records, and a maximum number allowed. I would like to define this in the trait. Then, if I have an endpoint that needs to change those numbers (for example, raise it because there is a larger amount of smaller data) I can override the default

Current workaround:
Create two traits: One with resource parameters, and one without that calls the first one and passes in values. This requires duplicated traits to exist and be maintained though

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

No branches or pull requests

1 participant