[英]Group exclusion in Nelmio Api Doc does not work After updating composer
我将参数设置为数组,如http://jmsyst.com/libs/serializer/master/reference/annotations 中所述
class QuestionAnswer
{
/**
* @JMS\Type("ArrayCollection<Rest\Bundle\Entity\Fixture\QuestionOptions>")
* @Groups({"QuestionAnswer"})
*/
public $question_options_array ;
}
并在另一个类中定义一些选项
class QuestionOptions
{
/**
* @JMS\Type("integer")
* @Groups({"get_option"})
*/
public $question_option_id ;
/**
* @JMS\Type("string")
* @Groups({"post_option"})
*/
public $question_option_description;
}
在@ApiDoc 我定义
* input={
* "class" = "Rest\BeautyBundle\Entity\Fixture\ProfileQuestionAnswer",
* "groups"={"QuestionAnswer", "get_option"},
* },
在更新之前它运行良好。 但是在composer update
只有“QuestionAnswer”组名有效,它显示了 QuestionOptions 类的所有属性。 如何按照更新前的方式提交数组中的属性?
哇很奇怪。 我过去发生过类似的事情,似乎是一个API问题。 代码端没有任何东西可供我们的开发人员使用。 没有人找到解决方法或修复。
marcin-jozwikowski 于 2020 年 11 月 25 日发表评论
好的,我成功了! 答案和它一样古老:清除缓存。 至少在我的情况下是这样。 Serializer 手册中还要求安装
sensio/framework-extra-bundle
但没有它对我sensio/framework-extra-bundle
。
原评论: https : //github.com/nelmio/NelmioApiDocBundle/issues/1167#issuecomment-733909426
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.