1

I want to create an API with following spec.:

project-api.json

{
"Project": {
    "required": [
        "uuid"
    ],
    "properties": {
        "uuid": {
            "type": "string",
            "format": "string"
        }
        "Tasks": {
                "type": "array",
                "items": {
                    "$ref": "models/task.json"
                }
            }
        }
...

task.json

{
"Task": {
"required": [
    "uuid"
],
"properties": {
    "user": {
      "type": "string"
    },
    "title": {
        "type": "string"
    },
...

Instead of making a reference to models/tasks.json, the generated api generates:

List<ModelstasksJson>

Anyone know how to reference to models from another json file?

Gobliins
  • 3,848
  • 16
  • 67
  • 122
  • Generated using swagger-codegen? – Ron Feb 01 '16 at 16:26
  • Are you asking how to split your schema definition across multiple files like here: http://stackoverflow.com/questions/8179137/how-to-manage-multiple-json-schema-files? – Charlie Feb 01 '16 at 20:35
  • This would only ever happen if the resolver couldn't find the reference `models/task.json`. Please share more if you're still having an issue with this. – fehguy Feb 03 '16 at 23:43
  • @fehguy i still have issues with this, i think swagger is not capaple of resolving local paths when their not in URL form like http://... – Gobliins Feb 05 '16 at 07:52

0 Answers0