(这是我的第一个堆栈溢出帖子,所以请放轻松,哈哈)
我正在使用:
-OpenApi (v3)
-L5-Swagger(swagger-php 和 swagger-ui 的包装器)
我正在使用注释来生成 OpenAPI 规范。正在从控制台生成规范,没有错误。但是,在每个模型的每个属性中,一旦生成,就会添加一个附加属性。
我尝试过:
1. 重写模型,
2. 以不同方式重写属性
我的模型之一和“id”属性:
/**
* Class ActionPlan
*
* @OA\Schema(
* description="Action Plans",
* title="Action Plan Schema",
* required={
* "id",
* "name",
* "organization_id",
* "assessment_period_id",
* "completed",
* "created_by",
* "updated_by"
* },
* )
*
* @OA\Property(
* property="id",
* type="integer",
* format="int32",
* description="Action Plan ID"
* )
这是正在生成的内容:
"ActionPlan": {
"title": "Action Plan Schema",
"description": "Action Plans",
"required": [
"id",
"name",
"organization_id",
"assessment_period_id",
"completed",
"created_by",
"updated_by"
],
"properties": {
"id": {
"schema": "ActionPlan",
"description": "Action Plan ID",
"type": "integer",
"format": "int32"
},
我在做什么,正在生成一个“模式”属性?
当我将规范文件放入 Swagger 编辑器时,它说 ActionPlan.properties.id 不应该有其他属性。附加属性:模式。
我只是想知道创建“模式”属性发生了什么。
提前致谢!