{ "openapi": "3.0.1", "info": { "title": "MiniStaffomatic API", "version": "v1", "description": "A scheduling API" }, "paths": { "/v1/{account_subdomain}/account": { "parameters": [ { "name": "account_subdomain", "in": "path", "required": true, "schema": { "type": "string" } } ], "get": { "summary": "Shows the account", "tags": [ "Accounts" ], "security": [ { "BasicAuth": [] } ], "parameters": [ { "name": "include", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Include related resources in the response ([JSON:API includes](https://jsonapi.org/format/#fetching-includes)).

**Available relationships:**
`users`, `schedules`" } ], "responses": { "200": { "description": "account found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/account_resource" } } } } } }, "patch": { "summary": "Updates the account", "tags": [ "Accounts" ], "security": [ { "BasicAuth": [] } ], "parameters": [], "responses": { "200": { "description": "account updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/account_resource" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/account_post_resource" } } } } } }, "/v1/{account_subdomain}/applications": { "parameters": [ { "name": "account_subdomain", "in": "path", "required": true, "schema": { "type": "string" } } ], "get": { "summary": "Lists applications", "tags": [ "Applications" ], "security": [ { "BasicAuth": [] } ], "parameters": [ { "name": "page[number]", "in": "query", "required": false, "description": "Page number", "schema": { "type": "integer" } }, { "name": "page[size]", "in": "query", "required": false, "description": "Page size", "schema": { "type": "integer" } }, { "name": "filter[{attribute}_{predicate}]", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Filter by attribute using Ransack predicates.

**Available attributes:**
`shift_id`, `user_id`, `schedule_id`, `creator_id`, `state`, `cancel_reason`, `created_at`, `updated_at`

**Common predicates:**
`eq`, `not_eq`, `matches`, `lt`, `lteq`, `gt`, `gteq`, `in`, `not_in`, `cont`, `start`, `end`, `null`, `not_null`

[Full list of predicates](https://activerecord-hackery.github.io/ransack/getting-started/using-predicates/)" }, { "name": "include", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Include related resources in the response ([JSON:API includes](https://jsonapi.org/format/#fetching-includes)).

**Available relationships:**
`shift`, `user`, `schedule`, `creator`" } ], "responses": { "200": { "description": "applications found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/application_resources" } } } } } }, "post": { "summary": "Creates an application", "tags": [ "Applications" ], "security": [ { "BasicAuth": [] } ], "parameters": [], "responses": { "201": { "description": "application created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/application_resource" } } } }, "422": { "description": "invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/jsonapi_errors" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/application_post_resource" } } } } } }, "/v1/{account_subdomain}/applications/{id}": { "parameters": [ { "name": "account_subdomain", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "get": { "summary": "Shows an application", "tags": [ "Applications" ], "security": [ { "BasicAuth": [] } ], "parameters": [ { "name": "include", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Include related resources in the response ([JSON:API includes](https://jsonapi.org/format/#fetching-includes)).

**Available relationships:**
`shift`, `user`, `schedule`, `creator`" } ], "responses": { "200": { "description": "application found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/application_resource" } } } } } }, "patch": { "summary": "Updates an application", "tags": [ "Applications" ], "security": [ { "BasicAuth": [] } ], "parameters": [ { "name": "do", "in": "query", "required": false, "schema": { "type": "string", "enum": [ "apply", "assign", "accept", "cancel", "revoke" ] }, "description": "State transition action" } ], "responses": { "200": { "description": "application state transitioned", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/application_resource" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/application_post_resource" } } } } }, "delete": { "summary": "Deletes an application", "tags": [ "Applications" ], "security": [ { "BasicAuth": [] } ], "responses": { "204": { "description": "application deleted" } } } }, "/v1/{account_subdomain}/schedules": { "parameters": [ { "name": "account_subdomain", "in": "path", "required": true, "schema": { "type": "string" } } ], "get": { "summary": "Lists schedules", "tags": [ "Schedules" ], "security": [ { "BasicAuth": [] } ], "parameters": [ { "name": "page[number]", "in": "query", "required": false, "description": "Page number", "schema": { "type": "integer" } }, { "name": "page[size]", "in": "query", "required": false, "description": "Page size", "schema": { "type": "integer" } }, { "name": "filter[{attribute}_{predicate}]", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Filter by attribute using Ransack predicates.

**Available attributes:**
`creator_id`, `name`, `bop`, `state`, `published_at`, `created_at`, `updated_at`

**Common predicates:**
`eq`, `not_eq`, `matches`, `lt`, `lteq`, `gt`, `gteq`, `in`, `not_in`, `cont`, `start`, `end`, `null`, `not_null`

[Full list of predicates](https://activerecord-hackery.github.io/ransack/getting-started/using-predicates/)" }, { "name": "include", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Include related resources in the response ([JSON:API includes](https://jsonapi.org/format/#fetching-includes)).

**Available relationships:**
`creator`, `shifts`" } ], "responses": { "200": { "description": "schedules found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/schedule_resources" } } } } } }, "post": { "summary": "Creates a schedule", "tags": [ "Schedules" ], "security": [ { "BasicAuth": [] } ], "parameters": [], "responses": { "201": { "description": "schedule created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/schedule_resource" } } } }, "422": { "description": "invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/jsonapi_errors" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/schedule_post_resource" } } } } } }, "/v1/{account_subdomain}/schedules/{id}": { "parameters": [ { "name": "account_subdomain", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "get": { "summary": "Shows a schedule", "tags": [ "Schedules" ], "security": [ { "BasicAuth": [] } ], "parameters": [ { "name": "include", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Include related resources in the response ([JSON:API includes](https://jsonapi.org/format/#fetching-includes)).

**Available relationships:**
`creator`, `shifts`" } ], "responses": { "200": { "description": "schedule found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/schedule_resource" } } } } } }, "patch": { "summary": "Updates a schedule", "tags": [ "Schedules" ], "security": [ { "BasicAuth": [] } ], "parameters": [], "responses": { "200": { "description": "schedule updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/schedule_resource" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/schedule_post_resource" } } } } }, "delete": { "summary": "Deletes a schedule", "tags": [ "Schedules" ], "security": [ { "BasicAuth": [] } ], "responses": { "204": { "description": "schedule deleted" } } } }, "/v1/{account_subdomain}/schedules/{id}/publish": { "parameters": [ { "name": "account_subdomain", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "put": { "summary": "Publishes a schedule", "tags": [ "Schedules" ], "security": [ { "BasicAuth": [] } ], "responses": { "200": { "description": "schedule published", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/schedule_resource" } } } } } } }, "/v1/{account_subdomain}/shifts": { "parameters": [ { "name": "account_subdomain", "in": "path", "required": true, "schema": { "type": "string" } } ], "get": { "summary": "Lists shifts", "tags": [ "Shifts" ], "security": [ { "BasicAuth": [] } ], "parameters": [ { "name": "page[number]", "in": "query", "required": false, "description": "Page number", "schema": { "type": "integer" } }, { "name": "page[size]", "in": "query", "required": false, "description": "Page size", "schema": { "type": "integer" } }, { "name": "filter[{attribute}_{predicate}]", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Filter by attribute using Ransack predicates.

**Available attributes:**
`schedule_id`, `creator_id`, `starts_at`, `ends_at`, `desired_coverage`, `note`, `published_at`, `created_at`, `updated_at`

**Common predicates:**
`eq`, `not_eq`, `matches`, `lt`, `lteq`, `gt`, `gteq`, `in`, `not_in`, `cont`, `start`, `end`, `null`, `not_null`

[Full list of predicates](https://activerecord-hackery.github.io/ransack/getting-started/using-predicates/)" }, { "name": "include", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Include related resources in the response ([JSON:API includes](https://jsonapi.org/format/#fetching-includes)).

**Available relationships:**
`schedule`, `creator`, `applications`" } ], "responses": { "200": { "description": "shifts found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/shift_resources" } } } } } }, "post": { "summary": "Creates a shift", "tags": [ "Shifts" ], "security": [ { "BasicAuth": [] } ], "parameters": [], "responses": { "201": { "description": "shift created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/shift_resource" } } } }, "422": { "description": "invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/jsonapi_errors" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/shift_post_resource" } } } } } }, "/v1/{account_subdomain}/shifts/{id}": { "parameters": [ { "name": "account_subdomain", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "get": { "summary": "Shows a shift", "tags": [ "Shifts" ], "security": [ { "BasicAuth": [] } ], "parameters": [ { "name": "include", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Include related resources in the response ([JSON:API includes](https://jsonapi.org/format/#fetching-includes)).

**Available relationships:**
`schedule`, `creator`, `applications`" } ], "responses": { "200": { "description": "shift found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/shift_resource" } } } } } }, "patch": { "summary": "Updates a shift", "tags": [ "Shifts" ], "security": [ { "BasicAuth": [] } ], "parameters": [], "responses": { "200": { "description": "shift updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/shift_resource" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/shift_post_resource" } } } } }, "delete": { "summary": "Deletes a shift", "tags": [ "Shifts" ], "security": [ { "BasicAuth": [] } ], "responses": { "204": { "description": "shift deleted" } } } }, "/v1/{account_subdomain}/users": { "parameters": [ { "name": "account_subdomain", "in": "path", "required": true, "schema": { "type": "string" } } ], "get": { "summary": "Lists users", "tags": [ "Users" ], "security": [ { "BasicAuth": [] } ], "parameters": [ { "name": "page[number]", "in": "query", "required": false, "description": "Page number", "schema": { "type": "integer" } }, { "name": "page[size]", "in": "query", "required": false, "description": "Page size", "schema": { "type": "integer" } }, { "name": "filter[{attribute}_{predicate}]", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Filter by attribute using Ransack predicates.

**Available attributes:**
`email`, `first_name`, `last_name`, `role`, `locked_at`, `created_at`, `updated_at`

**Common predicates:**
`eq`, `not_eq`, `matches`, `lt`, `lteq`, `gt`, `gteq`, `in`, `not_in`, `cont`, `start`, `end`, `null`, `not_null`

[Full list of predicates](https://activerecord-hackery.github.io/ransack/getting-started/using-predicates/)" } ], "responses": { "200": { "description": "users found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/user_resources" } } } } } }, "post": { "summary": "Creates a user", "tags": [ "Users" ], "security": [ { "BasicAuth": [] } ], "parameters": [], "responses": { "201": { "description": "user created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/user_resource" } } } }, "422": { "description": "invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/jsonapi_errors" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/user_post_resource" } } } } } }, "/v1/{account_subdomain}/users/{id}": { "parameters": [ { "name": "account_subdomain", "in": "path", "required": true, "schema": { "type": "string" } }, { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } } ], "get": { "summary": "Shows a user", "tags": [ "Users" ], "security": [ { "BasicAuth": [] } ], "responses": { "200": { "description": "user found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/user_resource" } } } } } }, "patch": { "summary": "Updates a user", "tags": [ "Users" ], "security": [ { "BasicAuth": [] } ], "parameters": [], "responses": { "200": { "description": "user updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/user_resource" } } } } }, "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/user_post_resource" } } } } }, "delete": { "summary": "Deletes a user", "tags": [ "Users" ], "security": [ { "BasicAuth": [] } ], "responses": { "204": { "description": "user deleted" } } } } }, "servers": [ { "url": "http://localhost:3000", "description": "Development" } ], "components": { "securitySchemes": { "BasicAuth": { "type": "http", "scheme": "basic" } }, "schemas": { "jsonapi_error": { "type": "object", "properties": { "status": { "type": "string" }, "source": { "type": "object", "properties": { "pointer": { "type": "string" } } }, "title": { "type": "string" }, "detail": { "type": "string" } } }, "jsonapi_errors": { "type": "object", "properties": { "errors": { "type": "array", "items": { "$ref": "#/components/schemas/jsonapi_error" } } } }, "jsonapi_links": { "type": "object", "properties": { "self": { "type": "string" }, "first": { "type": "string" }, "prev": { "type": "string", "nullable": true }, "next": { "type": "string", "nullable": true }, "last": { "type": "string" } } }, "jsonapi_meta": { "type": "object", "properties": { "total": { "type": "integer" }, "pages": { "type": "integer" } } }, "jsonapi_included_item": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "attributes": { "type": "object", "additionalProperties": true }, "relationships": { "type": "object", "additionalProperties": true } } }, "jsonapi_relationship": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } } } } }, "jsonapi_relationships_collection": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" } } } } } }, "account_resource": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/account_item" }, "included": { "type": "array", "items": { "$ref": "#/components/schemas/jsonapi_included_item" } } } }, "account_item": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "account" ] }, "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "subdomain": { "type": "string" }, "locale": { "type": "string" }, "time_zone": { "type": "string" }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } }, "relationships": { "type": "object", "properties": { "users": { "$ref": "#/components/schemas/jsonapi_relationships_collection" }, "schedules": { "$ref": "#/components/schemas/jsonapi_relationships_collection" } } } } }, "account_post_resource": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "attributes" ], "properties": { "attributes": { "type": "object", "properties": { "name": { "type": "string" }, "subdomain": { "type": "string" }, "locale": { "type": "string" }, "time_zone": { "type": "string" } }, "required": [ "name" ] } } } } }, "user_resource": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/user_item" }, "included": { "type": "array", "items": { "$ref": "#/components/schemas/jsonapi_included_item" } } } }, "user_item": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "user" ] }, "attributes": { "type": "object", "properties": { "email": { "type": "string" }, "first_name": { "type": "string" }, "last_name": { "type": "string" }, "role": { "type": "string", "enum": [ "staff", "manager", "admin" ] }, "locked_at": { "type": "string", "format": "date-time", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } }, "relationships": { "type": "object", "properties": { "account": { "$ref": "#/components/schemas/jsonapi_relationship" } } } } }, "user_resources": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/user_item" } }, "included": { "type": "array", "items": { "$ref": "#/components/schemas/jsonapi_included_item" } }, "meta": { "$ref": "#/components/schemas/jsonapi_meta" } } }, "user_post_resource": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "attributes" ], "properties": { "attributes": { "type": "object", "properties": { "email": { "type": "string" }, "first_name": { "type": "string" }, "last_name": { "type": "string" }, "role": { "type": "string", "enum": [ "staff", "manager", "admin" ] } }, "required": [ "email", "first_name", "last_name" ] } } } } }, "schedule_resource": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/schedule_item" }, "included": { "type": "array", "items": { "$ref": "#/components/schemas/jsonapi_included_item" } } } }, "schedule_item": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "schedule" ] }, "attributes": { "type": "object", "properties": { "name": { "type": "string", "nullable": true }, "bop": { "type": "string", "format": "date" }, "eop": { "type": "string", "format": "date" }, "state": { "type": "string", "enum": [ "draft", "published" ] }, "published_at": { "type": "string", "format": "date-time", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } }, "relationships": { "type": "object", "properties": { "account": { "$ref": "#/components/schemas/jsonapi_relationship" }, "creator": { "$ref": "#/components/schemas/jsonapi_relationship" }, "shifts": { "$ref": "#/components/schemas/jsonapi_relationships_collection" } } } } }, "schedule_resources": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/schedule_item" } }, "included": { "type": "array", "items": { "$ref": "#/components/schemas/jsonapi_included_item" } }, "meta": { "$ref": "#/components/schemas/jsonapi_meta" } } }, "schedule_post_resource": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "attributes" ], "properties": { "attributes": { "type": "object", "properties": { "name": { "type": "string", "nullable": true }, "bop": { "type": "string", "format": "date" } }, "required": [ "bop" ] } } } } }, "shift_resource": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/shift_item" }, "included": { "type": "array", "items": { "$ref": "#/components/schemas/jsonapi_included_item" } } } }, "shift_item": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "shift" ] }, "attributes": { "type": "object", "properties": { "starts_at": { "type": "string", "format": "date-time" }, "ends_at": { "type": "string", "format": "date-time" }, "desired_coverage": { "type": "integer" }, "note": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } }, "relationships": { "type": "object", "properties": { "account": { "$ref": "#/components/schemas/jsonapi_relationship" }, "schedule": { "$ref": "#/components/schemas/jsonapi_relationship" }, "creator": { "$ref": "#/components/schemas/jsonapi_relationship" }, "applications": { "$ref": "#/components/schemas/jsonapi_relationships_collection" } } } } }, "shift_resources": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/shift_item" } }, "included": { "type": "array", "items": { "$ref": "#/components/schemas/jsonapi_included_item" } }, "meta": { "$ref": "#/components/schemas/jsonapi_meta" } } }, "shift_post_resource": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "attributes", "relationships" ], "properties": { "attributes": { "type": "object", "properties": { "starts_at": { "type": "string", "format": "date-time" }, "ends_at": { "type": "string", "format": "date-time" }, "desired_coverage": { "type": "integer" }, "note": { "type": "string", "nullable": true } }, "required": [ "starts_at", "ends_at" ] }, "relationships": { "type": "object", "properties": { "schedule": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "schedule" ] } }, "required": [ "id", "type" ] } } } } } } } } }, "application_resource": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/application_item" }, "included": { "type": "array", "items": { "$ref": "#/components/schemas/jsonapi_included_item" } } } }, "application_item": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "application" ] }, "attributes": { "type": "object", "properties": { "state": { "type": "string", "enum": [ "new", "applied", "assigned", "cancelled" ] }, "cancel_reason": { "type": "string", "nullable": true }, "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" } } }, "relationships": { "type": "object", "properties": { "account": { "$ref": "#/components/schemas/jsonapi_relationship" }, "shift": { "$ref": "#/components/schemas/jsonapi_relationship" }, "user": { "$ref": "#/components/schemas/jsonapi_relationship" }, "schedule": { "$ref": "#/components/schemas/jsonapi_relationship" }, "creator": { "$ref": "#/components/schemas/jsonapi_relationship" } } } } }, "application_resources": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/application_item" } }, "included": { "type": "array", "items": { "$ref": "#/components/schemas/jsonapi_included_item" } }, "meta": { "$ref": "#/components/schemas/jsonapi_meta" } } }, "application_post_resource": { "type": "object", "required": [ "data" ], "properties": { "data": { "type": "object", "required": [ "attributes", "relationships" ], "properties": { "attributes": { "type": "object", "properties": { "cancel_reason": { "type": "string", "nullable": true } } }, "relationships": { "type": "object", "properties": { "shift": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "shift" ] } }, "required": [ "id", "type" ] } } }, "user": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "user" ] } }, "required": [ "id", "type" ] } } }, "schedule": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "schedule" ] } }, "required": [ "id", "type" ] } } } } } } } } } } } }