{"action":"created","issue":{"url":"https://api.github.com/repos/mchlbrnd/swagged-angular-resources/issues/14","labels_url":"https://api.github.com/repos/mchlbrnd/swagged-angular-resources/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/mchlbrnd/swagged-angular-resources/issues/14/comments","events_url":"https://api.github.com/repos/mchlbrnd/swagged-angular-resources/issues/14/events","html_url":"https://github.com/mchlbrnd/swagged-angular-resources/issues/14","id":115269521,"number":14,"title":"Generate the same code for any definition file","user":{"login":"teone","id":3929466,"avatar_url":"https://avatars.githubusercontent.com/u/3929466?v=3","gravatar_id":"","url":"https://api.github.com/users/teone","html_url":"https://github.com/teone","followers_url":"https://api.github.com/users/teone/followers","following_url":"https://api.github.com/users/teone/following{/other_user}","gists_url":"https://api.github.com/users/teone/gists{/gist_id}","starred_url":"https://api.github.com/users/teone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teone/subscriptions","organizations_url":"https://api.github.com/users/teone/orgs","repos_url":"https://api.github.com/users/teone/repos","events_url":"https://api.github.com/users/teone/events{/privacy}","received_events_url":"https://api.github.com/users/teone/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-05T12:00:10Z","updated_at":"2015-11-05T13:46:06Z","closed_at":null,"body":"Hi @mchlbrnd, I was giving a try to this module, but it seems to generate the same output for any definition file... This is the command I'm using:\r\n`swagged-angular-resources api-generator-dev/sample.swagger.json`\r\n\r\nThis is the input file:\r\n```\r\n{\r\n  \"swaggerVersion\":\"1.2\",\r\n  \"apis\":[\r\n    {\r\n      \"operations\":[\r\n        {\r\n          \"parameters\":[\r\n\r\n          ],\r\n          \"nickname\":\"Hpc_Api_Root_GET\",\r\n          \"notes\":\"\",\r\n          \"summary\":\"\",\r\n          \"type\":\"object\",\r\n          \"method\":\"GET\"\r\n        }\r\n      ],\r\n      \"path\":\"/hpcapi/\",\r\n      \"description\":\"\"\r\n    },\r\n    {\r\n      \"operations\":[\r\n        {\r\n          \"parameters\":[\r\n\r\n          ],\r\n          \"nickname\":\"Content_Provider_List_GET\",\r\n          \"notes\":\"\",\r\n          \"summary\":\"\",\r\n          \"type\":\"ContentProviderSerializer\",\r\n          \"method\":\"GET\"\r\n        },\r\n        {\r\n          \"parameters\":[\r\n            {\r\n              \"name\":\"enacted\",\r\n              \"format\":\"date-time\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"string\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"policed\",\r\n              \"format\":\"date-time\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"string\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"backend_register\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"string\",\r\n              \"defaultValue\":\"{}\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"backend_status\",\r\n              \"paramType\":\"form\",\r\n              \"required\":true,\r\n              \"type\":\"string\",\r\n              \"defaultValue\":\"0 - Provisioning in progress\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"deleted\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"boolean\",\r\n              \"defaultValue\":false,\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"write_protect\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"boolean\",\r\n              \"defaultValue\":false,\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"lazy_blocked\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"boolean\",\r\n              \"defaultValue\":false,\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"no_sync\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"boolean\",\r\n              \"defaultValue\":false,\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"content_provider_id\",\r\n              \"format\":\"int64\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"integer\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"name\",\r\n              \"paramType\":\"form\",\r\n              \"required\":true,\r\n              \"type\":\"string\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"enabled\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"boolean\",\r\n              \"defaultValue\":true,\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"description\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"string\",\r\n              \"description\":\"Description of Content Provider\"\r\n            },\r\n            {\r\n              \"name\":\"serviceProvider\",\r\n              \"paramType\":\"form\",\r\n              \"required\":true,\r\n              \"type\":\"string\",\r\n              \"description\":\"\"\r\n            }\r\n          ],\r\n          \"nickname\":\"Content_Provider_List_POST\",\r\n          \"notes\":\"\",\r\n          \"summary\":\"\",\r\n          \"type\":\"ContentProviderSerializer\",\r\n          \"method\":\"POST\"\r\n        }\r\n      ],\r\n      \"path\":\"/hpcapi/contentproviders/\",\r\n      \"description\":\"\"\r\n    },\r\n    {\r\n      \"operations\":[\r\n        {\r\n          \"parameters\":[\r\n            {\r\n              \"paramType\":\"path\",\r\n              \"required\":true,\r\n              \"type\":\"string\",\r\n              \"name\":\"pk\"\r\n            }\r\n          ],\r\n          \"nickname\":\"Content_Provider_Detail_GET\",\r\n          \"notes\":\"\",\r\n          \"summary\":\"\",\r\n          \"type\":\"ContentProviderSerializer\",\r\n          \"method\":\"GET\"\r\n        },\r\n        {\r\n          \"parameters\":[\r\n            {\r\n              \"paramType\":\"path\",\r\n              \"required\":true,\r\n              \"type\":\"string\",\r\n              \"name\":\"pk\"\r\n            },\r\n            {\r\n              \"name\":\"enacted\",\r\n              \"format\":\"date-time\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"string\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"policed\",\r\n              \"format\":\"date-time\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"string\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"backend_register\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"string\",\r\n              \"defaultValue\":\"{}\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"backend_status\",\r\n              \"paramType\":\"form\",\r\n              \"required\":true,\r\n              \"type\":\"string\",\r\n              \"defaultValue\":\"0 - Provisioning in progress\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"deleted\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"boolean\",\r\n              \"defaultValue\":false,\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"write_protect\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"boolean\",\r\n              \"defaultValue\":false,\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"lazy_blocked\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"boolean\",\r\n              \"defaultValue\":false,\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"no_sync\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"boolean\",\r\n              \"defaultValue\":false,\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"content_provider_id\",\r\n              \"format\":\"int64\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"integer\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"name\",\r\n              \"paramType\":\"form\",\r\n              \"required\":true,\r\n              \"type\":\"string\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"enabled\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"boolean\",\r\n              \"defaultValue\":true,\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"description\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"string\",\r\n              \"description\":\"Description of Content Provider\"\r\n            },\r\n            {\r\n              \"name\":\"serviceProvider\",\r\n              \"paramType\":\"form\",\r\n              \"required\":true,\r\n              \"type\":\"string\",\r\n              \"description\":\"\"\r\n            }\r\n          ],\r\n          \"nickname\":\"Content_Provider_Detail_PUT\",\r\n          \"notes\":\"\",\r\n          \"summary\":\"\",\r\n          \"type\":\"ContentProviderSerializer\",\r\n          \"method\":\"PUT\"\r\n        },\r\n        {\r\n          \"parameters\":[\r\n            {\r\n              \"paramType\":\"path\",\r\n              \"required\":true,\r\n              \"type\":\"string\",\r\n              \"name\":\"pk\"\r\n            },\r\n            {\r\n              \"name\":\"enacted\",\r\n              \"format\":\"date-time\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"string\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"policed\",\r\n              \"format\":\"date-time\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"string\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"backend_register\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"string\",\r\n              \"defaultValue\":\"{}\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"backend_status\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"string\",\r\n              \"defaultValue\":\"0 - Provisioning in progress\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"deleted\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"boolean\",\r\n              \"defaultValue\":false,\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"write_protect\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"boolean\",\r\n              \"defaultValue\":false,\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"lazy_blocked\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"boolean\",\r\n              \"defaultValue\":false,\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"no_sync\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"boolean\",\r\n              \"defaultValue\":false,\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"content_provider_id\",\r\n              \"format\":\"int64\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"integer\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"name\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"string\",\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"enabled\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"boolean\",\r\n              \"defaultValue\":true,\r\n              \"description\":\"\"\r\n            },\r\n            {\r\n              \"name\":\"description\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"string\",\r\n              \"description\":\"Description of Content Provider\"\r\n            },\r\n            {\r\n              \"name\":\"serviceProvider\",\r\n              \"paramType\":\"form\",\r\n              \"required\":false,\r\n              \"type\":\"string\",\r\n              \"description\":\"\"\r\n            }\r\n          ],\r\n          \"nickname\":\"Content_Provider_Detail_PATCH\",\r\n          \"notes\":\"\",\r\n          \"summary\":\"\",\r\n          \"type\":\"ContentProviderSerializer\",\r\n          \"method\":\"PATCH\"\r\n        },\r\n        {\r\n          \"parameters\":[\r\n            {\r\n              \"paramType\":\"path\",\r\n              \"required\":true,\r\n              \"type\":\"string\",\r\n              \"name\":\"pk\"\r\n            }\r\n          ],\r\n          \"nickname\":\"Content_Provider_Detail_DELETE\",\r\n          \"notes\":\"\",\r\n          \"summary\":\"\",\r\n          \"type\":\"ContentProviderSerializer\",\r\n          \"method\":\"DELETE\"\r\n        }\r\n      ],\r\n      \"path\":\"/hpcapi/contentproviders/{pk}/\",\r\n      \"description\":\"\"\r\n    }\r\n  ],\r\n  \"basePath\":\"http://localhost:9999\",\r\n  \"resourcePath\":\"/hpcapi\",\r\n  \"apiVersion\":\"\"\r\n}\r\n```\r\n\r\nand this is the output:\r\n\r\n```\r\n(function(angular) {\r\n  'use strict';\r\n\r\n  var moduleName = 'swaggedAngularResources';\r\n\r\n  angular\r\n    .module(moduleName, ['ngResource'])\r\n    .provider('$resourceActionConfig', function () {\r\n      var actionConfigs = {$global: {}};\r\n\r\n      this.addActionConfig = function (resourceName, actionName, config) {\r\n        if (arguments.length === 1) {\r\n          actionConfigs.$global = resourceName; // resourceName === config\r\n          return this;\r\n        } else if (arguments.length === 2) {\r\n          config = actionName;\r\n          actionName = '$global';\r\n        }\r\n\r\n        actionConfigs[resourceName] = actionConfigs[resourceName] || {};\r\n        actionConfigs[resourceName][actionName] = config;\r\n        return this;\r\n      };\r\n\r\n      this.$get = function () {\r\n        return function (resourceName, actionName) {\r\n          return actionConfigs[resourceName]\r\n            ? (actionConfigs[resourceName][actionName] || actionConfigs[resourceName].$global)\r\n            : actionConfigs.$global;\r\n        };\r\n      };\r\n    })\r\n;\r\n\r\n    if (typeof exports !== 'undefined') {\r\n        if (typeof module !== 'undefined' && module.exports) {\r\n            exports = module.exports = moduleName;\r\n        }\r\n        exports = moduleName;\r\n    }\r\n}(angular));\r\n```\r\n\r\nI can't see any of my endpoint. And an option to configure the filename in which output will be great. Any tip?"},"comment":{"url":"https://api.github.com/repos/mchlbrnd/swagged-angular-resources/issues/comments/154062104","html_url":"https://github.com/mchlbrnd/swagged-angular-resources/issues/14#issuecomment-154062104","issue_url":"https://api.github.com/repos/mchlbrnd/swagged-angular-resources/issues/14","id":154062104,"user":{"login":"teone","id":3929466,"avatar_url":"https://avatars.githubusercontent.com/u/3929466?v=3","gravatar_id":"","url":"https://api.github.com/users/teone","html_url":"https://github.com/teone","followers_url":"https://api.github.com/users/teone/followers","following_url":"https://api.github.com/users/teone/following{/other_user}","gists_url":"https://api.github.com/users/teone/gists{/gist_id}","starred_url":"https://api.github.com/users/teone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teone/subscriptions","organizations_url":"https://api.github.com/users/teone/orgs","repos_url":"https://api.github.com/users/teone/repos","events_url":"https://api.github.com/users/teone/events{/privacy}","received_events_url":"https://api.github.com/users/teone/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T13:46:06Z","updated_at":"2015-11-05T13:46:06Z","body":"@mchlbrnd thanks for pointing me, but it seems to have the same behavior :)\r\n\r\nI'm going to as there..."}}