From d9f17536ea5a533ada1f9cb43a43e501851a6749 Mon Sep 17 00:00:00 2001 From: RomanHarazha <96019015+RomanHarazha@users.noreply.github.com> Date: Fri, 12 Jan 2024 13:50:26 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=2091609?= =?UTF-8?q?5656f9957f09e3618240b71533fdf856531=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openapi.json | 301 +++++++++++++++++++++++++++------------------------ openapi.yaml | 211 +++++++++++++++++++----------------- 2 files changed, 269 insertions(+), 243 deletions(-) diff --git a/openapi.json b/openapi.json index 4312060..4572b85 100644 --- a/openapi.json +++ b/openapi.json @@ -12,14 +12,14 @@ } ], "paths": { - "/v1/proofs": { + "/v1/links": { "post": { "tags": [ "Proofs" ], - "summary": "Create the proof", - "description": "Allows to create a proof in the service database. After saving the proof, it will be accessible by its ID.\n", - "operationId": "createProof", + "summary": "Create Link Proofs", + "description": "Add link to the specified proofs\n", + "operationId": "createProofsLink", "security": [ { "Bearer": [] @@ -34,7 +34,22 @@ "properties": { "data": { "type": "object", - "$ref": "#/components/schemas/ProofCreate" + "properties": { + "proofs_ids": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "550e8400-e29b-41d4-a716-446655440001", + "550e8400-e29b-41d4-a716-446655440002", + "550e8400-e29b-41d4-a716-446655440003" + ] + } + }, + "required": [ + "proofs_ids" + ] } } } @@ -48,12 +63,10 @@ "application/json": { "schema": { "type": "object", - "required": [ - "data" - ], "properties": { "data": { - "$ref": "#/components/schemas/Proof" + "type": "object", + "$ref": "#/components/schemas/ProofLink" } } } @@ -70,25 +83,28 @@ "$ref": "#/components/responses/internalError" } } - } - }, - "/v1/proofs/{id}": { + }, "get": { - "summary": "Get Proof by ID", - "description": "Returns information about the particular proof.\n", - "operationId": "proofByID", + "summary": "Get Proofs Links by User DID", + "description": "Returns information about the all links of the user.\n", + "operationId": "proofsLinksByUserDID", + "security": [ + { + "Bearer": [] + } + ], "tags": [ "Proofs" ], "parameters": [ { "in": "path", - "name": "id", + "name": "did", "required": true, - "description": "The ID of the proof", + "description": "The User DID", "schema": { "type": "string", - "example": 1 + "example": "did:iden3:readonly:tM1QCJ7ytcbvLB7EFQhGsJPumc11DEE18gEvAzxE7" } } ], @@ -104,7 +120,10 @@ ], "properties": { "data": { - "$ref": "#/components/schemas/Proof" + "type": "array", + "items": { + "$ref": "#/components/schemas/ProofLink" + } } } } @@ -123,61 +142,47 @@ } } }, - "/v1/proofs/link": { - "post": { - "tags": [ - "Proofs" - ], - "summary": "Create Link Proofs", - "description": "Add link to the specified proofs\n", - "operationId": "createProofsLink", + "/v1/links/{link_id}": { + "get": { + "summary": "Get Proofs by Link ID", + "description": "Returns information about the all proofs of the link.\n", + "operationId": "proofsByLinkID", "security": [ { "Bearer": [] } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "proofs_ids": { - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "550e8400-e29b-41d4-a716-446655440001", - "550e8400-e29b-41d4-a716-446655440002", - "550e8400-e29b-41d4-a716-446655440003" - ] - } - }, - "required": [ - "proofs_ids" - ] - } - } - } + "tags": [ + "Proofs" + ], + "parameters": [ + { + "in": "path", + "name": "link_id", + "required": true, + "description": "The Link ID", + "schema": { + "type": "string", + "example": "550e8400-e29b-41d4-a716-446655440000" } } - }, + ], "responses": { "200": { - "description": "Success", + "description": "OK", "content": { - "application/json": { + "application/vnd.api+json": { "schema": { "type": "object", + "required": [ + "data" + ], "properties": { "data": { - "type": "object", - "$ref": "#/components/schemas/ProofLink" + "type": "array", + "items": { + "$ref": "#/components/schemas/Proof" + } } } } @@ -187,8 +192,8 @@ "400": { "$ref": "#/components/responses/invalidParameter" }, - "401": { - "$ref": "#/components/responses/invalidAuth" + "404": { + "$ref": "#/components/responses/notFound" }, "500": { "$ref": "#/components/responses/internalError" @@ -196,36 +201,40 @@ } } }, - "/v1/proofs/link/{link_id}": { - "get": { - "summary": "Get Proofs by Link ID", - "description": "Returns information about the all proofs of the link.\n", - "operationId": "proofsByLinkID", + "/v1/proofs": { + "post": { + "tags": [ + "Proofs" + ], + "summary": "Create the proof", + "description": "Allows to create a proof in the service database. After saving the proof, it will be accessible by its ID.\n", + "operationId": "createProof", "security": [ { "Bearer": [] } ], - "tags": [ - "Proofs" - ], - "parameters": [ - { - "in": "path", - "name": "link_id", - "required": true, - "description": "The Link ID", - "schema": { - "type": "string", - "example": "550e8400-e29b-41d4-a716-446655440000" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "$ref": "#/components/schemas/ProofCreate" + } + } + } } } - ], + }, "responses": { "200": { - "description": "OK", + "description": "Success", "content": { - "application/vnd.api+json": { + "application/json": { "schema": { "type": "object", "required": [ @@ -233,10 +242,7 @@ ], "properties": { "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Proof" - } + "$ref": "#/components/schemas/Proof" } } } @@ -246,16 +252,14 @@ "400": { "$ref": "#/components/responses/invalidParameter" }, - "404": { - "$ref": "#/components/responses/notFound" + "401": { + "$ref": "#/components/responses/invalidAuth" }, "500": { "$ref": "#/components/responses/internalError" } } - } - }, - "/v1/proofs/user/{user_did}": { + }, "get": { "summary": "Get Proofs by User DID", "description": "Returns information about the all proofs of the user.\n", @@ -270,8 +274,8 @@ ], "parameters": [ { - "in": "path", - "name": "user_did", + "in": "query", + "name": "did", "required": true, "description": "The User DID", "schema": { @@ -314,28 +318,23 @@ } } }, - "/v1/proofs/user/{user_did}/link": { + "/v1/proofs/{id}": { "get": { - "summary": "Get Proofs Links by User DID", - "description": "Returns information about the all links of the user.\n", - "operationId": "proofsLinksByUserDID", - "security": [ - { - "Bearer": [] - } - ], + "summary": "Get Proof by ID", + "description": "Returns information about the particular proof.\n", + "operationId": "proofByID", "tags": [ "Proofs" ], "parameters": [ { "in": "path", - "name": "user_did", + "name": "id", "required": true, - "description": "The User DID", + "description": "The ID of the proof", "schema": { "type": "string", - "example": "did:iden3:readonly:tM1QCJ7ytcbvLB7EFQhGsJPumc11DEE18gEvAzxE7" + "example": 1 } } ], @@ -351,10 +350,7 @@ ], "properties": { "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ProofLink" - } + "$ref": "#/components/schemas/Proof" } } } @@ -438,6 +434,59 @@ } } }, + "Link": { + "allOf": [ + { + "$ref": "#/components/schemas/LinkKey" + }, + { + "type": "object", + "required": [ + "attributes" + ], + "properties": { + "attributes": { + "type": "object", + "required": [ + "created_at", + "link" + ], + "properties": { + "link": { + "type": "string", + "description": "UUID Link to proofs", + "example": "05260b49-2c35-48b9-8300-d39ae48ca312" + }, + "created_at": { + "type": "string", + "description": "The date and time when the proof was created in the timestamp format", + "example": "1702480643" + } + } + } + } + } + ] + }, + "LinkKey": { + "type": "object", + "required": [ + "id", + "type" + ], + "properties": { + "id": { + "type": "string", + "example": "550e8400-e29b-41d4-a716-446655440000" + }, + "type": { + "type": "string", + "enum": [ + "links" + ] + } + } + }, "Proof": { "allOf": [ { @@ -528,40 +577,6 @@ ] } } - }, - "ProofLink": { - "allOf": [ - { - "$ref": "#/components/schemas/ProofKey" - }, - { - "type": "object", - "required": [ - "attributes" - ], - "properties": { - "attributes": { - "type": "object", - "required": [ - "created_at", - "link" - ], - "properties": { - "link": { - "type": "string", - "description": "UUID Link to proofs", - "example": "05260b49-2c35-48b9-8300-d39ae48ca312" - }, - "created_at": { - "type": "string", - "description": "The date and time when the proof was created in the timestamp format", - "example": "1702480643" - } - } - } - } - } - ] } }, "responses": { diff --git a/openapi.yaml b/openapi.yaml index 0e83de2..1384224 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -7,14 +7,14 @@ servers: - url: 'https://api.demo.tokend.io' description: rarime-link-svc paths: - /v1/proofs: + /v1/links: post: tags: - Proofs - summary: Create the proof + summary: Create Link Proofs description: | - Allows to create a proof in the service database. After saving the proof, it will be accessible by its ID. - operationId: createProof + Add link to the specified proofs + operationId: createProofsLink security: - Bearer: [] requestBody: @@ -26,7 +26,17 @@ paths: properties: data: type: object - $ref: '#/components/schemas/ProofCreate' + properties: + proofs_ids: + type: array + items: + type: string + example: + - 550e8400-e29b-41d4-a716-446655440001 + - 550e8400-e29b-41d4-a716-446655440002 + - 550e8400-e29b-41d4-a716-446655440003 + required: + - proofs_ids responses: '200': description: Success @@ -34,33 +44,33 @@ paths: application/json: schema: type: object - required: - - data properties: data: - $ref: '#/components/schemas/Proof' + type: object + $ref: '#/components/schemas/ProofLink' '400': $ref: '#/components/responses/invalidParameter' '401': $ref: '#/components/responses/invalidAuth' '500': $ref: '#/components/responses/internalError' - '/v1/proofs/{id}': get: - summary: Get Proof by ID + summary: Get Proofs Links by User DID description: | - Returns information about the particular proof. - operationId: proofByID + Returns information about the all links of the user. + operationId: proofsLinksByUserDID + security: + - Bearer: [] tags: - Proofs parameters: - in: path - name: id + name: did required: true - description: The ID of the proof + description: The User DID schema: type: string - example: 1 + example: 'did:iden3:readonly:tM1QCJ7ytcbvLB7EFQhGsJPumc11DEE18gEvAzxE7' responses: '200': description: OK @@ -72,61 +82,16 @@ paths: - data properties: data: - $ref: '#/components/schemas/Proof' + type: array + items: + $ref: '#/components/schemas/ProofLink' '400': $ref: '#/components/responses/invalidParameter' '404': $ref: '#/components/responses/notFound' '500': $ref: '#/components/responses/internalError' - /v1/proofs/link: - post: - tags: - - Proofs - summary: Create Link Proofs - description: | - Add link to the specified proofs - operationId: createProofsLink - security: - - Bearer: [] - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - data: - type: object - properties: - proofs_ids: - type: array - items: - type: string - example: - - 550e8400-e29b-41d4-a716-446655440001 - - 550e8400-e29b-41d4-a716-446655440002 - - 550e8400-e29b-41d4-a716-446655440003 - required: - - proofs_ids - responses: - '200': - description: Success - content: - application/json: - schema: - type: object - properties: - data: - type: object - $ref: '#/components/schemas/ProofLink' - '400': - $ref: '#/components/responses/invalidParameter' - '401': - $ref: '#/components/responses/invalidAuth' - '500': - $ref: '#/components/responses/internalError' - '/v1/proofs/link/{link_id}': + '/v1/links/{link_id}': get: summary: Get Proofs by Link ID description: | @@ -164,7 +129,44 @@ paths: $ref: '#/components/responses/notFound' '500': $ref: '#/components/responses/internalError' - '/v1/proofs/user/{user_did}': + /v1/proofs: + post: + tags: + - Proofs + summary: Create the proof + description: | + Allows to create a proof in the service database. After saving the proof, it will be accessible by its ID. + operationId: createProof + security: + - Bearer: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + type: object + $ref: '#/components/schemas/ProofCreate' + responses: + '200': + description: Success + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/Proof' + '400': + $ref: '#/components/responses/invalidParameter' + '401': + $ref: '#/components/responses/invalidAuth' + '500': + $ref: '#/components/responses/internalError' get: summary: Get Proofs by User DID description: | @@ -175,8 +177,8 @@ paths: tags: - Proofs parameters: - - in: path - name: user_did + - in: query + name: did required: true description: The User DID schema: @@ -202,24 +204,22 @@ paths: $ref: '#/components/responses/notFound' '500': $ref: '#/components/responses/internalError' - '/v1/proofs/user/{user_did}/link': + '/v1/proofs/{id}': get: - summary: Get Proofs Links by User DID + summary: Get Proof by ID description: | - Returns information about the all links of the user. - operationId: proofsLinksByUserDID - security: - - Bearer: [] + Returns information about the particular proof. + operationId: proofByID tags: - Proofs parameters: - in: path - name: user_did + name: id required: true - description: The User DID + description: The ID of the proof schema: type: string - example: 'did:iden3:readonly:tM1QCJ7ytcbvLB7EFQhGsJPumc11DEE18gEvAzxE7' + example: 1 responses: '200': description: OK @@ -231,9 +231,7 @@ paths: - data properties: data: - type: array - items: - $ref: '#/components/schemas/ProofLink' + $ref: '#/components/schemas/Proof' '400': $ref: '#/components/responses/invalidParameter' '404': @@ -288,6 +286,40 @@ components: - 404 - 409 - 500 + Link: + allOf: + - $ref: '#/components/schemas/LinkKey' + - type: object + required: + - attributes + properties: + attributes: + type: object + required: + - created_at + - link + properties: + link: + type: string + description: UUID Link to proofs + example: 05260b49-2c35-48b9-8300-d39ae48ca312 + created_at: + type: string + description: The date and time when the proof was created in the timestamp format + example: '1702480643' + LinkKey: + type: object + required: + - id + - type + properties: + id: + type: string + example: 550e8400-e29b-41d4-a716-446655440000 + type: + type: string + enum: + - links Proof: allOf: - $ref: '#/components/schemas/ProofKey' @@ -351,27 +383,6 @@ components: type: string enum: - proofs - ProofLink: - allOf: - - $ref: '#/components/schemas/ProofKey' - - type: object - required: - - attributes - properties: - attributes: - type: object - required: - - created_at - - link - properties: - link: - type: string - description: UUID Link to proofs - example: 05260b49-2c35-48b9-8300-d39ae48ca312 - created_at: - type: string - description: The date and time when the proof was created in the timestamp format - example: '1702480643' responses: internalError: description: Internal server error