From db238f2f9a8cf37471479834db5ed7fb80f5dba7 Mon Sep 17 00:00:00 2001 From: natsuki ueda Date: Tue, 4 Feb 2025 13:28:04 +0900 Subject: [PATCH 1/2] add in faq --- docs/guide/faq.md | 33 ++++++++-------------- docs/snippets/guide/faq/dummy_class_an.php | 21 ++++++++++++++ docs/snippets/guide/faq/dummy_class_at.php | 18 ++++++++++++ 3 files changed, 51 insertions(+), 21 deletions(-) create mode 100644 docs/snippets/guide/faq/dummy_class_an.php create mode 100644 docs/snippets/guide/faq/dummy_class_at.php diff --git a/docs/guide/faq.md b/docs/guide/faq.md index 87bf9d962..37fcc92dd 100644 --- a/docs/guide/faq.md +++ b/docs/guide/faq.md @@ -24,27 +24,18 @@ related code, the info annotation (and a few more) is kind of global. The simplest solution to avoid this issue is to add a 'dummy' class to the docblock and add all 'global' annotations (e.g. `Tag`, `Server`, `SecurityScheme`, etc.) **in a single docblock** to that class. -```php -/** - * @OA\Tag( - * name="user", - * description="User related operations" - * ) - * @OA\Info( - * version="1.0", - * title="Example API", - * description="Example info", - * @OA\Contact(name="Swagger API Team") - * ) - * @OA\Server( - * url="https://example.localhost", - * description="API server" - * ) - */ -class OpenApiSpec -{ -} -``` + + + + **As of version 4.8 the `doctrine/annotations` library is optional and might cause the same message.** diff --git a/docs/snippets/guide/faq/dummy_class_an.php b/docs/snippets/guide/faq/dummy_class_an.php new file mode 100644 index 000000000..7df8deb56 --- /dev/null +++ b/docs/snippets/guide/faq/dummy_class_an.php @@ -0,0 +1,21 @@ + Date: Tue, 11 Feb 2025 14:44:25 +0900 Subject: [PATCH 2/2] OAT to OA --- docs/snippets/guide/faq/dummy_class_at.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/snippets/guide/faq/dummy_class_at.php b/docs/snippets/guide/faq/dummy_class_at.php index 7e1a9ec92..3d1b0e9af 100644 --- a/docs/snippets/guide/faq/dummy_class_at.php +++ b/docs/snippets/guide/faq/dummy_class_at.php @@ -1,15 +1,15 @@