Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion generate_schemas.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env node

import fs from "fs";
import path from "path";
import { glob } from "glob";
Expand Down Expand Up @@ -115,7 +117,7 @@ function return_json_schema(directoryPath, folder_path, projectName) {
jsonTypes.join("\n");
pythonContent = pythonContent.replace(
/@dataclass\nclass (\w+)(?:\s*\([^)]*\))?\s*:/g,
"@dataclass\nclass $1(DataClassJsonMixin):"
"@dataclass\nclass $1(DataClassJsonMixin):\n def __post_init__(self):\n print(self, flush=True)\n"
);
const pythonFile = path.join(folder.path, filename + ".py");
const initFile = path.join(folder.path, "__init__.py");
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
"name": "@geode/opengeodeweb-microservice",
"version": "0.0.0",
"description": "Shared utilities and schema generator for OpenGeodeWeb ecosystem",
"bin": {
"opengeodeweb-microservice-generate": "./generate_schemas.js"
},
"main": "generate_schemas.js",
"scripts": {
"json": "echo \"Error: no test specified\" && exit 0",
"test": "echo \"Error: no test specified\" && exit 0",
"build": "echo \"Error: no test specified\" && exit 0"
},
Expand Down