diff --git a/enveloped-application.json b/enveloped-application.json index 04990d3..00f059c 100644 --- a/enveloped-application.json +++ b/enveloped-application.json @@ -255,7 +255,7 @@ "$ref": "#/components/schemas/ResultMetadata" }, "application": { - "$ref": "#/components/schemas/Application" + "$ref": "#/components/schemas/ResultApplication" }, "verificationTypes": { "$ref": "#/components/schemas/VerificationTypes" @@ -282,65 +282,45 @@ "description": "The data to verify", "properties": { "fields": { + "$ref": "#/components/schemas/Fields" + }, + "documents": { "type": "array", - "description": "Data fields to check.\n\nFor example: Last Name and Date of Birth sent from web form\n", + "description": "Documents for data extraction or cross-checking", "items": { - "$ref": "#/components/schemas/Field" - }, - "example": [ - { - "contentType": "string", - "category": "First name", - "content": "Artem" - }, - { - "contentType": "string", - "category": "Last name", - "content": "Gerus" - }, - { - "contentType": "sex", - "category": "Sex", - "content": "male" - }, - { - "contentType": "bool", - "category": "Agree on something", - "content": "true" + "$ref": "#/components/schemas/Document" + } + }, + "selfie": { + "description": "Media required for `face-matching`", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FacesMedia" + } } - ] + }, + "required": [ + "files" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "ResultApplication": { + "type": "object", + "description": "The data to verify", + "properties": { + "fields": { + "$ref": "#/components/schemas/Fields" }, "documents": { "type": "array", "description": "Documents for data extraction or cross-checking", "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "document id (filled automatically when missing)" - }, - "issuingCountry": { - "type": "string", - "description": "The code of the country of issue\n([alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)\nor [alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements))\n", - "pattern": "^[a-zA-Z]{2,3}$", - "example": "JPN" - }, - "documentType": { - "$ref": "#/components/schemas/DocumentType" - }, - "files": { - "description": "Document photos or scans", - "type": "array", - "items": { - "$ref": "#/components/schemas/DocumentMedia" - } - } - }, - "required": [ - "files" - ], - "additionalProperties": false + "$ref": "#/components/schemas/ResultDocument" } }, "selfie": { @@ -349,7 +329,7 @@ "files": { "type": "array", "items": { - "$ref": "#/components/schemas/FacesMedia" + "$ref": "#/components/schemas/ResultFacesMedia" } } }, @@ -361,6 +341,93 @@ }, "additionalProperties": false }, + "Fields": { + "type": "array", + "description": "Data fields to check.\n\nFor example: Last Name and Date of Birth sent from web form\n", + "items": { + "$ref": "#/components/schemas/Field" + }, + "example": [ + { + "contentType": "string", + "category": "First name", + "content": "Artem" + }, + { + "contentType": "string", + "category": "Last name", + "content": "Gerus" + }, + { + "contentType": "sex", + "category": "Sex", + "content": "male" + }, + { + "contentType": "bool", + "category": "Agree on something", + "content": "true" + } + ] + }, + "Document": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "document id (filled automatically when missing)" + }, + "issuingCountry": { + "type": "string", + "description": "The code of the country of issue\n([alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)\nor [alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements))\n", + "pattern": "^[a-zA-Z]{2,3}$", + "example": "JPN" + }, + "documentType": { + "$ref": "#/components/schemas/DocumentType" + }, + "files": { + "description": "Document photos or scans", + "type": "array", + "items": { + "$ref": "#/components/schemas/DocumentMedia" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false + }, + "ResultDocument": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "document id (filled automatically when missing)" + }, + "issuingCountry": { + "type": "string", + "description": "The code of the country of issue\n([alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)\nor [alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements))\n", + "pattern": "^[a-zA-Z]{2,3}$", + "example": "JPN" + }, + "documentType": { + "$ref": "#/components/schemas/DocumentType" + }, + "files": { + "description": "Temporary links to the document photos or scans", + "type": "array", + "items": { + "$ref": "#/components/schemas/ResultDocumentMedia" + } + } + }, + "required": [ + "files" + ], + "additionalProperties": false + }, "Field": { "type": "object", "oneOf": [ @@ -563,7 +630,27 @@ "uri": { "description": "Data URI of the media\n\nAll common image formats are acceptable.\n\nAcceptable video formats: WebM + VP8, MP4 + AVC\n", "type": "string", - "example": "data:video/webm;base64," + "format": "media-data-uri", + "example": "data:video/webm;base64,aGVsbG8=" + } + }, + "required": [ + "uri" + ], + "additionalProperties": false + }, + "ResultFacesMedia": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "file id (filled automatically when missing)" + }, + "uri": { + "description": "Temporary link to the media", + "type": "string", + "format": "uri", + "example": "https://some.site/image.jpeg?t=123" } }, "required": [ @@ -589,9 +676,10 @@ "example": "front" }, "uri": { - "description": "Data URI of the media", + "description": "Data URI of the media\n\nAll common image formats are acceptable.\n", "type": "string", - "example": "data:image/png;base64,R0lGODlhDAAMAK..." + "format": "media-data-uri", + "example": "data:image/png;base64,aGVsbG8=" } }, "required": [ @@ -600,6 +688,37 @@ ], "additionalProperties": false }, + "ResultDocumentMedia": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "file id (filled automatically when missing)" + }, + "kind": { + "type": "string", + "description": "kind of document page", + "enum": [ + "front", + "back", + "single-page" + ], + "example": "front" + }, + "uri": { + "description": "Temporary link to the media", + "type": "string", + "format": "uri", + "example": "https://some.site/image.jpeg?t=123" + } + }, + "required": [ + "id", + "uri", + "kind" + ], + "additionalProperties": false + }, "OverallResult": { "type": "object", "description": "Summary verification result (omitted if state is `processing`)", diff --git a/enveloped-application.yaml b/enveloped-application.yaml index 4d36f77..2711149 100644 --- a/enveloped-application.yaml +++ b/enveloped-application.yaml @@ -167,7 +167,7 @@ components: metadata: $ref: "#/components/schemas/ResultMetadata" application: - $ref: "#/components/schemas/Application" + $ref: "#/components/schemas/ResultApplication" verificationTypes: $ref: "#/components/schemas/VerificationTypes" processingState: @@ -187,65 +187,119 @@ components: description: The data to verify properties: fields: + $ref: '#/components/schemas/Fields' + documents: type: array - description: | - Data fields to check. - - For example: Last Name and Date of Birth sent from web form + description: Documents for data extraction or cross-checking items: - $ref: "#/components/schemas/Field" - example: - - contentType: string - category: First name - content: Artem - - contentType: string - category: Last name - content: Gerus - - contentType: sex - category: Sex - content: male - - contentType: bool - category: Agree on something - content: "true" + $ref: "#/components/schemas/Document" + selfie: + description: Media required for `face-matching` + properties: + files: + type: array + items: + $ref: "#/components/schemas/FacesMedia" + required: + - files + additionalProperties: false + additionalProperties: false + + ResultApplication: + type: object + description: The data to verify + properties: + fields: + $ref: '#/components/schemas/Fields' documents: type: array description: Documents for data extraction or cross-checking items: - type: object - properties: - id: - type: string - description: document id (filled automatically when missing) - issuingCountry: - type: string - description: | - The code of the country of issue - ([alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) - or [alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements)) - pattern: ^[a-zA-Z]{2,3}$ - example: JPN - documentType: - $ref: "#/components/schemas/DocumentType" - files: - description: Document photos or scans - type: array - items: - $ref: "#/components/schemas/DocumentMedia" - required: - - files - additionalProperties: false + $ref: '#/components/schemas/ResultDocument' selfie: description: Media required for `face-matching` properties: files: type: array items: - $ref: "#/components/schemas/FacesMedia" + $ref: '#/components/schemas/ResultFacesMedia' required: - files additionalProperties: false additionalProperties: false + Fields: + type: array + description: | + Data fields to check. + + For example: Last Name and Date of Birth sent from web form + items: + $ref: "#/components/schemas/Field" + example: + - contentType: string + category: First name + content: Artem + - contentType: string + category: Last name + content: Gerus + - contentType: sex + category: Sex + content: male + - contentType: bool + category: Agree on something + content: "true" + + Document: + type: object + properties: + id: + type: string + description: document id (filled automatically when missing) + issuingCountry: + type: string + description: | + The code of the country of issue + ([alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + or [alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements)) + pattern: ^[a-zA-Z]{2,3}$ + example: JPN + documentType: + $ref: "#/components/schemas/DocumentType" + files: + description: Document photos or scans + type: array + items: + $ref: "#/components/schemas/DocumentMedia" + required: + - files + additionalProperties: false + + ResultDocument: + type: object + properties: + id: + type: string + description: document id (filled automatically when missing) + issuingCountry: + type: string + description: | + The code of the country of issue + ([alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + or [alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements)) + pattern: ^[a-zA-Z]{2,3}$ + example: JPN + documentType: + $ref: '#/components/schemas/DocumentType' + files: + description: Temporary links to the document photos or scans + type: array + items: + $ref: '#/components/schemas/ResultDocumentMedia' + required: + - files + additionalProperties: false + Field: type: object oneOf: @@ -385,7 +439,22 @@ components: Acceptable video formats: WebM + VP8, MP4 + AVC type: string - example: "data:video/webm;base64," + format: media-data-uri + example: data:video/webm;base64,aGVsbG8= + required: [uri] + additionalProperties: false + + ResultFacesMedia: + type: object + properties: + id: + type: string + description: file id (filled automatically when missing) + uri: + description: Temporary link to the media + type: string + format: uri + example: https://some.site/image.jpeg?t=123 required: [uri] additionalProperties: false @@ -404,12 +473,38 @@ components: - single-page example: front uri: - description: Data URI of the media + description: | + Data URI of the media + + All common image formats are acceptable. type: string - example: data:image/png;base64,R0lGODlhDAAMAK... + format: media-data-uri + example: data:image/png;base64,aGVsbG8= required: [uri, kind] additionalProperties: false + ResultDocumentMedia: + type: object + properties: + id: + type: string + description: file id (filled automatically when missing) + kind: + type: string + description: kind of document page + enum: + - front + - back + - single-page + example: front + uri: + description: Temporary link to the media + type: string + format: uri + example: https://some.site/image.jpeg?t=123 + required: [id, uri, kind] + additionalProperties: false + OverallResult: type: object description: Summary verification result (omitted if state is `processing`)