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

Empty Headers added to the API when there no operationId in Swagger #45

Closed
chathudan opened this issue Jul 11, 2019 · 4 comments · Fixed by #52
Closed

Empty Headers added to the API when there no operationId in Swagger #45

chathudan opened this issue Jul 11, 2019 · 4 comments · Fixed by #52
Assignees
Labels
bug Something isn't working
Milestone

Comments

@chathudan
Copy link

chathudan commented Jul 11, 2019

Empty header added to the API ( @headers() ) when there no operationId. This is giving runtime error
java.lang.IllegalArgumentException: @Headers annotation is empty.

Remove the empty header or add auto-generated operationId like "X-Operation-ID: deviceGet"

Empty operationId found for path: get /devices. Renamed to auto-generated operationId: devicesGet

Ex:

Bellow endpoint doesn't include opertationID which add empty @Headers() while generating the code.

       "/devices": {
            "get": {
                "summary": "Fetch a list of Devices",
                "description": "Without any params, returns a list of the user's devices",
                "tags": [
                    "Device"
                ],
                "parameters": [
                    {
                        "$ref": "#/parameters/all"
                    },
                    {
                        "$ref": "#/parameters/userId"
                    },
                    {
                        "name": "id",
                        "in": "query",
                        "description": "To fetch one or more devices. Multiple params can be passed like `id=31&id=42`",
                        "required": false,
                        "type": "integer",
                        "collectionFormat": "multi"
                    },
                    {
                        "name": "uniqueId",
                        "in": "query",
                        "description": "To fetch one or more devices. Multiple params can be passed like `uniqueId=333331&uniqieId=44442`",
                        "required": false,
                        "type": "string",
                        "collectionFormat": "multi"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/Device"
                            }
                        }
                    },
                    "400": {
                        "description": "No permission"
                    }
                }
            }

Screen Shot 2019-07-11 at 11 37 01 am

@cortinico
Copy link
Collaborator

Thanks for the report @chathudan
Looks like a bug, I should a fix for this in the next days.

@cortinico cortinico self-assigned this Jul 13, 2019
@cortinico cortinico added the bug Something isn't working label Jul 13, 2019
@cortinico cortinico added this to the 1.2.0 milestone Jul 13, 2019
@chathudan
Copy link
Author

chathudan commented Jul 29, 2019

@cortinico when are you planning to release 1.2.0 ?

@cortinico
Copy link
Collaborator

@chathudan Ideally after #52 gets merged, so maybe by the end of this week?

@cortinico
Copy link
Collaborator

@cortinico when are you planning to release 1.2.0 ?

Just released 🎉

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

Successfully merging a pull request may close this issue.

2 participants