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 @@ +