{"action":"created","issue":{"url":"https://api.github.com/repos/raml-org/raml-spec/issues/168","labels_url":"https://api.github.com/repos/raml-org/raml-spec/issues/168/labels{/name}","comments_url":"https://api.github.com/repos/raml-org/raml-spec/issues/168/comments","events_url":"https://api.github.com/repos/raml-org/raml-spec/issues/168/events","html_url":"https://github.com/raml-org/raml-spec/issues/168","id":109022615,"number":168,"title":"New type system should be expressible in simplified YAML-based syntax","user":{"login":"usarid","id":39899,"avatar_url":"https://avatars.githubusercontent.com/u/39899?v=3","gravatar_id":"","url":"https://api.github.com/users/usarid","html_url":"https://github.com/usarid","followers_url":"https://api.github.com/users/usarid/followers","following_url":"https://api.github.com/users/usarid/following{/other_user}","gists_url":"https://api.github.com/users/usarid/gists{/gist_id}","starred_url":"https://api.github.com/users/usarid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usarid/subscriptions","organizations_url":"https://api.github.com/users/usarid/orgs","repos_url":"https://api.github.com/users/usarid/repos","events_url":"https://api.github.com/users/usarid/events{/privacy}","received_events_url":"https://api.github.com/users/usarid/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/raml-org/raml-spec/labels/v1-type-system","name":"v1-type-system","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/raml-org/raml-spec/milestones/1","html_url":"https://github.com/raml-org/raml-spec/milestones/v1.0","labels_url":"https://api.github.com/repos/raml-org/raml-spec/milestones/1/labels","id":769207,"number":1,"title":"v1.0","description":"The 1.0 version of the RESTful API Modeling language. These candidates have been tentatively accepted and are expected to become part of the RAML 1.0 spec by end of October 2015.","creator":{"login":"nohorbee","id":2273179,"avatar_url":"https://avatars.githubusercontent.com/u/2273179?v=3","gravatar_id":"","url":"https://api.github.com/users/nohorbee","html_url":"https://github.com/nohorbee","followers_url":"https://api.github.com/users/nohorbee/followers","following_url":"https://api.github.com/users/nohorbee/following{/other_user}","gists_url":"https://api.github.com/users/nohorbee/gists{/gist_id}","starred_url":"https://api.github.com/users/nohorbee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nohorbee/subscriptions","organizations_url":"https://api.github.com/users/nohorbee/orgs","repos_url":"https://api.github.com/users/nohorbee/repos","events_url":"https://api.github.com/users/nohorbee/events{/privacy}","received_events_url":"https://api.github.com/users/nohorbee/received_events","type":"User","site_admin":false},"open_issues":26,"closed_issues":1,"state":"open","created_at":"2014-08-28T14:53:48Z","updated_at":"2015-10-01T04:26:55Z","due_on":"2015-10-31T07:00:00Z","closed_at":null},"comments":5,"created_at":"2015-09-30T06:24:33Z","updated_at":"2015-10-13T13:23:57Z","closed_at":null,"body":"It should be very easy to express structural constraints on data in a YAML-based syntax that fits with the rest of RAML.\r\n\r\nFor example:\r\n```yaml\r\n#%RAML 1.0\r\ntitle: My API with Types\r\nmediaType: application/json\r\ntypes:\r\n  Person:\r\n    type: object\r\n    properties:\r\n      firstname: string\r\n      lastname:  string\r\n      title?:    string\r\n  Phone:\r\n    pattern: ^[0-9()-]+$\r\n  Manager: \r\n    type: Person\r\n    properties:\r\n      reports: Person[]\r\n      phone:  Phone\r\n  Admin:\r\n    type: Person\r\n    properties:\r\n      clearanceLevel:\r\n        enum: [ low, high ]\r\n  AlertableAdmin:\r\n    type: Admin\r\n    properties:\r\n      phone: Phone\r\n  Alertable: Manager | AlertableAdmin\r\n  Org:\r\n    type: object\r\n    properties:\r\n      onCall: AlertableAdmin\r\n      [role]: Person\r\n    example: |\r\n      {\r\n        \"onCall\": \r\n        {\r\n          \"firstname\": \"Stan\",\r\n          \"lastname\":  \"Nicholas\",\r\n          \"title\":     \"DBA Lead\",\r\n          \"phone\":     \"415-555-1212\"\r\n        },\r\n        \"Head\": \r\n        {\r\n          \"firstname\": \"Jen\",\r\n          \"lastname\":  \"Smith\",\r\n          \"title\":     \"Regional VP\",\r\n          \"reports\": \r\n          [\r\n            {\r\n              \"firstname\": \"Bob\",\r\n              \"lastname\":  \"Graves\"\r\n            },\r\n            {\r\n              \"firstname\": \"Mara\",\r\n              \"lastname\":  \"Burns\"\r\n            }\r\n          ]\r\n        }\r\n      }\r\n/orgs/{orgId}:\r\n  get:\r\n    responses: \r\n      200:\r\n        body:\r\n          application/json:\r\n            type: Org\r\n```"},"comment":{"url":"https://api.github.com/repos/raml-org/raml-spec/issues/comments/147712540","html_url":"https://github.com/raml-org/raml-spec/issues/168#issuecomment-147712540","issue_url":"https://api.github.com/repos/raml-org/raml-spec/issues/168","id":147712540,"user":{"login":"freddrake","id":588792,"avatar_url":"https://avatars.githubusercontent.com/u/588792?v=3","gravatar_id":"","url":"https://api.github.com/users/freddrake","html_url":"https://github.com/freddrake","followers_url":"https://api.github.com/users/freddrake/followers","following_url":"https://api.github.com/users/freddrake/following{/other_user}","gists_url":"https://api.github.com/users/freddrake/gists{/gist_id}","starred_url":"https://api.github.com/users/freddrake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freddrake/subscriptions","organizations_url":"https://api.github.com/users/freddrake/orgs","repos_url":"https://api.github.com/users/freddrake/repos","events_url":"https://api.github.com/users/freddrake/events{/privacy}","received_events_url":"https://api.github.com/users/freddrake/received_events","type":"User","site_admin":false},"created_at":"2015-10-13T13:23:57Z","updated_at":"2015-10-13T13:23:57Z","body":"My understanding was that this is a syntactical transformation to make it easier to write and embed JSON Schema inside RAML, but that wasn't stated clearly (neither what the new system by the MuleSoft crew nor my assumption).\r\n\r\nI'd be happy with a YAML syntax applied to JSON Schema with a clearly defined mechanical transformation to produce JSON Schema from the YAML syntax (similar to Relax NG and the RNC compact syntax).\r\n\r\nThis avoids creating a new schema system, which shouldn't be a goal.  Continuing to support embedded JSON Schema or XSD would be ideal, though I'd avoid them myself."}}