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

Set default values #91

Open
cptchloroplast opened this issue Aug 25, 2023 · 1 comment
Open

Set default values #91

cptchloroplast opened this issue Aug 25, 2023 · 1 comment

Comments

@cptchloroplast
Copy link

I can define default values in the OpenAPI schema but it would be nice for the route to set them automatically.

@G4brym
Copy link
Member

G4brym commented Aug 31, 2023

Hey @cptchloroplast can you further explain?
Currently, if you define a default in an endpoint, that default will be passed to the endpoint in the data object
Here is an example of a query parameter with a default value

Query(Number, {
    description: 'Limit the number of objects per search category.',
    default: 3
})

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

2 participants