Skip to content

Commit 1224400

Browse files
authored
Merge pull request #12 from javrrr/fix/dmo-field-input-schema
Fix DataObjectFieldInputRepresentation: dataType and isDynamicLookup
2 parents 03381e0 + 2e3ee7b commit 1224400

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

scripts/generate-types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ const SCHEMA_OVERRIDES: Record<string, SchemaOverride> = {
6969
note: "Spec bugs: recordModifiedFieldName and orgUnitIdentifierFieldName are not required for all DLO types",
7070
makeOptional: ["recordModifiedFieldName", "orgUnitIdentifierFieldName"],
7171
},
72+
DataObjectFieldInputRepresentation: {
73+
note: "Spec bugs: API expects `dataType` instead of `type` for field data type; isDynamicLookup missing but required for PATCH to work",
74+
makeOptional: ["type"],
75+
addRequiredFields: {
76+
dataType: '"Boolean" | "Date" | "DateOnly" | "DateTime" | "Email" | "Number" | "Percent" | "Phone" | "Text" | "Url"',
77+
isDynamicLookup: "boolean",
78+
},
79+
},
7280
SemanticSearchInputRepresentation: {
7381
note: "Spec bugs: processingType missing from spec but required by API; attachment/transcribe fields are only required for document/PDF search indexes, not structured DMO search",
7482
makeOptional: [

src/schemas.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2072,7 +2072,16 @@ export type DataModelObjectRepresentation = {
20722072
type?: "DataLakeObject" | "DataModelObject";
20732073
status?: "Active" | "Error" | "Inactive" | "Processing";
20742074
}
2075-
export type DataObjectFieldInputRepresentation = Schemas["DataObjectFieldInputRepresentation"];
2075+
/** @override Spec bugs: API expects `dataType` instead of `type` for field data type; isDynamicLookup missing but required for PATCH to work */
2076+
export type DataObjectFieldInputRepresentation = {
2077+
isPrimaryKey: boolean;
2078+
keyQualifierFieldName: string;
2079+
label: string;
2080+
name: string;
2081+
type?: "Boolean" | "Date" | "DateOnly" | "DateTime" | "Email" | "Number" | "Percent" | "Phone" | "Text" | "Url";
2082+
dataType: "Boolean" | "Date" | "DateOnly" | "DateTime" | "Email" | "Number" | "Percent" | "Phone" | "Text" | "Url";
2083+
isDynamicLookup: boolean;
2084+
}
20762085
export type DataObjectFieldRepresentation = Schemas["DataObjectFieldRepresentation"];
20772086
export type DataObjectInputRepresentation = {
20782087
dataSpaceName?: string;

0 commit comments

Comments
 (0)