Using external definition reference raises "Extra JSON Reference properties will be ignored: title"

223 views
Skip to first unread message

Steffen Köhler

unread,
May 19, 2016, 2:42:52 AM5/19/16
to Swagger
I use swagger editor 2.10.1 as my first version. But I have problems to use my existing json schema files. I have created a short example (real files are much larger:-)
 
---
swagger: '2.0'
info:
  version: 0.0.0
  title: Simple API
paths:
  /:
    get:
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/message'
            
definitions:
    message:

Where message.json is defined as:
{
 
"type": "object",
 
"description": "A simple message.",
 
"required": [
   
"message"
  ],
 
"properties": {
   
"message": {
     
"type": "string",
     
"description": "The stored message"
    }
 
}
}

This raises the warning:


And as result I can't generate client or server part with the error:
code: 500; type: "unknown" and message: "something bad happened"

But when I copy the message.json content at the place of the $ref in the swagger file all is working as expected, but this is no option.

Thanks for any help
Steffen

Ron Ratovsky

unread,
May 19, 2016, 3:15:21 PM5/19/16
to swagger-sw...@googlegroups.com

Those two are unrelated. The generator can’t generate your client files because it can’t access your localhost.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steffen Köhler

unread,
May 20, 2016, 3:02:24 AM5/20/16
to Swagger
Why? At this address runs a server that delivers the schema. The editor itself can read the file (from localhost) and present the structure in the preview field except the warning. But the generator can't do the same, I'm a little bit surprised.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Ron Ratovsky

unread,
May 20, 2016, 10:22:05 AM5/20/16
to swagger-sw...@googlegroups.com

Because the editor is running in your browser and is accessing localhost from your own computer. The generator is running as a service on internet and that can’t access your localhost.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--

You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

Steffen Köhler

unread,
May 20, 2016, 11:20:31 AM5/20/16
to Swagger
Thanks, now I see http://generator.swagger.io/api/gen/servers/nodejs-server is called, remains the warning problem.

Ron Ratovsky

unread,
May 20, 2016, 11:21:40 AM5/20/16
to swagger-sw...@googlegroups.com

 

What do you mean? Anything else that needs to be resolved?

 

 

 

From: <swagger-sw...@googlegroups.com> on behalf of Steffen Köhler <stefen....@gmail.com>
Reply-To: "swagger-sw...@googlegroups.com" <swagger-sw...@googlegroups.com>
Date: Friday, 20 May 2016 at 08:20
To: Swagger <swagger-sw...@googlegroups.com>
Subject: Re: Using external definition reference raises "Extra JSON Reference properties will be ignored: title"

 

Thanks, now I see http://generator.swagger.io/api/gen/servers/nodejs-server is called, remains the warning problem.

--

Steffen Köhler

unread,
May 22, 2016, 4:14:28 AM5/22/16
to Swagger
Yes, there is the initially question, why I see the 'title' warning when I use a $ref and with copied definition not. Especially I have not set a title property.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages