mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-01 15:37:32 +08:00
fd79b59377
Proper fix for that is in drwpow/openapi-typescript#1014
15 lines
510 B
JavaScript
15 lines
510 B
JavaScript
// this is a helper script that fixes const values
|
|
// upstream fix in https://github.com/drwpow/openapi-typescript/pull/1014
|
|
import openapiTS from "openapi-typescript";
|
|
|
|
const inputFilePath = process.argv[2];
|
|
|
|
const localPath = new URL(inputFilePath, import.meta.url);
|
|
openapiTS(localPath, {
|
|
transform(schemaObject, metadata) {
|
|
if ("const" in schemaObject && schemaObject.type === "string") {
|
|
return `"${schemaObject.const}"`;
|
|
}
|
|
},
|
|
}).then((output) => console.log(output));
|