swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
16.95k stars 6.03k forks source link

How to rename the generated client SDK project by modifying the input json #12164

Open MeikandaNayanar opened 1 year ago

MeikandaNayanar commented 1 year ago

I am using the https://editor.swagger.io/ to generate SDK. When I generate the SDK by selecting Generate Client -> CSharp, the SDK project is generated. But the problem is, I could not modify the project-name and namespaces. It by default gives the name as 'IO.Swagger.csproj' but I want to generate the SDK project name as 'MyProjectName.API'. How to achieve this?

The below is my model json file.

openapi: 3.0.1
info:
  title: MyProjectName.API
  version: '1'
  x-packageName: MyProjectName.API
servers:
  - url: http://localhost:64733
paths:
  /v1/brand/ActionName:

security:
  - Bearer: []
  - X-API-KEY: []

Even for the Petstore example they provide the SDK project is named as 'IO.Swagger.csproj'.

I do not like to do renaming after the SDK is generated except for the case we cannot do this with https://editor.swagger.io/

char0n commented 1 year ago

Hi @MeikandaNayanar,

Transferring this issue to swagger-codegen repo as it's not really related to the SwaggerEditor.