{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3032","repository_url":"https://api.github.com/repos/swagger-api/swagger-codegen","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3032/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3032/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3032/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/3032","id":158217031,"number":3032,"title":"[C#] namespace issues","user":{"login":"Serjster","id":3606218,"avatar_url":"https://avatars.githubusercontent.com/u/3606218?v=3","gravatar_id":"","url":"https://api.github.com/users/Serjster","html_url":"https://github.com/Serjster","followers_url":"https://api.github.com/users/Serjster/followers","following_url":"https://api.github.com/users/Serjster/following{/other_user}","gists_url":"https://api.github.com/users/Serjster/gists{/gist_id}","starred_url":"https://api.github.com/users/Serjster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Serjster/subscriptions","organizations_url":"https://api.github.com/users/Serjster/orgs","repos_url":"https://api.github.com/users/Serjster/repos","events_url":"https://api.github.com/users/Serjster/events{/privacy}","received_events_url":"https://api.github.com/users/Serjster/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Client:%20C-Sharp","name":"Client: C-Sharp","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/9","html_url":"https://github.com/swagger-api/swagger-codegen/milestones/v2.2.0","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/9/labels","id":1375944,"number":9,"title":"v2.2.0","description":"","creator":{"login":"fehguy","id":249413,"avatar_url":"https://avatars.githubusercontent.com/u/249413?v=3","gravatar_id":"","url":"https://api.github.com/users/fehguy","html_url":"https://github.com/fehguy","followers_url":"https://api.github.com/users/fehguy/followers","following_url":"https://api.github.com/users/fehguy/following{/other_user}","gists_url":"https://api.github.com/users/fehguy/gists{/gist_id}","starred_url":"https://api.github.com/users/fehguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fehguy/subscriptions","organizations_url":"https://api.github.com/users/fehguy/orgs","repos_url":"https://api.github.com/users/fehguy/repos","events_url":"https://api.github.com/users/fehguy/events{/privacy}","received_events_url":"https://api.github.com/users/fehguy/received_events","type":"User","site_admin":false},"open_issues":191,"closed_issues":415,"state":"open","created_at":"2015-10-25T23:43:33Z","updated_at":"2016-06-05T14:34:40Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-06-02T19:11:22Z","updated_at":"2016-06-06T01:48:58Z","closed_at":null,"body":"I'm using http://editor.swagger.io/ though I think that is of little consequence. I have 2 swagger clients being consumed in my web app and since they both share the same namespace when I try to new up a new client it becomes ambiguous... it would be awesome if there was an attribute that I can set in my server/swagger apps that specified the namespace to create in the client... is there one that I missed? If it's simple enough, any clue how I could go about creating one? My concern is that I'd have to make modifications to the gen tool to make use of my new attribute and I don't want to do that. I know I can specify a namespace in the jar codegen... but we'd like to stay with the online tool if possible... the other option is to create a new project for each client.... but that seems like a band-aid, not to mention overkill. Your help is appreciated."},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments/223852839","html_url":"https://github.com/swagger-api/swagger-codegen/issues/3032#issuecomment-223852839","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3032","id":223852839,"user":{"login":"jimschubert","id":109659,"avatar_url":"https://avatars.githubusercontent.com/u/109659?v=3","gravatar_id":"","url":"https://api.github.com/users/jimschubert","html_url":"https://github.com/jimschubert","followers_url":"https://api.github.com/users/jimschubert/followers","following_url":"https://api.github.com/users/jimschubert/following{/other_user}","gists_url":"https://api.github.com/users/jimschubert/gists{/gist_id}","starred_url":"https://api.github.com/users/jimschubert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimschubert/subscriptions","organizations_url":"https://api.github.com/users/jimschubert/orgs","repos_url":"https://api.github.com/users/jimschubert/repos","events_url":"https://api.github.com/users/jimschubert/events{/privacy}","received_events_url":"https://api.github.com/users/jimschubert/received_events","type":"User","site_admin":false},"created_at":"2016-06-06T01:48:58Z","updated_at":"2016-06-06T01:48:58Z","body":"@Serjster You can view the specification at http://swagger.io/specification/.\r\n\r\nI think you're probably generating your clients in an unmaintainable way (or unintended, maybe?). The parameters used to customize the generated client are only available via the codegen jar or the generator web application. You can access the generator online at https://generator.swagger.io/ to check it out.\r\n\r\nYou can also run the codegen jar as a docker container. I have a container available for the codegen jar (https://hub.docker.com/r/jimschubert/swagger-codegen-cli/) and there's already one available for the generator api (https://hub.docker.com/r/swaggerapi/swagger-generator/), and I have pull #2945 open to integrate my container and other changes related to docker builds.\r\n\r\nThe following is an example usage of hitting the generator docker container, it's written for bash, so pre-Windows 10 you'd probably want to adapt it to batch or powershell:\r\n\r\n```\r\n# Start container and save the container id\r\nCID=$(docker run -d swaggerapi/swagger-generator)\r\n# allow for startup\r\nsleep 5\r\n# Get the IP of the running container\r\nGEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}'  $CID)\r\n# Execute an HTTP request and store the download link\r\nRESULT=$(curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{\r\n  \"swaggerUrl\": \"http://petstore.swagger.io/v2/swagger.json\"\r\n}' 'http://localhost:8188/api/gen/clients/javascript' | jq '.link' | tr -d '\"')\r\n# Download the generated zip and redirect to a file\r\ncurl $RESULT > result.zip\r\n# Shutdown the swagger generator image\r\ndocker stop $CID && docker rm $CID\r\n```\r\n\r\nIf you absolutely want to use a web-based service, you can send an HTTP post with the options you need to `https://generator.swagger.io/`. I'm not sure whether that service is intended to be used like that, but that's where the code from http://editor.swagger.io/ is being generated if you look at your devtools network tab. You could probably also write a [snippet](https://developers.google.com/web/tools/chrome-devtools/debug/snippets/) fairly easily which intercepts requests on that page and adds the namespace to the request.\r\n\r\nRegarding your question about specifying a namespace in the API's swagger definition, I think it would probably be difficult to get community buy-in on such a change to the official API specification. Generating clients for your swagger-documented API is generally considered a devops concern, not a public API concern. From a different perspective, the specification isn't designed to assume homogenous languages between APIs and Clients. The public API documentation is intentionally pretty language agnostic. There is a concept of [vendor extensions](http://swagger.io/specification/#vendorExtensions) which I think could support your requirements, but it would still require modification to the codegen module. Not only that, a vendor extension would either be .NET specific or it would require modifications to all generators."}}
{"actor":{"display_login":"jimschubert"}}