├── .github └── workflows │ └── python-publish.yml ├── .gitignore ├── .pylintrc ├── LICENSE ├── MANIFEST.in ├── README.md ├── images └── swagger-coverage-report.png ├── python-publish.yml ├── requirements.txt ├── setup.py └── swagger_coverage_py ├── __init__.py ├── configs.py ├── docs_writers ├── __init__.py └── api_doc_writer.py ├── listener.py ├── reporter.py ├── request_schema_handler.py ├── results_writers ├── __init__.py ├── base_schemas_manager.py ├── openapi_schemas_manager.py └── swagger_schemas_manager.py ├── swagger-coverage-commandline ├── bin │ ├── swagger-coverage-commandline │ └── swagger-coverage-commandline.bat └── lib │ ├── btf-1.3.jar │ ├── checker-compat-qual-2.5.5.jar │ ├── checker-qual-3.12.0.jar │ ├── commons-codec-1.11.jar │ ├── commons-codec-1.9.jar │ ├── commons-io-2.11.0.jar │ ├── commons-io-2.6.jar │ ├── commons-lang3-3.12.0.jar │ ├── commons-lang3-3.7.jar │ ├── commons-logging-1.2.jar │ ├── error_prone_annotations-2.3.4.jar │ ├── error_prone_annotations-2.7.1.jar │ ├── failureaccess-1.0.1.jar │ ├── freemarker-2.3.31.jar │ ├── guava-28.2-android.jar │ ├── guava-31.0.1-android.jar │ ├── httpclient-4.5.13.jar │ ├── httpclient-4.5.2.jar │ ├── httpcore-4.4.13.jar │ ├── httpcore-4.4.4.jar │ ├── j2objc-annotations-1.3.jar │ ├── jackson-annotations-2.12.3.jar │ ├── jackson-core-2.12.3.jar │ ├── jackson-coreutils-2.0.jar │ ├── jackson-coreutils-equivalence-1.0.jar │ ├── jackson-databind-2.12.3.jar │ ├── jackson-dataformat-yaml-2.12.3.jar │ ├── jackson-datatype-jsr310-2.9.8.jar │ ├── jakarta.activation-api-1.2.1.jar │ ├── jakarta.validation-api-2.0.2.jar │ ├── jakarta.xml.bind-api-2.3.2.jar │ ├── jcommander-1.81.jar │ ├── joda-time-2.10.5.jar │ ├── jopt-simple-5.0.4.jar │ ├── json-patch-1.13.jar │ ├── json-schema-core-1.2.14.jar │ ├── json-schema-validator-2.2.14.jar │ ├── jsr305-3.0.2.jar │ ├── libphonenumber-8.11.1.jar │ ├── listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar │ ├── logback-classic-1.2.10.jar │ ├── logback-core-1.2.10.jar │ ├── mailapi-1.6.2.jar │ ├── msg-simple-1.2.jar │ ├── rhino-1.7.7.2.jar │ ├── slf4j-api-1.7.32.jar │ ├── slf4j-ext-1.7.28.jar │ ├── snakeyaml-1.27.jar │ ├── spring-beans-5.3.7.jar │ ├── spring-core-5.3.7.jar │ ├── spring-jcl-5.3.7.jar │ ├── spring-web-5.3.7.jar │ ├── swagger-annotations-1.6.2.jar │ ├── swagger-annotations-1.6.6.jar │ ├── swagger-annotations-2.1.10.jar │ ├── swagger-annotations-2.2.0.jar │ ├── swagger-compat-spec-parser-1.0.54.jar │ ├── swagger-compat-spec-parser-1.0.59.jar │ ├── swagger-core-1.6.2.jar │ ├── swagger-core-1.6.6.jar │ ├── swagger-core-2.1.10.jar │ ├── swagger-core-2.2.0.jar │ ├── swagger-coverage-commandline-1.0-SNAPSHOT.jar │ ├── swagger-coverage-commons-1.0-SNAPSHOT.jar │ ├── swagger-models-1.6.2.jar │ ├── swagger-models-1.6.6.jar │ ├── swagger-models-2.1.10.jar │ ├── swagger-models-2.2.0.jar │ ├── swagger-parser-1.0.54.jar │ ├── swagger-parser-1.0.59.jar │ ├── swagger-parser-2.0.25.jar │ ├── swagger-parser-2.0.32.jar │ ├── swagger-parser-core-2.0.25.jar │ ├── swagger-parser-core-2.0.32.jar │ ├── swagger-parser-v2-converter-2.0.25.jar │ ├── swagger-parser-v2-converter-2.0.32.jar │ ├── swagger-parser-v3-2.0.25.jar │ ├── swagger-parser-v3-2.0.32.jar │ ├── uri-template-0.10.jar │ └── validation-api-1.1.0.Final.jar └── uri.py /.github/workflows/python-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will upload a Python Package using Twine when a release is created 2 | # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries 3 | 4 | # This workflow uses actions that are not certified by GitHub. 5 | # They are provided by a third-party and are governed by 6 | # separate terms of service, privacy policy, and support 7 | # documentation. 8 | 9 | name: Upload Python Package 10 | 11 | on: 12 | release: 13 | types: [published] 14 | 15 | jobs: 16 | deploy: 17 | 18 | runs-on: ubuntu-latest 19 | 20 | steps: 21 | - uses: actions/checkout@v2 22 | - name: Set up Python 23 | uses: actions/setup-python@v2 24 | with: 25 | python-version: '3.x' 26 | - name: Install dependencies 27 | run: | 28 | python -m pip install --upgrade pip 29 | pip install build 30 | - name: Build package 31 | run: python -m build 32 | - name: Publish package 33 | uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 34 | with: 35 | user: __token__ 36 | password: ${{ secrets.PYPI_API_TOKEN }} 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib64/ 18 | parts/ 19 | sdist/ 20 | var/ 21 | wheels/ 22 | pip-wheel-metadata/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | 53 | # Translations 54 | *.mo 55 | *.pot 56 | 57 | # Django stuff: 58 | *.log 59 | local_settings.py 60 | db.sqlite3 61 | db.sqlite3-journal 62 | 63 | # Flask stuff: 64 | instance/ 65 | .webassets-cache 66 | 67 | # Scrapy stuff: 68 | .scrapy 69 | 70 | # Sphinx documentation 71 | docs/_build/ 72 | 73 | # PyBuilder 74 | target/ 75 | 76 | # Jupyter Notebook 77 | .ipynb_checkpoints 78 | 79 | # IPython 80 | profile_default/ 81 | ipython_config.py 82 | 83 | # pyenv 84 | .python-version 85 | 86 | # pipenv 87 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 88 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 89 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 90 | # install all needed dependencies. 91 | #Pipfile.lock 92 | 93 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 94 | __pypackages__/ 95 | 96 | # Celery stuff 97 | celerybeat-schedule 98 | celerybeat.pid 99 | 100 | # SageMath parsed files 101 | *.sage.py 102 | 103 | # Environments 104 | .env 105 | .venv 106 | env/ 107 | venv/ 108 | ENV/ 109 | env.bak/ 110 | venv.bak/ 111 | 112 | # Spyder project settings 113 | .spyderproject 114 | .spyproject 115 | 116 | # Rope project settings 117 | .ropeproject 118 | 119 | # mkdocs documentation 120 | /site 121 | 122 | # mypy 123 | .mypy_cache/ 124 | .dmypy.json 125 | dmypy.json 126 | 127 | # Pyre type checker 128 | .pyre/ 129 | 130 | 131 | .idea -------------------------------------------------------------------------------- /.pylintrc: -------------------------------------------------------------------------------- 1 | [MASTER] 2 | 3 | # A comma-separated list of package or module names from where C extensions may 4 | # be loaded. Extensions are loading into the active Python interpreter and may 5 | # run arbitrary code. 6 | extension-pkg-allow-list= 7 | 8 | # A comma-separated list of package or module names from where C extensions may 9 | # be loaded. Extensions are loading into the active Python interpreter and may 10 | # run arbitrary code. (This is an alternative name to extension-pkg-allow-list 11 | # for backward compatibility.) 12 | extension-pkg-whitelist= 13 | 14 | # Return non-zero exit code if any of these messages/categories are detected, 15 | # even if score is above --fail-under value. Syntax same as enable. Messages 16 | # specified are enabled, while categories only check already-enabled messages. 17 | fail-on= 18 | 19 | # Specify a score threshold to be exceeded before program exits with error. 20 | fail-under=10.0 21 | 22 | # Files or directories to be skipped. They should be base names, not paths. 23 | ignore=CVS,pytest.ini,README.md,requirements.txt,send_allure_results.py,venv,.venv,venv38,Dockerfile 24 | 25 | # Add files or directories matching the regex patterns to the ignore-list. The 26 | # regex matches against paths. 27 | ignore-paths= 28 | 29 | # Files or directories matching the regex patterns are skipped. The regex 30 | # matches against base names, not paths. 31 | ignore-patterns=.*\.html,.*\.json 32 | 33 | # Python code to execute, usually for sys.path manipulation such as 34 | # pygtk.require(). 35 | #init-hook= 36 | 37 | # Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the 38 | # number of processors available to use. 39 | jobs=1 40 | 41 | # Control the amount of potential inferred values when inferring a single 42 | # object. This can help the performance when dealing with large functions or 43 | # complex, nested conditions. 44 | limit-inference-results=100 45 | 46 | # List of plugins (as comma separated values of python module names) to load, 47 | # usually to register additional checkers. 48 | load-plugins= 49 | 50 | # Pickle collected data for later comparisons. 51 | persistent=yes 52 | 53 | # When enabled, pylint would attempt to guess common misconfiguration and emit 54 | # user-friendly hints instead of false-positive error messages. 55 | suggestion-mode=yes 56 | 57 | # Allow loading of arbitrary C extensions. Extensions are imported into the 58 | # active Python interpreter and may run arbitrary code. 59 | unsafe-load-any-extension=no 60 | 61 | 62 | [MESSAGES CONTROL] 63 | 64 | # Only show warnings with the listed confidence levels. Leave empty to show 65 | # all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED. 66 | confidence= 67 | 68 | # Disable the message, report, category or checker with the given id(s). You 69 | # can either give multiple identifiers separated by comma (,) or put this 70 | # option multiple times (only on the command line, not in the configuration 71 | # file where it should appear only once). You can also use "--disable=all" to 72 | # disable everything first and then reenable specific checks. For example, if 73 | # you want to run only the similarities checker, you can use "--disable=all 74 | # --enable=similarities". If you want to run only the classes checker, but have 75 | # no Warning level messages displayed, use "--disable=all --enable=classes 76 | # --disable=W". 77 | disable=print-statement, 78 | parameter-unpacking, 79 | unpacking-in-except, 80 | old-raise-syntax, 81 | backtick, 82 | long-suffix, 83 | old-ne-operator, 84 | old-octal-literal, 85 | import-star-module-level, 86 | non-ascii-bytes-literal, 87 | raw-checker-failed, 88 | bad-inline-option, 89 | locally-disabled, 90 | file-ignored, 91 | suppressed-message, 92 | useless-suppression, 93 | deprecated-pragma, 94 | use-symbolic-message-instead, 95 | apply-builtin, 96 | basestring-builtin, 97 | buffer-builtin, 98 | cmp-builtin, 99 | coerce-builtin, 100 | execfile-builtin, 101 | file-builtin, 102 | long-builtin, 103 | raw_input-builtin, 104 | reduce-builtin, 105 | standarderror-builtin, 106 | unicode-builtin, 107 | xrange-builtin, 108 | coerce-method, 109 | delslice-method, 110 | getslice-method, 111 | setslice-method, 112 | no-absolute-import, 113 | old-division, 114 | dict-iter-method, 115 | dict-view-method, 116 | next-method-called, 117 | metaclass-assignment, 118 | indexing-exception, 119 | raising-string, 120 | reload-builtin, 121 | oct-method, 122 | hex-method, 123 | nonzero-method, 124 | cmp-method, 125 | input-builtin, 126 | round-builtin, 127 | intern-builtin, 128 | unichr-builtin, 129 | map-builtin-not-iterating, 130 | zip-builtin-not-iterating, 131 | range-builtin-not-iterating, 132 | filter-builtin-not-iterating, 133 | using-cmp-argument, 134 | eq-without-hash, 135 | div-method, 136 | idiv-method, 137 | rdiv-method, 138 | exception-message-attribute, 139 | invalid-str-codec, 140 | sys-max-int, 141 | bad-python3-import, 142 | deprecated-string-function, 143 | deprecated-str-translate-call, 144 | deprecated-itertools-function, 145 | deprecated-types-field, 146 | next-method-defined, 147 | dict-items-not-iterating, 148 | dict-keys-not-iterating, 149 | dict-values-not-iterating, 150 | deprecated-operator-function, 151 | deprecated-urllib-function, 152 | xreadlines-attribute, 153 | deprecated-sys-function, 154 | exception-escape, 155 | comprehension-escape, 156 | C0114, 157 | C0116, 158 | invalid-name, 159 | missing-class-docstring, 160 | too-few-public-methods, 161 | too-many-instance-attributes, 162 | pointless-string-statement, 163 | redefined-outer-name, 164 | 165 | 166 | # Enable the message, report, category or checker with the given id(s). You can 167 | # either give multiple identifier separated by comma (,) or put this option 168 | # multiple time (only on the command line, not in the configuration file where 169 | # it should appear only once). See also the "--disable" option for examples. 170 | enable=c-extension-no-member 171 | 172 | 173 | [REPORTS] 174 | 175 | # Python expression which should return a score less than or equal to 10. You 176 | # have access to the variables 'error', 'warning', 'refactor', and 'convention' 177 | # which contain the number of messages in each category, as well as 'statement' 178 | # which is the total number of statements analyzed. This score is used by the 179 | # global evaluation report (RP0004). 180 | evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) 181 | 182 | # Template used to display messages. This is a python new-style format string 183 | # used to format the message information. See doc for all details. 184 | #msg-template= 185 | 186 | # Set the output format. Available formats are text, parseable, colorized, json 187 | # and msvs (visual studio). You can also give a reporter class, e.g. 188 | # mypackage.mymodule.MyReporterClass. 189 | output-format=text 190 | 191 | # Tells whether to display a full report or only the messages. 192 | reports=no 193 | 194 | # Activate the evaluation score. 195 | score=yes 196 | 197 | 198 | [REFACTORING] 199 | 200 | # Maximum number of nested blocks for function / method body 201 | max-nested-blocks=5 202 | 203 | # Complete name of functions that never returns. When checking for 204 | # inconsistent-return-statements if a never returning function is called then 205 | # it will be considered as an explicit return statement and no message will be 206 | # printed. 207 | never-returning-functions=sys.exit,argparse.parse_error 208 | 209 | 210 | [LOGGING] 211 | 212 | # The type of string formatting that logging methods do. `old` means using % 213 | # formatting, `new` is for `{}` formatting. 214 | logging-format-style=new 215 | 216 | # Logging modules to check that the string format arguments are in logging 217 | # function parameter format. 218 | logging-modules=logging 219 | 220 | 221 | [SPELLING] 222 | 223 | # Limits count of emitted suggestions for spelling mistakes. 224 | max-spelling-suggestions=4 225 | 226 | # Spelling dictionary name. Available dictionaries: none. To make it work, 227 | # install the 'python-enchant' package. 228 | spelling-dict= 229 | 230 | # List of comma separated words that should be considered directives if they 231 | # appear and the beginning of a comment and should not be checked. 232 | spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy: 233 | 234 | # List of comma separated words that should not be checked. 235 | spelling-ignore-words= 236 | 237 | # A path to a file that contains the private dictionary; one word per line. 238 | spelling-private-dict-file= 239 | 240 | # Tells whether to store unknown words to the private dictionary (see the 241 | # --spelling-private-dict-file option) instead of raising a message. 242 | spelling-store-unknown-words=no 243 | 244 | 245 | [MISCELLANEOUS] 246 | 247 | # List of note tags to take in consideration, separated by a comma. 248 | notes=FIXME, 249 | XXX, 250 | TODO 251 | 252 | # Regular expression of note tags to take in consideration. 253 | #notes-rgx= 254 | 255 | 256 | [TYPECHECK] 257 | 258 | # List of decorators that produce context managers, such as 259 | # contextlib.contextmanager. Add to this list to register other decorators that 260 | # produce valid context managers. 261 | contextmanager-decorators=contextlib.contextmanager 262 | 263 | # List of members which are set dynamically and missed by pylint inference 264 | # system, and so shouldn't trigger E1101 when accessed. Python regular 265 | # expressions are accepted. 266 | generated-members= 267 | 268 | # Tells whether missing members accessed in mixin class should be ignored. A 269 | # mixin class is detected if its name ends with "mixin" (case insensitive). 270 | ignore-mixin-members=yes 271 | 272 | # Tells whether to warn about missing members when the owner of the attribute 273 | # is inferred to be None. 274 | ignore-none=yes 275 | 276 | # This flag controls whether pylint should warn about no-member and similar 277 | # checks whenever an opaque object is returned when inferring. The inference 278 | # can return multiple potential results while evaluating a Python object, but 279 | # some branches might not be evaluated, which results in partial inference. In 280 | # that case, it might be useful to still emit no-member and other checks for 281 | # the rest of the inferred objects. 282 | ignore-on-opaque-inference=yes 283 | 284 | # List of class names for which member attributes should not be checked (useful 285 | # for classes with dynamically set attributes). This supports the use of 286 | # qualified names. 287 | ignored-classes=optparse.Values,thread._local,_thread._local 288 | 289 | # List of module names for which member attributes should not be checked 290 | # (useful for modules/projects where namespaces are manipulated during runtime 291 | # and thus existing member attributes cannot be deduced by static analysis). It 292 | # supports qualified module names, as well as Unix pattern matching. 293 | ignored-modules= 294 | 295 | # Show a hint with possible names when a member name was not found. The aspect 296 | # of finding the hint is based on edit distance. 297 | missing-member-hint=yes 298 | 299 | # The minimum edit distance a name should have in order to be considered a 300 | # similar match for a missing member name. 301 | missing-member-hint-distance=1 302 | 303 | # The total number of similar names that should be taken in consideration when 304 | # showing a hint for a missing member. 305 | missing-member-max-choices=1 306 | 307 | # List of decorators that change the signature of a decorated function. 308 | signature-mutators= 309 | 310 | 311 | [VARIABLES] 312 | 313 | # List of additional names supposed to be defined in builtins. Remember that 314 | # you should avoid defining new builtins when possible. 315 | additional-builtins= 316 | 317 | # Tells whether unused global variables should be treated as a violation. 318 | allow-global-unused-variables=yes 319 | 320 | # List of names allowed to shadow builtins 321 | allowed-redefined-builtins= 322 | 323 | # List of strings which can identify a callback function by name. A callback 324 | # name must start or end with one of those strings. 325 | callbacks=cb_, 326 | _cb 327 | 328 | # A regular expression matching the name of dummy variables (i.e. expected to 329 | # not be used). 330 | dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ 331 | 332 | # Argument names that match this expression will be ignored. Default to name 333 | # with leading underscore. 334 | ignored-argument-names=_.*|^ignored_|^unused_ 335 | 336 | # Tells whether we should check for unused import in __init__ files. 337 | init-import=no 338 | 339 | # List of qualified module names which can have objects that can redefine 340 | # builtins. 341 | redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io 342 | 343 | 344 | [FORMAT] 345 | 346 | # Expected format of line ending, e.g. empty (any line ending), LF or CRLF. 347 | expected-line-ending-format= 348 | 349 | # Regexp for a line that is allowed to be longer than the limit. 350 | ignore-long-lines=^\s*(# )??$ 351 | 352 | # Number of spaces of indent required inside a hanging or continued line. 353 | indent-after-paren=4 354 | 355 | # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 356 | # tab). 357 | indent-string=' ' 358 | 359 | # Maximum number of characters on a single line. 360 | max-line-length=100 361 | 362 | # Maximum number of lines in a module. 363 | max-module-lines=1000 364 | 365 | # Allow the body of a class to be on the same line as the declaration if body 366 | # contains single statement. 367 | single-line-class-stmt=no 368 | 369 | # Allow the body of an if to be on the same line as the test if there is no 370 | # else. 371 | single-line-if-stmt=no 372 | 373 | 374 | [SIMILARITIES] 375 | 376 | # Ignore comments when computing similarities. 377 | ignore-comments=yes 378 | 379 | # Ignore docstrings when computing similarities. 380 | ignore-docstrings=yes 381 | 382 | # Ignore imports when computing similarities. 383 | ignore-imports=yes 384 | 385 | # Ignore function signatures when computing similarities. 386 | ignore-signatures=yes 387 | 388 | # Minimum lines number of a similarity. 389 | min-similarity-lines=20 390 | 391 | 392 | [BASIC] 393 | 394 | # Naming style matching correct argument names. 395 | argument-naming-style=snake_case 396 | 397 | # Regular expression matching correct argument names. Overrides argument- 398 | # naming-style. 399 | #argument-rgx= 400 | 401 | # Naming style matching correct attribute names. 402 | attr-naming-style=snake_case 403 | 404 | # Regular expression matching correct attribute names. Overrides attr-naming- 405 | # style. 406 | #attr-rgx= 407 | 408 | # Bad variable names which should always be refused, separated by a comma. 409 | bad-names=foo, 410 | bar, 411 | baz, 412 | toto, 413 | tutu, 414 | tata 415 | 416 | # Bad variable names regexes, separated by a comma. If names match any regex, 417 | # they will always be refused 418 | bad-names-rgxs= 419 | 420 | # Naming style matching correct class attribute names. 421 | class-attribute-naming-style=any 422 | 423 | # Regular expression matching correct class attribute names. Overrides class- 424 | # attribute-naming-style. 425 | #class-attribute-rgx= 426 | 427 | # Naming style matching correct class constant names. 428 | class-const-naming-style=UPPER_CASE 429 | 430 | # Regular expression matching correct class constant names. Overrides class- 431 | # const-naming-style. 432 | #class-const-rgx= 433 | 434 | # Naming style matching correct class names. 435 | class-naming-style=PascalCase 436 | 437 | # Regular expression matching correct class names. Overrides class-naming- 438 | # style. 439 | #class-rgx= 440 | 441 | # Naming style matching correct constant names. 442 | const-naming-style=UPPER_CASE 443 | 444 | # Regular expression matching correct constant names. Overrides const-naming- 445 | # style. 446 | #const-rgx= 447 | 448 | # Minimum line length for functions/classes that require docstrings, shorter 449 | # ones are exempt. 450 | docstring-min-length=-1 451 | 452 | # Naming style matching correct function names. 453 | function-naming-style=snake_case 454 | 455 | # Regular expression matching correct function names. Overrides function- 456 | # naming-style. 457 | #function-rgx= 458 | 459 | # Good variable names which should always be accepted, separated by a comma. 460 | good-names=i, 461 | j, 462 | k, 463 | ex, 464 | Run, 465 | _ 466 | 467 | # Good variable names regexes, separated by a comma. If names match any regex, 468 | # they will always be accepted 469 | good-names-rgxs= 470 | 471 | # Include a hint for the correct naming format with invalid-name. 472 | include-naming-hint=no 473 | 474 | # Naming style matching correct inline iteration names. 475 | inlinevar-naming-style=any 476 | 477 | # Regular expression matching correct inline iteration names. Overrides 478 | # inlinevar-naming-style. 479 | #inlinevar-rgx= 480 | 481 | # Naming style matching correct method names. 482 | method-naming-style=snake_case 483 | 484 | # Regular expression matching correct method names. Overrides method-naming- 485 | # style. 486 | #method-rgx= 487 | 488 | # Naming style matching correct module names. 489 | module-naming-style=snake_case 490 | 491 | # Regular expression matching correct module names. Overrides module-naming- 492 | # style. 493 | #module-rgx= 494 | 495 | # Colon-delimited sets of names that determine each other's naming style when 496 | # the name regexes allow several styles. 497 | name-group= 498 | 499 | # Regular expression which should only match function or class names that do 500 | # not require a docstring. 501 | no-docstring-rgx=^_ 502 | 503 | # List of decorators that produce properties, such as abc.abstractproperty. Add 504 | # to this list to register other decorators that produce valid properties. 505 | # These decorators are taken in consideration only for invalid-name. 506 | property-classes=abc.abstractproperty 507 | 508 | # Naming style matching correct variable names. 509 | variable-naming-style=snake_case 510 | 511 | # Regular expression matching correct variable names. Overrides variable- 512 | # naming-style. 513 | #variable-rgx= 514 | 515 | 516 | [STRING] 517 | 518 | # This flag controls whether inconsistent-quotes generates a warning when the 519 | # character used as a quote delimiter is used inconsistently within a module. 520 | check-quote-consistency=no 521 | 522 | # This flag controls whether the implicit-str-concat should generate a warning 523 | # on implicit string concatenation in sequences defined over several lines. 524 | check-str-concat-over-line-jumps=no 525 | 526 | 527 | [IMPORTS] 528 | 529 | # List of modules that can be imported at any level, not just the top level 530 | # one. 531 | allow-any-import-level= 532 | 533 | # Allow wildcard imports from modules that define __all__. 534 | allow-wildcard-with-all=no 535 | 536 | # Analyse import fallback blocks. This can be used to support both Python 2 and 537 | # 3 compatible code, which means that the block might have code that exists 538 | # only in one or another interpreter, leading to false positives when analysed. 539 | analyse-fallback-blocks=no 540 | 541 | # Deprecated modules which should not be used, separated by a comma. 542 | deprecated-modules= 543 | 544 | # Output a graph (.gv or any supported image format) of external dependencies 545 | # to the given file (report RP0402 must not be disabled). 546 | ext-import-graph= 547 | 548 | # Output a graph (.gv or any supported image format) of all (i.e. internal and 549 | # external) dependencies to the given file (report RP0402 must not be 550 | # disabled). 551 | import-graph= 552 | 553 | # Output a graph (.gv or any supported image format) of internal dependencies 554 | # to the given file (report RP0402 must not be disabled). 555 | int-import-graph= 556 | 557 | # Force import order to recognize a module as part of the standard 558 | # compatibility libraries. 559 | known-standard-library= 560 | 561 | # Force import order to recognize a module as part of a third party library. 562 | known-third-party=enchant 563 | 564 | # Couples of modules and preferred modules, separated by a comma. 565 | preferred-modules= 566 | 567 | 568 | [CLASSES] 569 | 570 | # Warn about protected attribute access inside special methods 571 | check-protected-access-in-special-methods=no 572 | 573 | # List of method names used to declare (i.e. assign) instance attributes. 574 | defining-attr-methods=__init__, 575 | __new__, 576 | setUp, 577 | __post_init__ 578 | 579 | # List of member names, which should be excluded from the protected access 580 | # warning. 581 | exclude-protected=_asdict, 582 | _fields, 583 | _replace, 584 | _source, 585 | _make 586 | 587 | # List of valid names for the first argument in a class method. 588 | valid-classmethod-first-arg=cls 589 | 590 | # List of valid names for the first argument in a metaclass class method. 591 | valid-metaclass-classmethod-first-arg=cls 592 | 593 | 594 | [DESIGN] 595 | 596 | # Maximum number of arguments for function / method. 597 | max-args=5 598 | 599 | # Maximum number of attributes for a class (see R0902). 600 | max-attributes=7 601 | 602 | # Maximum number of boolean expressions in an if statement (see R0916). 603 | max-bool-expr=5 604 | 605 | # Maximum number of branch for function / method body. 606 | max-branches=12 607 | 608 | # Maximum number of locals for function / method body. 609 | max-locals=15 610 | 611 | # Maximum number of parents for a class (see R0901). 612 | max-parents=7 613 | 614 | # Maximum number of public methods for a class (see R0904). 615 | max-public-methods=20 616 | 617 | # Maximum number of return / yield for function / method body. 618 | max-returns=6 619 | 620 | # Maximum number of statements in function / method body. 621 | max-statements=50 622 | 623 | # Minimum number of public methods for a class (see R0903). 624 | min-public-methods=2 625 | 626 | 627 | [EXCEPTIONS] 628 | 629 | # Exceptions that will emit a warning when being caught. Defaults to 630 | # "BaseException, Exception". 631 | overgeneral-exceptions=BaseException, 632 | Exception 633 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Jamal 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include swagger_coverage_py/swagger-coverage-commandline/bin/swagger-coverage-commandline 2 | include swagger_coverage_py/swagger-coverage-commandline/bin/swagger-coverage-commandline.bat 3 | include swagger_coverage_py/swagger-coverage-commandline/lib/*.jar -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Supported Python Versions](https://img.shields.io/badge/python-3.6-blue) 2 | ![Version](https://img.shields.io/badge/Version-2.0.1-blue) 3 | 4 | # swagger-coverage-py 5 | 6 | #### This project is the adapter that allows using [swagger-coverage](https://github.com/viclovsky/swagger-coverage) tool in Python projects (PyTest+Requests). 7 | 8 | ## Original description summary: 9 | 10 | > Swagger-coverage gives a full picture about coverage of API tests (regression) based on OAS 2 (Swagger). By saying 11 | > coverage we mean not a broad theme functionality, but presence (or absence) of calls defined by API methods, parameters, 12 | > return codes or other conditions which corresponds specification of API. 13 | 14 | Some more info about the project you can also 15 | find [HERE](https://viclovsky.github.io/%D0%B0%D0%B2%D1%82%D0%BE%D1%82%D0%B5%D1%81%D1%82%D1%8B%20%D0%BD%D0%B0%20api/2020/01/16/swagger-coverage) 16 |
17 | 18 | 19 | # How to use: 20 | 21 | All required steps are listed below. Additionally, you can find a working example 22 | here: [allure-results-sample](https://github.com/JamalZeynalov/allure-results-sample). 23 | 24 | ### 0. Resolve dependencies: 25 | 26 | * python 3.6+ 27 | * java JDK 11+ (with JAVA_HOME environment variable set) 28 | * Enable Long Paths (Windows only). Check the 29 | guide [HERE](https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation#enable-long-paths-in-windows-10-version-1607-and-later) 30 | 31 | ### 1. Install `swagger-coverage-py` as a project requirement. 32 | 33 | ```shell 34 | pip install swagger-coverage 35 | ``` 36 | 37 | ### 2. Add environment variables (Optionally): 38 | 39 | ```dotenv 40 | API_DOCS_TYPE="swagger" # Note: "openapi" is default type of API docs 41 | API_DOCS_VERSION="2.0" # Note: "3.0.0" is default version of API docs 42 | API_DOCS_FORMAT="yaml" # Note: "json" is default format of API docs and output files 43 | API_COVERAGE_REPORTS_DISABLED=True # Skip requests recording. No files will be saved to 'swagger-coverage-output' dir 44 | DEBUG_MODE=True # Enable debug mode. All commandline logs will be printed to console (False by default) 45 | 46 | ``` 47 | 48 | ### 3. Add the session-scoped fixture 49 | 50 | ```python 51 | import pytest 52 | from swagger_coverage_py.reporter import CoverageReporter 53 | from requests.auth import HTTPBasicAuth 54 | 55 | 56 | @pytest.fixture(scope="session", autouse=True) 57 | def setup_swagger_coverage(): 58 | reporter = CoverageReporter(api_name="my-project", host="http://my-project.com") 59 | reporter.cleanup_input_files() 60 | reporter.setup("/api/v1/resources/my_project/doc/swagger.json", auth=HTTPBasicAuth("username", "password")) 61 | 62 | yield 63 | reporter.generate_report() 64 | ``` 65 | 66 | #### If you have 2 and more projects, then just add more reporters: 67 | 68 | ```python 69 | import pytest 70 | from swagger_coverage_py.reporter import CoverageReporter 71 | from requests.auth import HTTPBasicAuth 72 | 73 | 74 | @pytest.fixture(scope="session", autouse=True) 75 | def setup_swagger_coverage(): 76 | reporter = CoverageReporter(api_name="petstore", host="https://petstore.swagger.io") 77 | reporter.cleanup_input_files() 78 | reporter.setup(path_to_swagger_json="/v2/swagger.json") 79 | 80 | reporter2 = CoverageReporter(api_name="my-project", host="http://my-project.com") 81 | reporter2.cleanup_input_files() 82 | reporter2.setup(path_to_swagger_json="/api/v1/swagger.json", auth=HTTPBasicAuth("username", "password")) 83 | 84 | yield 85 | reporter.generate_report() 86 | reporter2.generate_report() 87 | ``` 88 | 89 | #### YAML format is also supported: 90 | 91 | ```python 92 | import pytest 93 | from swagger_coverage_py.reporter import CoverageReporter 94 | 95 | 96 | @pytest.fixture(scope="session", autouse=True) 97 | def setup_swagger_coverage(): 98 | reporter = CoverageReporter(api_name="petstore", host="https://petstore.swagger.io") 99 | reporter.cleanup_input_files() 100 | reporter.setup("/v2/swagger.yaml") 101 | 102 | yield 103 | reporter.generate_report() 104 | ``` 105 | 106 | > #### Steps and Parameters: 107 | > `api_name` - Define the name of the API. This name will be used to find a configuration file.
108 | >      For APIs in this example the files must 109 | > have names `swagger-coverage-config-petstore.json` and `swagger-coverage-config-my-project.json`.
110 | > 111 | > `host` - The host of the API. 112 | > It will be used to download a swagger.json file and to identify the CoverageListener output directory for each API. 113 | > 114 | > `cleanup_input_files()` - THis step deletes all files in the CoverageListener output directory (according to the 115 | > target host) 116 | > 117 | > `path_to_swagger_json` - A second part of the HTTP link to your OpenApi/Swagger documentation in JSON format
118 | >      Adapted `swagger-.json` file will be created in your project root.
119 | >      The "Swagger 2.0" format is completely compatible with this tool.
120 | >      The "OpenAPI 3.0.2" format is partly compatible. 121 | > "Tags coverage summary" calculation is not supported.
122 | > 123 | > `auth` - An authentication parameter for "requests" lib. Skip it if your API doesn't require authentication. 124 | 125 | ### 4. Create and place `swagger-coverage-config-.json` file(s) to your project: 126 | 127 | ```json 128 | { 129 | "rules": { 130 | "status": { 131 | "enable": true, 132 | "ignore": [ 133 | "500" 134 | ], 135 | "filter": [] 136 | }, 137 | "paths": { 138 | "enable": true, 139 | "ignore": [ 140 | "/user/{username}" 141 | ] 142 | }, 143 | "only-declared-status": { 144 | "enable": false 145 | }, 146 | "exclude-deprecated": { 147 | "enable": true 148 | } 149 | }, 150 | "writers": { 151 | "html": { 152 | "locale": "en", 153 | "filename": "swagger-coverage-report-petstore.html" 154 | } 155 | } 156 | } 157 | ``` 158 | The `path` section is designed to exclude specific endpoints (all methods) from the final HTML report. 159 | To do this, you need to set `enable` parameter to `true` and specify a list of endpoints (as you see them in the swagger doc) in the `ignore` section. 160 | Then these endpoints will be removed from the API doc before it is saved locally.
161 | Note: Remove already downloaded API docs before running a new version of this lib. 162 | 163 | > ### If you have more than 1 API then this config MUST: 164 | > #### 1. Be created for each microservice which you track using `CoverageListener`. 165 | > Otherwise, the default behavior will be applied, and your report will be saved as `swagger-coverage-report.html` which 166 | > may cause override in case you have multiple APIs 167 | > #### 2. Contain `writers` section with filename in the format: `swagger-coverage-report-.html` 168 | > #### 3. Be placed in the root of your project 169 | 170 | More examples of configuration options you can find in 171 | the [Configuration options](https://github.com/JamalZeynalov/swagger-coverage#configuration-options) section of the 172 | documentation. 173 | 174 | ### 5. Trace all your API calls with CoverageListener: 175 | 176 | ```python 177 | from requests import Response 178 | from requests.auth import HTTPBasicAuth 179 | from swagger_coverage_py.listener import CoverageListener 180 | 181 | response: Response = CoverageListener( 182 | method="get", 183 | base_url="https://petstore.swagger.io", 184 | raw_path="/v2/store/order/{orderId}", 185 | uri_params={"orderId": 1}, 186 | auth=HTTPBasicAuth("username", "password"), 187 | params={"type": "active"}, 188 | ).response 189 | ``` 190 | 191 | > #### Note: "auth" and "params" arguments are default for "requests" lib and are not required.
You can use any other **kwargs that are applicable for Requests library. 192 | 193 | ### 6. Run your tests and open created `swagger-coverage-report-.html` report(s) in your browser. 194 | 195 | Important remarks: 196 | 197 | 1. Virtual environments are supported. Make sure your virtual environment directory has name `venv`. 198 | 2. To create report you have to run your test from the project root. Check that workind directory of your runner is 199 | not `"/test"` 200 | 201 | # How it works: 202 | 203 | 1. The fixture `setup_swagger_coverage` setups required artifacts 204 | 2. During test execution the CoverageListener saves all requests as JSON files in swagger format to a subdirectory named 205 | as a called host. (e.g. `swagger-coverage-output/petstore.swagger.io/`). 206 | 3. After all tests execution a `CoverageReporter().generate_report()` creates and saves new report(s) into your project 207 | root. 208 | 209 | ## Created & Maintained By 210 | 211 | [Jamal Zeinalov](https://github.com/JamalZeynalov) 212 | 213 | ## License 214 | 215 | Swagger coverage is released under version 2.0 of the [Apache License](http://www.apache.org/licenses/LICENSE-2.0) -------------------------------------------------------------------------------- /images/swagger-coverage-report.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/images/swagger-coverage-report.png -------------------------------------------------------------------------------- /python-publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will upload a Python Package using Twine when a release is created 2 | # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries 3 | 4 | # This workflow uses actions that are not certified by GitHub. 5 | # They are provided by a third-party and are governed by 6 | # separate terms of service, privacy policy, and support 7 | # documentation. 8 | 9 | name: Upload Python Package 10 | 11 | on: 12 | release: 13 | types: [published] 14 | 15 | jobs: 16 | deploy: 17 | 18 | runs-on: ubuntu-latest 19 | 20 | steps: 21 | - uses: actions/checkout@v2 22 | - name: Set up Python 23 | uses: actions/setup-python@v2 24 | with: 25 | python-version: '3.x' 26 | - name: Install dependencies 27 | run: | 28 | python -m pip install --upgrade pip 29 | pip install build 30 | - name: Build package 31 | run: python -m build 32 | - name: Publish package 33 | uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 34 | with: 35 | user: __token__ 36 | password: ${{ secrets.PYPI_API_TOKEN }} 37 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | requests==2.31.0 2 | Faker>=15.2.0 3 | setuptools==69.0.3 4 | PyYAML>=6.0 5 | python-dotenv>=0.21.0 6 | rootpath==0.1.0 7 | environs>=9.5.0 8 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import find_packages, setup 2 | 3 | with open("README.md", "r") as fh: 4 | long_description = fh.read() 5 | 6 | setup( 7 | name="swagger-coverage", 8 | version="3.5.1", 9 | author="Jamal Zeinalov", 10 | author_email="jamal.zeynalov@gmail.com", 11 | description='Python adapter for "swagger-coverage" tool', 12 | long_description=long_description, 13 | long_description_content_type="text/markdown", 14 | url="https://github.com/JamalZeynalov/swagger-coverage-py", 15 | packages=find_packages(), 16 | classifiers=[ 17 | "Programming Language :: Python :: 3", 18 | "License :: OSI Approved :: MIT License", 19 | "Operating System :: OS Independent", 20 | ], 21 | install_requires=[ 22 | "requests>=2.31.0", 23 | "Faker>=15.2.0", 24 | "setuptools>=69.0.3", 25 | "PyYAML>=6.0", 26 | "python-dotenv>=0.21.0", 27 | "rootpath==0.1.0", 28 | "environs>=9.5.0", 29 | ], 30 | python_requires=">=3.6", 31 | include_package_data=True, 32 | ) 33 | -------------------------------------------------------------------------------- /swagger_coverage_py/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/__init__.py -------------------------------------------------------------------------------- /swagger_coverage_py/configs.py: -------------------------------------------------------------------------------- 1 | from environs import Env 2 | 3 | import rootpath 4 | from dotenv import load_dotenv 5 | 6 | load_dotenv(f"{rootpath.detect()}/.env") 7 | env = Env() 8 | 9 | API_DOCS_TYPE = env.str("API_DOCS_TYPE", default="openapi") # "swagger" 10 | API_DOCS_VERSION = env.str("API_DOCS_VERSION", default="3.0.0") # "2.0" 11 | API_DOCS_FORMAT = env.str("API_DOCS_FORMAT", default="json") # "yaml" 12 | IS_DISABLED = env.bool( 13 | "API_COVERAGE_REPORTS_DISABLED", default=False 14 | ) # If True then requests won't be recorded 15 | 16 | DEBUG_MODE = env.bool( 17 | "DEBUG_MODE", default=False 18 | ) # Set to True to see commandline output 19 | -------------------------------------------------------------------------------- /swagger_coverage_py/docs_writers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/docs_writers/__init__.py -------------------------------------------------------------------------------- /swagger_coverage_py/docs_writers/api_doc_writer.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | import requests 4 | import yaml 5 | 6 | from swagger_coverage_py.configs import API_DOCS_FORMAT, API_DOCS_TYPE 7 | 8 | 9 | def __delete_ignored_paths_from_json( 10 | api_doc_data: requests.Response, paths_to_delete: list 11 | ) -> dict: 12 | data: dict = api_doc_data.json() 13 | for path in paths_to_delete: 14 | if path in data["paths"]: 15 | del data["paths"][path] 16 | return data 17 | 18 | 19 | def __delete_ignored_paths_from_yaml( 20 | api_doc_data: requests.Response, paths_to_delete: list 21 | ) -> dict: 22 | data: dict = yaml.safe_load(str(api_doc_data.text)) 23 | for path in paths_to_delete: 24 | if path in data["paths"]: 25 | del data["paths"][path] 26 | return data 27 | 28 | 29 | def __write_api_doc_to_json( 30 | file_path: str, api_doc_data: requests.Response, paths_to_delete: list 31 | ): 32 | api_doc_data = __delete_ignored_paths_from_json(api_doc_data, paths_to_delete) 33 | if API_DOCS_TYPE == "swagger" and not api_doc_data.get("swagger", None): 34 | api_doc_data["swagger"] = "2.0" 35 | 36 | with open(file_path, "w+") as file: 37 | file.write(json.dumps(api_doc_data)) 38 | 39 | 40 | def __write_api_doc_to_yaml( 41 | file_path: str, api_doc_data: requests.Response, paths_to_delete: list 42 | ): 43 | data = __delete_ignored_paths_from_yaml(api_doc_data, paths_to_delete) 44 | 45 | if API_DOCS_TYPE == "swagger" and not data.get("swagger", None): 46 | data["swagger"] = "2.0" 47 | 48 | with open(file_path, "w+") as file: 49 | file.write(yaml.safe_dump(data, indent=4, sort_keys=False)) 50 | 51 | 52 | def write_api_doc_to_file(file_path: str, api_doc_data: dict, paths_to_delete: list): 53 | if API_DOCS_FORMAT == "json": 54 | __write_api_doc_to_json(file_path, api_doc_data, paths_to_delete) 55 | else: 56 | __write_api_doc_to_yaml(file_path, api_doc_data, paths_to_delete) 57 | -------------------------------------------------------------------------------- /swagger_coverage_py/listener.py: -------------------------------------------------------------------------------- 1 | import requests 2 | 3 | from swagger_coverage_py.configs import IS_DISABLED 4 | from swagger_coverage_py.request_schema_handler import RequestSchemaHandler 5 | from swagger_coverage_py.uri import URI 6 | 7 | 8 | class CoverageListener: 9 | def __init__( 10 | self, 11 | method: str, 12 | base_url: str, 13 | raw_path: str, 14 | uri_params: dict, 15 | base_path: str = "", 16 | **kwargs 17 | ): 18 | """Records an HTTP request as a file in swagger format 19 | 20 | :param method: the HTTP method name in lowercase. 21 | :param base_url: Base URl with a protocol but without a path. (e.g. "https://petstore.swagger.io") 22 | :param raw_path: Not formatted URL path. 23 | Parameters names in braces will be used for further formatting (e.g. "/v2/store/order/{orderId}") 24 | :param uri_params: URL path parameters. Must match to parameters names specified in "raw_path" 25 | :param kwargs: Optional arguments that are applicable 26 | for appropriate request of "requests" library. (e.g. "auth", "headers", "cookies", etc.) 27 | """ 28 | self.__uri = URI(base_url, base_path, raw_path, **uri_params) 29 | self.response = requests.request(method, self.__uri.full, **kwargs) 30 | 31 | if not IS_DISABLED: 32 | RequestSchemaHandler( 33 | self.__uri, method, self.response, kwargs 34 | ).write_schema() 35 | -------------------------------------------------------------------------------- /swagger_coverage_py/reporter.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | import platform 4 | import re 5 | import shutil 6 | import subprocess 7 | from pathlib import Path 8 | from typing import List 9 | 10 | import requests 11 | 12 | from swagger_coverage_py.configs import API_DOCS_FORMAT, DEBUG_MODE 13 | from swagger_coverage_py.docs_writers.api_doc_writer import write_api_doc_to_file 14 | 15 | 16 | class CoverageReporter: 17 | def __init__(self, api_name: str, host: str, verify: bool = True): 18 | self.host = host 19 | self.verify = verify 20 | self.swagger_doc_file = f"swagger-doc-{api_name}.{API_DOCS_FORMAT}" 21 | self.output_dir = self.__get_output_dir() 22 | self.swagger_coverage_config = f"swagger-coverage-config-{api_name}.json" 23 | self.ignored_paths = self.__get_ignored_paths_from_config() 24 | 25 | def __get_output_dir(self): 26 | output_dir = "swagger-coverage-output" 27 | subdir = re.match(r"(^\w*)://(.*)", self.host).group(2) 28 | return f"{output_dir}/{subdir}" 29 | 30 | def __get_ignored_paths_from_config(self) -> List[str]: 31 | """Reads the swagger-coverage-config-.json file and returns 32 | a list of endpoints/paths to exclude from the report 33 | 34 | """ 35 | paths_to_ignore = [] 36 | if not self.swagger_coverage_config: 37 | return paths_to_ignore 38 | 39 | with open(self.swagger_coverage_config, "r") as file: 40 | data = json.load(file) 41 | paths = data.get("rules").get("paths", {}) 42 | if paths.get("enable", False): 43 | paths_to_ignore = paths.get("ignore") 44 | 45 | return paths_to_ignore 46 | 47 | def setup( 48 | self, path_to_swagger_json: str, auth: object = None, cookies: dict = None 49 | ): 50 | """Setup all required attributes to generate report 51 | 52 | :param path_to_swagger_json: The relative URL path to the swagger.json (example: "/docs/api") 53 | :param auth: Authentication object acceptable by "requests" library 54 | :param cookies: Cookies dictionary. (Usage example: set this to bypass Okta auth locally) 55 | 56 | """ 57 | link_to_swagger_json = f"{self.host}{path_to_swagger_json}" 58 | 59 | response = requests.get( 60 | link_to_swagger_json, auth=auth, cookies=cookies, verify=self.verify 61 | ) 62 | assert response.ok, ( 63 | f"Swagger doc is not pulled. See details: " 64 | f"{response.status_code} {response.request.url}" 65 | f"{response.content}\n{response.content}" 66 | ) 67 | if self.swagger_coverage_config: 68 | write_api_doc_to_file( 69 | self.swagger_doc_file, 70 | api_doc_data=response, 71 | paths_to_delete=self.ignored_paths, 72 | ) 73 | 74 | def generate_report(self): 75 | inner_location = "swagger-coverage-commandline/bin/swagger-coverage-commandline" 76 | 77 | cmd_path = os.path.join(os.path.dirname(__file__), inner_location) 78 | assert Path( 79 | cmd_path 80 | ).exists(), ( 81 | f"No commandline tools is found in following locations:\n{cmd_path}\n" 82 | ) 83 | command = [cmd_path, "-s", self.swagger_doc_file, "-i", self.output_dir] 84 | if self.swagger_coverage_config: 85 | command.extend(["-c", self.swagger_coverage_config]) 86 | 87 | # Adjust the file paths for Windows 88 | if platform.system() == "Windows": 89 | command = [arg.replace("/", "\\") for arg in command] 90 | 91 | # Suppress all output if not in debug mode 92 | if not DEBUG_MODE: 93 | with open(os.devnull, 'w') as devnull: 94 | subprocess.run(command, stdout=devnull, stderr=devnull) 95 | else: 96 | subprocess.run(command) 97 | 98 | 99 | def cleanup_input_files(self): 100 | shutil.rmtree(self.output_dir, ignore_errors=True) 101 | Path(self.output_dir).mkdir(parents=True, exist_ok=True) 102 | -------------------------------------------------------------------------------- /swagger_coverage_py/request_schema_handler.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from requests import Response 4 | 5 | from swagger_coverage_py.configs import API_DOCS_TYPE 6 | from swagger_coverage_py.results_writers.openapi_schemas_manager import ( 7 | OpenApiSchemasManager, 8 | ) 9 | from swagger_coverage_py.results_writers.swagger_schemas_manager import ( 10 | SwaggerSchemasManager, 11 | ) 12 | from swagger_coverage_py.uri import URI 13 | 14 | 15 | class RequestSchemaHandler: 16 | def __init__(self, uri: URI, method: str, response: Response, kwargs: dict): 17 | self.__manager = self.__get_manager(uri, method, response, kwargs) 18 | 19 | @staticmethod 20 | def __get_manager( 21 | uri, method, response, kwargs 22 | ) -> Union[SwaggerSchemasManager, OpenApiSchemasManager]: 23 | if API_DOCS_TYPE == "swagger": 24 | return SwaggerSchemasManager(uri, method, response, kwargs) 25 | 26 | return OpenApiSchemasManager(uri, method, response, kwargs) 27 | 28 | def write_schema(self): 29 | self.__manager.write_schema() 30 | -------------------------------------------------------------------------------- /swagger_coverage_py/results_writers/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/results_writers/__init__.py -------------------------------------------------------------------------------- /swagger_coverage_py/results_writers/base_schemas_manager.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | import platform 4 | import re 5 | import urllib 6 | 7 | import yaml 8 | from faker import Faker 9 | from requests import Response 10 | 11 | from swagger_coverage_py.configs import API_DOCS_FORMAT 12 | from swagger_coverage_py.uri import URI 13 | 14 | 15 | class ApiDocsManagerBase: 16 | def __init__(self, uri: URI, response: Response, kwargs: dict, method: str = None): 17 | self._uri = uri 18 | self._method = method 19 | self._response: Response = response 20 | self._other_request_params = kwargs 21 | 22 | def _get_path_params(self) -> list: 23 | params_ = [] 24 | for key, value in self._uri.uri_params.items(): 25 | params_.append( 26 | { 27 | "name": key, 28 | "in": "path", 29 | "required": False, 30 | "x-example": urllib.parse.unquote(str(value)), 31 | } 32 | ) 33 | return params_ 34 | 35 | def _get_body_params(self): 36 | try: 37 | request_body = json.loads(self._response.request.body) 38 | except Exception: 39 | request_body = None 40 | 41 | if request_body: 42 | types = { 43 | "object": "object", 44 | "str": "string", 45 | "int": "number", 46 | "float": "number", 47 | "bool": "boolean", 48 | "list": "array", 49 | } 50 | if isinstance(request_body, dict): 51 | properties = {} 52 | for k, v in request_body.items(): 53 | value_type = types.get(type(v).__name__, "object") 54 | if value_type == "string": 55 | value = urllib.parse.unquote(str(v)) 56 | else: 57 | value = v 58 | properties[k] = {k: value, "type": value_type} 59 | 60 | request_body: dict = { 61 | "content": { 62 | "application/json": { 63 | "schema": {"type": "object", "properties": properties}, 64 | "example": json.loads(self._response.request.body), 65 | } 66 | } 67 | } 68 | elif isinstance(request_body, list): 69 | items_type = types.get(type(request_body[0]).__name__, "object") 70 | request_body: dict = { 71 | "content": { 72 | "application/json": { 73 | "schema": { 74 | "type": "array", 75 | "items": {"type": items_type}, 76 | }, 77 | "example": json.loads(self._response.request.body), 78 | } 79 | } 80 | } 81 | else: 82 | request_body: dict = { 83 | "content": { 84 | "application/json": { 85 | "schema": { 86 | "type": "string", 87 | }, 88 | "example": urllib.parse.unquote( 89 | str(self._response.request.body) 90 | ), 91 | } 92 | } 93 | } 94 | else: 95 | request_body = None 96 | 97 | return request_body 98 | 99 | def _get_other_request_params(self, params_key: str, params_in: str) -> list: 100 | prams_raw = self._other_request_params.get(params_key, {}) 101 | if prams_raw: 102 | params = list(prams_raw.items()) 103 | else: 104 | params = [] 105 | 106 | raw = self._uri.raw.split("?") 107 | if len(raw) > 1: 108 | params += [tuple(x.split("=")) for x in str(raw[1]).split("&")] 109 | if not params: 110 | return [] 111 | 112 | params_ = [] 113 | for key, value in params: 114 | params_.append( 115 | { 116 | "name": key, 117 | "in": params_in, 118 | "required": False, 119 | "x-example": urllib.parse.unquote(str(value)), 120 | } 121 | ) 122 | return params_ 123 | 124 | def _get_query_params(self) -> list: 125 | return self._get_other_request_params(params_key="params", params_in="query") 126 | 127 | def _get_header_params(self) -> list: 128 | return self._get_other_request_params(params_key="headers", params_in="header") 129 | 130 | def __get_output_subdir(self): 131 | return re.match(r"(^\w*)://(.*)", self._uri.host).group(2) 132 | 133 | def write_schema(self): 134 | schema_dict = self._get_schema() 135 | rnd = Faker().pystr(min_chars=5, max_chars=5) 136 | file_name = f"{self._method.upper()} {self._uri.formatted[1::]}".replace( 137 | "/", "-" 138 | ).replace(":", "_") 139 | path_ = f"swagger-coverage-output/{self.__get_output_subdir()}" 140 | file_path = f"{path_}/{file_name}".split("?")[0] 141 | file_path = f"{file_path} ({rnd}).{API_DOCS_FORMAT}" 142 | 143 | try: 144 | with open(file_path, "w+") as file: 145 | if API_DOCS_FORMAT == "yaml": 146 | file.write(yaml.safe_dump(schema_dict, indent=4, sort_keys=False)) 147 | elif API_DOCS_FORMAT == "json": 148 | file.write(json.dumps(schema_dict, indent=4)) 149 | else: 150 | raise Exception( 151 | f"Unexpected docs format: {API_DOCS_FORMAT}. Valid formats: json, yaml" 152 | ) 153 | 154 | except FileNotFoundError as e: 155 | system_ = platform.system() 156 | abs_path = os.path.abspath(file_path) 157 | 158 | if system_ == "Windows" and len(abs_path) > 256: 159 | raise EnvironmentError( 160 | f"Absolute path length is greater than 256 symbols:\n" 161 | f"{abs_path}\n" 162 | f"To remove this restriction you can use this guide: " 163 | f"https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation#enable-long-paths-in-windows-10-version-1607-and-later " 164 | ) 165 | else: 166 | raise Exception( 167 | f"Cannot write to file.\n" 168 | f"Path: {abs_path}\n" 169 | f"Details: {e.strerror}" 170 | ) 171 | 172 | return schema_dict 173 | -------------------------------------------------------------------------------- /swagger_coverage_py/results_writers/openapi_schemas_manager.py: -------------------------------------------------------------------------------- 1 | from requests import Response 2 | 3 | from swagger_coverage_py.configs import API_DOCS_TYPE, API_DOCS_VERSION 4 | from swagger_coverage_py.results_writers.base_schemas_manager import ApiDocsManagerBase 5 | from swagger_coverage_py.uri import URI 6 | 7 | 8 | class OpenApiSchemasManager(ApiDocsManagerBase): 9 | def __init__(self, uri: URI, method: str, response: Response, kwargs: dict): 10 | super().__init__(uri, response, kwargs, method) 11 | 12 | def _paths(self): 13 | path_ = self._uri.raw.split("?")[0] 14 | params = ( 15 | self._get_path_params() 16 | + self._get_query_params() 17 | + self._get_header_params() 18 | ) 19 | dict_ = { 20 | path_: { 21 | self._method: { 22 | "parameters": params, 23 | "responses": {self._response.status_code: {}}, 24 | } 25 | } 26 | } 27 | 28 | body_params = self._get_body_params() 29 | if body_params: 30 | dict_[path_][self._method]["requestBody"] = body_params 31 | return dict_ 32 | 33 | def _get_schema(self): 34 | schema_dict = { 35 | API_DOCS_TYPE: API_DOCS_VERSION, 36 | "info": {"title": "Recorded Request"}, 37 | "paths": self._paths(), 38 | } 39 | return schema_dict 40 | -------------------------------------------------------------------------------- /swagger_coverage_py/results_writers/swagger_schemas_manager.py: -------------------------------------------------------------------------------- 1 | import re 2 | from typing import List 3 | 4 | from requests import Response 5 | 6 | from swagger_coverage_py.configs import API_DOCS_TYPE, API_DOCS_VERSION 7 | from swagger_coverage_py.results_writers.base_schemas_manager import ApiDocsManagerBase 8 | from swagger_coverage_py.uri import URI 9 | 10 | 11 | class SwaggerSchemasManager(ApiDocsManagerBase): 12 | def __init__(self, uri: URI, method: str, response: Response, kwargs: dict): 13 | super().__init__(uri, response, kwargs, method) 14 | self._uri = uri 15 | self.__response = response 16 | 17 | def __host(self): 18 | return self._uri.host 19 | 20 | def __schema(self) -> List[str]: 21 | return [re.match(r"(^\w*):", self._uri.host).group(1)] 22 | 23 | def __consumes(self) -> list: 24 | return [self.__response.request.headers.get("content-type", "")] 25 | 26 | def __produces(self) -> list: 27 | return [self.__response.headers.get("content-type", "")] 28 | 29 | def _paths(self): 30 | path_ = self._uri.raw.split("?")[0] 31 | params = ( 32 | self._get_path_params() 33 | + self._get_query_params() 34 | + self._get_body_params() 35 | + self._get_header_params() 36 | ) 37 | dict_ = { 38 | path_: { 39 | self._method: { 40 | "parameters": params, 41 | "responses": {self.__response.status_code: {}}, 42 | } 43 | } 44 | } 45 | return dict_ 46 | 47 | def _get_schema(self): 48 | schema_dict = { 49 | API_DOCS_TYPE: API_DOCS_VERSION, 50 | "host": self.__host(), 51 | "schemes": self.__schema(), 52 | "consumes": self.__consumes(), 53 | "produces": self.__produces(), 54 | "paths": self._paths(), 55 | } 56 | return schema_dict 57 | -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/bin/swagger-coverage-commandline: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # swagger-coverage-commandline start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh swagger-coverage-commandline 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and SWAGGER_COVERAGE_COMMANDLINE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | APP_HOME=$( cd "${APP_HOME:-./}.." && pwd -P ) || exit 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and SWAGGER_COVERAGE_COMMANDLINE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS="" 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/lib/swagger-coverage-commandline-1.0-SNAPSHOT.jar:$APP_HOME/lib/swagger-coverage-commons-1.0-SNAPSHOT.jar:$APP_HOME/lib/swagger-parser-2.0.32.jar:$APP_HOME/lib/logback-classic-1.2.10.jar:$APP_HOME/lib/swagger-parser-v2-converter-2.0.32.jar:$APP_HOME/lib/swagger-compat-spec-parser-1.0.59.jar:$APP_HOME/lib/swagger-parser-1.0.59.jar:$APP_HOME/lib/swagger-core-1.6.6.jar:$APP_HOME/lib/swagger-models-1.6.6.jar:$APP_HOME/lib/swagger-parser-v3-2.0.32.jar:$APP_HOME/lib/swagger-core-2.2.0.jar:$APP_HOME/lib/slf4j-api-1.7.32.jar:$APP_HOME/lib/jcommander-1.81.jar:$APP_HOME/lib/spring-web-5.3.7.jar:$APP_HOME/lib/freemarker-2.3.31.jar:$APP_HOME/lib/swagger-parser-core-2.0.32.jar:$APP_HOME/lib/swagger-models-2.2.0.jar:$APP_HOME/lib/jackson-datatype-jsr310-2.9.8.jar:$APP_HOME/lib/jackson-annotations-2.12.3.jar:$APP_HOME/lib/jackson-dataformat-yaml-2.12.3.jar:$APP_HOME/lib/json-patch-1.13.jar:$APP_HOME/lib/json-schema-validator-2.2.14.jar:$APP_HOME/lib/json-schema-core-1.2.14.jar:$APP_HOME/lib/jackson-coreutils-equivalence-1.0.jar:$APP_HOME/lib/jackson-coreutils-2.0.jar:$APP_HOME/lib/jackson-databind-2.12.3.jar:$APP_HOME/lib/jackson-core-2.12.3.jar:$APP_HOME/lib/commons-io-2.11.0.jar:$APP_HOME/lib/logback-core-1.2.10.jar:$APP_HOME/lib/spring-beans-5.3.7.jar:$APP_HOME/lib/spring-core-5.3.7.jar:$APP_HOME/lib/swagger-annotations-1.6.6.jar:$APP_HOME/lib/jakarta.xml.bind-api-2.3.2.jar:$APP_HOME/lib/commons-lang3-3.12.0.jar:$APP_HOME/lib/swagger-annotations-2.2.0.jar:$APP_HOME/lib/jakarta.validation-api-2.0.2.jar:$APP_HOME/lib/snakeyaml-1.27.jar:$APP_HOME/lib/spring-jcl-5.3.7.jar:$APP_HOME/lib/jakarta.activation-api-1.2.1.jar:$APP_HOME/lib/uri-template-0.10.jar:$APP_HOME/lib/guava-31.0.1-android.jar:$APP_HOME/lib/validation-api-1.1.0.Final.jar:$APP_HOME/lib/httpclient-4.5.13.jar:$APP_HOME/lib/failureaccess-1.0.1.jar:$APP_HOME/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:$APP_HOME/lib/msg-simple-1.2.jar:$APP_HOME/lib/btf-1.3.jar:$APP_HOME/lib/jsr305-3.0.2.jar:$APP_HOME/lib/checker-qual-3.12.0.jar:$APP_HOME/lib/checker-compat-qual-2.5.5.jar:$APP_HOME/lib/error_prone_annotations-2.7.1.jar:$APP_HOME/lib/j2objc-annotations-1.3.jar:$APP_HOME/lib/mailapi-1.6.2.jar:$APP_HOME/lib/joda-time-2.10.5.jar:$APP_HOME/lib/libphonenumber-8.11.1.jar:$APP_HOME/lib/jopt-simple-5.0.4.jar:$APP_HOME/lib/httpcore-4.4.13.jar:$APP_HOME/lib/commons-logging-1.2.jar:$APP_HOME/lib/commons-codec-1.11.jar:$APP_HOME/lib/rhino-1.7.7.2.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 147 | # shellcheck disable=SC3045 148 | MAX_FD=$( ulimit -H -n ) || 149 | warn "Could not query maximum file descriptor limit" 150 | esac 151 | case $MAX_FD in #( 152 | '' | soft) :;; #( 153 | *) 154 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 155 | # shellcheck disable=SC3045 156 | ulimit -n "$MAX_FD" || 157 | warn "Could not set maximum file descriptor limit to $MAX_FD" 158 | esac 159 | fi 160 | 161 | # Collect all arguments for the java command, stacking in reverse order: 162 | # * args from the command line 163 | # * the main class name 164 | # * -classpath 165 | # * -D...appname settings 166 | # * --module-path (only if needed) 167 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and SWAGGER_COVERAGE_COMMANDLINE_OPTS environment variables. 168 | 169 | # For Cygwin or MSYS, switch paths to Windows format before running java 170 | if "$cygwin" || "$msys" ; then 171 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 172 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 173 | 174 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 175 | 176 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 177 | for arg do 178 | if 179 | case $arg in #( 180 | -*) false ;; # don't mess with options #( 181 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 182 | [ -e "$t" ] ;; #( 183 | *) false ;; 184 | esac 185 | then 186 | arg=$( cygpath --path --ignore --mixed "$arg" ) 187 | fi 188 | # Roll the args list around exactly as many times as the number of 189 | # args, so each arg winds up back in the position where it started, but 190 | # possibly modified. 191 | # 192 | # NB: a `for` loop captures its iteration list before it begins, so 193 | # changing the positional parameters here affects neither the number of 194 | # iterations, nor the values presented in `arg`. 195 | shift # remove old arg 196 | set -- "$@" "$arg" # push replacement arg 197 | done 198 | fi 199 | 200 | # Collect all arguments for the java command; 201 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $SWAGGER_COVERAGE_COMMANDLINE_OPTS can contain fragments of 202 | # shell script including quotes and variable substitutions, so put them in 203 | # double quotes to make sure that they get re-expanded; and 204 | # * put everything else in single quotes, so that it's not re-expanded. 205 | 206 | set -- \ 207 | -classpath "$CLASSPATH" \ 208 | com.github.viclovsky.swagger.coverage.CommandLine \ 209 | "$@" 210 | 211 | # Stop when "xargs" is not available. 212 | if ! command -v xargs >/dev/null 2>&1 213 | then 214 | die "xargs is not available" 215 | fi 216 | 217 | # Use "xargs" to parse quoted args. 218 | # 219 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 220 | # 221 | # In Bash we could simply go: 222 | # 223 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 224 | # set -- "${ARGS[@]}" "$@" 225 | # 226 | # but POSIX shell has neither arrays nor command substitution, so instead we 227 | # post-process each arg (as a line of input to sed) to backslash-escape any 228 | # character that might be a shell metacharacter, then use eval to reverse 229 | # that process (while maintaining the separation between arguments), and wrap 230 | # the whole thing up as a single "set" statement. 231 | # 232 | # This will of course break if any of these variables contains a newline or 233 | # an unmatched quote. 234 | # 235 | 236 | eval "set -- $( 237 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $SWAGGER_COVERAGE_COMMANDLINE_OPTS" | 238 | xargs -n1 | 239 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 240 | tr '\n' ' ' 241 | )" '"$@"' 242 | 243 | exec "$JAVACMD" "$@" 244 | -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/bin/swagger-coverage-commandline.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem swagger-coverage-commandline startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME%.. 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and SWAGGER_COVERAGE_COMMANDLINE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS= 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 48 | echo. 49 | echo Please set the JAVA_HOME variable in your environment to match the 50 | echo location of your Java installation. 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 62 | echo. 63 | echo Please set the JAVA_HOME variable in your environment to match the 64 | echo location of your Java installation. 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\lib\swagger-coverage-commandline-1.0-SNAPSHOT.jar;%APP_HOME%\lib\swagger-coverage-commons-1.0-SNAPSHOT.jar;%APP_HOME%\lib\swagger-parser-2.0.32.jar;%APP_HOME%\lib\logback-classic-1.2.10.jar;%APP_HOME%\lib\swagger-parser-v2-converter-2.0.32.jar;%APP_HOME%\lib\swagger-compat-spec-parser-1.0.59.jar;%APP_HOME%\lib\swagger-parser-1.0.59.jar;%APP_HOME%\lib\swagger-core-1.6.6.jar;%APP_HOME%\lib\swagger-models-1.6.6.jar;%APP_HOME%\lib\swagger-parser-v3-2.0.32.jar;%APP_HOME%\lib\swagger-core-2.2.0.jar;%APP_HOME%\lib\slf4j-api-1.7.32.jar;%APP_HOME%\lib\jcommander-1.81.jar;%APP_HOME%\lib\spring-web-5.3.7.jar;%APP_HOME%\lib\freemarker-2.3.31.jar;%APP_HOME%\lib\swagger-parser-core-2.0.32.jar;%APP_HOME%\lib\swagger-models-2.2.0.jar;%APP_HOME%\lib\jackson-datatype-jsr310-2.9.8.jar;%APP_HOME%\lib\jackson-annotations-2.12.3.jar;%APP_HOME%\lib\jackson-dataformat-yaml-2.12.3.jar;%APP_HOME%\lib\json-patch-1.13.jar;%APP_HOME%\lib\json-schema-validator-2.2.14.jar;%APP_HOME%\lib\json-schema-core-1.2.14.jar;%APP_HOME%\lib\jackson-coreutils-equivalence-1.0.jar;%APP_HOME%\lib\jackson-coreutils-2.0.jar;%APP_HOME%\lib\jackson-databind-2.12.3.jar;%APP_HOME%\lib\jackson-core-2.12.3.jar;%APP_HOME%\lib\commons-io-2.11.0.jar;%APP_HOME%\lib\logback-core-1.2.10.jar;%APP_HOME%\lib\spring-beans-5.3.7.jar;%APP_HOME%\lib\spring-core-5.3.7.jar;%APP_HOME%\lib\swagger-annotations-1.6.6.jar;%APP_HOME%\lib\jakarta.xml.bind-api-2.3.2.jar;%APP_HOME%\lib\commons-lang3-3.12.0.jar;%APP_HOME%\lib\swagger-annotations-2.2.0.jar;%APP_HOME%\lib\jakarta.validation-api-2.0.2.jar;%APP_HOME%\lib\snakeyaml-1.27.jar;%APP_HOME%\lib\spring-jcl-5.3.7.jar;%APP_HOME%\lib\jakarta.activation-api-1.2.1.jar;%APP_HOME%\lib\uri-template-0.10.jar;%APP_HOME%\lib\guava-31.0.1-android.jar;%APP_HOME%\lib\validation-api-1.1.0.Final.jar;%APP_HOME%\lib\httpclient-4.5.13.jar;%APP_HOME%\lib\failureaccess-1.0.1.jar;%APP_HOME%\lib\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;%APP_HOME%\lib\msg-simple-1.2.jar;%APP_HOME%\lib\btf-1.3.jar;%APP_HOME%\lib\jsr305-3.0.2.jar;%APP_HOME%\lib\checker-qual-3.12.0.jar;%APP_HOME%\lib\checker-compat-qual-2.5.5.jar;%APP_HOME%\lib\error_prone_annotations-2.7.1.jar;%APP_HOME%\lib\j2objc-annotations-1.3.jar;%APP_HOME%\lib\mailapi-1.6.2.jar;%APP_HOME%\lib\joda-time-2.10.5.jar;%APP_HOME%\lib\libphonenumber-8.11.1.jar;%APP_HOME%\lib\jopt-simple-5.0.4.jar;%APP_HOME%\lib\httpcore-4.4.13.jar;%APP_HOME%\lib\commons-logging-1.2.jar;%APP_HOME%\lib\commons-codec-1.11.jar;%APP_HOME%\lib\rhino-1.7.7.2.jar 72 | 73 | 74 | @rem Execute swagger-coverage-commandline 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %SWAGGER_COVERAGE_COMMANDLINE_OPTS% -classpath "%CLASSPATH%" com.github.viclovsky.swagger.coverage.CommandLine %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable SWAGGER_COVERAGE_COMMANDLINE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%SWAGGER_COVERAGE_COMMANDLINE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/btf-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/btf-1.3.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/checker-compat-qual-2.5.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/checker-compat-qual-2.5.5.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/checker-qual-3.12.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/checker-qual-3.12.0.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/commons-codec-1.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/commons-codec-1.11.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/commons-codec-1.9.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/commons-codec-1.9.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/commons-io-2.11.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/commons-io-2.11.0.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/commons-io-2.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/commons-io-2.6.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/commons-lang3-3.12.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/commons-lang3-3.12.0.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/commons-lang3-3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/commons-lang3-3.7.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/commons-logging-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/commons-logging-1.2.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/error_prone_annotations-2.3.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/error_prone_annotations-2.3.4.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/error_prone_annotations-2.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/error_prone_annotations-2.7.1.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/failureaccess-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/failureaccess-1.0.1.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/freemarker-2.3.31.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/freemarker-2.3.31.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/guava-28.2-android.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/guava-28.2-android.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/guava-31.0.1-android.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/guava-31.0.1-android.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/httpclient-4.5.13.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/httpclient-4.5.13.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/httpclient-4.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/httpclient-4.5.2.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/httpcore-4.4.13.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/httpcore-4.4.13.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/httpcore-4.4.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/httpcore-4.4.4.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/j2objc-annotations-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/j2objc-annotations-1.3.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/jackson-annotations-2.12.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/jackson-annotations-2.12.3.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/jackson-core-2.12.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/jackson-core-2.12.3.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/jackson-coreutils-2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/jackson-coreutils-2.0.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/jackson-coreutils-equivalence-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/jackson-coreutils-equivalence-1.0.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/jackson-databind-2.12.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/jackson-databind-2.12.3.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/jackson-dataformat-yaml-2.12.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/jackson-dataformat-yaml-2.12.3.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/jackson-datatype-jsr310-2.9.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/jackson-datatype-jsr310-2.9.8.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/jakarta.activation-api-1.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/jakarta.activation-api-1.2.1.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/jakarta.validation-api-2.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/jakarta.validation-api-2.0.2.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/jakarta.xml.bind-api-2.3.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/jakarta.xml.bind-api-2.3.2.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/jcommander-1.81.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/jcommander-1.81.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/joda-time-2.10.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/joda-time-2.10.5.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/jopt-simple-5.0.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/jopt-simple-5.0.4.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/json-patch-1.13.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/json-patch-1.13.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/json-schema-core-1.2.14.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/json-schema-core-1.2.14.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/json-schema-validator-2.2.14.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/json-schema-validator-2.2.14.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/jsr305-3.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/jsr305-3.0.2.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/libphonenumber-8.11.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/libphonenumber-8.11.1.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/logback-classic-1.2.10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/logback-classic-1.2.10.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/logback-core-1.2.10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/logback-core-1.2.10.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/mailapi-1.6.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/mailapi-1.6.2.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/msg-simple-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/msg-simple-1.2.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/rhino-1.7.7.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/rhino-1.7.7.2.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/slf4j-api-1.7.32.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/slf4j-api-1.7.32.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/slf4j-ext-1.7.28.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/slf4j-ext-1.7.28.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/snakeyaml-1.27.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/snakeyaml-1.27.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/spring-beans-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/spring-beans-5.3.7.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/spring-core-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/spring-core-5.3.7.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/spring-jcl-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/spring-jcl-5.3.7.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/spring-web-5.3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/spring-web-5.3.7.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-annotations-1.6.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-annotations-1.6.2.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-annotations-1.6.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-annotations-1.6.6.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-annotations-2.1.10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-annotations-2.1.10.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-annotations-2.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-annotations-2.2.0.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-compat-spec-parser-1.0.54.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-compat-spec-parser-1.0.54.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-compat-spec-parser-1.0.59.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-compat-spec-parser-1.0.59.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-core-1.6.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-core-1.6.2.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-core-1.6.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-core-1.6.6.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-core-2.1.10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-core-2.1.10.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-core-2.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-core-2.2.0.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-coverage-commandline-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-coverage-commandline-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-coverage-commons-1.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-coverage-commons-1.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-models-1.6.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-models-1.6.2.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-models-1.6.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-models-1.6.6.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-models-2.1.10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-models-2.1.10.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-models-2.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-models-2.2.0.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-1.0.54.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-1.0.54.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-1.0.59.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-1.0.59.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-2.0.25.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-2.0.25.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-2.0.32.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-2.0.32.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-core-2.0.25.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-core-2.0.25.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-core-2.0.32.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-core-2.0.32.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-v2-converter-2.0.25.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-v2-converter-2.0.25.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-v2-converter-2.0.32.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-v2-converter-2.0.32.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-v3-2.0.25.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-v3-2.0.25.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-v3-2.0.32.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/swagger-parser-v3-2.0.32.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/uri-template-0.10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/uri-template-0.10.jar -------------------------------------------------------------------------------- /swagger_coverage_py/swagger-coverage-commandline/lib/validation-api-1.1.0.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JamalZeynalov/swagger-coverage-py/5c14e5bd3c782d5a1cc14c40007118bec3aa1692/swagger_coverage_py/swagger-coverage-commandline/lib/validation-api-1.1.0.Final.jar -------------------------------------------------------------------------------- /swagger_coverage_py/uri.py: -------------------------------------------------------------------------------- 1 | class URI: 2 | def __init__(self, host: str, base_path, unformatted_path: str, **uri_params): 3 | self.host = host 4 | self.formatted = base_path + unformatted_path.format(**uri_params) 5 | self.full = f"{self.host}{self.formatted}" 6 | self.raw = unformatted_path 7 | self.uri_params: dict = uri_params 8 | --------------------------------------------------------------------------------