Skip to content

[RequiredPropertiesMissingInResourceModel] False positive if array element model has no "properties" property #786

@mikeharder

Description

@mikeharder

In Azure/azure-rest-api-specs#36704, RequiredPropertiesMissingInResourceModel failed with what appears to be a false positive:

https://github.com/Azure/azure-rest-api-specs/actions/runs/17415866870

I believe the bug is here:

else if(reference){
const referenceSchema = resolveRef(createEnhancedSchema(model.properties.value.items, source.file), inventory)
if (referenceSchema && referenceSchema.value && referenceSchema.value.properties) {
model = referenceSchema.value
}
}

Image

In this spec, referenceSchema.value.properties is undefined, because the value is just allOf two other models, with no properties of its own:

    "ContainerGroupProfile": {
      "description": "A container group profile.",
      "allOf": [
        {
          "$ref": "#/definitions/Resource"
        },
        {
          "$ref": "#/definitions/ContainerGroupProfileProperties"
        }
      ]
    },

https://github.com/Azure/azure-rest-api-specs/blob/2c1d4b6d885719edf0df8de4f289c78c6238d4a3/specification/containerinstance/resource-manager/Microsoft.ContainerInstance/stable/2025-09-01/containerInstance.json#L1758-L1768

A workaround is to add an empty properties bag:

    "ContainerGroupProfile": {
      "description": "A container group profile.",
      "allOf": [
        {
          "$ref": "#/definitions/Resource"
        },
        {
          "$ref": "#/definitions/ContainerGroupProfileProperties"
        }
      ],
      "properties": { }
    },

I think it should be fairly simple to fix this in the tool:

Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions