Skip to content

Commit

Permalink
fix: return all json schema validation errors and expose Ajv types (#38)
Browse files Browse the repository at this point in the history
* fix: return all json schema validation errors and expose Ajv types

* fix: doc generation Ajv incompatibility issues

* fix! remove outdated relayer api json schemas

* chore: add changelog entry for monorepo-scripts
  • Loading branch information
kimpers committed Jun 28, 2021
1 parent 3056524 commit f9e8674
Show file tree
Hide file tree
Showing 23 changed files with 29 additions and 730 deletions.
3 changes: 2 additions & 1 deletion doc-gen-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"TFillData": true,
"IterableIterator": true,
"Set": true,
"Exclude": true
"Exclude": true,
"Ajv": true
},
"ignoredExcessiveTypes": [
"NonceSubproviderErrors",
Expand Down
9 changes: 9 additions & 0 deletions json-schemas/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
[
{
"version": "6.2.0",
"changes": [
{
"note": "Return all schema validation errors and expose Ajv types, remove outdated relayer api schemas",
"pr": 38
}
]
},
{
"timestamp": 1619585664,
"version": "6.1.3",
Expand Down

This file was deleted.

12 changes: 0 additions & 12 deletions json-schemas/schemas/relayer_api_asset_data_pairs_schema.json

This file was deleted.

11 changes: 0 additions & 11 deletions json-schemas/schemas/relayer_api_asset_data_trade_info_schema.json

This file was deleted.

21 changes: 0 additions & 21 deletions json-schemas/schemas/relayer_api_error_response_schema.json

This file was deleted.

This file was deleted.

24 changes: 0 additions & 24 deletions json-schemas/schemas/relayer_api_order_config_payload_schema.json

This file was deleted.

32 changes: 0 additions & 32 deletions json-schemas/schemas/relayer_api_order_config_response_schema.json

This file was deleted.

9 changes: 0 additions & 9 deletions json-schemas/schemas/relayer_api_order_schema.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions json-schemas/schemas/relayer_api_orders_response_schema.json

This file was deleted.

7 changes: 0 additions & 7 deletions json-schemas/schemas/relayer_api_orders_schema.json

This file was deleted.

1 change: 1 addition & 0 deletions json-schemas/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export { SchemaValidator } from './schema_validator';
export { schemas } from './schemas';
export { Ajv } from 'ajv';
import * as AJV from 'ajv';
export { AJV };
module.exports.AJV = AJV;
2 changes: 1 addition & 1 deletion json-schemas/src/schema_validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class SchemaValidator {
* Instantiates a SchemaValidator instance
*/
constructor(newSchemas: object[] = []) {
this._validator = new AJV({ schemaId: 'auto' });
this._validator = new AJV({ schemaId: 'auto', allErrors: true });
this._validator.addSchema(values(schemas).filter(s => s !== undefined && s.id !== undefined));
this._validator.addSchema(newSchemas.filter(s => s !== undefined));
}
Expand Down
28 changes: 0 additions & 28 deletions json-schemas/src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,6 @@ import * as ordersRequestOptsSchema from '../schemas/orders_request_opts_schema.
import * as ordersSchema from '../schemas/orders_schema.json';
import * as pagedRequestOptsSchema from '../schemas/paged_request_opts_schema.json';
import * as paginatedCollectionSchema from '../schemas/paginated_collection_schema.json';
import * as relayerApiAssetDataPairsResponseSchema from '../schemas/relayer_api_asset_data_pairs_response_schema.json';
import * as relayerApiAssetDataPairsSchema from '../schemas/relayer_api_asset_data_pairs_schema.json';
import * as relayerApiAssetDataTradeInfoSchema from '../schemas/relayer_api_asset_data_trade_info_schema.json';
import * as relayerApiErrorResponseSchema from '../schemas/relayer_api_error_response_schema.json';
import * as relayerApiFeeRecipientsResponseSchema from '../schemas/relayer_api_fee_recipients_response_schema.json';
import * as relayerApiOrderConfigPayloadSchema from '../schemas/relayer_api_order_config_payload_schema.json';
import * as relayerApiOrderConfigResponseSchema from '../schemas/relayer_api_order_config_response_schema.json';
import * as relayerApiOrderSchema from '../schemas/relayer_api_order_schema.json';
import * as relayerApiOrderbookResponseSchema from '../schemas/relayer_api_orderbook_response_schema.json';
import * as relayerApiOrdersChannelSubscribePayloadSchema from '../schemas/relayer_api_orders_channel_subscribe_payload_schema.json';
import * as relayerApiOrdersChannelSubscribeSchema from '../schemas/relayer_api_orders_channel_subscribe_schema.json';
import * as relayerApiOrdersChannelUpdateSchema from '../schemas/relayer_api_orders_channel_update_response_schema.json';
import * as relayerApiOrdersResponseSchema from '../schemas/relayer_api_orders_response_schema.json';
import * as relayerApiOrdersSchema from '../schemas/relayer_api_orders_schema.json';
import * as signedOrderSchema from '../schemas/signed_order_schema.json';
import * as signedOrdersSchema from '../schemas/signed_orders_schema.json';
import * as tokenSchema from '../schemas/token_schema.json';
Expand Down Expand Up @@ -76,20 +62,6 @@ export const schemas = {
assetPairsRequestOptsSchema,
txDataSchema,
paginatedCollectionSchema,
relayerApiErrorResponseSchema,
relayerApiFeeRecipientsResponseSchema,
relayerApiOrderSchema,
relayerApiOrdersSchema,
relayerApiOrderConfigPayloadSchema,
relayerApiOrderConfigResponseSchema,
relayerApiOrderbookResponseSchema,
relayerApiAssetDataPairsResponseSchema,
relayerApiAssetDataTradeInfoSchema,
relayerApiOrdersChannelSubscribeSchema,
relayerApiOrdersChannelSubscribePayloadSchema,
relayerApiOrdersChannelUpdateSchema,
relayerApiOrdersResponseSchema,
relayerApiAssetDataPairsSchema,
zeroExTransactionSchema,
exchangeProxyMetaTransactionSchema,
wholeNumberSchema,
Expand Down
Loading

0 comments on commit f9e8674

Please sign in to comment.