forked from loafle/openapi-generator-original
Add model name mapping feature to C# codegen (#16209)
* add model name mapping feature to C# codegen * rename file * update samples * update doc
This commit is contained in:
@@ -416,7 +416,16 @@ Here is an example to use `nameMappings` and `parameterNameMapping` in CLI:
|
||||
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g java -i modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-okhttp-gson.yaml -o /tmp/java2/ --name-mappings _type=underscoreType, type_=typeWithUnderscore, --parameter-name-mappings _type=paramType, type_=typeParam
|
||||
```
|
||||
|
||||
(Not all generators support this feature yet. Please give it a try to confirm the behaviour and open an issue (ticket) to let us know which generators you would like to have this feature enabled and we'll prioritize accordingly.)
|
||||
To map model names, use `modelNameMappings` option, e.g.
|
||||
```sh
|
||||
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g csharp -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o /tmp/csharp/ --model-name-mappings Tag=Label
|
||||
```
|
||||
will rename the Tag schema to Label instead.
|
||||
|
||||
|
||||
(Not all generators support thess features yet. Please give it a try to confirm the behaviour and open an issue (ticket) to let us know which generators you would like to have this feature enabled and we'll prioritize accordingly.)
|
||||
|
||||
Related PRs: #16209 (modelNameMappings), #16194, #16206 (nameMappings, parameterNameMappings)
|
||||
|
||||
## Schema Mapping
|
||||
|
||||
|
||||
Reference in New Issue
Block a user