{"action":"created","issue":{"url":"https://api.github.com/repos/raml-org/raml-spec/issues/593","repository_url":"https://api.github.com/repos/raml-org/raml-spec","labels_url":"https://api.github.com/repos/raml-org/raml-spec/issues/593/labels{/name}","comments_url":"https://api.github.com/repos/raml-org/raml-spec/issues/593/comments","events_url":"https://api.github.com/repos/raml-org/raml-spec/issues/593/events","html_url":"https://github.com/raml-org/raml-spec/issues/593","id":200670956,"number":593,"title":"User defined annotations on type properties","user":{"login":"peterdmv","id":20562905,"avatar_url":"https://avatars.githubusercontent.com/u/20562905?v=3","gravatar_id":"","url":"https://api.github.com/users/peterdmv","html_url":"https://github.com/peterdmv","followers_url":"https://api.github.com/users/peterdmv/followers","following_url":"https://api.github.com/users/peterdmv/following{/other_user}","gists_url":"https://api.github.com/users/peterdmv/gists{/gist_id}","starred_url":"https://api.github.com/users/peterdmv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterdmv/subscriptions","organizations_url":"https://api.github.com/users/peterdmv/orgs","repos_url":"https://api.github.com/users/peterdmv/repos","events_url":"https://api.github.com/users/peterdmv/events{/privacy}","received_events_url":"https://api.github.com/users/peterdmv/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-13T16:42:21Z","updated_at":"2017-01-23T12:43:12Z","closed_at":null,"body":"Hi,\r\n\r\nI'm investigating the feasibility of moving our REST API definition from RAML 0.8 to 1.0. In the current implementation of our service, we are using JSON schemas for validation on the server side and also for documentation (raml2html). \r\nWe've added semantic information (**description**) to the properties of our schemas to help our users to build their REST clients. See an example below:\r\n\r\nSchema:\r\n```\r\n{\r\n  \"$schema\": \"http://json-schema.org/draft-04/schema\",\r\n  \"id\": \"file://schema/Example#\",\r\n  \"title\": \"Example\",\r\n  \"description\":\"Definition of an Example\",\r\n  \"type\": \"object\",\r\n  \"properties\": {\r\n    \"field1\": {\r\n      \"description\":\"A short human readable string.\",\r\n      \"type\": \"string\",\r\n      \"pattern\": \"^[^,= \\n\\t+<>#;\\\\*\\\"]+$\"\r\n    }\r\n   ...\r\n}\r\n```\r\nMessage:\r\n```\r\n{\r\n  \"field1\": \"Lorem ipsum\",\r\n  ...\r\n}\r\n```\r\n\r\nWe would like to add the same documentation to the properties using the new type system. Is there any way to do this with RAML 1.0? According to the RAML 1.0 specification annotations can only be added to specific target locations:\r\n\r\n> Annotations can also be used to add properties to the built-in RAML nodes in certain locations within the RAML specification.\r\n\r\nand\r\n\r\n> The location within an API specification where annotations can be applied MUST be one of the target locations in the following Target Locations table. The targets are the locations themselves, not sub-properties within the locations;\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/raml-org/raml-spec/issues/comments/274478925","html_url":"https://github.com/raml-org/raml-spec/issues/593#issuecomment-274478925","issue_url":"https://api.github.com/repos/raml-org/raml-spec/issues/593","id":274478925,"user":{"login":"sichvoge","id":498114,"avatar_url":"https://avatars.githubusercontent.com/u/498114?v=3","gravatar_id":"","url":"https://api.github.com/users/sichvoge","html_url":"https://github.com/sichvoge","followers_url":"https://api.github.com/users/sichvoge/followers","following_url":"https://api.github.com/users/sichvoge/following{/other_user}","gists_url":"https://api.github.com/users/sichvoge/gists{/gist_id}","starred_url":"https://api.github.com/users/sichvoge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sichvoge/subscriptions","organizations_url":"https://api.github.com/users/sichvoge/orgs","repos_url":"https://api.github.com/users/sichvoge/repos","events_url":"https://api.github.com/users/sichvoge/events{/privacy}","received_events_url":"https://api.github.com/users/sichvoge/received_events","type":"User","site_admin":false},"created_at":"2017-01-23T12:43:12Z","updated_at":"2017-01-23T12:43:12Z","body":"Does that cover what you need?\r\n\r\n```yaml\r\ntypes:\r\n  Example:\r\n    description: Definition of an Example\r\n    type: object\r\n    properties:\r\n      field1:\r\n        description: A short human readable string.\r\n        type: string\r\n        pattern: ^[^,= \\n\\t+<>#;\\\\*\\\"]+$\r\n```"}}
{"actor":{"display_login":"sichvoge"}}