Skip to content

feat(ns-openapi-3-1): add support for Boolean JSON Schemas #430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apidom/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import stampit from 'stampit';
import { always, defaultTo } from 'ramda';
import { isNonEmptyString, isNull } from 'ramda-adjunct';
import { ObjectElement, isStringElement, ArrayElement } from 'apidom';
import { ObjectElement, ArrayElement, BooleanElement, isStringElement, BREAK } from 'apidom';

import { isSchemaElement, isJsonSchemaDialectElement } from '../../../../predicates';
import SchemaElement from '../../../../elements/Schema';
Expand All @@ -17,8 +17,6 @@ const SchemaVisitor = stampit(FixedFieldsVisitor, ParentSchemaAwareVisitor, Fall
},
// @ts-ignore
init() {
this.element = new SchemaElement();

/**
* Private Api.
*/
Expand Down Expand Up @@ -85,6 +83,7 @@ const SchemaVisitor = stampit(FixedFieldsVisitor, ParentSchemaAwareVisitor, Fall
* Public Api.
*/
this.ObjectElement = function _ObjectElement(objectElement: ObjectElement) {
this.element = new SchemaElement();
handle$schema(objectElement);
handle$id(objectElement);

Expand All @@ -93,6 +92,13 @@ const SchemaVisitor = stampit(FixedFieldsVisitor, ParentSchemaAwareVisitor, Fall
// @ts-ignore
return FixedFieldsVisitor.compose.methods.ObjectElement.call(this, objectElement);
};

this.BooleanElement = function _BooleanElement(booleanElement: BooleanElement) {
this.element = booleanElement.clone();
this.element.classes.push('boolean-json-schema');

return BREAK;
};
},
});

Expand Down
2 changes: 1 addition & 1 deletion experiments/apidom-playground/.npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
audit-whitelist=[565,1677,1693,1745,1747]
audit-whitelist=[565,1677,1693,1745,1747,1748]
12 changes: 6 additions & 6 deletions experiments/apidom-playground/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.