{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-parser/issues/146","labels_url":"https://api.github.com/repos/swagger-api/swagger-parser/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-parser/issues/146/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-parser/issues/146/events","html_url":"https://github.com/swagger-api/swagger-parser/issues/146","id":120786801,"number":146,"title":"Using YAML anchors causes com.fasterxml.jackson.databind.node exception","user":{"login":"chandravadans","id":3457242,"avatar_url":"https://avatars.githubusercontent.com/u/3457242?v=3","gravatar_id":"","url":"https://api.github.com/users/chandravadans","html_url":"https://github.com/chandravadans","followers_url":"https://api.github.com/users/chandravadans/followers","following_url":"https://api.github.com/users/chandravadans/following{/other_user}","gists_url":"https://api.github.com/users/chandravadans/gists{/gist_id}","starred_url":"https://api.github.com/users/chandravadans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chandravadans/subscriptions","organizations_url":"https://api.github.com/users/chandravadans/orgs","repos_url":"https://api.github.com/users/chandravadans/repos","events_url":"https://api.github.com/users/chandravadans/events{/privacy}","received_events_url":"https://api.github.com/users/chandravadans/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-07T14:35:16Z","updated_at":"2016-01-13T13:57:27Z","closed_at":null,"body":"YAML anchors don't seem to be supported in swagger parser. An exception relating to conversion of `com.fasterxml.jackson.databind.node.TextNode`  to `com.fasterxml.jackson.databind.node.ArrayNode` occurs.\r\n\r\nExample YAML :\r\n```\r\nswagger: '2.0'\r\n\r\ninfo:\r\n  version: \"0.0.1\"\r\n  title: API\r\n\r\nx-types:\r\n  OperationType: &OperationType\r\n    - registration\r\n\r\n# Describe your paths here\r\npaths:\r\n  /checker:\r\n    get:\r\n      parameters:\r\n        - name: operations\r\n          in: query\r\n          type: array\r\n          items:\r\n            type: string\r\n            enum: *OperationType\r\n          default: [registration]\r\n      responses:\r\n        200:\r\n          description: OK\r\n          schema:\r\n            $ref: '#/definitions/OperationType'\r\n\r\ndefinitions:      \r\n  OperationType:\r\n    type: string\r\n    enum: *OperationType\r\n```\r\n\r\nexample taken from [here](https://github.com/swagger-api/swagger-editor/issues/609) and the same issue filed [here](https://github.com/swagger-api/swagger-codegen/issues/1662)"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-parser/issues/comments/171297837","html_url":"https://github.com/swagger-api/swagger-parser/issues/146#issuecomment-171297837","issue_url":"https://api.github.com/repos/swagger-api/swagger-parser/issues/146","id":171297837,"user":{"login":"ge1st","id":2834740,"avatar_url":"https://avatars.githubusercontent.com/u/2834740?v=3","gravatar_id":"","url":"https://api.github.com/users/ge1st","html_url":"https://github.com/ge1st","followers_url":"https://api.github.com/users/ge1st/followers","following_url":"https://api.github.com/users/ge1st/following{/other_user}","gists_url":"https://api.github.com/users/ge1st/gists{/gist_id}","starred_url":"https://api.github.com/users/ge1st/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ge1st/subscriptions","organizations_url":"https://api.github.com/users/ge1st/orgs","repos_url":"https://api.github.com/users/ge1st/repos","events_url":"https://api.github.com/users/ge1st/events{/privacy}","received_events_url":"https://api.github.com/users/ge1st/received_events","type":"User","site_admin":false},"created_at":"2016-01-13T13:57:27Z","updated_at":"2016-01-13T13:57:27Z","body":"I assume I have the same issue. The code generator CLI gives me the very helpful error:\r\n\r\n```\r\n[main] INFO io.swagger.codegen.DefaultCodegen - generated operationId puppiesGet       for Path: get /puppies\r\nException in thread \"main\" java.lang.NullPointerException\r\n        at io.swagger.codegen.DefaultGenerator.generateParameterId(DefaultGenerator.java:613)\r\n        at io.swagger.codegen.DefaultGenerator.processOperation(DefaultGenerator.java:531)\r\n        at io.swagger.codegen.DefaultGenerator.processPaths(DefaultGenerator.java:496)\r\n        at io.swagger.codegen.DefaultGenerator.generate(DefaultGenerator.java:226)\r\n        at io.swagger.codegen.cmd.Generate.run(Generate.java:188)\r\n        at io.swagger.codegen.SwaggerCodegen.main(SwaggerCodegen.java:35)\r\n```\r\n\r\nUsing one of the debug switches to the gen cli showed that many objects within the spec had null values in the object parsed in. Those with nulls were using anchors. Piping it in with a ruby yaml parser and back out as json let me work-around this.\r\n\r\nI agree with @nazr this makes it difficult to handle large APIs."}}