[Swagger-Codegen] Definition getting ignored

37 views
Skip to first unread message

lsa...@genexus.com

unread,
Jun 27, 2016, 8:23:05 AM6/27/16
to Swagger
Hello, I have this json https://watson-api-explorer.mybluemix.net/listings/tradeoff-analytics-v1.json which according to the swagger-editor is correct.
No matter the language I choose on swagger-codegen the model Map is always ignored.

    "Map": {
      "description": "Typically, the map format would be consumed by Tradeoff Analytics JavaScript widget.",
      "required": [
        "anchors",
        "nodes"
      ],
      "properties": {
        "anchors": {
          "description": "A representation of the vertices for the objectives and their positions on the map visualization.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/Anchor"
          }
        },
        "nodes": {
          "description": "A cell on the map visualization. Each cell in the array includes coordinates that describe the position on the map of the glyphs for one or more listed options, which are identified by their keys. The structure of an array element is `{\"coordinates\": {\"x\": 0, \"y\": 0}, \"solution_refs\": [\"key1\", \"key3\"]}`, where `coordinates` describe the position on the map visualization of options identified by the keys in `solution_refs`.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/MapNode"
          }
        }
      }
    }

What might be the issue?
Thanks!!

tony tam

unread,
Jun 27, 2016, 9:56:18 AM6/27/16
to swagger-sw...@googlegroups.com
Try changing the name to something other than Map.  My guess is that name is assumed to be a language-specific type in the generators, which may be incorrect (we may need to rename it to avoid collisions)

--
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.

lsa...@genexus.com

unread,
Jun 27, 2016, 11:20:57 AM6/27/16
to Swagger
The problem is that I don´t generate that json, I got it from here: https://watson-api-explorer.mybluemix.net/ Ideally I don´t want to modify it or modify the names, unless they are a reserved word for my language.

The same problem might arise if it was called something like List of Array then?

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

Tony Tam

unread,
Jun 27, 2016, 11:23:16 AM6/27/16
to swagger-sw...@googlegroups.com
I'm not sure, my suggestion is to rename it and we can see if that solves the issue. If so, we know what to change in the codegen. That's the best way to debug an issue like this

You can simply save the file locally and rename the field throughout the file
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

lsa...@genexus.com

unread,
Jun 27, 2016, 11:41:59 AM6/27/16
to Swagger
I renamed it to "Mapa"  and it solved the issue (both in C# and java), so it seems that´s the problem.

I also tried with "List" and again it doesn´t create the file, I´m guessing that would be the case for other names that correspond with types

tony tam

unread,
Jun 27, 2016, 11:43:33 AM6/27/16
to swagger-sw...@googlegroups.com
OK great—can you please open an issue in swagger-codegen and we can get it addressed.

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

lsa...@genexus.com

unread,
Jun 27, 2016, 11:48:15 AM6/27/16
to Swagger
Sure, and thanks!
Reply all
Reply to author
Forward
0 new messages