JSON Schema API (v1)

http://localhost:8081/{version}

Table of contents

JSON Schema API

This documents the API calls that can be made to get JSON Schemas of a module defined by X-Okapi-Module-Id header

/_/jsonSchemas

GET /_/jsonSchemas

Get JSON Schemas for the given module defined by header X-Okapi-Module-Id. Without path query param will return list of JSON Schema paths. With path query param will return the specific JSON Schema with resolvable references.

GET /_/jsonSchemas
Query Parameters
  • path: (string)

    Path to specific JSON Schema

    Example:

    userdata.json

Response 200

JSON Schema

Body

Media type: application/json

Type: any

Example:

[
  "userdataCollection.json",
  "usergroups.json",
  "proxyfor.json",
  "userdata.json",
  "proxyforCollection.json",
  "usergroup.json",
  "addresstype.json",
  "addresstypeCollection.json"
]

Media type: application/schema+json

Type: any

Example:

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "User Schema",
    "description": "A user",
    "type": "object",
    "properties": {
        "username": {
            "description": "A unique name belonging to a user. Typically used for login",
            "type": "string"
        },
        "id": {
            "description": "A globally unique (UUID) identifier for the user",
            "type": "string"
        },
        "externalSystemId": {
            "description": "An ID that corresponds to an external authority",
            "type": "string"
        },
        "barcode": {
            "description": "The library barcode for this user",
            "type": "string"
        },
        "active": {
            "description": "A flag to determine if a user can log in, take out loans, etc.",
            "type": "boolean"
        },
        "type": {
            "description": "The class of user",
            "type": "string"
        },
        "patronGroup": {
            "description": "A UUID corresponding to the group the user belongs to",
            "type": "string"
        },
        "meta": {
            "description": "Deprecated",
            "type": "object"
        },
        "proxyFor": {
            "description": "Deprecated",
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "personal": {
            "description": "Personal information about the user",
            "type": "object",
            "properties": {
                "lastName": {
                    "description": "The user's surname",
                    "type": "string"
                },
                "firstName": {
                    "description": "The user's given name",
                    "type": "string"
                },
                "middleName": {
                    "description": "The user's middle name (if any)",
                    "type": "string"
                },
                "email": {
                    "description": "The user's email address",
                    "type": "string"
                },
                "phone": {
                    "description": "The user's primary phone number",
                    "type": "string"
                },
                "mobilePhone": {
                    "description": "The user's mobile phone number",
                    "type": "string"
                },
                "dateOfBirth": {
                    "type": "string",
                    "description": "The user's birth date",
                    "format": "date-time"
                },
                "addresses": {
                    "description": "Physical addresses associated with the user",
                    "type": "array",
                    "minItems": 0,
                    "items": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "description": "A unique id for this address",
                                "type": "string"
                            },
                            "countryId": {
                                "description": "The country code for this address",
                                "type": "string"
                            },
                            "addressLine1": {
                                "description": "Address, Line 1",
                                "type": "string"
                            },
                            "addressLine2": {
                                "description": "Address, Line 2",
                                "type": "string"
                            },
                            "city": {
                                "description": "City name",
                                "type": "string"
                            },
                            "region": {
                                "description": "Region",
                                "type": "string"
                            },
                            "postalCode": {
                                "description": "Postal Code",
                                "type": "string"
                            },
                            "addressTypeId": {
                                "description": "A UUID that corresponds with an address type object",
                                "type": "string"
                            },
                            "primaryAddress": {
                                "description": "Is this the user's primary address?",
                                "type": "boolean"
                            }
                        },
                        "additionalProperties": false
                    }
                },
                "preferredContactTypeId": {
                    "description": "Id of user's preferred contact type",
                    "type": "string"
                }
            },
            "additionalProperties": false,
            "required": [
                "lastName"
            ]
        },
        "enrollmentDate": {
            "description": "The date in which the user joined the organization",
            "type": "string",
            "format": "date-time"
        },
        "expirationDate": {
            "description": "The date for when the user becomes inactive",
            "type": "string",
            "format": "date-time"
        },
        "createdDate": {
            "description": "Deprecated",
            "type": "string",
            "format": "date-time"
        },
        "updatedDate": {
            "description": "Deprecated",
            "type": "string",
            "format": "date-time"
        },
        "metadata": {
            "type": "object",
            "$ref": "http://localhost:9130/_/jsonSchemas?path=raml-util/schemas/metadata.schema"
        },
        "tags": {
            "type": "object",
            "$ref": "http://localhost:9130/_/jsonSchemas?path=raml-util/schemas/tags.schema"
        }
    },
    "additionalProperties": false,
    "required": [
        "id"
    ]
}

Response 404

JSON Schema with a given path not found

Body

Media type: text/plain

Type: any

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator