multi-oneOf fix (#16)
* always emit type * regen * okay no * bump stuff * okay maybe * more regen
This commit is contained in:
Родитель
2de2d01b23
Коммит
910d3a133b
|
@ -55,7 +55,7 @@ task 'regenerate', '', (done) ->
|
|||
'EventHub': { folder: 'eventhub', tags: [ 'package-2017-04', 'package-2015-08' ] },
|
||||
# 'IotHub': { folder: 'iothub', tags: [ 'package-2017-07', 'package-2017-01', 'package-2016-02' ] },
|
||||
# 'KeyVault': { folder: 'keyvault', tags: [ 'package-2016-10', 'package-2015-06' ] },
|
||||
'Logic': { folder: 'logic', tags: [ 'package-2016-06', 'package-2015-08-preview', 'package-2015-02-preview' ] },
|
||||
'Logic': { folder: 'logic', tags: [ 'package-2016-06', 'package-2015-08-preview', 'package-2015-02-preview' ] }, # missing 'type: object'
|
||||
# 'Monitor': { folder: 'monitor', tags: [ 'package-2017-09' ] },
|
||||
'Network': { folder: 'network', tags: [ 'package-2017-10', 'package-2017-09', 'package-2017-08', 'package-2017-06', 'package-2017-03', 'package-2016-12', 'package-2016-09', 'package-2016-06', 'package-2016-03' ] },
|
||||
# 'NotificationHubs': { folder: 'notificationhubs', tags: [ 'package-2017-04', 'package-2016-03', 'package-2014-09' ] },
|
||||
|
@ -69,10 +69,10 @@ task 'regenerate', '', (done) ->
|
|||
# 'Scheduler': { folder: 'scheduler', tags: [ 'package-2016-03', 'package-2016-01', 'package-2014-08-preview' ] },
|
||||
# 'Search': { folder: 'search', tags: [ 'package-2015-08', 'package-2015-02' ] },
|
||||
'ServiceBus': { folder: 'servicebus', tags: [ 'package-2017-04', 'package-2015-08' ] },
|
||||
'ServiceFabric': { folder: 'servicefabric', tags: [ 'package-2017-07', 'package-2016-09' ] },
|
||||
'ServiceFabric': { folder: 'servicefabric', tags: [ 'package-2017-07', 'package-2016-09' ] }, # missing 'type: object'
|
||||
'Storage': { folder: 'storage', tags: [ 'package-2017-10', 'package-2017-06', 'package-2016-12', 'package-2016-05', 'package-2016-01', 'package-2015-06', 'package-2015-05-preview' ] },
|
||||
# 'TrafficManager': { folder: 'trafficmanager', tags: [ 'package-2017-09-preview', 'package-2017-05', 'package-2017-03', 'package-2015-11' ] },
|
||||
'Web': { folder: 'web', tags: [ 'package-2016-09' ] },
|
||||
'Web': { folder: 'web', tags: [ 'package-2016-09' ] }, # missing 'type: object'
|
||||
# 'poly': { file: __dirname + "/../test/Resource/poly-service.json", tags: [ '' ] }
|
||||
},
|
||||
'language': 'azureresourceschema'
|
||||
|
|
|
@ -17,7 +17,7 @@ contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additio
|
|||
|
||||
``` yaml
|
||||
use-extension:
|
||||
"@microsoft.azure/autorest.modeler": "2.3.38" # keep in sync with package.json's dev dependency in order to have meaningful tests
|
||||
"@microsoft.azure/autorest.modeler": "2.3.45" # keep in sync with package.json's dev dependency in order to have meaningful tests
|
||||
|
||||
pipeline:
|
||||
azureresourceschema/imodeler1:
|
||||
|
|
|
@ -52,4 +52,4 @@
|
|||
"dependencies": {
|
||||
"dotnet-2.0.0": "^1.4.4"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -292,6 +292,11 @@ namespace AutoRest.AzureResourceSchema
|
|||
{
|
||||
return ParseSequenceType(property, sequenceType, definitions, modelTypes);
|
||||
}
|
||||
// A schema that matches anything
|
||||
if (type is MultiType)
|
||||
{
|
||||
return new JsonSchema();
|
||||
}
|
||||
Debug.Fail("Unrecognized property type: " + type.GetType());
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -113,7 +113,7 @@ namespace AutoRest.AzureResourceSchema
|
|||
writer.WritePropertyName(definitionName);
|
||||
writer.WriteStartObject();
|
||||
|
||||
writer.WritePropertyName("oneOf");
|
||||
writer.WritePropertyName(definition.JsonType == "object" && definition.IsEmpty() ? "anyOf" : "oneOf"); // hack, until MultiType thing is enforced across the specs repo!
|
||||
writer.WriteStartArray();
|
||||
|
||||
if (definition.Description != null)
|
||||
|
@ -178,7 +178,7 @@ namespace AutoRest.AzureResourceSchema
|
|||
|
||||
if (definition.JsonType != "object" || !definition.IsEmpty())
|
||||
{
|
||||
WriteProperty(writer, "type", definition.JsonType);
|
||||
WriteProperty(writer, "type", definition.JsonType); // move out once MultiType is here
|
||||
WriteProperty(writer, "minimum", definition.Minimum);
|
||||
WriteProperty(writer, "maximum", definition.Maximum);
|
||||
WriteProperty(writer, "pattern", definition.Pattern);
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
|
||||
<PackageReference Include="YamlDotNet.Signed" Version="4.2.1" />
|
||||
<PackageReference Include="autorest.common" Version="2.4.36" />
|
||||
<PackageReference Include="Microsoft.AutoRest.Common" Version="2.4.44" />
|
||||
<!-- <ProjectReference Include="../../autorest.common/src/autorest.common.csproj" /> -->
|
||||
</ItemGroup>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче