我对我的 Swagger YAML 文件感到困惑,我 99% 肯定是正确的,但显然不是,但不确定问题可能出在哪里:
/**
* @openapi
* components:
* schemas:
* ViewMedicationDto:
* type: array
* items:
* type: object
* properties:
* _type:
* type: string
* id:
* type: string
* pui:
* type: string
* medicationType:
* type: string
* tradeName:
* type: string
* medicationTags: []
* createdOn:
* type: string
* updatedOn:
* type: string
* example:
* - _type: ViewMedicationDto
* id: 61ae82c8f95692912cc423ed
* pui: test_danielcortes_821205_59909
* medicationType: Rescue
* tradeName: Accolate
* medicationTags: [ [Object], [Object] ]
* createdOn: 2021-12-06T21:38:16.359Z
* updatedOn: 2021-12-06T21:38:16.359Z
*/
export class ViewMedicationDto implements DtoInterface {
readonly _type = 'ViewMedicationDto';
readonly id: ID
readonly pui: string
readonly medicationType: MedicationType
readonly tradeName: string
readonly medicationTags?: ITag[]
readonly createdOn?: Date
readonly updatedOn?: Date
constructor(id: ID, pui: string,
medicationType: MedicationType, tradeName: string,
medicationTags?: ITag[],
createdOn?: Date, updatedOn?: Date) {
this.id = id
this.pui = pui
this.medicationType = medicationType
this.tradeName = tradeName
this.medicationTags = medicationTags
this.createdOn = createdOn
this.updatedOn = updatedOn
}
}
我认为这是medicationTags
问题所在,但是当我删除它时,它不会呈现静止状态。
更新
我试图像这样遵循以下解决方案:
/**
* @openapi
* components:
* schemas:
* ViewMedicationDto:
* type: array
* items:
* type: object
* properties:
* _type:
* type: string
* id:
* type: string
* pui:
* type: string
* medicationType:
* type: string
* tradeName:
* type: string
* medicationTags:
* type: array
* items:
* type: object
* createdOn:
* type: string
* updatedOn:
* type: string
* example:
* _type: ViewMedicationDto
* id: 61ae82c8f95692912cc423ed
* pui: test_danielcortes_821205_59909
* medicationType: Rescue
* tradeName: Accolate
* medicationTags: [{}, {}]
* createdOn: 2021-12-06T21:38:16.359Z
* updatedOn: 2021-12-06T21:38:16.359Z
*/