Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Crash if duplicate model names (across files) used in allOf

Open
#479 2 comments 0 reactions 1 assignee View on GitHub

@mikeharder is already working on this.

Since May 5, 2026.

Assessment

This issue has not been assessed yet.

Description

A TSP conversion PR resulted in this error:

"details":"incompatible properties : tags

definitions/ContainerGroup/properties/tags
 at file:///home/runner/work/azure-rest-api-specs/azure-rest-api-specs/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/ContainerInstance/stable/2025-09-01/containerInstance.json#L2245:8

definitions/Resource/properties/tags
  at file:///home/runner/work/azure-rest-api-specs/azure-rest-api-specs/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/ContainerInstance/stable/2025-09-01/containerInstance.json#L4642:8"

Root cause, oad cannot handle two definitions in different files with the same name, if one definition is used in an allOf:

duplicate-names.json
{
  "swagger": "2.0",
  "info": {
    "title": "duplicate-names",
    "version": "1.0"
  },
  "paths": {},
  "definitions": {
    "Bar": {
      "type": "object",
      "properties": {
        "p1": {
          "type": "string"
        }
      },
      "allOf": [
        {
          "$ref": "./common-types.json#/definitions/Foo"
        }
      ]
    },
    "Foo": {
      "type": "object",
      "properties": {
        "p1": {
          "type": "object"
        }
      }
    }
  }
}
common-types.json
{
  "swagger": "2.0",
  "info": {
    "title": "common-types",
    "version": "1.0"
  },
  "paths": {},
  "definitions": {
    "Foo": {
      "type": "object",
      "properties": {
        "p1": {
          "type": "string"
        }
      }
    }
  }
}
test result
    incompatible properties : p1
      definitions/Bar/properties/p1
        at file:///home/mharder/openapi-diff-mh/incompat-prop/src/test/specs/incompatible-properties/duplicate-names.json#L12:8
      definitions/Foo/properties/p1
        at file:///home/mharder/openapi-diff-mh/incompat-prop/src/test/specs/incompatible-properties/duplicate-names.json#L25:8

Reason, it assumes model names are unique across all files:

https://github.com/Azure/openapi-diff/blob/bb4653d32f49ceb2abab48656c42c253865697e1/src/lib/util/resolveSwagger.ts#L346-L352

Related: #347

Dominant language
C#
Stars
290
Forks
50
Avg merge
2d 21h
Merged PRs (30d)
10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/openapi-diff

All issues in Azure/openapi-diff

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.