Skip to content
This repository was archived by the owner on Feb 2, 2022. It is now read-only.

Error copying examples to workdir #208

Open
LYDE1234 opened this issue May 25, 2021 · 4 comments
Open

Error copying examples to workdir #208

LYDE1234 opened this issue May 25, 2021 · 4 comments

Comments

@LYDE1234
Copy link

I've setup my RAFT config with:

    "toolName": "RESTler",
    "outputFolder": "restler-logs",
    "toolConfiguration": {
      "tasks": [
        {
          "task": "compile",
      "compileConfiguration": 
	{
		"discoverExamples": true,
    "usebodyexamples": true,
    "UseQueryExamples": true,
    "ExamplesDirectory": "."

and my API json has:

    "parameters": [
      {
        "name": "id",
        "in": "path",
        "description": "Id of the object",
        "required": true,
        "schema": {
          "type": "string",
          "format": "guid"
        },
          "examples": 
        {
            "example": {
              "$ref": "./examples.json"
            }
        }

So I would expect the Examples.json to get copied to the work dir, but I get

Unhandled exception. System.AggregateException: One or more errors occurred. (Could not resolve the JSON path '/work_dir_6ac5804a-4632-4ec4-aa45-a0dd090ecfde/examples.json' with the full JSON path '/work_dir_6ac5804a-4632-4ec4-aa45-a0dd090ecfde/examples.json'.)
---> System.InvalidOperationException: Could not resolve the JSON path '/work_dir_6ac5804a-4632-4ec4-aa45-a0dd090ecfde/examples.json' with the full JSON path '/work_dir_6ac5804a-4632-4ec4-aa45-a0dd090ecfde/examples.json'.
---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.IO.FileNotFoundException: Could not find file '/work_dir_6ac5804a-4632-4ec4-aa45-a0dd090ecfde/examples.json'.
File name: '/work_dir_6ac5804a-4632-4ec4-aa45-a0dd090ecfde/examples.json'

from the RESTler compiler and the examples.json is not in the workdir

@stishkin
Copy link
Contributor

stishkin commented Jun 3, 2021

@LYDE1234

Hi, can you provide RESTler config.json that was generated ?

@stishkin
Copy link
Contributor

@LYDE1234 - ping.

Could you attach the config.json file to the ticket ?

@LYDE1234
Copy link
Author

Sure. Please see attached file - renamed from json to txt to workaround issue editor limitation.

restler3.txt

@stishkin
Copy link
Contributor

@LYDE1234 - Sorry, I guess I was not clear. The config.json file we need is the one produced after RESTler compile step runs. In the RESTler compile output folder there will be number of files and one of them is named config.json

it contains data something like this:

{
  "SwaggerSpecFilePath": [
    "/work_dir_19cdb741-e617-4f39-9b9a-6590afc2b81c/swagger.json"
  ],
  "GrammarOutputDirectoryPath": "/work_dir_19cdb741-e617-4f39-9b9a-6590afc2b81c",
  "CustomDictionaryFilePath": "/work_dir_19cdb741-e617-4f39-9b9a-6590afc2b81c/customDictionary.json",
  "IncludeOptionalParameters": false,
  "UseQueryExamples": false,
  "UseBodyExamples": false,
  "DiscoverExamples": false,
  "ExamplesDirectory": "/work_dir_19cdb741-e617-4f39-9b9a-6590afc2b81c/Examples",
  "DataFuzzing": false,
  "ReadOnlyFuzz": false,
  "ResolveQueryDependencies": false,
  "ResolveBodyDependencies": false,
  "UseRefreshableToken": true,
  "AllowGetProducers": false
}

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

No branches or pull requests

2 participants