fix type generator

This commit is contained in:
Hayden 2023-07-27 16:12:25 -05:00
parent c46d691297
commit 9ddce9e28d
No known key found for this signature in database
GPG key ID: 17CF79474E257545
6 changed files with 51 additions and 62 deletions

View file

@ -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 \

View file

@ -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": {

View file

@ -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": {

View file

@ -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

View file

@ -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": {

View file

@ -10,11 +10,6 @@
* ---------------------------------------------------------------
*/
export interface MidErrorResponse {
error: string;
fields: Record<string, string>;
}
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;
}