{"action":"opened","issue":{"url":"https://api.github.com/repos/json-schema/json-schema/issues/253","repository_url":"https://api.github.com/repos/json-schema/json-schema","labels_url":"https://api.github.com/repos/json-schema/json-schema/issues/253/labels{/name}","comments_url":"https://api.github.com/repos/json-schema/json-schema/issues/253/comments","events_url":"https://api.github.com/repos/json-schema/json-schema/issues/253/events","html_url":"https://github.com/json-schema/json-schema/issues/253","id":261831882,"number":253,"title":"Question about using additionalProperties as an object","user":{"login":"cactusjiang","id":32121552,"avatar_url":"https://avatars3.githubusercontent.com/u/32121552?v=4","gravatar_id":"","url":"https://api.github.com/users/cactusjiang","html_url":"https://github.com/cactusjiang","followers_url":"https://api.github.com/users/cactusjiang/followers","following_url":"https://api.github.com/users/cactusjiang/following{/other_user}","gists_url":"https://api.github.com/users/cactusjiang/gists{/gist_id}","starred_url":"https://api.github.com/users/cactusjiang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cactusjiang/subscriptions","organizations_url":"https://api.github.com/users/cactusjiang/orgs","repos_url":"https://api.github.com/users/cactusjiang/repos","events_url":"https://api.github.com/users/cactusjiang/events{/privacy}","received_events_url":"https://api.github.com/users/cactusjiang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-30T09:25:18Z","updated_at":"2017-09-30T09:25:18Z","closed_at":null,"author_association":"NONE","body":"After reading additionalProperties related documents, I am not sure whether the following use of additionalProperties is correct. \r\n\r\nThe following schema example comes from the file:\r\nhttps://github.com/DMTF/Redfish-Interop-Validator/blob/master/profiles/RedfishInteroperabilityProfile.v1_0_0.json\r\n\r\nThe example is at L106. Both $ref and a property are defined in additionalProperties.\r\n\r\n```\r\n\"PropertyRequirements\": {\r\n    \"type\": \"object\",\r\n    \"description\": \"The property-level requirements for this Redfish Interoperability Profile.  These requirements apply to every instance of this resource.  If a property defined in the associated schema is not present, there is no requirement for that property to be supported.\",\r\n    \"additionalProperties\": {\r\n        \"$ref\": \"#/definitions/PropertyProfile\",\r\n\t\"PropertyRequirements\": {\r\n\t\t\"type\": \"object\",\r\n\t\t\"description\": \"Properties defined within an embedded JSON object which have requirements defined by this Profile.\",\r\n\t\t\"additionalProperties\": {\r\n\t\t\t\"$ref\": \"#/definitions/PropertyProfile\",\r\n\t\t\t\"PropertyRequirements\": {\r\n\t\t\t    \"type\": \"object\",\r\n\t\t\t    \"description\": \"Properties defined within an embedded JSON object which have requirements defined by this Profile.\",\r\n\t\t                \"additionalProperties\": {\t\t\t\t\t\t\t\r\n\t\t\t\t    \"$ref\": \"#/definitions/PropertyProfile\"\r\n\t\t\t        }\r\n\t\t        }\r\n\t        }\r\n        }\r\n    }\r\n},\r\n```\r\n\r\nShould we add anyOf to separate $ref and other properties inside additionalProperties?\r\n\r\n```\r\n\"PropertyRequirements\": {\r\n    \"type\": \"object\",\r\n    \"additionalProperties\": {\r\n        \"anyOf\" : [\r\n           {\r\n              \"$ref\": \"#/definitions/PropertyProfile\"\r\n          },\r\n          {\r\n                  \"PropertyRequirements\": {                          \r\n                      \"type\": \"object\",\r\n                      \"description\": \"Properties defined within an embedded JSON object which have requirements defined by this Profile.\",\r\n                      \"additionalProperties\": {\r\n                          \"anyOf\" : [\r\n                              {\r\n                                  \"$ref\": \"#/definitions/PropertyProfile\"\r\n                              },\r\n                              {\r\n                                      \"PropertyRequirements\": {\r\n                                          \"type\": \"object\",\r\n                                          \"description\": \"Properties defined within an embedded JSON object which have requirements defined by this Profile.\",\r\n                                          \"additionalProperties\": {             \r\n                                              \"$ref\": \"#/definitions/PropertyProfile\"\r\n                                          }\r\n                                      }\r\n                               }     \r\n                       ]                              \r\n               }\r\n           }\r\n       }\r\n   ]\r\n}\r\n\r\n```\r\n\r\nWhen there are multiple properties defined in additionalProperties, should the data match all the properties in additionalProperties, or the data can match only one property? Thanks.  \r\n\r\n"}}
{"actor":{"display_login":"cactusjiang"}}