From 764294369829eb3f094b32a906297558ec8398b2 Mon Sep 17 00:00:00 2001 From: Martin Rademacher Date: Thu, 26 Sep 2024 13:45:44 +1200 Subject: [PATCH] Add example of using `-b` to basic CLI example (#1659) --- docs/guide/generating-openapi-documents.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/guide/generating-openapi-documents.md b/docs/guide/generating-openapi-documents.md index bcf7cf3a..92fa204b 100644 --- a/docs/guide/generating-openapi-documents.md +++ b/docs/guide/generating-openapi-documents.md @@ -15,6 +15,17 @@ the tool will use the file extension to determine the format. The `--format` option can be used to force a specific format. ::: +::: tip Bootstrap +The bootstrap option `-b` is useful when trying to use `swagger-php` without proper autoloading. + +For example, you might want to evaluate the library using a single file with just a few annotations. In this case telling swagger-php to bootstrap (pre-load) the file prior to processing it will ensure PHP's `reflection` code will be able to inspect your code. + +```shell +> ./vendor/bin/openapi -b my_file.php my_file.php +``` +::: + + For a list of all available options use the `-h` option ```shell