diff --git a/source/__snapshots__/default-ftrack-schema.snap b/source/__snapshots__/default-ftrack-schema.snap index 5913f58..f270552 100644 --- a/source/__snapshots__/default-ftrack-schema.snap +++ b/source/__snapshots__/default-ftrack-schema.snap @@ -74,7 +74,7 @@ export interface State { } export interface AssetType { assets?: Asset[]; - component: string; + component?: string; readonly id: string; name: string; short: string; @@ -103,7 +103,7 @@ export interface TypedContextLink { metadata?: Metadata[]; to?: TypedContext; to_id: string; - type: string; + type?: string; __entity_type__?: "TypedContextLink"; __permissions?: Record; } @@ -209,7 +209,7 @@ export interface Appointment { } export interface TaskTypeSchema { readonly id: string; - name: string; + name?: string; types?: Type[]; __entity_type__?: "TaskTypeSchema"; __permissions?: Record; @@ -782,7 +782,7 @@ export interface ListCategory { } export interface WorkflowSchema { readonly id: string; - name: string; + name?: string; overrides?: ProjectSchemaOverride[]; statuses?: Status[]; __entity_type__?: "WorkflowSchema"; @@ -958,7 +958,7 @@ export interface ObjectType { icon: string; readonly id: string; is_leaf?: boolean; - is_prioritizable: boolean; + is_prioritizable?: boolean; is_schedulable: boolean; is_statusable: boolean; is_taskable: boolean; @@ -1012,7 +1012,7 @@ export interface AssetVersionStatusChange export interface Setting { readonly group: string; readonly name: string; - value: string; + value?: string; __entity_type__?: "Setting"; __permissions?: Record; } @@ -1079,7 +1079,7 @@ export interface List { owner?: User; project?: Project; project_id: string; - system_type: string; + system_type?: string; user_id?: string; __entity_type__?: "List"; __permissions?: Record; diff --git a/source/__snapshots__/default-highway-test.snap b/source/__snapshots__/default-highway-test.snap index 5951bcd..8b12a51 100644 --- a/source/__snapshots__/default-highway-test.snap +++ b/source/__snapshots__/default-highway-test.snap @@ -74,7 +74,7 @@ export interface State { } export interface AssetType { assets?: Asset[]; - component: string; + component?: string; readonly id: string; name: string; short: string; @@ -103,7 +103,7 @@ export interface TypedContextLink { metadata?: Metadata[]; to?: TypedContext; to_id: string; - type: string; + type?: string; __entity_type__?: "TypedContextLink"; __permissions?: Record; } @@ -209,7 +209,7 @@ export interface Appointment { } export interface TaskTypeSchema { readonly id: string; - name: string; + name?: string; types?: Type[]; __entity_type__?: "TaskTypeSchema"; __permissions?: Record; @@ -782,7 +782,7 @@ export interface ListCategory { } export interface WorkflowSchema { readonly id: string; - name: string; + name?: string; overrides?: ProjectSchemaOverride[]; statuses?: Status[]; __entity_type__?: "WorkflowSchema"; @@ -958,7 +958,7 @@ export interface ObjectType { icon: string; readonly id: string; is_leaf?: boolean; - is_prioritizable: boolean; + is_prioritizable?: boolean; is_schedulable: boolean; is_statusable: boolean; is_taskable: boolean; @@ -1012,7 +1012,7 @@ export interface AssetVersionStatusChange export interface Setting { readonly group: string; readonly name: string; - value: string; + value?: string; __entity_type__?: "Setting"; __permissions?: Record; } @@ -1079,7 +1079,7 @@ export interface List { owner?: User; project?: Project; project_id: string; - system_type: string; + system_type?: string; user_id?: string; __entity_type__?: "List"; __permissions?: Record; diff --git a/source/convertSchemaToInterface.ts b/source/convertSchemaToInterface.ts index 80c957a..b6db0ec 100644 --- a/source/convertSchemaToInterface.ts +++ b/source/convertSchemaToInterface.ts @@ -132,9 +132,7 @@ function convertPropertiesToTypes( } const isRequired = - schema.required?.includes(key) || - schema.primary_key?.includes(key) || - ("default" in value && !!value.default); + schema.required?.includes(key) || schema.primary_key?.includes(key); let type; if ("$ref" in value && value.$ref) {