You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve logging in RESTler compile step in case of a spec issue instead of just failing without and not giving clear indication of which property is problematic
#878
When the RESTler compile step is attempted with a spec that has an issue where array element doesn't have a declared type in RESTler. It would be beneficial if the logging is improved to show which specific filed(s) are problematic.
The error is: Unhandled exception. System.ArgumentException: Invalid array schema: found array property without a declared element at Restler.Compiler.SwaggerVisitors.generateGrammarElementForSchema(JsonSchema schema, FSharpOption1 exampleValue, Boolean generateFuzzablePayloadsForExamples, Boolean trackParameters, FSharpOption1 jsonPropertyMaxDepth, Boolean isRequired, Boolean isReadOnly, FSharpList1 parents, SchemaCache schemaCache, FSharpFunc2 cont) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 690 at Restler.Compiler.SwaggerVisitors.processProperty(String propertyName, JsonSchemaProperty property, FSharpOption1 propertyPayloadExampleValue, Boolean generateFuzzablePayload, Boolean trackParameters, FSharpOption1 jsonPropertyMaxDepth, FSharpList1 parents, SchemaCache schemaCache, FSharpFunc2 cont) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 479 at Restler.Compiler.SwaggerVisitors.declaredPropertyParameters@657.Invoke(KeyValuePair2 item) in D:\a_work_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 663
at Microsoft.FSharp.Collections.Internal.IEnumerator.choose@171.System-Collections-IEnumerator-MoveNext() in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 179
at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@266[T,TResult](ConcatEnumerator2 x, Unit unitVar0) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 268 at Microsoft.FSharp.Collections.SeqModule.oneStepTo@987[T](IEnumerable1 source, List1 prefix, FSharpRef1 enumeratorR, Int32 i) in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 996
at Microsoft.FSharp.Collections.SeqModule.action@4164-1[T](IEnumerable1 source, List1 prefix, FSharpRef1 enumeratorR, Int32 i, Unit unitVar0) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 1011 at [email protected](Int32 i) at Microsoft.FSharp.Collections.Internal.IEnumerator.unfold@205.DoMoveNext(b& curr) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 207 at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator1.System-Collections-IEnumerator-MoveNext() in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 64
at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable1 source) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 546 at Restler.Compiler.SwaggerVisitors.generateGrammarElementForSchema(JsonSchema schema, FSharpOption1 exampleValue, Boolean generateFuzzablePayloadsForExamples, Boolean trackParameters, FSharpOption1 jsonPropertyMaxDepth, Boolean isRequired, Boolean isReadOnly, FSharpList1 parents, SchemaCache schemaCache, FSharpFunc2 cont) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 885 at Restler.Compiler.SwaggerVisitors.generateGrammarElementForSchema(JsonSchema schema, FSharpOption1 exampleValue, Boolean generateFuzzablePayloadsForExamples, Boolean trackParameters, FSharpOption1 jsonPropertyMaxDepth, Boolean isRequired, Boolean isReadOnly, FSharpList1 parents, SchemaCache schemaCache, FSharpFunc2 cont) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 701 at Restler.Compiler.SwaggerVisitors.processProperty(String propertyName, JsonSchemaProperty property, FSharpOption1 propertyPayloadExampleValue, Boolean generateFuzzablePayload, Boolean trackParameters, FSharpOption1 jsonPropertyMaxDepth, FSharpList1 parents, SchemaCache schemaCache, FSharpFunc2 cont) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 479 at Restler.Compiler.SwaggerVisitors.declaredPropertyParameters@657.Invoke(KeyValuePair2 item) in D:\a_work_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 663
at Microsoft.FSharp.Collections.Internal.IEnumerator.choose@171.System-Collections-IEnumerator-MoveNext() in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 179
at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@266[T,TResult](ConcatEnumerator2 x, Unit unitVar0) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 268 at Microsoft.FSharp.Collections.SeqModule.oneStepTo@987[T](IEnumerable1 source, List1 prefix, FSharpRef1 enumeratorR, Int32 i) in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 996
at Microsoft.FSharp.Collections.SeqModule.action@4164-1[T](IEnumerable1 source, List1 prefix, FSharpRef1 enumeratorR, Int32 i, Unit unitVar0) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 1011 at [email protected](Int32 i) at Microsoft.FSharp.Collections.Internal.IEnumerator.unfold@205.DoMoveNext(b& curr) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 207 at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator1.System-Collections-IEnumerator-MoveNext() in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 64
at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable1 source) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 546 at Restler.Compiler.SwaggerVisitors.generateGrammarElementForSchema(JsonSchema schema, FSharpOption1 exampleValue, Boolean generateFuzzablePayloadsForExamples, Boolean trackParameters, FSharpOption1 jsonPropertyMaxDepth, Boolean isRequired, Boolean isReadOnly, FSharpList1 parents, SchemaCache schemaCache, FSharpFunc2 cont) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 885 at [email protected](IEnumerable1& next) in D:\a_work_temp\restler-fuzzer\src\compiler\Restler.Compiler\Compiler.fs:line 0
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase1.MoveNextImpl() in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 371 at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase1.System-Collections-IEnumerator-MoveNext() in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 403
at Microsoft.FSharp.Collections.SeqModule.TryHead[T](IEnumerable1 source) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 1370 at Restler.Compiler.Main.requestDataSeq$cont@1176(Config config, OpenApiDocument swaggerDoc, SchemaCache schemaCache, String ep, KeyValuePair2 m, RequestId requestId, FSharpOption1 exampleConfig, Unit unitVar) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\Compiler.fs:line 1268 at [email protected](IEnumerable1& next) in D:\a_work_temp\restler-fuzzer\src\compiler\Restler.Compiler\Compiler.fs:line 1176
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase1.MoveNextImpl() in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 371 at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase1.System-Collections-IEnumerator-MoveNext() in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 403
at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@266[T,TResult](ConcatEnumerator2 x, Unit unitVar0) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 268 at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at Microsoft.FSharp.Collections.SeqModule.ToArray[T](IEnumerable1 source) in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 825
at Restler.Compiler.Main.generateRequestGrammar(FSharpList1 swaggerDocs, MutationsDictionary dictionary, Config config, FSharpList1 globalExternalAnnotations, FSharpList1 userSpecifiedExamples) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\Compiler.fs:line 1338 at Restler.Workflow.generateGrammarFromSwagger(String grammarOutputDirectoryPath, Config config) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\Workflow.fs:line 143 at Restler.Workflow.generateRestlerGrammar(Config config) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\Workflow.fs:line 250 at Program.main(String[] argv) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.CompilerExe\Program.fs:line 43
Steps to reproduce
Expected results
No response
Actual results
No response
Environment details
No response
The text was updated successfully, but these errors were encountered:
Description
When the RESTler compile step is attempted with a spec that has an issue where array element doesn't have a declared type in RESTler. It would be beneficial if the logging is improved to show which specific filed(s) are problematic.
The error is:
Unhandled exception. System.ArgumentException: Invalid array schema: found array property without a declared element at Restler.Compiler.SwaggerVisitors.generateGrammarElementForSchema(JsonSchema schema, FSharpOption
1 exampleValue, Boolean generateFuzzablePayloadsForExamples, Boolean trackParameters, FSharpOption1 jsonPropertyMaxDepth, Boolean isRequired, Boolean isReadOnly, FSharpList
1 parents, SchemaCache schemaCache, FSharpFunc2 cont) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 690 at Restler.Compiler.SwaggerVisitors.processProperty(String propertyName, JsonSchemaProperty property, FSharpOption
1 propertyPayloadExampleValue, Boolean generateFuzzablePayload, Boolean trackParameters, FSharpOption1 jsonPropertyMaxDepth, FSharpList
1 parents, SchemaCache schemaCache, FSharpFunc2 cont) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 479 at Restler.Compiler.SwaggerVisitors.declaredPropertyParameters@657.Invoke(KeyValuePair
2 item) in D:\a_work_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 663at Microsoft.FSharp.Collections.Internal.IEnumerator.choose@171.System-Collections-IEnumerator-MoveNext() in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 179
at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@266[T,TResult](ConcatEnumerator
2 x, Unit unitVar0) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 268 at Microsoft.FSharp.Collections.SeqModule.oneStepTo@987[T](IEnumerable
1 source, List1 prefix, FSharpRef
1 enumeratorR, Int32 i) in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 996at Microsoft.FSharp.Collections.SeqModule.action@4164-1[T](IEnumerable
1 source, List
1 prefix, FSharpRef1 enumeratorR, Int32 i, Unit unitVar0) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 1011 at [email protected](Int32 i) at Microsoft.FSharp.Collections.Internal.IEnumerator.unfold@205.DoMoveNext(b& curr) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 207 at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator
1.System-Collections-IEnumerator-MoveNext() in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 64at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable
1 source) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 546 at Restler.Compiler.SwaggerVisitors.generateGrammarElementForSchema(JsonSchema schema, FSharpOption
1 exampleValue, Boolean generateFuzzablePayloadsForExamples, Boolean trackParameters, FSharpOption1 jsonPropertyMaxDepth, Boolean isRequired, Boolean isReadOnly, FSharpList
1 parents, SchemaCache schemaCache, FSharpFunc2 cont) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 885 at Restler.Compiler.SwaggerVisitors.generateGrammarElementForSchema(JsonSchema schema, FSharpOption
1 exampleValue, Boolean generateFuzzablePayloadsForExamples, Boolean trackParameters, FSharpOption1 jsonPropertyMaxDepth, Boolean isRequired, Boolean isReadOnly, FSharpList
1 parents, SchemaCache schemaCache, FSharpFunc2 cont) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 701 at Restler.Compiler.SwaggerVisitors.processProperty(String propertyName, JsonSchemaProperty property, FSharpOption
1 propertyPayloadExampleValue, Boolean generateFuzzablePayload, Boolean trackParameters, FSharpOption1 jsonPropertyMaxDepth, FSharpList
1 parents, SchemaCache schemaCache, FSharpFunc2 cont) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 479 at Restler.Compiler.SwaggerVisitors.declaredPropertyParameters@657.Invoke(KeyValuePair
2 item) in D:\a_work_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 663at Microsoft.FSharp.Collections.Internal.IEnumerator.choose@171.System-Collections-IEnumerator-MoveNext() in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 179
at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@266[T,TResult](ConcatEnumerator
2 x, Unit unitVar0) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 268 at Microsoft.FSharp.Collections.SeqModule.oneStepTo@987[T](IEnumerable
1 source, List1 prefix, FSharpRef
1 enumeratorR, Int32 i) in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 996at Microsoft.FSharp.Collections.SeqModule.action@4164-1[T](IEnumerable
1 source, List
1 prefix, FSharpRef1 enumeratorR, Int32 i, Unit unitVar0) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 1011 at [email protected](Int32 i) at Microsoft.FSharp.Collections.Internal.IEnumerator.unfold@205.DoMoveNext(b& curr) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 207 at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator
1.System-Collections-IEnumerator-MoveNext() in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 64at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable
1 source) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 546 at Restler.Compiler.SwaggerVisitors.generateGrammarElementForSchema(JsonSchema schema, FSharpOption
1 exampleValue, Boolean generateFuzzablePayloadsForExamples, Boolean trackParameters, FSharpOption1 jsonPropertyMaxDepth, Boolean isRequired, Boolean isReadOnly, FSharpList
1 parents, SchemaCache schemaCache, FSharpFunc2 cont) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\SwaggerVisitors.fs:line 885 at [email protected](IEnumerable
1& next) in D:\a_work_temp\restler-fuzzer\src\compiler\Restler.Compiler\Compiler.fs:line 0at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase
1.MoveNextImpl() in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 371 at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase
1.System-Collections-IEnumerator-MoveNext() in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 403at Microsoft.FSharp.Collections.SeqModule.TryHead[T](IEnumerable
1 source) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 1370 at Restler.Compiler.Main.requestDataSeq$cont@1176(Config config, OpenApiDocument swaggerDoc, SchemaCache schemaCache, String ep, KeyValuePair
2 m, RequestId requestId, FSharpOption1 exampleConfig, Unit unitVar) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\Compiler.fs:line 1268 at [email protected](IEnumerable
1& next) in D:\a_work_temp\restler-fuzzer\src\compiler\Restler.Compiler\Compiler.fs:line 1176at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase
1.MoveNextImpl() in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 371 at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase
1.System-Collections-IEnumerator-MoveNext() in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 403at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@266[T,TResult](ConcatEnumerator
2 x, Unit unitVar0) in F:\workspace\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 268 at System.Collections.Generic.List
1..ctor(IEnumerable1 collection) at Microsoft.FSharp.Collections.SeqModule.ToArray[T](IEnumerable
1 source) in F:\workspace_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 825at Restler.Compiler.Main.generateRequestGrammar(FSharpList
1 swaggerDocs, MutationsDictionary dictionary, Config config, FSharpList
1 globalExternalAnnotations, FSharpList1 userSpecifiedExamples) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\Compiler.fs:line 1338 at Restler.Workflow.generateGrammarFromSwagger(String grammarOutputDirectoryPath, Config config) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\Workflow.fs:line 143 at Restler.Workflow.generateRestlerGrammar(Config config) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.Compiler\Workflow.fs:line 250 at Program.main(String[] argv) in D:\a\_work\_temp\restler-fuzzer\src\compiler\Restler.CompilerExe\Program.fs:line 43
Steps to reproduce
Expected results
No response
Actual results
No response
Environment details
No response
The text was updated successfully, but these errors were encountered: