payload: {"action":"closed","issue":{"url":"https://api.github.com/repos/strongloop/loopback-next/issues/2684","repository_url":"https://api.github.com/repos/strongloop/loopback-next","labels_url":"https://api.github.com/repos/strongloop/loopback-next/issues/2684/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-next/issues/2684/comments","events_url":"https://api.github.com/repos/strongloop/loopback-next/issues/2684/events","html_url":"https://github.com/strongloop/loopback-next/issues/2684","id":428864234,"node_id":"MDU6SXNzdWU0Mjg4NjQyMzQ=","number":2684,"title":"Refactor metaToJsonProperty to accept AJV keywords","user":{"login":"iqbaldjulfri","id":11365169,"node_id":"MDQ6VXNlcjExMzY1MTY5","avatar_url":"https://avatars2.githubusercontent.com/u/11365169?v=4","gravatar_id":"","url":"https://api.github.com/users/iqbaldjulfri","html_url":"https://github.com/iqbaldjulfri","followers_url":"https://api.github.com/users/iqbaldjulfri/followers","following_url":"https://api.github.com/users/iqbaldjulfri/following{/other_user}","gists_url":"https://api.github.com/users/iqbaldjulfri/gists{/gist_id}","starred_url":"https://api.github.com/users/iqbaldjulfri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iqbaldjulfri/subscriptions","organizations_url":"https://api.github.com/users/iqbaldjulfri/orgs","repos_url":"https://api.github.com/users/iqbaldjulfri/repos","events_url":"https://api.github.com/users/iqbaldjulfri/events{/privacy}","received_events_url":"https://api.github.com/users/iqbaldjulfri/received_events","type":"User","site_admin":false},"labels":[{"id":753598385,"node_id":"MDU6TGFiZWw3NTM1OTgzODU=","url":"https://api.github.com/repos/strongloop/loopback-next/labels/Validation","name":"Validation","color":"fcc53a","default":false},{"id":779763959,"node_id":"MDU6TGFiZWw3Nzk3NjM5NTk=","url":"https://api.github.com/repos/strongloop/loopback-next/labels/community-contribution","name":"community-contribution","color":"77d11d","default":false}],"state":"closed","locked":false,"assignee":{"login":"iqbaldjulfri","id":11365169,"node_id":"MDQ6VXNlcjExMzY1MTY5","avatar_url":"https://avatars2.githubusercontent.com/u/11365169?v=4","gravatar_id":"","url":"https://api.github.com/users/iqbaldjulfri","html_url":"https://github.com/iqbaldjulfri","followers_url":"https://api.github.com/users/iqbaldjulfri/followers","following_url":"https://api.github.com/users/iqbaldjulfri/following{/other_user}","gists_url":"https://api.github.com/users/iqbaldjulfri/gists{/gist_id}","starred_url":"https://api.github.com/users/iqbaldjulfri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iqbaldjulfri/subscriptions","organizations_url":"https://api.github.com/users/iqbaldjulfri/orgs","repos_url":"https://api.github.com/users/iqbaldjulfri/repos","events_url":"https://api.github.com/users/iqbaldjulfri/events{/privacy}","received_events_url":"https://api.github.com/users/iqbaldjulfri/received_events","type":"User","site_admin":false},"assignees":[{"login":"iqbaldjulfri","id":11365169,"node_id":"MDQ6VXNlcjExMzY1MTY5","avatar_url":"https://avatars2.githubusercontent.com/u/11365169?v=4","gravatar_id":"","url":"https://api.github.com/users/iqbaldjulfri","html_url":"https://github.com/iqbaldjulfri","followers_url":"https://api.github.com/users/iqbaldjulfri/followers","following_url":"https://api.github.com/users/iqbaldjulfri/following{/other_user}","gists_url":"https://api.github.com/users/iqbaldjulfri/gists{/gist_id}","starred_url":"https://api.github.com/users/iqbaldjulfri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iqbaldjulfri/subscriptions","organizations_url":"https://api.github.com/users/iqbaldjulfri/orgs","repos_url":"https://api.github.com/users/iqbaldjulfri/repos","events_url":"https://api.github.com/users/iqbaldjulfri/events{/privacy}","received_events_url":"https://api.github.com/users/iqbaldjulfri/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2019-04-03T16:31:32Z","updated_at":"2019-04-09T00:53:10Z","closed_at":"2019-04-09T00:53:10Z","author_association":"CONTRIBUTOR","body":"## Description\r\nWe need to add additional attributes ([AJV keywords](https://ajv.js.org/keywords.html)) 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).\r\n\r\n## Current Behavior\r\n```ts\r\n@model()\r\nexport class Employee extends Entity {\r\n  @property({\r\n    type: 'string',\r\n    required: true,\r\n    format: 'email', // this won't be written to openapi.json\r\n  })\r\n  email: string;\r\n\r\n  @property({\r\n    type: 'string',\r\n    required: true,\r\n    pattern: '(staff|manager|director)', // this also won't be written to openapi spec\r\n  })\r\n  type: string;\r\n}\r\n```\r\n\r\n## Expected Behavior\r\nOther AJV keywords is written to openapi spec"}}
other: {"actor":{"display_login":"iqbaldjulfri"}}