Skip to content

Commit

Permalink
fix: strict error check schema error (#701)
Browse files Browse the repository at this point in the history
  • Loading branch information
zccz14 authored Jul 12, 2024
1 parent b1fa243 commit a049fb8
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/account-composer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
const TERMINAL_ID = process.env.TERMINAL_ID || `AccountComposer`;
const terminal = new Terminal(process.env.HOST_URL!, { terminal_id: TERMINAL_ID, name: 'Account Composer' });

const ajv = new Ajv();
const ajv = new Ajv({ strict: false });
addFormats(ajv);

const validate = ajv.compile(getDataRecordSchema('account_composition_relation')!);
Expand Down
2 changes: 1 addition & 1 deletion apps/data-collector/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const MetricCronjobStatus = PromRegistry.create(
'data CronJob status',
);

const ajv = new Ajv();
const ajv = new Ajv({ strict: false });

const HOST_URL = process.env.HOST_URL!;
const STORAGE_TERMINAL_ID = process.env.STORAGE_TERMINAL_ID!;
Expand Down
2 changes: 1 addition & 1 deletion apps/general-data-source/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const MetricSyncDurationBucket = PromRegistry.create('histogram', 'general_data_

const MetricSyncStatus = PromRegistry.create('gauge', 'general_data_source_sync_status');

const ajv = new Ajv();
const ajv = new Ajv({ strict: false });
const validate = ajv.compile(getDataRecordSchema('general_specific_relation')!);

const HV_URL = process.env.HV_URL!;
Expand Down
2 changes: 1 addition & 1 deletion apps/general-realtime-data-source/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {

type IGeneralSpecificRelation = IDataRecordTypes['general_specific_relation'];

const ajv = new Ajv();
const ajv = new Ajv({ strict: false });
const validate = ajv.compile(getDataRecordSchema('general_specific_relation')!);

const HV_URL = process.env.HV_URL!;
Expand Down
2 changes: 1 addition & 1 deletion apps/market-data-collector/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const MetricCronjobStatus = PromRegistry.create(
'historical market data CronJob status',
);

const ajv = new Ajv();
const ajv = new Ajv({ strict: false });

const HV_URL = process.env.HV_URL!;
const STORAGE_TERMINAL_ID = process.env.STORAGE_TERMINAL_ID!;
Expand Down
2 changes: 1 addition & 1 deletion apps/risk-manager/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function mapRiskInfoToState$(riskInfo: IDataRecordTypes['account_risk_info']) {
);
}

const ajv = new Ajv({ strictSchema: false });
const ajv = new Ajv({ strict: false });
const validator = ajv.compile(getDataRecordSchema('account_risk_info')!);

const configs$ = defer(() => readDataRecords(terminal, { type: 'account_risk_info' })).pipe(
Expand Down
2 changes: 1 addition & 1 deletion apps/trade-copier/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ interface ITradeCopierConfig {
}>;
}

const ajv = new Ajv();
const ajv = new Ajv({ strict: false });
addFormats(ajv);

const tradeConfigValidate = ajv.compile(getDataRecordSchema('trade_copier_trade_config')!);
Expand Down
10 changes: 10 additions & 0 deletions common/changes/@yuants/app-account-composer/2024-07-12-13-33.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@yuants/app-account-composer",
"comment": "strict schema error",
"type": "patch"
}
],
"packageName": "@yuants/app-account-composer"
}
10 changes: 10 additions & 0 deletions common/changes/@yuants/app-data-collector/2024-07-12-13-33.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@yuants/app-data-collector",
"comment": "strict schema error",
"type": "patch"
}
],
"packageName": "@yuants/app-data-collector"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@yuants/app-general-data-source",
"comment": "strict schema error",
"type": "patch"
}
],
"packageName": "@yuants/app-general-data-source"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@yuants/app-general-realtime-data-source",
"comment": "strict schema error",
"type": "patch"
}
],
"packageName": "@yuants/app-general-realtime-data-source"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@yuants/app-market-data-collector",
"comment": "strict schema error",
"type": "patch"
}
],
"packageName": "@yuants/app-market-data-collector"
}
10 changes: 10 additions & 0 deletions common/changes/@yuants/app-risk-manager/2024-07-12-13-33.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@yuants/app-risk-manager",
"comment": "strict schema error",
"type": "patch"
}
],
"packageName": "@yuants/app-risk-manager"
}
10 changes: 10 additions & 0 deletions common/changes/@yuants/app-trade-copier/2024-07-12-13-33.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@yuants/app-trade-copier",
"comment": "strict schema error",
"type": "patch"
}
],
"packageName": "@yuants/app-trade-copier"
}

0 comments on commit a049fb8

Please sign in to comment.