【发布时间】:2021-12-11 16:08:57
【问题描述】:
在我的模型中,我有必需的属性,但是当我从前面提出请求时,我收到一个错误,例如“不应该有其他属性”的必填字段。你能帮帮我吗?
型号:
import {Entity, model, property} from '@loopback/repository';
@model()
export class InternalProjectServiceType extends Entity {
@property({
type: 'string',
id: true,
generated: true,
})
id?: string;
@property({
type: 'string',
required: true,
})
internalProjectId: string;
@property({
type: 'string',
})
serviceTypeId?: string;
constructor(data?: Partial<InternalProjectServiceType>) {
super(data);
}
}
export interface InternalProjectServiceTypeRelations {
// describe navigational properties here
}
export type InternalProjectServiceTypeWithRelations = InternalProjectServiceType & InternalProjectServiceTypeRelations;
【问题讨论】: