fix generating oepnapi types

This commit is contained in:
Georges-Antoine Assi
2024-06-02 21:29:01 -04:00
parent c2fb556a04
commit 89905599d9
5 changed files with 7 additions and 7 deletions

View File

@@ -97,8 +97,8 @@ class RomSchema(BaseModel):
class Config:
from_attributes = True
@property
@computed_field
@property
def sort_comparator(self) -> str:
return (
re.sub(

View File

@@ -25,7 +25,7 @@
"lint": "eslint . --fix",
"postinstall": "cd node_modules/emulatorjs/data/minify/ && npm i && npm run build",
"typecheck": "vue-tsc --noEmit",
"generate": "openapi --input http://localhost:5000/openapi.json --output ./src/__generated__ --client axios --useOptions --useUnionTypes --exportServices false --exportSchemas false --exportCore false"
"generate": "openapi --input http://127.0.0.1:5000/openapi.json --output ./src/__generated__ --client axios --useOptions --useUnionTypes --exportServices false --exportSchemas false --exportCore false"
},
"dependencies": {
"@mdi/font": "7.0.96",

View File

@@ -48,11 +48,11 @@ export type DetailedRomSchema = {
multi: boolean;
files: Array<string>;
full_path: string;
sort_comparator: string;
merged_screenshots: Array<string>;
sibling_roms?: Array<RomSchema>;
user_saves?: Array<SaveSchema>;
user_states?: Array<StateSchema>;
user_screenshots?: Array<ScreenshotSchema>;
user_notes?: Array<RomNoteSchema>;
readonly sort_comparator: string;
};

View File

@@ -43,5 +43,5 @@ export type RomSchema = {
multi: boolean;
files: Array<string>;
full_path: string;
sort_comparator: string;
readonly sort_comparator: string;
};

View File

@@ -67,18 +67,18 @@ export default defineConfig(({ mode }) => {
server: {
proxy: {
"/api": {
target: `http://localhost:${backendPort}`,
target: `http://127.0.0.1:${backendPort}`,
changeOrigin: false,
secure: false,
rewrite: (path) => path.replace(/^\/api/, ""),
},
"/ws": {
target: `http://localhost:${backendPort}`,
target: `http://127.0.0.1:${backendPort}`,
changeOrigin: false,
ws: true,
},
"/openapi.json": {
target: `http://localhost:${backendPort}`,
target: `http://127.0.0.1:${backendPort}`,
changeOrigin: false,
rewrite: (path) => path.replace(/^\/openapi.json/, "/openapi.json"),
},