Skip to content

[typescript-angular] Primitive typed parameters #7407

Description

@kewinbrand

Hi,

I have some API's that contain primitive parameters in the request body of POST requests.
The problem is that primtive parameters are forced to be JSON encoded, generating random
interfaces like:

export interface Body2 {
usuario: OctopusEntitiesColetorTUsuario;
iRecnoSolicitacao: number;
}

This also happens to responses classes.

Thank you.

Swagger-codegen version

2.4.0.
Also tested on 2.3.0. Same problem.

Swagger declaration file content or url
"/WmsService/AlocarTransferirMateriaisWms":{
         "post":{
            "tags":[
               "WmsService"
            ],
            "operationId":"IWmsService.AlocarTransferirMateriaisWms",
            "consumes":[
               "application/json"
            ],
            "produces":[
               "application/json"
            ],
            "parameters":[
               {
                  "in":"body",
                  "name":"body",
                  "required":true,
                  "schema":{
                     "type":"object",
                     "properties":{
                        "sCodigoItem":{
                           "type":"string"
                        },
                        "sLote":{
                           "type":"string"
                        },
                        "sMotivoMovimentacao":{
                           "type":"string"
                        },
                        "sUsuarioSistema":{
                           "type":"string"
                        },
                        "dQtdeMovimentacao":{
                           "type":"number"
                        },
                        "iNumeroOdf":{
                           "type":"integer"
                        },
                        "iCodigoLocalOrigem":{
                           "type":"integer"
                        },
                        "iCodigoLocalDestino":{
                           "type":"integer"
                        },
                        "iEmpresaRecno":{
                           "type":"integer"
                        }
                     },
                     "required":[
                        "sCodigoItem",
                        "sLote",
                        "sMotivoMovimentacao",
                        "sUsuarioSistema",
                        "dQtdeMovimentacao",
                        "iNumeroOdf",
                        "iCodigoLocalOrigem",
                        "iCodigoLocalDestino",
                        "iEmpresaRecno"
                     ]
                  }
               }
            ],
            "responses":{
               "200":{
                  "description":"Successful response",
                  "schema":{
                     "type":"object",
                     "properties":{
                        "value":{
                           "type":"boolean"
                        }
                     }
                  }
               }
            }
         }
      },

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions