{"action":"created","issue":{"url":"https://api.github.com/repos/Kinto/kinto/issues/1180","repository_url":"https://api.github.com/repos/Kinto/kinto","labels_url":"https://api.github.com/repos/Kinto/kinto/issues/1180/labels{/name}","comments_url":"https://api.github.com/repos/Kinto/kinto/issues/1180/comments","events_url":"https://api.github.com/repos/Kinto/kinto/issues/1180/events","html_url":"https://github.com/Kinto/kinto/issues/1180","id":219258773,"number":1180,"title":"Swagger spec still invalid","user":{"login":"tarekziade","id":250019,"avatar_url":"https://avatars2.githubusercontent.com/u/250019?v=3","gravatar_id":"","url":"https://api.github.com/users/tarekziade","html_url":"https://github.com/tarekziade","followers_url":"https://api.github.com/users/tarekziade/followers","following_url":"https://api.github.com/users/tarekziade/following{/other_user}","gists_url":"https://api.github.com/users/tarekziade/gists{/gist_id}","starred_url":"https://api.github.com/users/tarekziade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarekziade/subscriptions","organizations_url":"https://api.github.com/users/tarekziade/orgs","repos_url":"https://api.github.com/users/tarekziade/repos","events_url":"https://api.github.com/users/tarekziade/events{/privacy}","received_events_url":"https://api.github.com/users/tarekziade/received_events","type":"User","site_admin":false},"labels":[{"id":180758578,"url":"https://api.github.com/repos/Kinto/kinto/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":{"login":"gabisurita","id":4023375,"avatar_url":"https://avatars2.githubusercontent.com/u/4023375?v=3","gravatar_id":"","url":"https://api.github.com/users/gabisurita","html_url":"https://github.com/gabisurita","followers_url":"https://api.github.com/users/gabisurita/followers","following_url":"https://api.github.com/users/gabisurita/following{/other_user}","gists_url":"https://api.github.com/users/gabisurita/gists{/gist_id}","starred_url":"https://api.github.com/users/gabisurita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabisurita/subscriptions","organizations_url":"https://api.github.com/users/gabisurita/orgs","repos_url":"https://api.github.com/users/gabisurita/repos","events_url":"https://api.github.com/users/gabisurita/events{/privacy}","received_events_url":"https://api.github.com/users/gabisurita/received_events","type":"User","site_admin":false},"assignees":[{"login":"gabisurita","id":4023375,"avatar_url":"https://avatars2.githubusercontent.com/u/4023375?v=3","gravatar_id":"","url":"https://api.github.com/users/gabisurita","html_url":"https://github.com/gabisurita","followers_url":"https://api.github.com/users/gabisurita/followers","following_url":"https://api.github.com/users/gabisurita/following{/other_user}","gists_url":"https://api.github.com/users/gabisurita/gists{/gist_id}","starred_url":"https://api.github.com/users/gabisurita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabisurita/subscriptions","organizations_url":"https://api.github.com/users/gabisurita/orgs","repos_url":"https://api.github.com/users/gabisurita/repos","events_url":"https://api.github.com/users/gabisurita/events{/privacy}","received_events_url":"https://api.github.com/users/gabisurita/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2017-04-04T13:55:15Z","updated_at":"2017-04-04T19:19:16Z","closed_at":null,"body":"The Swagger spec is still invalid it seems\r\n\r\nExtract:\r\n\r\n```json\r\n/{prefix}/{api_ver:\\\\d+}/{application_guid}/{application_ver}/{metrics:.*}\": {\r\n      \"parameters\": [\r\n        {\r\n          \"name\": \"prefix\",\r\n          \"type\": \"string\",\r\n          \"required\": true,\r\n          \"in\": \"path\"\r\n        },\r\n        {\r\n          \"name\": \"api_ver:\\\\d+\",\r\n          \"type\": \"string\",\r\n          \"required\": true,\r\n          \"in\": \"path\"\r\n        },\r\n        {\r\n          \"name\": \"application_guid\",\r\n          \"type\": \"string\",\r\n          \"required\": true,\r\n          \"in\": \"path\"\r\n        },\r\n        {\r\n          \"name\": \"application_ver\",\r\n          \"type\": \"string\",\r\n          \"required\": true,\r\n          \"in\": \"path\"\r\n        },\r\n        {\r\n          \"name\": \"metrics:.*\",\r\n          \"type\": \"string\",\r\n          \"required\": true,\r\n          \"in\": \"path\"\r\n        }\r\n      ],\r\n```\r\n\r\nIn this API definitions, smwogger will choke on api_ver and metrics because their definitions in the parameter list should not include the regexp and just be the name of the parameter\r\n\r\nThe right definition should be\r\n\r\n```json\r\n/{prefix}/{api_ver:\\\\d+}/{application_guid}/{application_ver}/{metrics:.*}\": {\r\n      \"parameters\": [\r\n        {\r\n          \"name\": \"prefix\",\r\n          \"type\": \"string\",\r\n          \"required\": true,\r\n          \"in\": \"path\"\r\n        },\r\n        {\r\n          \"name\": \"api_ver\",\r\n          \"type\": \"string\",\r\n          \"required\": true,\r\n          \"in\": \"path\"\r\n        },\r\n        {\r\n          \"name\": \"application_guid\",\r\n          \"type\": \"string\",\r\n          \"required\": true,\r\n          \"in\": \"path\"\r\n        },\r\n        {\r\n          \"name\": \"application_ver\",\r\n          \"type\": \"string\",\r\n          \"required\": true,\r\n          \"in\": \"path\"\r\n        },\r\n        {\r\n          \"name\": \"metrics\",\r\n          \"type\": \"string\",\r\n          \"required\": true,\r\n          \"in\": \"path\"\r\n        }\r\n      ],\r\n```\r\n\r\nTo validate that it works, you can try this small program with Smowgger to print all operations:\r\n\r\n```python\r\nimport asyncio\r\nfrom smwogger import API\r\n\r\n\r\nasync def print_operations():\r\n    async with API('http://path.to.kinto/v1/__api__') as api:\r\n        print(api.operations)\r\n\r\nloop = asyncio.get_event_loop()\r\ntry:\r\n    loop.run_until_complete(print_operations())\r\nfinally:\r\n    loop.close()\r\n```\r\n\r\n\r\ncc @gabisurita @chartjes "},"comment":{"url":"https://api.github.com/repos/Kinto/kinto/issues/comments/291604365","html_url":"https://github.com/Kinto/kinto/issues/1180#issuecomment-291604365","issue_url":"https://api.github.com/repos/Kinto/kinto/issues/1180","id":291604365,"user":{"login":"chartjes","id":28321,"avatar_url":"https://avatars0.githubusercontent.com/u/28321?v=3","gravatar_id":"","url":"https://api.github.com/users/chartjes","html_url":"https://github.com/chartjes","followers_url":"https://api.github.com/users/chartjes/followers","following_url":"https://api.github.com/users/chartjes/following{/other_user}","gists_url":"https://api.github.com/users/chartjes/gists{/gist_id}","starred_url":"https://api.github.com/users/chartjes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chartjes/subscriptions","organizations_url":"https://api.github.com/users/chartjes/orgs","repos_url":"https://api.github.com/users/chartjes/repos","events_url":"https://api.github.com/users/chartjes/events{/privacy}","received_events_url":"https://api.github.com/users/chartjes/received_events","type":"User","site_admin":false},"created_at":"2017-04-04T19:19:16Z","updated_at":"2017-04-04T19:19:16Z","body":"No, it's https://kinto.stage.mozaws.net"}}
{"actor":{"display_login":"chartjes"}}