Skip to content

Missing required fields in the swagger json file #825

@Gara-Dorta

Description

@Gara-Dorta

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?

  • Yes

Have you read the troubleshooting page?

  • Yes

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions