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

'Unexpected error' In the responses/default/descritption of swagger #28

Open
jerowe opened this issue Feb 26, 2017 · 1 comment
Open

Comments

@jerowe
Copy link

jerowe commented Feb 26, 2017

Cool project!

I noticed when generating swagger I get an 'Unexpected Error'. How can I document the expected response in Raisin?

 {
      "get": {
        "consumes": [
          "application/x-yaml",
          "application/json"
        ],
        "operationId": "get_users__id",
        "responses": {
          "default": {
            "description": "Unexpected error"
          }
        },
        "tags": [
          "users"
        ],
        "produces": [
          "application/x-yaml",
          "application/json"
        ],
        "summary": "Show user",
        "description": "",
        "parameters": [
          {
            "type": "integer",
            "in": "path",
            "required": true,
            "description": "User ID",
            "format": "int32",
            "name": "id"
          }
        ]
      },

Thanks!

@khrt
Copy link
Owner

khrt commented Feb 26, 2017

Jillian,

currently you can't set response object manually but Raisin can generate one (a success one) automatically, for that you need to use Raisin::Entity to describe the response object.

See https://github.com/khrt/Raisin/blob/master/lib/Raisin/Plugin/Swagger.pm#L219 and https://github.com/khrt/Raisin/blob/master/examples/music-app/script/music_app_dbix.psgi#L46
and https://metacpan.org/pod/Raisin::Entity

I'll add it to my plan and try to implement with the next release.

@khrt khrt self-assigned this Feb 26, 2017
@khrt khrt added the openapi3 label May 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants