Bladeren bron

Make query parameters required (#204)

Apparently default is optional
Ali Behjati 3 jaren geleden
bovenliggende
commit
1a3d8f211e
1 gewijzigde bestanden met toevoegingen van 4 en 4 verwijderingen
  1. 4 4
      third_party/pyth/price-service/src/rest.ts

+ 4 - 4
third_party/pyth/price-service/src/rest.ts

@@ -66,8 +66,8 @@ export class RestAPI {
     
     const latestVaasInputSchema: schema = {
       query: Joi.object({
-        ids: Joi.array().items(Joi.string().regex(/^(0x)?[a-f0-9]{64}$/))
-      })
+        ids: Joi.array().items(Joi.string().regex(/^(0x)?[a-f0-9]{64}$/)).required()
+      }).required()
     }
     app.get("/latest_vaas", validate(latestVaasInputSchema), (req: Request, res: Response) => {
       let priceIds = req.query.ids as string[];
@@ -110,8 +110,8 @@ export class RestAPI {
 
     const latestPriceFeedsInputSchema: schema = {
       query: Joi.object({
-        ids: Joi.array().items(Joi.string().regex(/^(0x)?[a-f0-9]{64}$/))
-      })
+        ids: Joi.array().items(Joi.string().regex(/^(0x)?[a-f0-9]{64}$/)).required()
+      }).required()
     }
     app.get("/latest_price_feeds", validate(latestPriceFeedsInputSchema), (req: Request, res: Response) => {
       let priceIds = req.query.ids as string[];