-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
Description
We need to add additional attributes (AJV keywords) from PropertyDefinition so they will be written to openapi.json and we can use it as validation. Currently, only type, description, items (for arrays), and $ref are written (and a hard-coded format: 'date-time' for Date instances).
Current Behavior
@model()
export class Employee extends Entity {
@property({
type: 'string',
required: true,
format: 'email', // this won't be written to openapi.json
})
email: string;
@property({
type: 'string',
required: true,
pattern: '(staff|manager|director)', // this also won't be written to openapi spec
})
type: string;
}Expected Behavior
Other AJV keywords is written to openapi spec