├── .github └── cov.png └── README.md /.github/cov.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reqover/docs/737b50a5de6712ee259fcf7ce90c28fe7f30b6f5/.github/cov.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Reqover 2 | 3 | Reqover is language agnostic tool that gives a picture about coverage of APIs based on Open API (Swagger). 4 | 5 | ### Usage example: 6 | 7 | For basic example you can use https://petstore.swagger.io 8 | 9 | 1. Start recoder 10 | ``` 11 | docker run -p 3000:3000 -v $PWD:/reqover reqover/reqover-cli record -t https://petstore.swagger.io 12 | ``` 13 | 14 | Setup API URL, Swagger specification url and save 15 | 16 | ``` 17 | curl --location --request GET 'http://localhost:3000/v2/pet/9222968140497128105' 18 | ``` 19 | 20 | 2. Run tests and observe folder reqover-results 21 | 3. Download swagger.json file https://petstore.swagger.io/v2/swagger.json 22 | 4. Run command to generate coverage report 23 | 24 | ``` 25 | npx reqover generate -f swagger.json -d reqover-results --html 26 | ``` 27 | Or using docker 28 | 29 | ``` 30 | docker run -v $PWD:/reqover \ 31 | -v $PWD/data:/tmp/data \ 32 | -v $PWD/swagger.json:/tmp/swagger.json \ 33 | reqover/reqover-cli generate -f /tmp/swagger.json -d /tmp/data -p /v2 --html 34 | ``` 35 | 36 | Folder .reqover should appear 37 | 38 | ``` 39 | npx reqover serve 40 | ``` 41 | 42 | 5. Open browser at http://localhost:3000 43 | 44 | #### Configuration: 45 | 46 | As advanced config, it's possible to use reqover.config.json file: 47 | 48 | - includeOptionalParams (default: false) - allows to inlude optonal params in coverage calculation score 49 | - ignore - allows to ignore specific status code globally or per endpoint 50 | 51 | ``` 52 | { 53 | "includeOptionalParams": true, 54 | "ignore": { 55 | "status": [405, 404], 56 | "/v2/pet": { 57 | "POST": { 58 | "status": [405] 59 | } 60 | } 61 | } 62 | } 63 | ``` 64 | 65 | Use it during report generation adding --config cli option: 66 | 67 | ``` 68 | npx reqover generate -f swagger.json -d reqover-results --html --config reqover.config.json 69 | ``` 70 | 71 | Examples: 72 | 73 | - [Reqover Java and Spring boot](https://github.com/reqover/reqover-spring-boot) 74 | - [Reqover Python and FastAPI](https://github.com/reqover/reqover-fast-api) 75 | 76 | Report example: 77 | 78 | ![Swagger Coverage Report](.github/cov.png) 79 | --------------------------------------------------------------------------------