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

Getting "null" in response definition #66

Closed
phunsberger opened this issue Mar 10, 2016 · 4 comments
Closed

Getting "null" in response definition #66

phunsberger opened this issue Mar 10, 2016 · 4 comments

Comments

@phunsberger
Copy link

First, great project, many thanks for your work!

In my routes I have comments as follows:

description: get the default module description
summary: default module
responses:
200:
description: success
schema:
$ref: '#/definitions/models.Protocol.ModuleDef'

(#'s removed to keep formatting sort of normal)

In the resultant swagger.json I get:

"/":{ "get":{ "tags":[ "routes" ], "summary":"default module", "description":"get the default module description", "responses":null, "200":{ "description":"Modules definition", "schema":{ "$ref":"#/definitions/models.Protocol.ModuleDef" } },....

Note the "null" instead of the JSON object start for the response. The object that is being referenced is included in the definitions so it's not a case of a broken reference.

I'm running Play 2.5 but get the same result with 2.4.6. Build is using 0.2.0 not the 0.2.1 Play 2.5 specific version since that is currently throwing JSLookup errors when I try to use it instead.

@kailuowang
Copy link
Member

Can you double check if your 200 is indented properly underneath responses (should be two more space indentation)

@phunsberger
Copy link
Author

The indent looks like what I would expect. The formatting (leading spaces) seems to get lost when you cut and paste here?

@phunsberger
Copy link
Author

Ack, found the problem, there was a tab embedded in the indenting. Other portions of the same routes file have resulted in exceptions being thrown when tabs were embedded, that would likely be the better option here also?

@kailuowang
Copy link
Member

we will add swagger validation in the future

Javakky-pxv added a commit to scala-steward/play-swagger that referenced this issue Jan 21, 2024
…re-4.20.4

Update specs2-core, specs2-mock to 4.20.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants