Skip to content

Commit 9dfad32

Browse files
esteiningerclaude
andcommitted
fix: add null→None post-generation fixup, bump spec to 1.3.1
OpenAPI Generator renders JSON `null` as Python literal `null` instead of `None`, breaking import on ~90 model fields. Added sed fixup to both generate.sh and CI workflow. Bumped spec version to trigger new PyPI publish. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 95d1505 commit 9dfad32

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/sync-and-publish.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ jobs:
242242
# Cleanup unnecessary files
243243
rm -f .travis.yml git_push.sh .gitlab-ci.yml || true
244244
245+
# Fix OpenAPI Generator null bug: JSON null renders as Python `null` instead of `None`
246+
echo "🔧 Fixing null → None in generated models..."
247+
find mixpeek -name '*.py' -exec sed -i 's/default=null/default=None/g' {} +
248+
245249
# Restore custom wrapper code
246250
if [ -d "/tmp/_client_backup" ]; then
247251
echo "📦 Restoring custom wrapper..."

generate.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ openapi-generator-cli generate \
211211
--package-name mixpeek \
212212
--additional-properties=projectName=mixpeek,packageVersion=0.81.0,packageUrl=https://github.com/mixpeek/python-sdk,library=urllib3
213213

214+
# Fix OpenAPI Generator null bug: JSON null renders as Python `null` instead of `None`
215+
echo "🔧 Fixing null → None in generated models..."
216+
find mixpeek -name '*.py' -exec sed -i '' 's/default=null/default=None/g' {} +
217+
214218
# Post-generation cleanup
215219
echo "✨ Post-generation cleanup..."
216220

openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"url": "https://mixpeek.com/contact",
1010
"email": "info@mixpeek.com"
1111
},
12-
"version": "1.3.0"
12+
"version": "1.3.1"
1313
},
1414
"servers": [
1515
{

0 commit comments

Comments
 (0)