API平台中的OpenAPI上下文(USECase:Anyof)



oke我在API平台中的OpenAPII V3 Doc中所引用的使用中有点丢失。

现在,根据API平台文档,我们可以在OpenAPI上下文上传递如下

 * @ApiProperty(
 *     attributes={
 *         "openapi_context"={
 *             "type"="string",
 *             "enum"={"one", "two"},
 *             "example"="one"
 *         }
 *     }
 * )

不幸的是,我找不到有关使用任何人的文档(或示例)。现在遵循Previeus示例,我希望它是

的线条
* @ApiProperty(
 *     attributes={
 *         "openapi_context"={
 *             "anyOf"={
 *                  "type"="string",
 *                  "type"="url",
 *                  "type"="base64"
 *             },
 *             "example"="one"
 *         }
 *     }
 * )

不幸的是不起作用。

此外,尚不清楚如何给出一个示例,描述等。

如果对来这里的人有任何用途,以下php 8属性可以工作:

#[ApiProperty(openapiContext: [
    'anyOf' => [
        ['type' => 'string'],
        ['type' => 'url'],
        ['type' => 'base64'],
    ]
])]

最新更新