Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.69k stars 5.12k forks source link

Invalid Specification on api versions #21141

Open Nepomuceno opened 2 years ago

Nepomuceno commented 2 years ago

Invalid Specification version

Although the spec files do have a place fot you to put version:

"info": {
    "title": "****",
    "description": "****",
    "version": "2018-10-01"
  }

we also do have a version as part of the folder structure of the file.

specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/vmssNetworkInterface.json

This is not only confusing but can cause errors on generation of clients from the files and some validation.

The fix would be to verify and them change or the folder or the specs.

This is the list of specifications that are wrong.

specification/frontdoor/resource-manager/Microsoft.Network/preview/2018-08-01-preview/webapplicationfirewall.json -> 2018-08-01/webapplicationfirewall.json
specification/mariadb/resource-manager/Microsoft.DBforMariaDB/preview/2018-06-01-privatepreview/mariadb.json -> 2018-06-01/mariadb.json
specification/mysql/resource-manager/Microsoft.DBforMySQL/preview/2018-06-01-privatepreview/mysql.json -> 2017-12-01/mysql.json
specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2019-02-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/storage/resource-manager/Microsoft.Storage/stable/2019-06-01/privatelinks.json -> 1.0/privatelinks.json
specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-08-01-preview/common-types.json -> 2021-10-01/common-types.json
specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-11-01/network.json -> 2018-02-01/network.json
specification/network/resource-manager/Microsoft.Network/stable/2018-11-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2020-05-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/engagementfabric/resource-manager/Microsoft.EngagementFabric/preview/2018-09-01/EngagementFabric.json -> 2018-09-01-preview/EngagementFabric.json
specification/frontdoor/resource-manager/Microsoft.Network/preview/2019-03-01-preview/webapplicationfirewall.json -> 2019-03-01/webapplicationfirewall.json
specification/network/resource-manager/Microsoft.Network/stable/2018-02-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2019-04-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2019-08-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2020-04-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2019-09-30/openShiftManagedClusters.json -> 2019-09-30-preview/openShiftManagedClusters.json
specification/network/resource-manager/Microsoft.Network/stable/2020-08-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2022-01-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2020-08-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2021-03-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2021-05-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2019-12-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2019-08-02/HybridCompute.json -> 2019-08-02-preview/HybridCompute.json
specification/network/resource-manager/Microsoft.Network/stable/2017-08-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2018-12-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2019-06-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2019-08-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2020-06-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/backups_legacy.json -> 2014-04-01/backups_legacy.json
specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-05-01/network.json -> 2018-02-01/network.json
specification/network/resource-manager/Microsoft.Network/stable/2017-11-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2018-04-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2018-08-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2019-02-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2021-03-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2022-01-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2017-03-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2020-04-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2017-10-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-04-01/network.json -> 2018-02-01/network.json
specification/network/resource-manager/Microsoft.Network/stable/2017-06-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2018-10-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2019-07-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2019-11-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2020-03-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2020-11-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/cost-management/resource-manager/Microsoft.CostManagement/preview/2022-10-01-preview/common-types.json -> 2021-10-01/common-types.json
specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2020-04-01-preview/machineLearningServices.json -> 2020-03-01/machineLearningServices.json
specification/network/resource-manager/Microsoft.Network/stable/2017-09-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2017-10-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2018-01-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2018-08-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2019-07-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2019-03-18/HybridCompute.json -> 2019-03-18-preview/HybridCompute.json
specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2018-02-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2018-04-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2018-06-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2019-04-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2019-09-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2022-05-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/replicationLinks_legacy.json -> 2014-04-01/replicationLinks_legacy.json
specification/frontdoor/resource-manager/Microsoft.Network/preview/2018-08-01-preview/network.json -> 2018-02-01/network.json
specification/network/resource-manager/Microsoft.Network/stable/2017-08-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2017-09-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2018-01-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2018-07-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2018-12-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2017-06-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2020-03-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2022-05-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2018-10-01/vmssPublicIpAddress.json -> 2017-03-30/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2020-11-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/reservations/resource-manager/Microsoft.Capacity/preview/2019-07-19/quota.json -> 2019-07-19-preview/quota.json
specification/frontdoor/resource-manager/Microsoft.Network/preview/2018-08-01-preview/frontdoor.json -> 2018-08-01/frontdoor.json
specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/usages_legacy.json -> 2014-04-01/usages_legacy.json
specification/network/resource-manager/Microsoft.Network/stable/2019-12-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/frontdoor/resource-manager/Microsoft.Network/preview/2019-03-01-preview/network.json -> 2018-02-01/network.json
specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/sql.core_legacy.json -> 2014-04-01/sql.core_legacy.json
specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2014-04-01/cosmos-db.json -> 2015-04-01/cosmos-db.json
specification/network/resource-manager/Microsoft.Network/stable/2017-11-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2018-07-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2019-06-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
specification/network/resource-manager/Microsoft.Network/stable/2020-05-01/vmssPublicIpAddress.json -> 2018-10-01/vmssPublicIpAddress.json
specification/network/resource-manager/Microsoft.Network/stable/2020-06-01/vmssNetworkInterface.json -> 2018-10-01/vmssNetworkInterface.json
specification/resourcehealth/resource-manager/Microsoft.ResourceHealth/preview/2018-08-01/ResourceHealth.json -> 2018-07-01-preview/ResourceHealth.json
specification/network/resource-manager/Microsoft.Network/stable/2017-03-01/vmssNetworkInterface.json -> 2017-03-30/vmssNetworkInterface.json
raych1 commented 2 years ago

Network specs is by design, it usually copy previous version specs to new version without changing api version.

@ruowan , can you evaluate if we can align the version between spec and path for other RP cases listed above?

ruowan commented 2 years ago

We already have validation rule for this case. https://github.com/Azure/avocado#inconsistent_api_version.

For existing issues in spec repo, it's risky to fix them. And it will cause breaking change.

Nepomuceno commented 2 years ago

There are some that are as late as 2022-08-01 how long has this validation been active?

raych1 commented 2 years ago

@Nepomuceno , what's the impact since this only happens for legacy api versions?