Skip to content

Creating an API from OpenAPI specification results in false "duplicate signature" error.  #129

Description

@jessy100

Describe the bug
When importing the following OpenApi spec with the OpenApi importer in Azure Api Management, an error is returned:

'Importing API has duplicate signature operations: 2 operations with signature 'GET /api/group-users/{id}'

To Reproduce
Steps to reproduce the behavior:

  1. Go to Azure Api Management in portal.azure.com
  2. Click on Apis
  3. Click on Add Api
  4. Click on Create definition from OpenAPI
  5. Use the following OpenApi spec:
{
    "x-generator": "NSwag v14.0.2.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))",
    "openapi": "3.0.0",
    "info": {
      "title": "Test web API",
      "description": "Test web API",
      "version": "1.0.0"
    },
    "servers": [
      {
        "url": "https://testwebapi.com"
      }
    ],
    "paths": {
      "/api/group-users/{id}": {
        "get": {
          "tags": [
            "GroupUsers"
          ],
          "operationId": "GroupUsers_GetById",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "integer",
                "format": "int32"
              },
              "x-position": 1
            }
          ],
          "responses": {
            "200": {
              "description": "",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/groupUser"
                  }
                }
              }
            },
          }
          }
        },
      "/api/group-users/{guidId}": {
        "get": {
          "tags": [
            "GroupUsers"
          ],
          "operationId": "GroupUsers_GetByguidId",
          "parameters": [
            {
              "name": "guidId",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "guid"
              },
              "x-position": 1
            }
          ],
            "responses": {
            "200": {
              "description": "",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/groupUser"
                  }
                }
              }
            }
          }
          }
        }
      },
    "components": {
      "schemas": {
            "groupUser": {
              "readOnly": true,
              "nullable": true,
              "oneOf": [
                {
                  "$ref": "#/components/schemas/GroupUser"
                }
              ]
            },"GroupUser": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "integer",
              "readOnly": true,
              "format": "int32"
            }
          }
        },
          }
      }
  }

Expected behavior
I expect the Import to succeed. There isn't a duplicate endpoint. While the definition is the same, it differs in datatype and OperationId. This is a valid open API spec.

Screenshots
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions