aminalaee / sqladmin

SQLAlchemy Admin for FastAPI and Starlette
https://aminalaee.dev/sqladmin/
BSD 3-Clause "New" or "Revised" License
1.88k stars 188 forks source link

Comma added on last entry of JSON export makes result not valid JSON #842

Open jbrendel opened 3 hours ago

jbrendel commented 3 hours ago

Checklist

Describe the bug

Export a table with more than one entry. The last one will have a trailing ,, which is not valid JSON.

Steps to reproduce the bug

Export a table, check the last two characters, they will be ,].

Expected behavior

No trailing ,

Actual behavior

A comma is added after the last entry in the output table.

Debugging material

No response

Environment

Ubuntu 20.04, version 0.20.0

Additional context

I'll provide a PR for the fix shortly.

jbrendel commented 3 hours ago

I have submitted a PR for this: https://github.com/aminalaee/sqladmin/pull/843