Skip to content

net.IP slice breaks swag generated documentation #33

@necheffa

Description

@necheffa

The tags on the goca.Identity.IPAddresses field for swag generated documentation cause the doc tests to fail. Swag doesn't know what to do with the []net.IP type when parsing the provided example.

As a temporary workaround, the tag can be replaced with swaggerignore:"true" to have swag skip it.

The swaggertype tag can be used to provide a type hint to swag, but since byte isn't a primitive type to swag, it fails on this too. (net.IP is a typedef of []byte).

According to the swag README section "Use swaggertype tag to supported custom type" we may be able to implement the encoding.JSON.Marshaler interface and use the swaggertype tag to get example parsing working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions