The problem
There is no required field in the json file that is generated for the swagger documentation. If I use it to generate code from it, then all fields are marked as optional, which is not true.
Digging a bit into it, it seems that swag should be ran with swag init --requiredByDefault. This adds the fields to the required category except for the ones marked as omitempty.
I'm happy to make a PR for it but I'm rather confused about it. Most of the omitempty annotations don't seem to be used. For example, for the SendMessageV2 the one with omitempty is in:
|
EditTimestamp *int64 `json:"edit-timestamp,omitempty"` |
but the one that makes it to swagger is this one:
|
EditTimestamp *int64 `json:"edit_timestamp"` |
Are the annotations in client.go doing anything? Should they be removed and placed in api.go? Or should they be copied over?
Are you using the latest released version?
Have you read the troubleshooting page?
What type of installation are you running?
signal-cli-rest-api Docker Container
In which mode are you using the docker container?
Normal Mode
What's the architecture of your host system?
x86-64
Additional information
No response
The problem
There is no
requiredfield in the json file that is generated for the swagger documentation. If I use it to generate code from it, then all fields are marked as optional, which is not true.Digging a bit into it, it seems that swag should be ran with
swag init --requiredByDefault. This adds the fields to therequiredcategory except for the ones marked asomitempty.I'm happy to make a PR for it but I'm rather confused about it. Most of the
omitemptyannotations don't seem to be used. For example, for theSendMessageV2the one withomitemptyis in:signal-cli-rest-api/src/client/client.go
Line 544 in eb34542
signal-cli-rest-api/src/api/api.go
Line 134 in eb34542
Are the annotations in
client.godoing anything? Should they be removed and placed inapi.go? Or should they be copied over?Are you using the latest released version?
Have you read the troubleshooting page?
What type of installation are you running?
signal-cli-rest-api Docker Container
In which mode are you using the docker container?
Normal Mode
What's the architecture of your host system?
x86-64
Additional information
No response