{"action":"opened","issue":{"url":"https://api.github.com/repos/json-schema-org/json-schema-spec/issues/668","repository_url":"https://api.github.com/repos/json-schema-org/json-schema-spec","labels_url":"https://api.github.com/repos/json-schema-org/json-schema-spec/issues/668/labels{/name}","comments_url":"https://api.github.com/repos/json-schema-org/json-schema-spec/issues/668/comments","events_url":"https://api.github.com/repos/json-schema-org/json-schema-spec/issues/668/events","html_url":"https://github.com/json-schema-org/json-schema-spec/issues/668","id":377212133,"node_id":"MDU6SXNzdWUzNzcyMTIxMzM=","number":668,"title":"Can you define subschemas and recycle parent schemas?","user":{"login":"adjenks-p","id":43732547,"node_id":"MDQ6VXNlcjQzNzMyNTQ3","avatar_url":"https://avatars2.githubusercontent.com/u/43732547?v=4","gravatar_id":"","url":"https://api.github.com/users/adjenks-p","html_url":"https://github.com/adjenks-p","followers_url":"https://api.github.com/users/adjenks-p/followers","following_url":"https://api.github.com/users/adjenks-p/following{/other_user}","gists_url":"https://api.github.com/users/adjenks-p/gists{/gist_id}","starred_url":"https://api.github.com/users/adjenks-p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adjenks-p/subscriptions","organizations_url":"https://api.github.com/users/adjenks-p/orgs","repos_url":"https://api.github.com/users/adjenks-p/repos","events_url":"https://api.github.com/users/adjenks-p/events{/privacy}","received_events_url":"https://api.github.com/users/adjenks-p/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-05T00:17:28Z","updated_at":"2018-11-05T00:17:28Z","closed_at":null,"author_association":"NONE","body":"Is it possible to specify a schema and then specify another schema which uses that schema as a parent class? For example, a particular property could be labeled a slot in the parent and the child schema could be defined as a Parent with a list of variations in particular slot properties? Or is there another way to achieve a similar effect?\r\n\r\nThe reason I am asking is because I was trying to create a general purpose \"HTTPResponse\" schema for an HTTP request responses. It might contain a data property, which can contain anything.\r\nI was hoping I could define a schema, let's say a \"Human\" and then define a \"HumanResponse\" where I would specify `parentSchema: \"HTTPResponse\"`, and then specify `\"slots\": {\"data\": \"Human\"}`\r\n\r\nIf some sort of feature like this does not exist and if I wanted to define a Mouse, Cat, Dog and a Human schema, I would have to describe everything about what it means to be a mammal four times.\r\n\r\nI know that I could define a Leg schema, and a Tail schema and an Eye schema and then create a Cat schema and specify an array of \"BodyParts\" and specify that it must contain, a tail or legs or whatever else, but I cannot seem to see a way of inheriting features and specifying variants.\r\n\r\nIn the same way that JavaScript has a prototypical inheritance model instead of a class based model, perhaps I just don't understand how to do what I am trying to accomplish and there is another way? Or is it impossible to create a Dog by defining it as a subschema of a Mammal schema, without typing out the whole mammal schema all over again?"}}
{"actor":{"display_login":"adjenks-p"}}