fix: set by_alias for json export

This commit is contained in:
Sefa Eyeoglu 2022-04-02 14:46:38 +02:00
parent a5bb3a091d
commit 367518371f
No known key found for this signature in database
GPG Key ID: C10411294912A422
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ class MetaBase(pydantic.BaseModel):
if k in kwargs:
del kwargs[k]
return super(MetaBase, self).json(exclude_none=True, sort_keys=True, indent=4, **kwargs)
return super(MetaBase, self).json(exclude_none=True, sort_keys=True, by_alias=True, indent=4, **kwargs)
def write(self, file_path):
with open(file_path, "w") as f:

View File

@ -93,7 +93,7 @@ def compute_jar_file(path, url):
sha256 = filehash(jar_path, hashlib.sha256)
size = os.path.getsize(jar_path)
data = FabricJarInfo(releaseTime=tstamp, sha1=sha1, sha256=sha256, size=size)
data = FabricJarInfo(release_time=tstamp, sha1=sha1, sha256=sha256, size=size)
data.write(path + ".json")