{"action":"opened","issue":{"url":"https://api.github.com/repos/janephp/janephp/issues/45","repository_url":"https://api.github.com/repos/janephp/janephp","labels_url":"https://api.github.com/repos/janephp/janephp/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/janephp/janephp/issues/45/comments","events_url":"https://api.github.com/repos/janephp/janephp/issues/45/events","html_url":"https://github.com/janephp/janephp/issues/45","id":375739062,"node_id":"MDU6SXNzdWUzNzU3MzkwNjI=","number":45,"title":"How do you define Nullable properties","user":{"login":"edgji","id":577351,"node_id":"MDQ6VXNlcjU3NzM1MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/577351?v=4","gravatar_id":"","url":"https://api.github.com/users/edgji","html_url":"https://github.com/edgji","followers_url":"https://api.github.com/users/edgji/followers","following_url":"https://api.github.com/users/edgji/following{/other_user}","gists_url":"https://api.github.com/users/edgji/gists{/gist_id}","starred_url":"https://api.github.com/users/edgji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgji/subscriptions","organizations_url":"https://api.github.com/users/edgji/orgs","repos_url":"https://api.github.com/users/edgji/repos","events_url":"https://api.github.com/users/edgji/events{/privacy}","received_events_url":"https://api.github.com/users/edgji/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-30T23:37:08Z","updated_at":"2018-10-30T23:37:08Z","closed_at":null,"author_association":"NONE","body":"I understand support for OpenAPI v3 is in the works and a solution to may already be in the works considering a similar issue described in #28 \r\n\r\nHow would one describe a nullable component?\r\nI'm attempting generation for a v3 client using 5.x-dev and describing an endpoint as follows:\r\n```\r\npaths:\r\n  '/component/{parentComponentId}':\r\n    get:\r\n      parameters:\r\n      - name: parentComponentId\r\n        in: path\r\n        required: true\r\n        schema:\r\n          type: integer\r\n          format: int64\r\n      responses:\r\n        '200':\r\n          content:\r\n            application/json:\r\n              schema:\r\n                type: object\r\n                properties:\r\n                  data:\r\n                    $ref: '#/components/schemas/ParentComponent'\r\ncomponents:\r\n  schemas:\r\n    ParentComponent:\r\n      type: object\r\n      properties:\r\n        id:\r\n          type: integer\r\n        child:\r\n          nullable: true\r\n          oneOf:\r\n          - $ref: '#/components/schemas/Component'\r\n```\r\nbut the generated code only accepts null values for the nullable property since it doesn't try to denormalize non null values.\r\n```\r\n// section of code generated for ParentNormalizer.php\r\nif (property_exists($data, 'child')) {\r\n    $object->setComponent($data->{'child'});\r\n}\r\n```\r\nthis causes issues since setComponent method is type hinted with the Component model class"}}
{"actor":{"display_login":"edgji"}}