Skip to content

Commit ae3783b

Browse files
committedSep 7, 2023
Update the formatting
1 parent 992ae47 commit ae3783b

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed
 

‎README.md

+14-4
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,32 @@ It will take around 10 minutes. If you are not using Ubuntu 20.04, please check
5757

5858
### Steps to Use NLP2REST
5959

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)
6161

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:
6367
- Obtain a model either by training one yourself or by downloading the pre-trained model from the Google Drive link supplied in the README.
6468
- 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.
6569
- The service is designed to run on `localhost` on port `4000`, i.e., [http://localhost:4000/]().
6670

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.
6874
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).
6975
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.
7076
Currently, we found some bugs in the generated specifications. While fixing the bugs, please use `validator.py`. You can use it using this command:
77+
7178
```
7279
python3 validator.py {Json OpenAPI Specification location}
7380
```
81+
7482
It will generate `validation-result.json` which is a report of after validation.
7583

7684
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.
7785

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

Comments
 (0)
Please sign in to comment.