{"action":"created","issue":{"url":"https://api.github.com/repos/raml-org/raml-spec/issues/207","labels_url":"https://api.github.com/repos/raml-org/raml-spec/issues/207/labels{/name}","comments_url":"https://api.github.com/repos/raml-org/raml-spec/issues/207/comments","events_url":"https://api.github.com/repos/raml-org/raml-spec/issues/207/events","html_url":"https://github.com/raml-org/raml-spec/issues/207","id":119464211,"number":207,"title":"Use annotations from libraries without prefix","user":{"login":"oberlies","id":353942,"avatar_url":"https://avatars.githubusercontent.com/u/353942?v=3","gravatar_id":"","url":"https://api.github.com/users/oberlies","html_url":"https://github.com/oberlies","followers_url":"https://api.github.com/users/oberlies/followers","following_url":"https://api.github.com/users/oberlies/following{/other_user}","gists_url":"https://api.github.com/users/oberlies/gists{/gist_id}","starred_url":"https://api.github.com/users/oberlies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oberlies/subscriptions","organizations_url":"https://api.github.com/users/oberlies/orgs","repos_url":"https://api.github.com/users/oberlies/repos","events_url":"https://api.github.com/users/oberlies/events{/privacy}","received_events_url":"https://api.github.com/users/oberlies/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-11-30T10:34:26Z","updated_at":"2015-11-30T16:35:20Z","closed_at":null,"body":"The \"uses\" property is useful for splitting a larger RAML file into smaller, manageable parts. For example, I would like to split out our numerous annotations into a separate RAML file/library. With the current definition of \"uses\", this then forces me to use the annotations with a prefix. This may make sense when using third party annotation libraries, but is unnecessary bloat for our own annotations.\r\n\r\nSo, it should be possible to import a set of annotations from a separate file and still use them without prefix.\r\n\r\nExample:\r\n* annotations.raml:\r\n\r\n        #%RAML 1.0 Library\r\n        \r\n        annotationTypes:\r\n          errors:\r\n            allowedTargets: API\r\n            parameters:\r\n              value: errorMetaType[]\r\n          errorResponses:\r\n            allowedTargets: Method\r\n            parameters:\r\n              codes: string[]\r\n        types:\r\n          errorMetaType:\r\n            type: object\r\n            properties:\r\n              httpStatus: string\r\n              description: string\r\n\r\n* api.raml (current syntax):\r\n\r\n        #%RAML 1.0\r\n        title: \"\"\r\n        uses:\r\n          - annotations: !include annotations.raml\r\n        (annotations.errors):\r\n          value:\r\n            invalidRequestBody:\r\n              httpStatus: badRequest (400)\r\n              description: The request body is not a JSON object\r\n        /resource:\r\n          post:\r\n            description: Creates a new resource\r\n            responses:\r\n              201:\r\n                description: ...\r\n            (annotations.errorResponses):\r\n              codes: [invalidRequestBody]\r\n\r\nIt should be possible to use `(errors)` and `(errorResponses)` in api.raml. Currently this doesn't work."},"comment":{"url":"https://api.github.com/repos/raml-org/raml-spec/issues/comments/160681470","html_url":"https://github.com/raml-org/raml-spec/issues/207#issuecomment-160681470","issue_url":"https://api.github.com/repos/raml-org/raml-spec/issues/207","id":160681470,"user":{"login":"gardea","id":8659307,"avatar_url":"https://avatars.githubusercontent.com/u/8659307?v=3","gravatar_id":"","url":"https://api.github.com/users/gardea","html_url":"https://github.com/gardea","followers_url":"https://api.github.com/users/gardea/followers","following_url":"https://api.github.com/users/gardea/following{/other_user}","gists_url":"https://api.github.com/users/gardea/gists{/gist_id}","starred_url":"https://api.github.com/users/gardea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gardea/subscriptions","organizations_url":"https://api.github.com/users/gardea/orgs","repos_url":"https://api.github.com/users/gardea/repos","events_url":"https://api.github.com/users/gardea/events{/privacy}","received_events_url":"https://api.github.com/users/gardea/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T16:35:19Z","updated_at":"2015-11-30T16:35:19Z","body":"On a personal note, I initially did not appreciate *!include*, if only because the \"reference\" implementation of the parser was not (and still isn't, apparently) capable of pointing out syntax issues correctly (i.e. the context of the file is lost in the merge). I thought then that include/import in XSD was so much better executed. These days, I grew to like seeing people not getting lost in the semantics of it; it simply adds, in an unambiguous way, to the symbol space. I think uses may be a step in the right direction; as long as we don't reintroduce \"namespace\", etc. which proved to be such a misunderstood concept in XML (at least). I would really try to see if problems in scope for RAML could be addressed without namespaces. uses brings it's own issues, still undocumented, which would have to explain how to ensure files are not considered twice in contributing to the symbol space (as it were with special XSD schemas, where well known schemas would point out to local copies of known namespaces, thus creating problems when known schemas were put together in yet another context)."}}