diff options
author | Remco Bloemen <remco@wicked.ventures> | 2018-11-09 01:32:40 +0800 |
---|---|---|
committer | Remco Bloemen <remco@wicked.ventures> | 2018-11-09 01:32:40 +0800 |
commit | d71362af993d3797dbdbfcac245ad57f0086bce3 (patch) | |
tree | 888826fe23c2d06d6c9191fb3a238e14f9fe4aac /packages/sra-spec/src/parameters.ts | |
parent | a5665a68756c905637c551fc48c9b7011a55c237 (diff) | |
parent | f6abc007ffb249e4bbf85b8a7a77309d43e0a147 (diff) | |
download | dexon-sol-tools-d71362af993d3797dbdbfcac245ad57f0086bce3.tar dexon-sol-tools-d71362af993d3797dbdbfcac245ad57f0086bce3.tar.gz dexon-sol-tools-d71362af993d3797dbdbfcac245ad57f0086bce3.tar.bz2 dexon-sol-tools-d71362af993d3797dbdbfcac245ad57f0086bce3.tar.lz dexon-sol-tools-d71362af993d3797dbdbfcac245ad57f0086bce3.tar.xz dexon-sol-tools-d71362af993d3797dbdbfcac245ad57f0086bce3.tar.zst dexon-sol-tools-d71362af993d3797dbdbfcac245ad57f0086bce3.zip |
Merge remote-tracking branch 'origin/development' into feature/utils/prettybignum
Diffstat (limited to 'packages/sra-spec/src/parameters.ts')
-rw-r--r-- | packages/sra-spec/src/parameters.ts | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/packages/sra-spec/src/parameters.ts b/packages/sra-spec/src/parameters.ts new file mode 100644 index 000000000..48ffb036d --- /dev/null +++ b/packages/sra-spec/src/parameters.ts @@ -0,0 +1,39 @@ +import { ParameterObject } from '@loopback/openapi-v3-types'; +export const paginationParameters: ParameterObject[] = [ + { + name: 'page', + in: 'query', + description: 'The number of the page to request in the collection.', + example: 3, + schema: { + type: 'number', + default: 1, + }, + }, + { + name: 'perPage', + in: 'query', + description: 'The number of records to return per page.', + example: 10, + schema: { + type: 'number', + default: 100, + }, + }, +]; + +export const networkdIdParameter: ParameterObject = { + name: 'networkId', + in: 'query', + description: 'The id of the Ethereum network', + example: 42, + schema: { + type: 'number', + default: 1, + }, +}; + +export const generateParameters = (parameters: ParameterObject[], isPaginated: boolean = false): ParameterObject[] => { + const optionalParameters = isPaginated ? paginationParameters : []; + return [...parameters, networkdIdParameter, ...optionalParameters]; +}; |