From ef20891d132098ac44f1ac6197710e43fccdc64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Gorej?= Date: Tue, 30 Apr 2024 14:04:39 +0200 Subject: [PATCH] refactor(ns-json-schema-draft-6): remove explicit Fallback visitors (#4069) --- .../src/refractor/specification.ts | 9 +++------ .../src/refractor/visitors/json-schema/$idVisitor.ts | 3 --- .../src/refractor/visitors/json-schema/ConstVisitor.ts | 3 --- .../link-description/SubmissionEncTypeVisitor.ts | 3 --- 4 files changed, 3 insertions(+), 15 deletions(-) delete mode 100644 packages/apidom-ns-json-schema-draft-6/src/refractor/visitors/json-schema/$idVisitor.ts delete mode 100644 packages/apidom-ns-json-schema-draft-6/src/refractor/visitors/json-schema/ConstVisitor.ts delete mode 100644 packages/apidom-ns-json-schema-draft-6/src/refractor/visitors/json-schema/link-description/SubmissionEncTypeVisitor.ts diff --git a/packages/apidom-ns-json-schema-draft-6/src/refractor/specification.ts b/packages/apidom-ns-json-schema-draft-6/src/refractor/specification.ts index 3e5ca388a..522b3dc7c 100644 --- a/packages/apidom-ns-json-schema-draft-6/src/refractor/specification.ts +++ b/packages/apidom-ns-json-schema-draft-6/src/refractor/specification.ts @@ -2,12 +2,9 @@ import { pipe, assocPath, dissocPath } from 'ramda'; import { specificationObj } from '@swagger-api/apidom-ns-json-schema-draft-4'; import JSONSchemaVisitor from './visitors/json-schema'; -import JSONSchema$idVisitor from './visitors/json-schema/$idVisitor'; import JSONSchemaItemsVisitor from './visitors/json-schema/ItemsVisitor'; -import JSONSchemaConstVisitor from './visitors/json-schema/ConstVisitor'; import JSONSchemaExamplesVisitor from './visitors/json-schema/ExamplesVisitor'; import LinkDescriptionVisitor from './visitors/json-schema/link-description'; -import LinkDescriptionSubmissionEncTypeVisitor from './visitors/json-schema/link-description/SubmissionEncTypeVisitor'; const specification = pipe( // JSON Schema object modifications @@ -15,7 +12,7 @@ const specification = pipe( dissocPath(['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'id']), assocPath( ['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', '$id'], - JSONSchema$idVisitor, + specificationObj.visitors.value, ), assocPath( ['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'contains'], @@ -31,7 +28,7 @@ const specification = pipe( ), assocPath( ['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'const'], - JSONSchemaConstVisitor, + specificationObj.visitors.value, ), assocPath( ['visitors', 'document', 'objects', 'JSONSchema', 'fixedFields', 'examples'], @@ -55,7 +52,7 @@ const specification = pipe( dissocPath(['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'encType']), assocPath( ['visitors', 'document', 'objects', 'LinkDescription', 'fixedFields', 'submissionEncType'], - LinkDescriptionSubmissionEncTypeVisitor, + specificationObj.visitors.value, ), )(specificationObj); diff --git a/packages/apidom-ns-json-schema-draft-6/src/refractor/visitors/json-schema/$idVisitor.ts b/packages/apidom-ns-json-schema-draft-6/src/refractor/visitors/json-schema/$idVisitor.ts deleted file mode 100644 index c2a95148d..000000000 --- a/packages/apidom-ns-json-schema-draft-6/src/refractor/visitors/json-schema/$idVisitor.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { FallbackVisitor } from '@swagger-api/apidom-ns-json-schema-draft-4'; - -export default FallbackVisitor; diff --git a/packages/apidom-ns-json-schema-draft-6/src/refractor/visitors/json-schema/ConstVisitor.ts b/packages/apidom-ns-json-schema-draft-6/src/refractor/visitors/json-schema/ConstVisitor.ts deleted file mode 100644 index c2a95148d..000000000 --- a/packages/apidom-ns-json-schema-draft-6/src/refractor/visitors/json-schema/ConstVisitor.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { FallbackVisitor } from '@swagger-api/apidom-ns-json-schema-draft-4'; - -export default FallbackVisitor; diff --git a/packages/apidom-ns-json-schema-draft-6/src/refractor/visitors/json-schema/link-description/SubmissionEncTypeVisitor.ts b/packages/apidom-ns-json-schema-draft-6/src/refractor/visitors/json-schema/link-description/SubmissionEncTypeVisitor.ts deleted file mode 100644 index c2a95148d..000000000 --- a/packages/apidom-ns-json-schema-draft-6/src/refractor/visitors/json-schema/link-description/SubmissionEncTypeVisitor.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { FallbackVisitor } from '@swagger-api/apidom-ns-json-schema-draft-4'; - -export default FallbackVisitor;