3

I have a swagger.json file automatically generated by Swagger for .NetCore (C#). In this Json file we can find our DTOs placed in the "definitions" section.

Our Class name are construct with this template "CompanyName.DTO.ViewMode.AClassName" e.g. "Jabberwocky.DTO.ViewModel.Address"

When I generate the class with Swagger codegen, all the DTO are place in a Model folder, and the class name are now "CompanyNameDTOViewModeAClassName".

The Class name have been change to remove the dot, even in the code of the class. That’s a little hard to work with this kind of class name...

Is it possible during generation that Swagger Codegen constructs subfolders according to the dot present in the name of the class?

Like :

Model
- CompanyName
  - DTO
    - ViewModel
      - Address.cs

Here is the first lines of our definitions part from the json file :

"definitions": {
    "Jabberwocky.DTO.APIEntity.Address": {
        "description": "Represents an Address",
        "type": "object",
        "properties": {
            "id": {
                "format": "int32",
                "description": "Identifies the address in the Database",
                "type": "integer"
            },

Thanks for your help !

Waldo
  • 1,070
  • 1
  • 11
  • 30

0 Answers0