Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix request schema #4400

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 16 additions & 20 deletions packages/types/src/schemas/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24436,6 +24436,7 @@ export const DataTableSchema = {
"data_element_metadata",
"data_group_metadata",
"entities",
"entity_attributes",
"entity_relations",
"events",
"sql"
Expand Down Expand Up @@ -24666,7 +24667,6 @@ export const EntitySchema = {
"case_contact",
"catchment",
"city",
"complaint",
"country",
"disaster",
"district",
Expand All @@ -24692,7 +24692,6 @@ export const EntitySchema = {
"sub_facility",
"trap",
"village",
"water_sample",
"wish_sub_district",
"world"
],
Expand Down Expand Up @@ -24997,6 +24996,15 @@ export const MapOverlaySchema = {
"name": {
"type": "string"
},
"permission_group": {
"type": "string"
},
"project_codes": {
"type": "array",
"items": {
"type": "string"
}
},
"report_code": {
"type": "string"
}
Expand All @@ -25005,7 +25013,8 @@ export const MapOverlaySchema = {
"additionalProperties": false,
"required": [
"code",
"name"
"name",
"permission_group"
]
}

Expand Down Expand Up @@ -25044,12 +25053,6 @@ export const MapOverlayGroupRelationSchema = {
"map_overlay_group_id": {
"type": "string"
},
"permission_groups": {
"type": "array",
"items": {
"type": "string"
}
},
"sort_order": {
"type": "number"
}
Expand Down Expand Up @@ -25308,7 +25311,6 @@ export const PermissionsBasedMeditrakSyncQueueSchema = {
"case_contact",
"catchment",
"city",
"complaint",
"country",
"disaster",
"district",
Expand All @@ -25334,7 +25336,6 @@ export const PermissionsBasedMeditrakSyncQueueSchema = {
"sub_facility",
"trap",
"village",
"water_sample",
"wish_sub_district",
"world"
],
Expand Down Expand Up @@ -26068,7 +26069,6 @@ export const EntityTypeSchema = {
"case_contact",
"catchment",
"city",
"complaint",
"country",
"disaster",
"district",
Expand All @@ -26094,7 +26094,6 @@ export const EntityTypeSchema = {
"sub_facility",
"trap",
"village",
"water_sample",
"wish_sub_district",
"world"
],
Expand Down Expand Up @@ -26127,6 +26126,7 @@ export const DataTableTypeSchema = {
"data_element_metadata",
"data_group_metadata",
"entities",
"entity_attributes",
"entity_relations",
"events",
"sql"
Expand Down Expand Up @@ -26207,7 +26207,6 @@ export const EntityCreatedSchema = {
"case_contact",
"catchment",
"city",
"complaint",
"country",
"disaster",
"district",
Expand All @@ -26233,7 +26232,6 @@ export const EntityCreatedSchema = {
"sub_facility",
"trap",
"village",
"water_sample",
"wish_sub_district",
"world"
],
Expand Down Expand Up @@ -26376,7 +26374,6 @@ export const MeditrakSurveyResponseRequestSchema = {
"case_contact",
"catchment",
"city",
"complaint",
"country",
"disaster",
"district",
Expand All @@ -26402,7 +26399,6 @@ export const MeditrakSurveyResponseRequestSchema = {
"sub_facility",
"trap",
"village",
"water_sample",
"wish_sub_district",
"world"
],
Expand Down Expand Up @@ -26477,8 +26473,8 @@ export const MeditrakSurveyResponseRequestSchema = {
export const DataTablePreviewRequestSchema = {
"properties": {
"runtimeParams": {
"type": "object",
"additionalProperties": false
"additionalProperties": true,
"type": "object"
},
"code": {
"type": "string"
Expand All @@ -26502,6 +26498,7 @@ export const DataTablePreviewRequestSchema = {
"data_element_metadata",
"data_group_metadata",
"entities",
"entity_attributes",
"entity_relations",
"events",
"sql"
Expand All @@ -26515,7 +26512,6 @@ export const DataTablePreviewRequestSchema = {
"code",
"id",
"permission_groups",
"runtimeParams",
"type"
]
}
Expand Down
6 changes: 3 additions & 3 deletions packages/types/src/types/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ export interface MapOverlay {
'legacy'?: boolean;
'linked_measures'?: string[] | null;
'name': string;
'permission_group': string;
'project_codes'?: string[] | null;
'report_code'?: string | null;
}
export interface MapOverlayGroup {
Expand All @@ -325,7 +327,6 @@ export interface MapOverlayGroupRelation {
'child_type': string;
'id': string;
'map_overlay_group_id': string;
'permission_groups'?: string[] | null;
'sort_order'?: number | null;
}
export interface MeditrakDevice {
Expand Down Expand Up @@ -618,8 +619,6 @@ export enum EntityType {
'asset' = 'asset',
'institute' = 'institute',
'msupply_store' = 'msupply_store',
'complaint' = 'complaint',
'water_sample' = 'water_sample',
}
export enum DisasterType {
'cyclone' = 'cyclone',
Expand All @@ -641,6 +640,7 @@ export enum DataTableType {
'sql' = 'sql',
'data_group_metadata' = 'data_group_metadata',
'data_element_metadata' = 'data_element_metadata',
'entity_attributes' = 'entity_attributes',
}
export enum DataSourceType {
'dataElement' = 'dataElement',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
import { DataTable } from '../../models';

export interface DataTablePreviewRequest extends DataTable {
runtimeParams: Record<string, unknown>;
/**
* @additionalProperties true
*/
runtimeParams?: Record<string, unknown>;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ts to json schema generator puts this strictly as {} if you don't specify that it allows additional properties.

Also, I found that it is not always present, so I set it as optional.

}