Swag: unexpected doc generated for custom array `body` param

Created on 5 Nov 2019  路  4Comments  路  Source: swaggo/swag

issue description
unexpected doc generated for custom array body param

Your swag version
e.g. 1.6.3

Your go version
e.g. 1.13.1

golang doc for router handler method: (example @Param):

// @Param timelines body []db.Timeline true "timeline list"

json generated:

                "parameters": [
                    {
                        "description": "timeline list",
                        "name": "timelines",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "db.Timeline", // not expect
                            "items": {
                                "$ref": "#/definitions/db.Timeline"
                            }
                        }
                    }
                     ...

doc Web look not correct:
image

but should output:

                "parameters": [
                    {
                        "description": "timeline淇℃伅鍒楄〃",
                        "name": "timelines",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "array",  // expect
                            "items": {
                                "$ref": "#/definitions/db.Timeline"
                            }
                        }
                    }
                    ...

Most helpful comment

fixed by #579 please reopen it if there are any problems.

All 4 comments

Ya

I find myself in the same problem...

I got the same issue. Please tell me if anyone have the solution for this. Thank you.

579

fixed by #579 please reopen it if there are any problems.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LennyPenny picture LennyPenny  路  4Comments

padurean picture padurean  路  6Comments

lfaoro picture lfaoro  路  4Comments

welenlin picture welenlin  路  3Comments

henrahmagix picture henrahmagix  路  7Comments