From dd7e03c7d7434e5fd5aa96812e773a69247b8546 Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 13 Aug 2018 18:46:54 -0700 Subject: Add defaults for networkId and pagination --- packages/sra-api/src/parameters.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'packages/sra-api/src') diff --git a/packages/sra-api/src/parameters.ts b/packages/sra-api/src/parameters.ts index 10382894c..48ffb036d 100644 --- a/packages/sra-api/src/parameters.ts +++ b/packages/sra-api/src/parameters.ts @@ -7,6 +7,7 @@ export const paginationParameters: ParameterObject[] = [ example: 3, schema: { type: 'number', + default: 1, }, }, { @@ -16,6 +17,7 @@ export const paginationParameters: ParameterObject[] = [ example: 10, schema: { type: 'number', + default: 100, }, }, ]; @@ -27,10 +29,11 @@ export const networkdIdParameter: ParameterObject = { example: 42, schema: { type: 'number', + default: 1, }, }; export const generateParameters = (parameters: ParameterObject[], isPaginated: boolean = false): ParameterObject[] => { const optionalParameters = isPaginated ? paginationParameters : []; - return [networkdIdParameter, ...optionalParameters, ...parameters]; + return [...parameters, networkdIdParameter, ...optionalParameters]; }; -- cgit v1.2.3