Azure / Azure/oav

Handle duplicate models from different files

Open
#280 3 comments 0 reactions 0 assignees View on GitHub
P3
Dominant language
TypeScript
Stars
104
Forks
62
Avg merge
2d 12h
Merged PRs (30d)
5

Description

This raise an OAV problem:
https://github.com/Azure/azure-rest-api-specs/pull/3495

Swagger
```
"Zone": {
"properties": {
"etag": {
"type": "string",
"description": "The etag of the zone."
},
"properties": {
"x-ms-client-flatten": true,
"$ref": "#/definitions/ZoneProperties",
"description": "The properties of the zone."
}
},
"allOf": [
{
"$ref": "#/definitions/Resource"
}
],
"description": "Describes a DNS zone."
},
"Resource": {
"description": "The Resource model definition.",
"properties": {
"id": {
"readOnly": true,
"type": "string",
"description": "Resource Id"
},
"name": {
"readOnly": true,
"type": "string",
"description": "Resource name"
},
"type": {
"readOnly": true,
"type": "string",
"description": "Resource type"
},
"location": {
"type": "string",
"description": "Resource location"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Resource tags"
}
},
"required": [
"location"
],
"x-ms-azure-resource": true
},
```

JSON to match:
```json
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/dnsZones/zone1",
"etag": "00000000-0000-0000-0000-000000000000",
"location": "global",
"name": "zone1",
"type": "Microsoft.Network/dnsZones",
"properties": {
"maxNumberOfRecordSets": 5000,
"numberOfRecordSets": 1,
"nameServers": [],
"zoneType": "Private",
"registrationVirtualNetworks": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet1"
}
],
"resolutionVirtualNetworks": [
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnet2"
}
]
},
"tags": {
"key1": "value1"
}
}
```

Creates:
```
error:
operationId: Zones_CreateOrUpdate
scenario: Create zone
source: request
responseCode: ALL
severity: 0
errorCode: OBJECT_ADDITIONAL_PROPERTIES
errorDetails:
code: OBJECT_ADDITIONAL_PROPERTIES
params:
- - tags
- location
message: 'Additional properties not allowed: tags,location'
path: ''
description: Describes a DNS zone.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.