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
Copy file name to clipboardexpand all lines: README.md
+14-4
Original file line number
Diff line number
Diff line change
@@ -57,22 +57,32 @@ It will take around 10 minutes. If you are not using Ubuntu 20.04, please check
57
57
58
58
### Steps to Use NLP2REST
59
59
60
-
1.**REST API(s):** NLP2REST is designed to be applied to one or more target REST APIs. The APIs should be accessible at the URLs detailed in their OpenAPI specifications. We have provided several REST APIs in the [services](https://github.com/codingsoo/nlp2rest/tree/main/services) directory along with a manuscript for running these services. Alternatively, you can use any public APIs accessible online that have OpenAPI specifications. For a quick trial of our approach, we suggest using the [FDIC REST API](https://banks.data.fdic.gov/). This is an online API and its specification is available in our `specifications` directory.
60
+
#### 1. REST API(s)
61
61
62
-
2.**Deployment of the Rule Extractor:** This is a Python-based service accessible via a REST API. It's designed to extract formal OpenAPI rules from natural language descriptions. To run the Rule Extractor, please adhere to the instructions provided in the [rule_extractor](https://github.com/codingsoo/nlp2rest/tree/main/rule_extractor) directory. In brief, you will need to:
62
+
NLP2REST is designed to be applied to one or more target REST APIs. The APIs should be accessible at the URLs detailed in their OpenAPI specifications. We have provided several REST APIs in the [services](https://github.com/codingsoo/nlp2rest/tree/main/services) directory along with a manuscript for running these services. Alternatively, you can use any public APIs accessible online that have OpenAPI specifications. For a quick trial of our approach, we suggest using the [FDIC REST API](https://banks.data.fdic.gov/). This is an online API and its specification is available in our `specifications` directory.
63
+
64
+
#### 2. Deployment of the Rule Extractor
65
+
66
+
This is a Python-based service accessible via a REST API. It's designed to extract formal OpenAPI rules from natural language descriptions. To run the Rule Extractor, please adhere to the instructions provided in the [rule_extractor](https://github.com/codingsoo/nlp2rest/tree/main/rule_extractor) directory. In brief, you will need to:
63
67
- Obtain a model either by training one yourself or by downloading the pre-trained model from the Google Drive link supplied in the README.
64
68
- Build and run the Python application. We provide a `Dockerfile` for rapid deployment of the service. Alternatively, you can follow the instructions to install the service directly on your system.
65
69
- The service is designed to run on `localhost` on port `4000`, i.e., [http://localhost:4000/]().
66
70
67
-
3.**Run the Rule Validator:** This is a bespoke strategy built upon the RestTestGen framework, which is available in the [rule_validator](https://github.com/codingsoo/nlp2rest/tree/main/rule_validator) directory. The strategy parses the OpenAPI specification of the chosen API, uses the Rule Extractor to draw out rules from natural language descriptions, and interacts with the target API to validate the extracted rules.
71
+
#### 3. Run the Rule Validator
72
+
73
+
This is a bespoke strategy built upon the RestTestGen framework, which is available in the [rule_validator](https://github.com/codingsoo/nlp2rest/tree/main/rule_validator) directory. The strategy parses the OpenAPI specification of the chosen API, uses the Rule Extractor to draw out rules from natural language descriptions, and interacts with the target API to validate the extracted rules.
68
74
To employ our strategy within RestTestGen, you need to configure RestTestGen to run the strategy named `NlpStrategy`. For guidance, refer to the official RestTestGen README file available in the [rule_validator](https://github.com/codingsoo/nlp2rest/tree/main/rule_validator) directory or in the [official RestTestGen repository](https://github.com/SeUniVr/RestTestGen).
69
75
The results of RestTestGen will be stored in an `output` directory. This directory will hold the enhanced OpenAPI specification and reports of the HTTP interactions generated by the Rule Validator. Please note that RestTestGen expects the Rule Extractor to be running at [http://localhost:4000/](http://localhost:4000/). If the Rule Extractor is running on a different port or host, update the `baseUrl` field in the `RuleExtractorProxy` class of RestTestGen.
70
76
Currently, we found some bugs in the generated specifications. While fixing the bugs, please use `validator.py`. You can use it using this command:
It will generate `validation-result.json` which is a report of after validation.
75
83
76
84
You have successfully generated an enhanced OpenAPI specification and/or extracted rule report. Using these rules significantly boost the performance of REST API testing tools. To utilize these tools, please check the instructions in the [tools](https://github.com/codingsoo/nlp2rest/tree/main/tools) directory.
77
85
78
-
4.**Validate the Result:** For each service, we have documented the identified keywords and corresponding values we discovered in this [Google sheets](https://docs.google.com/spreadsheets/d/1SRdRQUJmavPkXmKndwY685aqjtfKmjvCbpKiCKe7Tis/edit#gid=1721158037). To validate our findings, you can cross-check if the enhanced specification includes the corresponding keyword and value entries present in the Google sheet.
86
+
#### 4. Validate the Result
87
+
88
+
For each service, we have documented the identified keywords and corresponding values we discovered in this [Google sheets](https://docs.google.com/spreadsheets/d/1SRdRQUJmavPkXmKndwY685aqjtfKmjvCbpKiCKe7Tis/edit#gid=1721158037). To validate our findings, you can cross-check if the enhanced specification includes the corresponding keyword and value entries present in the Google sheet.
0 commit comments