Skip to content

Commit

Permalink
refactor(ns-json-schema-draft-6): remove explicit Fallback visitors (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
char0n authored Apr 30, 2024
1 parent 2686f4c commit ef20891
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@ 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
assocPath(['visitors', 'document', 'objects', 'JSONSchema', '$visitor'], JSONSchemaVisitor),
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'],
Expand All @@ -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'],
Expand All @@ -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);

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit ef20891

Please sign in to comment.