package.cjs.elements.JSONSchema.cjs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apidom-ns-json-schema-draft-7 Show documentation
Show all versions of apidom-ns-json-schema-draft-7 Show documentation
JSON Schema Draft 7 namespace for ApiDOM.
"use strict";
exports.__esModule = true;
exports.default = void 0;
var _apidomError = require("@swagger-api/apidom-error");
var _apidomNsJsonSchemaDraft = require("@swagger-api/apidom-ns-json-schema-draft-6");
/* eslint-disable class-methods-use-this */
class JSONSchema extends _apidomNsJsonSchemaDraft.JSONSchemaElement {
constructor(content, meta, attributes) {
super(content, meta, attributes);
this.element = 'JSONSchemaDraft7';
}
/**
* Core vocabulary
*
* URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-01
*/
get $comment() {
return this.get('$comment');
}
set $comment($comment) {
this.set('$comment', $comment);
}
/**
* Validation vocabulary
*
* URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01
*/
/**
* Keywords for Applying Subschemas Conditionally
*
* URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#section-6.6
*/
get if() {
return this.get('if');
}
set if(ifValue) {
this.set('if', ifValue);
}
get then() {
return this.get('then');
}
set then(then) {
this.set('then', then);
}
get else() {
return this.get('else');
}
set else(elseValue) {
this.set('else', elseValue);
}
/**
* String-Encoding Non-JSON Data
*
* URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-00#section-8
*/
get contentEncoding() {
return this.get('contentEncoding');
}
set contentEncoding(contentEncoding) {
this.set('contentEncoding', contentEncoding);
}
get contentMediaType() {
return this.get('contentMediaType');
}
set contentMediaType(contentMediaType) {
this.set('contentMediaType', contentMediaType);
}
get media() {
throw new _apidomError.UnsupportedOperationError('media keyword from Hyper-Schema vocabulary has been moved to validation vocabulary as "contentMediaType" / "contentEncoding"');
}
set media(media) {
throw new _apidomError.UnsupportedOperationError('media keyword from Hyper-Schema vocabulary has been moved to validation vocabulary as "contentMediaType" / "contentEncoding"');
}
/**
* Schema annotations
*
* URI: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01#section-10
*/
get writeOnly() {
return this.get('writeOnly');
}
set writeOnly(writeOnly) {
this.set('writeOnly', writeOnly);
}
}
var _default = exports.default = JSONSchema;