Naming request body issue

Hi,

As part of the multiservice project, I am using the shared models located in a separate file.
When defining the POST request, I would like to name the body input parameter (which is referencing one of the shared models) with the name, so the client generation tool will be able to name the variable properly

The swagger description contains the following code:

{
    "in": "body",
    "name": "TrovUser",
    "required": true,
    "schema": {
      "$ref": "./shared_data_models.oas2.yml#/definitions/trov-user"
 },

When the final documentation is generated, the file is being flattened from the references and the final JSON looks like:

 {
     in: "body",
     name: "body",
     required: false,
     schema: {
}

There are two issues in the generated code:

  • The required attribute has a wrong value
  • The name has replaced with the default name

Please advise how to correct these issues

Thanks,
Vadim

Could you share your model definition that you’re referencing?

@vncz

The model is defined as follows:

      "allOf": [
        {
          "$ref": "#/definitions/base_scim_v2_object"
        },
        {
          "type": "object",
          "properties": {
            "userName": {
              "type": "string"
            },
            "name": {
              "$ref": "#/definitions/name"
            },
            "displayName": {
              "type": "string"
            },
            "nickName": {
              "type": "string"
            },
            "profileUrl": {
              "type": "string",
              "format": "uri"
            },
            "emails": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/extended_email"
              }
            },
            "phoneNumbers": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/phoneNumber"
              }
            },
            "locale": {
              "type": "string"
            },
            "timezone": {
              "type": "string"
            },
            "active": {
              "type": "boolean"
            },
            "password": {
              "type": "string"
            },
            "groups": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/userGroup"
              }
            },
            "roles": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "tenantId": {
              "type": "string",
              "description": "Tenant discriminator"
            },
            "otac": {
              "type": "string"
            },
            "otacExpiration": {
              "type": "string",
              "format": "date-time"
            },
            "mfaEnrolled": {
              "type": "boolean"
            },
            "passPhrase": {
              "type": "string"
            },
            "additionalClaims": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/claim"
              }
            }
          },
          "required": [
            "userName",
            "name",
            "emails",
            "tenantId"
          ]
        }
      ],
      "title": "Trov User object",
      "description": "Trov User Object (urn:trov:params:scim:schemas:core:1.0:TrovUser)"
    },