xcherryio / xcherry

server and main repo of xCherry project
Apache License 2.0
26 stars 1 forks source link

Postgres always insert empty object `{}` for empty jsontext #100

Open longquanzheng opened 11 months ago

longquanzheng commented 11 months ago

E.g. for commandRequest of nil in the below code:

Screenshot 2023-11-20 at 3 03 44 PM

It will insertert {} instead of NULL. As a result Screenshot 2023-11-20 at 3 03 55 PM

After upgrading to open API 7.1.0 ( see https://github.com/OpenAPITools/openapi-generator/releases/tag/v7.1.0 for Go and https://github.com/OpenAPITools/openapi-generator/pull/16863 )

There is a breaking change that it alwasy validate the required fields:

https://github.com/xcherryio/apis/blob/9ff80b8ba2c1bf8390f123e35707c63f56ef4d63/goapi/xcapi/model_command_request.go#L174

For now, we have to set the default value to emptyCommand and encodedObject

longquanzheng commented 11 months ago

cc @duoertai @zklgame