All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.es.refractor.visitors.json-schema.index.mjs Maven / Gradle / Ivy

There is a newer version: 0.99.2
Show newest version
import stampit from 'stampit';
import { always } from 'ramda';
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
import { FixedFieldsVisitor, FallbackVisitor } from '@swagger-api/apidom-ns-json-schema-draft-6';
import JSONSchemaElement from "../../../elements/JSONSchema.mjs";
const JSONSchemaVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
  props: {
    specPath: always(['document', 'objects', 'JSONSchema'])
  },
  methods: {
    ObjectElement(objectElement) {
      this.element = new JSONSchemaElement();

      // @ts-ignore
      return FixedFieldsVisitor.compose.methods.ObjectElement.call(this, objectElement);
    },
    BooleanElement(booleanElement) {
      this.element = cloneDeep(booleanElement);
      this.element.classes.push('boolean-json-schema');
      return BREAK;
    }
  }
});
export default JSONSchemaVisitor;




© 2015 - 2025 Weber Informatics LLC | Privacy Policy