Skip to content

The last field in a specs will always be included in the generated code, even when not supposed to #25

@lcsmuller

Description

@lcsmuller

For example, file field here shouldn't be included in the JSON encoding/decoding functions:

    {
      "title":"Create Guild Sticker",
      "namespace":["create_guild_sticker"],
      "struct":"params",
      "fields":
      [
        {"name":"name", "type":{"base":"char", "dec":"*"}, "comment":"name of the sticker (2-30 characters)"},
        {"name":"description", "type":{"base":"char", "dec":"*"}, "comment":"description of the sticker (empty or 2-100 characters)"},
        {"name":"tags", "type":{"base":"char", "dec":"*"}, "comment":"autocomplete/suggestion tags for the sticker (max 200 characters)"},
        {"name":"file", "type":{ "base":"struct discord_file", "dec":"*" }, "loc":"multipart", "comment":"the sticker file to upload, must be a PNG, APNG, or Lottie JSON file, max 500 KB"}
      ]
    }

but it will be added nonetheless (and lead to a compilation error), unless its moved from the last position.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions