[release] v0.22.0-unstable07

This commit is contained in:
Yann Stepienik
2026-03-17 19:24:25 +00:00
parent f8d04904ee
commit 091cc7bcad
3 changed files with 11 additions and 9 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cosmos-server",
"version": "0.22.0-unstable06",
"version": "0.22.0-unstable07",
"description": "",
"main": "test-server.js",
"bugs": {
+9 -7
View File
@@ -3,7 +3,7 @@ set -e
cd "$(dirname "$0")/.."
VERSION=$(jq -r .version package.json)
VERSION=$(node -p "require('./package.json').version")
echo "Generating API spec and Go SDK for v${VERSION}..."
@@ -18,12 +18,14 @@ npx swagger2openapi api-docs/swagger.json -o api-docs/openapi.json
# 4. Patch OpenAPI spec: replace Go stdlib types with simple schemas
# (os.FileMode, time.Duration, nat.PortSet produce uncompilable generated code)
jq '
.components.schemas["os.FileMode"] = {"type": "integer", "format": "uint32"} |
.components.schemas["time.Duration"] = {"type": "integer", "format": "int64"} |
.components.schemas["nat.PortSet"] = {"type": "object", "additionalProperties": true}
' api-docs/openapi.json > api-docs/openapi.patched.json
mv api-docs/openapi.patched.json api-docs/openapi.json
node -e "
const fs = require('fs');
const spec = JSON.parse(fs.readFileSync('api-docs/openapi.json', 'utf8'));
spec.components.schemas['os.FileMode'] = {type: 'integer', format: 'uint32'};
spec.components.schemas['time.Duration'] = {type: 'integer', format: 'int64'};
spec.components.schemas['nat.PortSet'] = {type: 'object', additionalProperties: true};
fs.writeFileSync('api-docs/openapi.json', JSON.stringify(spec, null, 2));
"
# 5. Generate Go SDK client (using go run — no install needed)
cd go-sdk
+1 -1
View File
@@ -201,7 +201,7 @@ func main() {
}
// @title Cosmos Server API
// @version 0.22.0-unstable04
// @version 0.22.0-unstable07
// @description REST API for Cosmos Cloud server management
// @BasePath /cosmos
// @securityDefinitions.apikey BearerAuth