Skip to content

Commit

Permalink
Updates parameter validators/defaults/nullability; Replaces checksum …
Browse files Browse the repository at this point in the history
…with etag (#28528)

* Updates minor tweaks

* Updates examples

---------

Co-authored-by: Graham Thomas <[email protected]>
  • Loading branch information
GrahamMThomas and Graham Thomas authored Mar 29, 2024
1 parent 7f8c1c3 commit 49695ca
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"confidenceScore": 0.83
}
],
"stringIndexType": "TextElement_v8"
"stringIndexType": "TextElement_v8",
"etag": "0x000000000000000"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ model Job {
@doc("The name of a job.")
@visibility("read")
@maxLength(36)
@minLength(1)
@minLength(3) // Must be 3 to match regex
@pattern("^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$")
@path
name: string;
Expand Down Expand Up @@ -138,11 +138,13 @@ model SourceStorageLocation {
location: url;

@doc("Prefix to filter blobs by.")
@minLength(1)
@maxLength(1024)
prefix: string;

@doc("List of extensions to filter blobs by.")
@minItems(1)
extensions?: Array<string> = ["*"];
extensions: Array<string> = ["*"];
}

@doc("Storage location.")
Expand All @@ -151,6 +153,8 @@ model TargetStorageLocation {
location: url;

@doc("Prefix to filter blobs by.")
@minLength(1)
@maxLength(1024)
prefix: string;
}

Expand Down Expand Up @@ -189,17 +193,16 @@ enum StringIndexType {
model DeidRequest {
@doc("Input text to deidentify.")
@maxLength(100000) // 100KB
@minLength(1)
inputText: string;

@doc("Data type of the input.")
dataType: DocumentDataType;
dataType: DocumentDataType = DocumentDataType.PlainText;

@doc("Operation to perform on the input.")
operation: OperationType;
operation: OperationType = OperationType.Surrogate;

@doc("Requested Encoding of the tag response indices.")
stringIndexType?: StringIndexType = StringIndexType.TextElement_v8;
stringIndexType: StringIndexType = StringIndexType.TextElement_v8;

@maxLength(16)
@doc("Format of the redacted output. Only valid when OperationType is Redact.")
Expand Down Expand Up @@ -227,8 +230,7 @@ model PhiTaggerResult {
@maxLength(1024) // Max length for Blob Name
path?: string;

@doc("Checksum of the file.")
checksum?: string;
...EtagProperty;
}

@doc("List of PHI Entities.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
"description": "The name of a job.",
"required": true,
"type": "string",
"minLength": 1,
"minLength": 3,
"maxLength": 36,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$"
},
Expand Down Expand Up @@ -224,7 +224,7 @@
"description": "The name of a job.",
"required": true,
"type": "string",
"minLength": 1,
"minLength": 3,
"maxLength": 36,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$"
},
Expand Down Expand Up @@ -312,7 +312,7 @@
"description": "The name of a job.",
"required": true,
"type": "string",
"minLength": 1,
"minLength": 3,
"maxLength": 36,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$"
},
Expand Down Expand Up @@ -366,7 +366,7 @@
"description": "The name of a job.",
"required": true,
"type": "string",
"minLength": 1,
"minLength": 3,
"maxLength": 36,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$"
},
Expand Down Expand Up @@ -423,7 +423,7 @@
"description": "The name of a job.",
"required": true,
"type": "string",
"minLength": 1,
"minLength": 3,
"maxLength": 36,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$"
},
Expand Down Expand Up @@ -590,16 +590,17 @@
"inputText": {
"type": "string",
"description": "Input text to deidentify.",
"minLength": 1,
"maxLength": 100000
},
"dataType": {
"$ref": "#/definitions/DocumentDataType",
"description": "Data type of the input."
"description": "Data type of the input.",
"default": "PlainText"
},
"operation": {
"$ref": "#/definitions/OperationType",
"description": "Operation to perform on the input."
"description": "Operation to perform on the input.",
"default": "Surrogate"
},
"stringIndexType": {
"$ref": "#/definitions/StringIndexType",
Expand All @@ -615,7 +616,8 @@
"required": [
"inputText",
"dataType",
"operation"
"operation",
"stringIndexType"
]
},
"DeidResponse": {
Expand Down Expand Up @@ -709,7 +711,7 @@
"name": {
"type": "string",
"description": "The name of a job.",
"minLength": 1,
"minLength": 3,
"maxLength": 36,
"pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]+[a-zA-Z0-9]$",
"readOnly": true
Expand Down Expand Up @@ -1219,14 +1221,16 @@
"description": "Path to the file in the storage container.",
"maxLength": 1024
},
"checksum": {
"type": "string",
"description": "Checksum of the file."
"etag": {
"$ref": "#/definitions/Azure.Core.eTag",
"description": "The entity tag for this resource.",
"readOnly": true
}
},
"required": [
"entities",
"stringIndexType"
"stringIndexType",
"etag"
]
},
"SourceStorageLocation": {
Expand All @@ -1240,7 +1244,9 @@
},
"prefix": {
"type": "string",
"description": "Prefix to filter blobs by."
"description": "Prefix to filter blobs by.",
"minLength": 1,
"maxLength": 1024
},
"extensions": {
"type": "array",
Expand All @@ -1256,7 +1262,8 @@
},
"required": [
"location",
"prefix"
"prefix",
"extensions"
]
},
"StringIndexType": {
Expand Down Expand Up @@ -1300,7 +1307,9 @@
},
"prefix": {
"type": "string",
"description": "Prefix to filter blobs by."
"description": "Prefix to filter blobs by.",
"minLength": 1,
"maxLength": 1024
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"confidenceScore": 0.83
}
],
"stringIndexType": "TextElement_v8"
"stringIndexType": "TextElement_v8",
"etag": "0x000000000000000"
}
}
}
Expand Down

0 comments on commit 49695ca

Please sign in to comment.