Skip to content

Operation parameter extensions not parsed #305

@JohnGalt1717

Description

@JohnGalt1717

I have the following in the swagger endpoint:


"/v1/Invoices/GetInventoryItemPrice": {
      "get": {
        "tags": [
          "Invoices"
        ],
        "summary": "Returns the price for the given inventory number between the two parties",
        "operationId": "V1InvoicesGetInventoryItemPriceGet",
        "consumes": [],
        "produces": [
          "application/json",
          "text/json",
          "application/xml",
          "text/xml",
          "application/bson"
        ],
        "parameters": [
          {
            "name": "fromContactId",
            "in": "query",
            "description": "",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "toContactId",
            "in": "query",
            "description": "",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "toContactType",
            "in": "query",
            "description": "",
            "required": false,
            "type": "string",
            "enum": [
              "User",
              "Organization"
            ],
            "x-ms-enum": {
              "name": "ContactTypes",
              "modelAsString": true,
              "values": [
                {
                  "value": 1,
                  "name": "User",
                  "description": "User"
                },
                {
                  "value": 2,
                  "name": "Organization",
                  "description": "Organization"
                }
              ]
            }
          },
          {
            "name": "inventoryId",
            "in": "query",
            "description": "",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "units",
            "in": "query",
            "description": "",
            "required": false,
            "type": "number",
            "format": "double"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "schema": {
              "format": "double",
              "type": "number"
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "oauth2": [
              "api1"
            ]
          }
        ]
      }
    },

Note toContactType:


{
            "name": "toContactType",
            "in": "query",
            "description": "",
            "required": false,
            "type": "string",
            "enum": [
              "User",
              "Organization"
            ],
            "x-ms-enum": {
              "name": "ContactTypes",
              "modelAsString": true,
              "values": [
                {
                  "value": 1,
                  "name": "User",
                  "description": "User"
                },
                {
                  "value": 2,
                  "name": "Organization",
                  "description": "Organization"
                }
              ]
            }
          },

which clearly has x-ms-enum as an extension. If this was on a schema type, it works fine and the extension is pulled in. However when it's on a parameter of an operation it fails and the extension collection is 0 length.

Metadata

Metadata

Labels

type:bugA broken experience

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions