Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: jsonfmt datamigration #6324

Merged
merged 1 commit into from
Jun 18, 2019

Conversation

nschonni
Copy link
Contributor

Ran jsonfmt -w "specification/datamigration/**/*.json"

Ran `jsonfmt -w "specification/datamigration/**/*.json"`
@nschonni nschonni requested a review from hitenjava as a code owner June 13, 2019 05:27
@openapi-sdkautomation
Copy link

openapi-sdkautomation bot commented Jun 13, 2019

SDK Automation [Logs] (Generated from e4898fe)

Pending Python: Azure/azure-sdk-for-python
  • Package generation pending.
Pending Go: Azure/azure-sdk-for-go
  • Package generation pending.
Pending JavaScript: Azure/azure-sdk-for-js
  • Package generation pending.
Pending Java: Azure/azure-sdk-for-java
  • Package generation pending.

@AutorestCI
Copy link

AutorestCI commented Jun 13, 2019

Automation for azure-sdk-for-ruby

Nothing to generate for azure-sdk-for-ruby

@AutorestCI
Copy link

AutorestCI commented Jun 13, 2019

Automation for azure-sdk-for-python

A PR has been created for you based on this PR content.

Once this PR will be merged, content will be added to your service PR:
Azure/azure-sdk-for-python#5417

@AutorestCI
Copy link

AutorestCI commented Jun 13, 2019

Automation for azure-sdk-for-java

A PR has been created for you based on this PR content.

Once this PR will be merged, content will be added to your service PR:
Azure/azure-sdk-for-java#3730

@azuresdkci
Copy link
Contributor

Can one of the admins verify this patch?

@AutorestCI
Copy link

AutorestCI commented Jun 13, 2019

Automation for azure-sdk-for-go

Nothing to generate for azure-sdk-for-go

@AutorestCI
Copy link

AutorestCI commented Jun 13, 2019

Automation for azure-sdk-for-js

Nothing to generate for azure-sdk-for-js

@amarzavery
Copy link
Contributor

Looks like the json after formatting is invalid. That should be fixed

Executing : /home/vsts/work/1/s/node_modules/.bin/autorest --input-file=specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2018-07-15-preview/datamigration.json --output-artifact=swagger-document.json --output-file=datamigration --output-folder=/tmp/resolved/specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2018-07-15-preview
Resolved map for the new specifications:
{ 'specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2018-07-15-preview/datamigration.json':
   '/tmp/resolved/specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2018-07-15-preview/datamigration.json' }
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Old Spec: "specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2018-07-15-preview/datamigration.json"
New Spec: "/tmp/resolved/specification/datamigration/resource-manager/Microsoft.DataMigration/preview/2018-07-15-preview/datamigration.json"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
{ Error: Command failed: dotnet /home/vsts/work/1/s/node_modules/@azure/oad/dlls/OpenApiDiff.dll -o /tmp/old.json -n /tmp/new.json

Unhandled Exception: Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'AutoRest.Swagger.Model.Operation' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path 'paths['/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}'].parameters', line 130, position 21.
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureArrayContract(JsonReader reader, Type objectType, JsonContract contract)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
   at Newtonsoft.Json.Linq.JToken.ToObject[T](JsonSerializer jsonSerializer)
   at AutoRest.Swagger.SwaggerParser.Parse(String swaggerDocument, String fileName) in D:\a\1\s\openapi-diff\src\modeler\AutoRest.Swagger\SwaggerParser.cs:line 17
   at AutoRest.Swagger.SwaggerModeler.Compare(String fileNameOld, String swaggerOld, String fileNameNew, String swaggerNew, Settings settings) in D:\a\1\s\openapi-diff\src\modeler\AutoRest.Swagger\SwaggerModeler.cs:line 29
   at OpenApiDiff.Program.Main(String[] args) in D:\a\1\s\openapi-diff\src\core\OpenApiDiff\Program.cs:line 35
Aborted (core dumped)

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:189:13)
    at maybeClose (internal/child_process.js:970:16)
    at Socket.stream.socket.on (internal/child_process.js:389:11)
    at Socket.emit (events.js:189:13)
    at Pipe._handle.close (net.js:597:12)
  killed: false,
  code: 134,
  signal: null,
  cmd:
   'dotnet /home/vsts/work/1/s/node_modules/@azure/oad/dlls/OpenApiDiff.dll -o /tmp/old.json -n /tmp/new.json',
  stdout: '',
  stderr:
   '\nUnhandled Exception: Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type \'AutoRest.Swagger.Model.Operation\' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.\nTo fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.\nPath \'paths[\'/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.DataMigration/services/{serviceName}\'].parameters\', line 130, position 21.\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureArrayContract(JsonReader reader, Type objectType, JsonContract contract)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, String id)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, String id)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)\n   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)\n   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)\n   at Newtonsoft.Json.Linq.JToken.ToObject[T](JsonSerializer jsonSerializer)\n   at AutoRest.Swagger.SwaggerParser.Parse(String swaggerDocument, String fileName) in D:\\a\\1\\s\\openapi-diff\\src\\modeler\\AutoRest.Swagger\\SwaggerParser.cs:line 17\n   at AutoRest.Swagger.SwaggerModeler.Compare(String fileNameOld, String swaggerOld, String fileNameNew, String swaggerNew, Settings settings) in D:\\a\\1\\s\\openapi-diff\\src\\modeler\\AutoRest.Swagger\\SwaggerModeler.cs:line 29\n   at OpenApiDiff.Program.Main(String[] args) in D:\\a\\1\\s\\openapi-diff\\src\\core\\OpenApiDiff\\Program.cs:line 35\nAborted (core dumped)\n' }

@nschonni
Copy link
Contributor Author

@amarzavery looks like the last PR was also breaking #5801 so it might be a toolchain issue. jsonfmt does fail if the JSON isn't well formed, so I don't think it's the actual files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants