BokaMera.API.Host

<back to all web services

CreateWidgetConfigurationSchema

Requires Authentication
Requires the role:superadmin
The following routes are available for this service:
POST/widget/configurationschemaCreate a widget configuration schemaCreates a new schema. SuperAdmin only. The schema document itself (Schema, DefaultConfiguration, Version) is immutable: there is no PUT or DELETE for it. The only mutable field is MigrationFromPreviousVersion, set via PUT /widget/configurationschema/{Version}/migration.
"use strict";
export class WidgetConfigurationSchemaResponse {
    /** @param {{Id?:number,Version?:number,Schema?:{ [index:string]: Object; },DefaultConfiguration?:string,MigrationFromPreviousVersion?:string,CreatedDate?:string,ResponseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    Id;
    /** @type {number} */
    Version;
    /** @type {{ [index:string]: Object; }} */
    Schema = {};
    /** @type {?string} */
    DefaultConfiguration;
    /** @type {?string} */
    MigrationFromPreviousVersion;
    /** @type {string} */
    CreatedDate;
    /** @type {ResponseStatus} */
    ResponseStatus;
}
export class CreateWidgetConfigurationSchema {
    /** @param {{Version?:number,Schema?:{ [index:string]: Object; },DefaultConfiguration?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description The schema version. Must be unique. */
    Version;
    /**
     * @type {{ [index:string]: Object; }}
     * @description The JSON Schema document. */
    Schema = {};
    /**
     * @type {?string}
     * @description Optional factory-default Configuration JSON for this schema version, used by the bump-version endpoint when UseFactoryDefaults=true. Must itself validate against Schema if provided. */
    DefaultConfiguration;
}

JavaScript CreateWidgetConfigurationSchema DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /widget/configurationschema HTTP/1.1 
Host: api.bookmore.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Version: 0,
	Schema: 
	{
		String: {}
	},
	DefaultConfiguration: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Id: 0,
	Version: 0,
	Schema: 
	{
		String: {}
	},
	DefaultConfiguration: String,
	MigrationFromPreviousVersion: String,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}