diff --git a/Taskfile.yml b/Taskfile.yml index 1bc16f8..5cab7cb 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -20,7 +20,7 @@ tasks: - db:generate cmds: - cd backend/app/api/static && swag fmt --dir=../ - - cd backend/app/api/static && swag init --dir=../,../../../internal,../../../pkgs --parseDependency + - cd backend/app/api/static && swag init --dir=../,../../../internal,../../../pkgs - | npx swagger-typescript-api \ --no-client \ @@ -139,4 +139,4 @@ tasks: - task: go:all - task: ui:check - task: ui:fix - - task: test:ci \ No newline at end of file + - task: test:ci diff --git a/backend/app/api/static/docs/docs.go b/backend/app/api/static/docs/docs.go index 30ee544..c5ec127 100644 --- a/backend/app/api/static/docs/docs.go +++ b/backend/app/api/static/docs/docs.go @@ -731,7 +731,7 @@ const docTemplate = `{ "422": { "description": "Unprocessable Entity", "schema": { - "$ref": "#/definitions/mid.ErrorResponse" + "$ref": "#/definitions/validate.ErrorResponse" } } } @@ -1799,20 +1799,6 @@ const docTemplate = `{ } }, "definitions": { - "mid.ErrorResponse": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "fields": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, "repo.DocumentOut": { "type": "object", "properties": { @@ -2853,6 +2839,17 @@ const docTemplate = `{ "properties": { "item": {} } + }, + "validate.ErrorResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "fields": { + "type": "string" + } + } } }, "securityDefinitions": { diff --git a/backend/app/api/static/docs/swagger.json b/backend/app/api/static/docs/swagger.json index 3c390f2..5bb08df 100644 --- a/backend/app/api/static/docs/swagger.json +++ b/backend/app/api/static/docs/swagger.json @@ -723,7 +723,7 @@ "422": { "description": "Unprocessable Entity", "schema": { - "$ref": "#/definitions/mid.ErrorResponse" + "$ref": "#/definitions/validate.ErrorResponse" } } } @@ -1791,20 +1791,6 @@ } }, "definitions": { - "mid.ErrorResponse": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "fields": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, "repo.DocumentOut": { "type": "object", "properties": { @@ -2845,6 +2831,17 @@ "properties": { "item": {} } + }, + "validate.ErrorResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "fields": { + "type": "string" + } + } } }, "securityDefinitions": { diff --git a/backend/app/api/static/docs/swagger.yaml b/backend/app/api/static/docs/swagger.yaml index e77257a..e414655 100644 --- a/backend/app/api/static/docs/swagger.yaml +++ b/backend/app/api/static/docs/swagger.yaml @@ -1,14 +1,5 @@ basePath: /api definitions: - mid.ErrorResponse: - properties: - error: - type: string - fields: - additionalProperties: - type: string - type: object - type: object repo.DocumentOut: properties: id: @@ -707,6 +698,13 @@ definitions: properties: item: {} type: object + validate.ErrorResponse: + properties: + error: + type: string + fields: + type: string + type: object info: contact: name: Don't @@ -1084,7 +1082,7 @@ paths: "422": description: Unprocessable Entity schema: - $ref: '#/definitions/mid.ErrorResponse' + $ref: '#/definitions/validate.ErrorResponse' security: - Bearer: [] summary: Create Item Attachment diff --git a/docs/docs/api/openapi-2.0.json b/docs/docs/api/openapi-2.0.json index 3c390f2..5bb08df 100644 --- a/docs/docs/api/openapi-2.0.json +++ b/docs/docs/api/openapi-2.0.json @@ -723,7 +723,7 @@ "422": { "description": "Unprocessable Entity", "schema": { - "$ref": "#/definitions/mid.ErrorResponse" + "$ref": "#/definitions/validate.ErrorResponse" } } } @@ -1791,20 +1791,6 @@ } }, "definitions": { - "mid.ErrorResponse": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "fields": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, "repo.DocumentOut": { "type": "object", "properties": { @@ -2845,6 +2831,17 @@ "properties": { "item": {} } + }, + "validate.ErrorResponse": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "fields": { + "type": "string" + } + } } }, "securityDefinitions": { diff --git a/frontend/lib/api/types/data-contracts.ts b/frontend/lib/api/types/data-contracts.ts index a2d7209..53ed238 100644 --- a/frontend/lib/api/types/data-contracts.ts +++ b/frontend/lib/api/types/data-contracts.ts @@ -10,11 +10,6 @@ * --------------------------------------------------------------- */ -export interface MidErrorResponse { - error: string; - fields: Record; -} - export interface DocumentOut { id: string; path: string; @@ -432,3 +427,8 @@ export interface TokenResponse { export interface Wrapped { item: any; } + +export interface ValidateErrorResponse { + error: string; + fields: string; +}