Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Explicitly indicate version of required nelmio/api-doc-bundle #543

Closed
wants to merge 1 commit into from
Closed

Conversation

gam6itko
Copy link
Contributor

@gam6itko gam6itko commented Sep 18, 2019

By default composer installs v3 and this error occurs:

An exception has been thrown during the rendering of a template ("[Semantical Error] The annotation "@nelmio\ApiDocBundle\Annotation\ApiDoc" in method Sonata\NewsBundle\Controller\Api\PostController::getPostsAction() does not exist, or could not be auto-loaded in Sonata\NewsBundle\Controller\Api\PostController (which is being imported from "/www/config/routes/routes.yaml").").

... and this error occurs
```
An exception has been thrown during the rendering of a template ("[Semantical Error] The annotation "@nelmio\ApiDocBundle\Annotation\ApiDoc" in method Sonata\NewsBundle\Controller\Api\PostController::getPostsAction() does not exist, or could not be auto-loaded in Sonata\NewsBundle\Controller\Api\PostController (which is being imported from "/www/config/routes/routes.yaml").").
```
@gam6itko gam6itko changed the title By default composer installs v3.* Explicitly indicate version of required nelmio/api-doc-bundle Sep 18, 2019
Copy link
Member

@core23 core23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of locking the docs to a specific version, you could add a conflict to the composer.json file. So the docs are always valid, regardless which minor/major version we need.

@gam6itko
Copy link
Contributor Author

gam6itko commented Sep 18, 2019

You mean something like this?

"conflict": {
    "doctrine/dbal": "<2.6.0",
    "friendsofsymfony/rest-bundle": "<1.8 || >=3.0",
    "jms/serializer": "<0.13",
    "sonata-project/block-bundle": "<3.18",
    "sonata-project/doctrine-orm-admin-bundle": "<3.0 || >=4.0",
    "sonata-project/notification-bundle": "<3.0 || >=4.0",
    "sonata-project/seo-bundle": "<2.0 || >=3.0",
    "nelmio/api-doc-bundle": "<2.0 || >=3.0"
},

@core23
Copy link
Member

core23 commented Sep 18, 2019

Exactly 👍

@gam6itko gam6itko closed this Sep 18, 2019
@gam6itko gam6itko deleted the patch-1 branch September 18, 2019 15:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants