{
  "swagger": "2.0",
  "info": {
    "version": "1.0.0",
    "title": "Swagger fortunejs Example",
    "description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification",
    "termsOfService": "http://swagger.io/terms/",
    "contact": {
      "name": "Swagger API Team"
    },
    "license": {
      "name": "MIT"
    }
  },
  "host": "petstore.swagger.io",
  "basePath": "/api",
  "schemes": [
    "http"
  ],
  "consumes": [
    "application/vnd.api+json",
    "application/json"
  ],
  "produces": [
    "application/vnd.api+json",
    "application/json"
  ],
  "flowee": {
    "model": {
      "write": true,
      "file": "/model.generated.json"
    },
    "dataPath": ".",
    "fortunejs": {
      "settings": {
        "endResponse": false
      },
      "serializers": [
        {
          "options": {
            "inflectType": true,
            "inflectKeys": true,
            "maxLimit": 1000,
            "includeLimit": 3,
            "bufferEncoding": "base64",
            "prefix": "",
            "uriTemplate": "{/type,ids,relatedField,relationship}{?query*}",
            "allowLevel": [
              [
                "GET"
              ],
              [
                "GET",
                "POST"
              ],
              [
                "GET",
                "PATCH",
                "DELETE"
              ],
              [
                "GET"
              ],
              [
                "GET",
                "POST",
                "PATCH",
                "DELETE"
              ]
            ]
          }
        }
      ],
      "adapter": {
        "options": {
          "dbPath": "./db"
        }
      },
      "enforceLinks": true
    }
  },
  "paths": {
    "/foo": {
      "get": {
        "public": true,
        "schema": {
          "query": {},
          "payload": {}
        },
        "description": "Returns all owners from the system that the user has access to",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "A list of owners.",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/user"
              }
            }
          }
        }
      }
    },
    "/model": {
      "get": {
        "public": true,
        "description": "Returns flowee (generated) model for backup or documentation purposes",
        "produces": [
          "application/json"
        ],
        "schema": {
          "query": {},
          "payload": {}
        },
        "responses": {
          "200": {
            "description": "The flowee json model",
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "/user": {
      "get": {
        "description": "Returns a collection of user objects from the database",
        "produces": [
          "application/vnd.api+json"
        ],
        "responses": {
          "200": {
            "description": "A collection of user objects",
            "schema": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "username": {
                      "type": "string"
                    },
                    "password": {
                      "type": "string"
                    },
                    "apitoken": {
                      "type": "string"
                    },
                    "following": {
                      "type": "array"
                    },
                    "followers": {
                      "type": "array"
                    },
                    "roles": {
                      "type": "array"
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "post": {
        "description": "Creates a user object",
        "produces": [
          "application/vnd.api+json"
        ],
        "responses": {
          "200": {
            "description": "A user object",
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "username": {
                  "type": "string"
                },
                "password": {
                  "type": "string"
                },
                "apitoken": {
                  "type": "string"
                },
                "following": {
                  "type": "array"
                },
                "followers": {
                  "type": "array"
                },
                "roles": {
                  "type": "array"
                }
              }
            }
          }
        }
      }
    },
    "/user/:id": {
      "get": {
        "description": "Returns a user object from the database",
        "produces": [
          "application/vnd.api+json"
        ],
        "responses": {
          "200": {
            "description": "A user object",
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "username": {
                  "type": "string"
                },
                "password": {
                  "type": "string"
                },
                "apitoken": {
                  "type": "string"
                },
                "following": {
                  "type": "array"
                },
                "followers": {
                  "type": "array"
                },
                "roles": {
                  "type": "array"
                }
              }
            }
          }
        }
      },
      "put": {
        "description": "Updates a user object",
        "produces": [
          "application/vnd.api+json"
        ],
        "responses": {
          "200": {
            "description": "A user object",
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "username": {
                  "type": "string"
                },
                "password": {
                  "type": "string"
                },
                "apitoken": {
                  "type": "string"
                },
                "following": {
                  "type": "array"
                },
                "followers": {
                  "type": "array"
                },
                "roles": {
                  "type": "array"
                }
              }
            }
          }
        }
      }
    },
    "/role": {
      "get": {
        "description": "Returns a collection of role objects from the database",
        "produces": [
          "application/vnd.api+json"
        ],
        "responses": {
          "200": {
            "description": "A collection of role objects",
            "schema": {
              "type": "array",
              "items": [
                {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "user": {}
                  }
                }
              ]
            }
          }
        }
      },
      "post": {
        "description": "Creates a role object",
        "produces": [
          "application/vnd.api+json"
        ],
        "responses": {
          "200": {
            "description": "A role object",
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "user": {}
              }
            }
          }
        }
      }
    },
    "/role/:id": {
      "get": {
        "description": "Returns a role object from the database",
        "produces": [
          "application/vnd.api+json"
        ],
        "responses": {
          "200": {
            "description": "A role object",
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "user": {}
              }
            }
          }
        }
      },
      "put": {
        "description": "Updates a role object",
        "produces": [
          "application/vnd.api+json"
        ],
        "responses": {
          "200": {
            "description": "A role object",
            "schema": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "user": {}
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "user": {
      "schema": {
        "name": {},
        "username": {},
        "password": {},
        "apitoken": {},
        "following": {
          "link": "user",
          "inverse": "followers",
          "isArray": true
        },
        "followers": {
          "link": "user",
          "inverse": "following",
          "isArray": true
        },
        "roles": {
          "link": "role",
          "inverse": "user",
          "isArray": true
        }
      }
    },
    "role": {
      "schema": {
        "message": {},
        "user": {
          "link": "user",
          "inverse": "roles"
        }
      }
    }
  }
}