fastify-resty
fastify-resty copied to clipboard
$sort error
Hi, I'm trying to figure out how to use $sort, when I use it like this:
/resource?$sort=field
I'm getting error:
"res":{"statusCode":400},"err":{"type":"Error","message":"querystring.$sort should be equal to one of the allowed values","stack":"Error: querystring.$sort should be equal to one of the allowed values\n at defaultSchemaErrorFormatter
...
fastify/lib/hooks.js:181:3)","validation":[{"keyword":"enum","dataPath":".$sort","schemaPath":"#/properties/%24sort/enum","params":{"allowedValues":["ASC","DESC","asc","desc"]},"message":"should be equal to one of the allowed values"}],"validationContext":"querystring"},"msg":"querystring.$sort should be equal to one of the allowed values"}
Is there something I'm missing?
node -v: v16.10.0
"fastify": "^3.6.0" "@fastify-resty/core": "^0.3.0" "@fastify-resty/typeorm": "^0.3.0" "typeorm": "^0.2.28"