@ng-formworks/core
Version:
Angular ng-formworks - JSON Schema Form builder core
22 lines (21 loc) • 866 B
TypeScript
/**
* 'convertSchemaToDraft6' function
*
* Converts a JSON Schema from draft 1 through 4 format to draft 6 format
*
* Inspired by on geraintluff's JSON Schema 3 to 4 compatibility function:
* https://github.com/geraintluff/json-schema-compatibility
* Also uses suggestions from AJV's JSON Schema 4 to 6 migration guide:
* https://github.com/epoberezkin/ajv/releases/tag/5.0.0
* And additional details from the official JSON Schema documentation:
* http://json-schema.org
*
* // { object } originalSchema - JSON schema (draft 1, 2, 3, 4, or 6)
* // { OptionObject = {} } options - options: parent schema changed?, schema draft number?
* // { object } - JSON schema (draft 6)
*/
export interface OptionObject {
changed?: boolean;
draft?: number;
}
export declare function convertSchemaToDraft6(schema: any, options?: OptionObject): any;