Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add parameter description and return value description #62

Open
Summer90xia opened this issue Jun 7, 2021 · 0 comments
Open
Labels
bug Something isn't working

Comments

@Summer90xia
Copy link

  • Laravel Swagger Version: 0.6.0
  • Laravel Version: 5.5.50
  • PHP Version: 7.3.24

Description:

After I run the script, I get the following

"/archive/color/add": {
            "post": {
                "summary": "",
                "description": "",
                "deprecated": false,
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                },
                "parameters": [
                    {
                        "in": "body",
                        "name": "body",
                        "description": "",
                        "schema": {
                            "type": "object",
                            "required": [
                                "color_name",
                                "color_en_name",
                                "archive_status"
                            ],
                            "properties": {
                                "color_name": {
                                    "type": "string"
                                },
                                "color_en_name": {
                                    "type": "string"
                                },
                                "color_value": {
                                    "type": "string"
                                },
                                "color_remark": {
                                    "type": "string"
                                },
                                "archive_status": {
                                    "type": "string",
                                    "enum": [
                                        "enable",
                                        "disable"
                                    ]
                                }
                            }
                        }
                    }
                ]
            }
        }

There is no parameter description and return value description.The result waht I want is like this:

"\/archive\/color\/add": {
            "post": {
                "summary": "",
                "description": "",
                "deprecated": false,
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$schema": "http:\/\/json-schema.org\/draft-04\/schema#",
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "numeric",
                                "description": "description string",
                                "required": true
                              },
                              "msg": {
                                "type": "string",
                                "description": "description string",
                                "required": true
                              }
                            }
                       }
                    }
                },
                "parameters": [
                    {
                        "in": "body",
                        "name": "body",
                        "description": "",
                        "schema": {
                            "type": "object",
                            "required": [
                                "color_name",
                                "color_en_name",
                                "archive_status"
                            ],
                            "properties": {
                                "color_name": {
                                    "type": "string",
                                     "description": "description string",
                                },
                                "color_en_name": {
                                    "type": "string",
                                    "description": "description string",
                                },
                                "color_value": {
                                    "type": "string",
                                    "description": "description string",
                                },
                                "color_remark": {
                                    "type": "string",
                                    "description": "description string",
                                },
                                "archive_status": {
                                    "type": "string",
                                    "description": "description string",
                                    "enum": [
                                        "enable",
                                        "disable"
                                    ]
                                }
                            }
                        }
                    }
                ]
            }
        }

How can i do it?

@Summer90xia Summer90xia added the bug Something isn't working label Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant