{"action":"created","issue":{"url":"https://api.github.com/repos/zalando/nakadi/issues/135","repository_url":"https://api.github.com/repos/zalando/nakadi","labels_url":"https://api.github.com/repos/zalando/nakadi/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/zalando/nakadi/issues/135/comments","events_url":"https://api.github.com/repos/zalando/nakadi/issues/135/events","html_url":"https://github.com/zalando/nakadi/issues/135","id":137050065,"number":135,"title":"EventTypeSchema requires JSON_SCHEMA as schema type","user":{"login":"bocytko","id":711379,"avatar_url":"https://avatars.githubusercontent.com/u/711379?v=3","gravatar_id":"","url":"https://api.github.com/users/bocytko","html_url":"https://github.com/bocytko","followers_url":"https://api.github.com/users/bocytko/followers","following_url":"https://api.github.com/users/bocytko/following{/other_user}","gists_url":"https://api.github.com/users/bocytko/gists{/gist_id}","starred_url":"https://api.github.com/users/bocytko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bocytko/subscriptions","organizations_url":"https://api.github.com/users/bocytko/orgs","repos_url":"https://api.github.com/users/bocytko/repos","events_url":"https://api.github.com/users/bocytko/events{/privacy}","received_events_url":"https://api.github.com/users/bocytko/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-02-28T12:53:30Z","updated_at":"2016-03-04T14:21:00Z","closed_at":"2016-03-01T14:28:03Z","body":"The `EventTypeSchema` spec suggests `json-schema` as valid value for `type`:\r\n\r\n```yaml\r\n  EventTypeSchema:\r\n    properties:\r\n      type:\r\n        type: string\r\n        example: 'json-schema'\r\n        description: The type of schema definition (avro, json-schema, etc).\r\n```\r\n\r\nHowever, the application requires `JSON_SCHEMA` as value. Neither `json-schema` nor `json_schema` are accepted.\r\n\r\n```sh\r\n$ http -v -a mytok: --verify no https://nakadi-testing.aruha-test.example.org/event-types < event-schema-2.json\r\nPOST /event-types HTTP/1.1\r\nAccept: application/json\r\n[...]\r\nUser-Agent: HTTPie/0.9.3\r\n\r\n{\r\n    \"category\": \"data\",\r\n    \"name\": \"order.ORDER_CANCELLED\",\r\n    \"schema\": {\r\n        \"schema\": \"{ \\\"properties\\\": { \\\"order_number\\\": { \\\"type\\\": \\\"string\\\" } } }\",\r\n        \"type\": \"json_schema\"\r\n    }\r\n}\r\n\r\nHTTP/1.1 400 Bad Request\r\n[...]\r\nX-Flow-Id: vZW4XYZXO2W3tudzBdi0Jwmy\r\n\r\n{\r\n    \"detail\": \"Could not read document: Can not construct instance of de.zalando.aruha.nakadi.domain.EventTypeSchema$Type from String value 'json_schema': value not one of declared Enum instance names: [JSON_SCHEMA]\\n at [Source: java.io.PushbackInputStream@27b876fd; line: 5, column: 3] (through reference chain: de.zalando.aruha.nakadi.domain.EventType[\\\"schema\\\"]->de.zalando.aruha.nakadi.domain.EventTypeSchema[\\\"type\\\"]); nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not construct instance of de.zalando.aruha.nakadi.domain.EventTypeSchema$Type from String value 'json_schema': value not one of declared Enum instance names: [JSON_SCHEMA]\\n at [Source: java.io.PushbackInputStream@27b876fd; line: 5, column: 3] (through reference chain: de.zalando.aruha.nakadi.domain.EventType[\\\"schema\\\"]->de.zalando.aruha.nakadi.domain.EventTypeSchema[\\\"type\\\"])\",\r\n    \"status\": 400,\r\n    \"title\": \"Bad Request\",\r\n    \"type\": \"http://httpstatus.es/400\"\r\n}\r\n```\r\n\r\nCreation with `JSON_SCHEMA` works perfectly:\r\n\r\n```sh\r\n$ http -v -a mytok: --verify no https://nakadi-testing.aruha-test.example.org/event-types < event-schema-2.json\r\nPOST /event-types HTTP/1.1\r\n[...]\r\n\r\n{\r\n    \"category\": \"data\",\r\n    \"name\": \"order.ORDER_CANCELLED\",\r\n    \"schema\": {\r\n        \"schema\": \"{ \\\"properties\\\": { \\\"order_number\\\": { \\\"type\\\": \\\"string\\\" } } }\",\r\n        \"type\": \"JSON_SCHEMA\"\r\n    }\r\n}\r\n\r\nHTTP/1.1 201 Created\r\n[...]\r\nX-Flow-Id: p1nSPcqtl7PnmP8XoWAYcOE7\r\n```"},"comment":{"url":"https://api.github.com/repos/zalando/nakadi/issues/comments/192299109","html_url":"https://github.com/zalando/nakadi/issues/135#issuecomment-192299109","issue_url":"https://api.github.com/repos/zalando/nakadi/issues/135","id":192299109,"user":{"login":"bocytko","id":711379,"avatar_url":"https://avatars.githubusercontent.com/u/711379?v=3","gravatar_id":"","url":"https://api.github.com/users/bocytko","html_url":"https://github.com/bocytko","followers_url":"https://api.github.com/users/bocytko/followers","following_url":"https://api.github.com/users/bocytko/following{/other_user}","gists_url":"https://api.github.com/users/bocytko/gists{/gist_id}","starred_url":"https://api.github.com/users/bocytko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bocytko/subscriptions","organizations_url":"https://api.github.com/users/bocytko/orgs","repos_url":"https://api.github.com/users/bocytko/repos","events_url":"https://api.github.com/users/bocytko/events{/privacy}","received_events_url":"https://api.github.com/users/bocytko/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T14:21:00Z","updated_at":"2016-03-04T14:21:00Z","body":"@tmuehl thanks for creating the issue! :+1: "}}