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-api/src/json-schemas.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-api/src/json-schemas.ts')
-rw-r--r-- | packages/sra-api/src/json-schemas.ts | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/packages/sra-api/src/json-schemas.ts b/packages/sra-api/src/json-schemas.ts deleted file mode 100644 index 173a04bfb..000000000 --- a/packages/sra-api/src/json-schemas.ts +++ /dev/null @@ -1,63 +0,0 @@ -import { schemas as jsonSchemas } from '@0xproject/json-schemas'; - -// Only include schemas we actually need -const { - numberSchema, - addressSchema, - hexSchema, - orderHashSchema, - orderSchema, - signedOrderSchema, - signedOrdersSchema, - ordersSchema, - paginatedCollectionSchema, - relayerApiErrorResponseSchema, - relayerApiFeeRecipientsResponseSchema, - relayerApiOrderSchema, - relayerApiOrdersSchema, - relayerApiOrderConfigPayloadSchema, - relayerApiOrderConfigResponseSchema, - relayerApiOrderbookResponseSchema, - relayerApiAssetDataPairsResponseSchema, - relayerApiAssetDataTradeInfoSchema, - relayerApiOrdersChannelSubscribeSchema, - relayerApiOrdersChannelSubscribePayload, - relayerApiOrdersChannelUpdateSchema, - relayerApiOrdersResponseSchema, - relayerApiAssetDataPairsSchema, -} = jsonSchemas; - -const usedSchemas = { - numberSchema, - addressSchema, - hexSchema, - orderHashSchema, - orderSchema, - signedOrderSchema, - signedOrdersSchema, - ordersSchema, - paginatedCollectionSchema, - relayerApiErrorResponseSchema, - relayerApiFeeRecipientsResponseSchema, - relayerApiOrderSchema, - relayerApiOrdersSchema, - relayerApiOrderConfigPayloadSchema, - relayerApiOrderConfigResponseSchema, - relayerApiOrderbookResponseSchema, - relayerApiAssetDataPairsResponseSchema, - relayerApiAssetDataTradeInfoSchema, - relayerApiOrdersChannelSubscribeSchema, - relayerApiOrdersChannelSubscribePayload, - relayerApiOrdersChannelUpdateSchema, - relayerApiOrdersResponseSchema, - relayerApiAssetDataPairsSchema, -}; - -// We need to replace the `$ref`s to be OpenAPI compliant. -const openApiSchemas = JSON.parse( - JSON.stringify(usedSchemas).replace(/(\/\w+)/g, match => `#/components/schemas${match}`), -); -// The json schema used by OpenAPI does not accept ids -Object.keys(openApiSchemas).forEach(key => delete openApiSchemas[key].id); - -export const schemas = openApiSchemas; |