@swagger-api/apidom-ns-openapi-3-0 0.76.2 → 0.78.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +2 -2
- package/cjs/elements/Callback.cjs +1 -2
- package/cjs/elements/Components.cjs +1 -2
- package/cjs/elements/Contact.cjs +1 -2
- package/cjs/elements/Discriminator.cjs +1 -2
- package/cjs/elements/Encoding.cjs +1 -2
- package/cjs/elements/Example.cjs +1 -2
- package/cjs/elements/ExternalDocumentation.cjs +1 -2
- package/cjs/elements/Header.cjs +1 -2
- package/cjs/elements/Info.cjs +1 -2
- package/cjs/elements/License.cjs +1 -2
- package/cjs/elements/Link.cjs +1 -2
- package/cjs/elements/MediaType.cjs +1 -2
- package/cjs/elements/OAuthFlow.cjs +1 -2
- package/cjs/elements/OAuthFlows.cjs +1 -2
- package/cjs/elements/OpenApi3-0.cjs +1 -2
- package/cjs/elements/Openapi.cjs +1 -2
- package/cjs/elements/Operation.cjs +1 -2
- package/cjs/elements/Parameter.cjs +1 -2
- package/cjs/elements/PathItem.cjs +1 -2
- package/cjs/elements/Paths.cjs +1 -2
- package/cjs/elements/Reference.cjs +1 -2
- package/cjs/elements/RequestBody.cjs +1 -2
- package/cjs/elements/Response.cjs +1 -2
- package/cjs/elements/Responses.cjs +1 -2
- package/cjs/elements/Schema.cjs +65 -2
- package/cjs/elements/SecurityRequirement.cjs +1 -2
- package/cjs/elements/SecurityScheme.cjs +1 -2
- package/cjs/elements/Server.cjs +1 -2
- package/cjs/elements/ServerVariable.cjs +1 -2
- package/cjs/elements/Tag.cjs +1 -2
- package/cjs/elements/Xml.cjs +1 -2
- package/cjs/elements/nces/ComponentsCallbacks.cjs +1 -2
- package/cjs/elements/nces/ComponentsExamples.cjs +1 -2
- package/cjs/elements/nces/ComponentsHeaders.cjs +1 -2
- package/cjs/elements/nces/ComponentsLinks.cjs +1 -2
- package/cjs/elements/nces/ComponentsParameters.cjs +1 -2
- package/cjs/elements/nces/ComponentsRequestBodies.cjs +1 -2
- package/cjs/elements/nces/ComponentsResponses.cjs +1 -2
- package/cjs/elements/nces/ComponentsSchemas.cjs +1 -2
- package/cjs/elements/nces/ComponentsSecuritySchemes.cjs +1 -2
- package/cjs/elements/nces/DiscriminatorMapping.cjs +1 -2
- package/cjs/elements/nces/EncodingHeaders.cjs +1 -2
- package/cjs/elements/nces/HeaderContent.cjs +1 -2
- package/cjs/elements/nces/HeaderExamples.cjs +1 -2
- package/cjs/elements/nces/LinkParameters.cjs +1 -2
- package/cjs/elements/nces/MediaTypeEncoding.cjs +1 -2
- package/cjs/elements/nces/MediaTypeExamples.cjs +1 -2
- package/cjs/elements/nces/OAuthFlowScopes.cjs +1 -2
- package/cjs/elements/nces/OperationCallbacks.cjs +1 -2
- package/cjs/elements/nces/OperationParameters.cjs +1 -2
- package/cjs/elements/nces/OperationSecurity.cjs +1 -2
- package/cjs/elements/nces/OperationServers.cjs +1 -2
- package/cjs/elements/nces/OperationTags.cjs +1 -2
- package/cjs/elements/nces/ParameterContent.cjs +1 -2
- package/cjs/elements/nces/ParameterExamples.cjs +1 -2
- package/cjs/elements/nces/PathItemParameters.cjs +1 -2
- package/cjs/elements/nces/PathItemServers.cjs +1 -2
- package/cjs/elements/nces/RequestBodyContent.cjs +1 -2
- package/cjs/elements/nces/ResponseContent.cjs +1 -2
- package/cjs/elements/nces/ResponseHeaders.cjs +1 -2
- package/cjs/elements/nces/ResponseLinks.cjs +1 -2
- package/cjs/elements/nces/Security.cjs +1 -2
- package/cjs/elements/nces/ServerVariables.cjs +1 -2
- package/cjs/elements/nces/Servers.cjs +1 -2
- package/cjs/elements/nces/Tags.cjs +1 -2
- package/cjs/media-types.cjs +1 -2
- package/cjs/namespace.cjs +1 -2
- package/cjs/predicates.cjs +28 -52
- package/cjs/refractor/index.cjs +1 -2
- package/cjs/refractor/plugins/replace-empty-element.cjs +7 -9
- package/cjs/refractor/predicates.cjs +4 -6
- package/cjs/refractor/specification.cjs +65 -52
- package/cjs/refractor/toolbox.cjs +1 -2
- package/cjs/refractor/visitors/FallbackVisitor.cjs +2 -3
- package/cjs/refractor/visitors/SpecificationExtensionVisitor.cjs +2 -3
- package/cjs/refractor/visitors/SpecificationVisitor.cjs +7 -4
- package/cjs/refractor/visitors/Visitor.cjs +1 -2
- package/cjs/refractor/visitors/generics/AlternatingVisitor.cjs +1 -2
- package/cjs/refractor/visitors/generics/FixedFieldsVisitor.cjs +6 -7
- package/cjs/refractor/visitors/generics/MapVisitor.cjs +1 -2
- package/cjs/refractor/visitors/generics/MixedFieldsVisitor.cjs +1 -2
- package/cjs/refractor/visitors/generics/PatternedFieldsVisitor.cjs +5 -6
- package/cjs/refractor/visitors/open-api-3-0/ContentVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/ExamplesVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/OpenapiVisitor.cjs +2 -3
- package/cjs/refractor/visitors/open-api-3-0/ParametersVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/SecurityVisitor.cjs +2 -3
- package/cjs/refractor/visitors/open-api-3-0/ServersVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/TagsVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/callback/index.cjs +3 -3
- package/cjs/refractor/visitors/open-api-3-0/components/CallbacksVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/components/ExamplesVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/components/HeadersVisitor.cjs +3 -3
- package/cjs/refractor/visitors/open-api-3-0/components/LinksVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/components/ParametersVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/components/RequestBodiesVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/components/ResponsesVisitor.cjs +3 -3
- package/cjs/refractor/visitors/open-api-3-0/components/SchemasVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/components/SecuritySchemesVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/components/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/contact/EmailVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/contact/NameVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/contact/UrlVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/contact/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/distriminator/MappingVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/distriminator/PropertyNameVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/distriminator/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/encoding/AllowReservedVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/encoding/ContentTypeVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/encoding/ExplodeVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/encoding/HeadersVisitor.cjs +3 -3
- package/cjs/refractor/visitors/open-api-3-0/encoding/StyleVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/encoding/index.cjs +2 -3
- package/cjs/refractor/visitors/open-api-3-0/example/DescriptionVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/example/ExternalValueVisitor.cjs +2 -3
- package/cjs/refractor/visitors/open-api-3-0/example/SummaryVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/example/ValueVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/example/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/external-documentation/DescriptionVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/external-documentation/UrlVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/external-documentation/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/header/AllowEmptyValueVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/header/AllowReservedVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/header/ContentVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/header/DeprecatedVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/header/DescriptionVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/header/ExampleVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/header/ExamplesVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/header/ExplodeVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/header/RequiredVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/header/SchemaVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/header/StyleVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/header/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/info/DescriptionVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/info/TermsOfServiceVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/info/TitleVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/info/VersionVisitor.cjs +2 -3
- package/cjs/refractor/visitors/open-api-3-0/info/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/license/NameVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/license/UrlVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/license/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/link/DescriptionVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/link/OperationIdVisitor.cjs +2 -3
- package/cjs/refractor/visitors/open-api-3-0/link/OperationRefVisitor.cjs +2 -3
- package/cjs/refractor/visitors/open-api-3-0/link/ParametersVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/link/RequestBodyVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/link/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/media-type/EncodingVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/media-type/ExampleVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/media-type/ExamplesVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/media-type/SchemaVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/media-type/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/oauth-flow/AuthorizationUrlVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/oauth-flow/RefreshUrlVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/oauth-flow/ScopesVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/oauth-flow/TokenUrlVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/oauth-flow/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/oauth-flows/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/operation/CallbacksVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/operation/DeprecatedVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/operation/DescriptionVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/operation/OperationIdVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/operation/ParametersVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/operation/RequestBodyVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/operation/SecurityVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/operation/ServersVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/operation/SummaryVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/operation/TagsVisitor.cjs +2 -3
- package/cjs/refractor/visitors/open-api-3-0/operation/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/parameter/AllowEmptyValueVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/parameter/AllowReservedVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/parameter/ContentVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/parameter/DeprecatedVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/parameter/DescriptionVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/parameter/ExampleVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/parameter/ExamplesVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/parameter/ExplodeVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/parameter/InVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/parameter/NameVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/parameter/RequiredVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/parameter/SchemaVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/parameter/StyleVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/parameter/index.cjs +2 -3
- package/cjs/refractor/visitors/open-api-3-0/path-item/$RefVisitor.cjs +2 -3
- package/cjs/refractor/visitors/open-api-3-0/path-item/DescriptionVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/path-item/ParametersVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/path-item/ServersVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/path-item/SummaryVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/path-item/index.cjs +3 -4
- package/cjs/refractor/visitors/open-api-3-0/paths/index.cjs +3 -3
- package/cjs/refractor/visitors/open-api-3-0/reference/$RefVisitor.cjs +2 -3
- package/cjs/refractor/visitors/open-api-3-0/reference/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/request-body/ContentVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/request-body/DescriptionVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/request-body/RequiredVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/request-body/index.cjs +2 -3
- package/cjs/refractor/visitors/open-api-3-0/response/ContentVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/response/DescriptionVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/response/HeadersVisitor.cjs +3 -3
- package/cjs/refractor/visitors/open-api-3-0/response/LinksVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/response/index.cjs +3 -4
- package/cjs/refractor/visitors/open-api-3-0/responses/DefaultVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/responses/index.cjs +4 -4
- package/cjs/refractor/visitors/open-api-3-0/schema/AllOfVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/schema/AnyOfVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/schema/DeprecatedVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/schema/ExampleVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/schema/ItemsVisitor.cjs +2 -3
- package/cjs/refractor/visitors/open-api-3-0/schema/NullableVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/schema/OneOfVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/schema/PropertiesVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/schema/SchemaOrReferenceVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/schema/TypeVisitor.cjs +2 -3
- package/cjs/refractor/visitors/open-api-3-0/schema/WriteOnlyVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/schema/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/security-requirement/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/security-scheme/BearerFormatVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/security-scheme/DescriptionVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/security-scheme/InVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/security-scheme/NameVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/security-scheme/OpenIdConnectUrlVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/security-scheme/SchemeVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/security-scheme/TypeVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/security-scheme/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/server/DescriptionVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/server/UrlVisitor.cjs +2 -3
- package/cjs/refractor/visitors/open-api-3-0/server/VariablesVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/server/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/server-variable/DefaultVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/server-variable/DescriptionVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/server-variable/EnumVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/server-variable/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/tag/DescriptionVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/tag/NameVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/tag/index.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/xml/AttributeVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/xml/NameVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/xml/NamespaceVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/xml/PrefixVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/xml/WrappedVisitor.cjs +1 -2
- package/cjs/refractor/visitors/open-api-3-0/xml/index.cjs +1 -2
- package/cjs/traversal/visitor.cjs +2 -3
- package/dist/apidom-ns-openapi-3-0.browser.js +5130 -17118
- package/dist/apidom-ns-openapi-3-0.browser.min.js +1 -1
- package/es/elements/Schema.mjs +65 -0
- package/es/predicates.mjs +4 -4
- package/es/refractor/plugins/replace-empty-element.mjs +7 -8
- package/es/refractor/predicates.mjs +2 -2
- package/es/refractor/specification.mjs +64 -50
- package/es/refractor/visitors/FallbackVisitor.mjs +2 -2
- package/es/refractor/visitors/SpecificationExtensionVisitor.mjs +2 -2
- package/es/refractor/visitors/SpecificationVisitor.mjs +8 -4
- package/es/refractor/visitors/generics/FixedFieldsVisitor.mjs +6 -6
- package/es/refractor/visitors/generics/PatternedFieldsVisitor.mjs +5 -5
- package/es/refractor/visitors/open-api-3-0/OpenapiVisitor.mjs +2 -2
- package/es/refractor/visitors/open-api-3-0/SecurityVisitor.mjs +2 -2
- package/es/refractor/visitors/open-api-3-0/callback/index.mjs +2 -1
- package/es/refractor/visitors/open-api-3-0/components/HeadersVisitor.mjs +2 -1
- package/es/refractor/visitors/open-api-3-0/components/ResponsesVisitor.mjs +2 -1
- package/es/refractor/visitors/open-api-3-0/encoding/HeadersVisitor.mjs +2 -1
- package/es/refractor/visitors/open-api-3-0/encoding/index.mjs +2 -2
- package/es/refractor/visitors/open-api-3-0/example/ExternalValueVisitor.mjs +2 -2
- package/es/refractor/visitors/open-api-3-0/info/VersionVisitor.mjs +2 -2
- package/es/refractor/visitors/open-api-3-0/link/OperationIdVisitor.mjs +2 -2
- package/es/refractor/visitors/open-api-3-0/link/OperationRefVisitor.mjs +2 -2
- package/es/refractor/visitors/open-api-3-0/operation/TagsVisitor.mjs +2 -2
- package/es/refractor/visitors/open-api-3-0/parameter/index.mjs +2 -2
- package/es/refractor/visitors/open-api-3-0/path-item/$RefVisitor.mjs +2 -2
- package/es/refractor/visitors/open-api-3-0/path-item/index.mjs +3 -3
- package/es/refractor/visitors/open-api-3-0/paths/index.mjs +2 -1
- package/es/refractor/visitors/open-api-3-0/reference/$RefVisitor.mjs +2 -2
- package/es/refractor/visitors/open-api-3-0/request-body/index.mjs +2 -2
- package/es/refractor/visitors/open-api-3-0/response/HeadersVisitor.mjs +2 -1
- package/es/refractor/visitors/open-api-3-0/response/index.mjs +3 -3
- package/es/refractor/visitors/open-api-3-0/responses/index.mjs +3 -2
- package/es/refractor/visitors/open-api-3-0/schema/ItemsVisitor.mjs +2 -2
- package/es/refractor/visitors/open-api-3-0/schema/TypeVisitor.mjs +2 -2
- package/es/refractor/visitors/open-api-3-0/server/UrlVisitor.mjs +2 -2
- package/package.json +7 -6
- package/types/dist.d.ts +53 -56
- package/cjs/refractor/visitors/open-api-3-0/schema/DefinitionsVisitor.cjs +0 -25
- package/cjs/refractor/visitors/open-api-3-0/schema/DependenciesVisitor.cjs +0 -25
- package/cjs/refractor/visitors/open-api-3-0/schema/PatternPropertiesVisitor.cjs +0 -25
- package/cjs/refractor/visitors/open-api-3-0/schema/inherited-fixed-fields.cjs +0 -15
- package/es/refractor/visitors/open-api-3-0/schema/DefinitionsVisitor.mjs +0 -19
- package/es/refractor/visitors/open-api-3-0/schema/DependenciesVisitor.mjs +0 -19
- package/es/refractor/visitors/open-api-3-0/schema/PatternPropertiesVisitor.mjs +0 -19
- package/es/refractor/visitors/open-api-3-0/schema/inherited-fixed-fields.mjs +0 -9
package/es/elements/Schema.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { UnsupportedOperationError } from '@swagger-api/apidom-error';
|
|
1
2
|
import { JSONSchemaElement } from '@swagger-api/apidom-ns-json-schema-draft-4';
|
|
3
|
+
/* eslint-disable class-methods-use-this */
|
|
2
4
|
class Schema extends JSONSchemaElement {
|
|
3
5
|
constructor(content, meta, attributes) {
|
|
4
6
|
super(content, meta, attributes);
|
|
@@ -6,6 +8,24 @@ class Schema extends JSONSchemaElement {
|
|
|
6
8
|
this.classes.push('json-schema-draft-4');
|
|
7
9
|
}
|
|
8
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Core vocabulary
|
|
13
|
+
*
|
|
14
|
+
* URI: https://tools.ietf.org/html/draft-wright-json-schema-00
|
|
15
|
+
*/
|
|
16
|
+
get idProp() {
|
|
17
|
+
throw new UnsupportedOperationError('idProp getter in Schema class is not not supported.');
|
|
18
|
+
}
|
|
19
|
+
set idProp(idProps) {
|
|
20
|
+
throw new UnsupportedOperationError('idProp setter in Schema class is not not supported.');
|
|
21
|
+
}
|
|
22
|
+
get $schema() {
|
|
23
|
+
throw new UnsupportedOperationError('$schema getter in Schema class is not not supported.');
|
|
24
|
+
}
|
|
25
|
+
set $schema($schema) {
|
|
26
|
+
throw new UnsupportedOperationError('$schema setter in Schema class is not not supported.');
|
|
27
|
+
}
|
|
28
|
+
|
|
9
29
|
/**
|
|
10
30
|
* Validation keywords for arrays
|
|
11
31
|
*/
|
|
@@ -33,6 +53,18 @@ class Schema extends JSONSchemaElement {
|
|
|
33
53
|
set additionalProperties(additionalProperties) {
|
|
34
54
|
this.set('additionalProperties', additionalProperties);
|
|
35
55
|
}
|
|
56
|
+
get patternProperties() {
|
|
57
|
+
throw new UnsupportedOperationError('patternProperties getter in Schema class is not not supported.');
|
|
58
|
+
}
|
|
59
|
+
set patternProperties(patternProperties) {
|
|
60
|
+
throw new UnsupportedOperationError('patternProperties setter in Schema class is not not supported.');
|
|
61
|
+
}
|
|
62
|
+
get dependencies() {
|
|
63
|
+
throw new UnsupportedOperationError('dependencies getter in Schema class is not not supported.');
|
|
64
|
+
}
|
|
65
|
+
set dependencies(dependencies) {
|
|
66
|
+
throw new UnsupportedOperationError('dependencies setter in Schema class is not not supported.');
|
|
67
|
+
}
|
|
36
68
|
|
|
37
69
|
/**
|
|
38
70
|
* Validation keywords for any instance type
|
|
@@ -50,6 +82,37 @@ class Schema extends JSONSchemaElement {
|
|
|
50
82
|
set not(not) {
|
|
51
83
|
this.set('not', not);
|
|
52
84
|
}
|
|
85
|
+
get definitions() {
|
|
86
|
+
throw new UnsupportedOperationError('definitions getter in Schema class is not not supported.');
|
|
87
|
+
}
|
|
88
|
+
set definitions(definitions) {
|
|
89
|
+
throw new UnsupportedOperationError('definitions setter in Schema class is not not supported.');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* JSON Hyper-Schema
|
|
94
|
+
*
|
|
95
|
+
* URI: https://datatracker.ietf.org/doc/html/draft-wright-json-schema-hyperschema-00
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
get base() {
|
|
99
|
+
throw new UnsupportedOperationError('base getter in Schema class is not not supported.');
|
|
100
|
+
}
|
|
101
|
+
set base(base) {
|
|
102
|
+
throw new UnsupportedOperationError('base setter in Schema class is not not supported.');
|
|
103
|
+
}
|
|
104
|
+
get links() {
|
|
105
|
+
throw new UnsupportedOperationError('links getter in Schema class is not not supported.');
|
|
106
|
+
}
|
|
107
|
+
set links(links) {
|
|
108
|
+
throw new UnsupportedOperationError('links setter in Schema class is not not supported.');
|
|
109
|
+
}
|
|
110
|
+
get media() {
|
|
111
|
+
throw new UnsupportedOperationError('media getter in Schema class is not not supported.');
|
|
112
|
+
}
|
|
113
|
+
set media(media) {
|
|
114
|
+
throw new UnsupportedOperationError('media setter in Schema class is not not supported.');
|
|
115
|
+
}
|
|
53
116
|
|
|
54
117
|
/**
|
|
55
118
|
* OpenAPI vocabulary
|
|
@@ -98,4 +161,6 @@ class Schema extends JSONSchemaElement {
|
|
|
98
161
|
this.set('deprecated', deprecated);
|
|
99
162
|
}
|
|
100
163
|
}
|
|
164
|
+
/* eslint-disable class-methods-use-this */
|
|
165
|
+
|
|
101
166
|
export default Schema;
|
package/es/predicates.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createPredicate, isBooleanElement, isStringElement } from '@swagger-api/apidom-core';
|
|
1
|
+
import { createPredicate, isBooleanElement, isStringElement, toValue } from '@swagger-api/apidom-core';
|
|
2
2
|
import CallbackElement from "./elements/Callback.mjs";
|
|
3
3
|
import ComponentsElement from "./elements/Components.mjs";
|
|
4
4
|
import ContactElement from "./elements/Contact.mjs";
|
|
@@ -93,7 +93,7 @@ export const isLinkElementExternal = element => {
|
|
|
93
93
|
if (!isStringElement(element.operationRef)) {
|
|
94
94
|
return false;
|
|
95
95
|
}
|
|
96
|
-
const value = element.operationRef
|
|
96
|
+
const value = toValue(element.operationRef);
|
|
97
97
|
return typeof value === 'string' && value.length > 0 && !value.startsWith('#');
|
|
98
98
|
};
|
|
99
99
|
export const isOpenapiElement = createPredicate(({
|
|
@@ -141,7 +141,7 @@ export const isPathItemElementExternal = element => {
|
|
|
141
141
|
if (!isStringElement(element.$ref)) {
|
|
142
142
|
return false;
|
|
143
143
|
}
|
|
144
|
-
const value = element.$ref
|
|
144
|
+
const value = toValue(element.$ref);
|
|
145
145
|
return typeof value === 'string' && value.length > 0 && !value.startsWith('#');
|
|
146
146
|
};
|
|
147
147
|
export const isPathsElement = createPredicate(({
|
|
@@ -165,7 +165,7 @@ export const isReferenceElementExternal = element => {
|
|
|
165
165
|
if (!isStringElement(element.$ref)) {
|
|
166
166
|
return false;
|
|
167
167
|
}
|
|
168
|
-
const value = element.$ref
|
|
168
|
+
const value = toValue(element.$ref);
|
|
169
169
|
return typeof value === 'string' && value.length > 0 && !value.startsWith('#');
|
|
170
170
|
};
|
|
171
171
|
export const isRequestBodyElement = createPredicate(({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MemberElement, ArrayElement, ObjectElement, isStringElement, includesClasses, isArrayElement } from '@swagger-api/apidom-core';
|
|
1
|
+
import { MemberElement, ArrayElement, ObjectElement, isStringElement, includesClasses, isArrayElement, cloneDeep, toValue } from '@swagger-api/apidom-core';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* OpenAPI 3.0.3 specification elements.
|
|
@@ -584,9 +584,8 @@ const schema = {
|
|
|
584
584
|
}
|
|
585
585
|
};
|
|
586
586
|
const findElementFactory = (ancestor, keyName) => {
|
|
587
|
-
var _ancestor$classes$fir, _ancestor$classes$fir2;
|
|
588
587
|
const elementType = getNodeType(ancestor); // @ts-ignore
|
|
589
|
-
const keyMapping = schema[elementType] || schema[(
|
|
588
|
+
const keyMapping = schema[elementType] || schema[toValue(ancestor.classes.first)];
|
|
590
589
|
return typeof keyMapping === 'undefined' ? undefined : Object.prototype.hasOwnProperty.call(keyMapping, '[key: *]') ? keyMapping['[key: *]'] : keyMapping[keyName];
|
|
591
590
|
};
|
|
592
591
|
const plugin = () => () => {
|
|
@@ -596,20 +595,20 @@ const plugin = () => () => {
|
|
|
596
595
|
// no empty Element, continue with next one
|
|
597
596
|
if (!isEmptyElement(element.value)) return undefined;
|
|
598
597
|
const [,,, ancestors] = rest;
|
|
599
|
-
const ancestor = ancestors
|
|
600
|
-
const elementFactory = findElementFactory(ancestor, element.key
|
|
598
|
+
const ancestor = ancestors.at(-1);
|
|
599
|
+
const elementFactory = findElementFactory(ancestor, toValue(element.key));
|
|
601
600
|
|
|
602
601
|
// no element factory found
|
|
603
602
|
if (typeof elementFactory === 'undefined') return undefined;
|
|
604
603
|
const originalValue = element.value;
|
|
605
604
|
return new MemberElement(element.key, elementFactory.call({
|
|
606
605
|
context: ancestor
|
|
607
|
-
}, undefined, originalValue.meta
|
|
606
|
+
}, undefined, cloneDeep(originalValue.meta), cloneDeep(originalValue.attributes)), cloneDeep(element.meta), cloneDeep(element.attributes));
|
|
608
607
|
},
|
|
609
608
|
StringElement(element, ...rest) {
|
|
610
609
|
if (!isEmptyElement(element)) return undefined;
|
|
611
610
|
const [,,, ancestors] = rest;
|
|
612
|
-
const ancestor = ancestors
|
|
611
|
+
const ancestor = ancestors.at(-1);
|
|
613
612
|
|
|
614
613
|
// we're only interested in empty elements in ArrayElements
|
|
615
614
|
if (!isArrayElement(ancestor)) return undefined;
|
|
@@ -619,7 +618,7 @@ const plugin = () => () => {
|
|
|
619
618
|
if (typeof elementFactory === 'undefined') return undefined;
|
|
620
619
|
return elementFactory.call({
|
|
621
620
|
context: element
|
|
622
|
-
}, undefined, element.meta
|
|
621
|
+
}, undefined, cloneDeep(element.meta), cloneDeep(element.attributes));
|
|
623
622
|
}
|
|
624
623
|
}
|
|
625
624
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isStringElement, isObjectElement } from '@swagger-api/apidom-core';
|
|
2
1
|
import { startsWith } from 'ramda';
|
|
2
|
+
import { isStringElement, isObjectElement, toValue } from '@swagger-api/apidom-core';
|
|
3
3
|
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
5
5
|
export const isOpenApi3_0LikeElement = element => {
|
|
@@ -26,5 +26,5 @@ export const isServerLikeElement = isObjectElement;
|
|
|
26
26
|
export const isTagLikeElement = isObjectElement;
|
|
27
27
|
export const isOpenApiExtension = element => {
|
|
28
28
|
// @ts-ignore
|
|
29
|
-
return isStringElement(element.key) && startsWith('x-', element.key
|
|
29
|
+
return isStringElement(element.key) && startsWith('x-', toValue(element.key));
|
|
30
30
|
};
|
|
@@ -70,17 +70,14 @@ import SchemaVisitor from "./visitors/open-api-3-0/schema/index.mjs";
|
|
|
70
70
|
import SchemaAllOfVisitor from "./visitors/open-api-3-0/schema/AllOfVisitor.mjs";
|
|
71
71
|
import SchemaAnyOfVisitor from "./visitors/open-api-3-0/schema/AnyOfVisitor.mjs";
|
|
72
72
|
import SchemaOneOfVisitor from "./visitors/open-api-3-0/schema/OneOfVisitor.mjs";
|
|
73
|
-
import SchemaDefinitionsVisitor from "./visitors/open-api-3-0/schema/DefinitionsVisitor.mjs";
|
|
74
|
-
import SchemaDependenciesVisitor from "./visitors/open-api-3-0/schema/DependenciesVisitor.mjs";
|
|
75
73
|
import SchemaItemsVisitor from "./visitors/open-api-3-0/schema/ItemsVisitor.mjs";
|
|
76
74
|
import SchemaPropertiesVisitor from "./visitors/open-api-3-0/schema/PropertiesVisitor.mjs";
|
|
77
|
-
import SchemaPatternPropertiesVisitor from "./visitors/open-api-3-0/schema/PatternPropertiesVisitor.mjs";
|
|
78
75
|
import SchemaTypeVisitor from "./visitors/open-api-3-0/schema/TypeVisitor.mjs";
|
|
79
76
|
import SchemaNullableVisitor from "./visitors/open-api-3-0/schema/NullableVisitor.mjs";
|
|
80
77
|
import SchemaWriteOnlyVisitor from "./visitors/open-api-3-0/schema/WriteOnlyVisitor.mjs";
|
|
81
78
|
import SchemaExampleVisitor from "./visitors/open-api-3-0/schema/ExampleVisitor.mjs";
|
|
82
79
|
import SchemaDeprecatedVisitor from "./visitors/open-api-3-0/schema/DeprecatedVisitor.mjs";
|
|
83
|
-
import
|
|
80
|
+
import SchemaOrReferenceVisitor from "./visitors/open-api-3-0/schema/SchemaOrReferenceVisitor.mjs";
|
|
84
81
|
import DiscriminatorVisitor from "./visitors/open-api-3-0/distriminator/index.mjs";
|
|
85
82
|
import DiscriminatorPropertyNameVisitor from "./visitors/open-api-3-0/distriminator/PropertyNameVisitor.mjs";
|
|
86
83
|
import DiscriminatorMappingVisitor from "./visitors/open-api-3-0/distriminator/MappingVisitor.mjs";
|
|
@@ -169,46 +166,9 @@ import TagsVisitor from "./visitors/open-api-3-0/TagsVisitor.mjs";
|
|
|
169
166
|
*
|
|
170
167
|
* Note: Specification object allows to use absolute internal JSON pointers.
|
|
171
168
|
*/
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
$ref: Reference$RefVisitor
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
const SchemaSpecification = {
|
|
179
|
-
$visitor: SchemaVisitor,
|
|
180
|
-
fixedFields: {
|
|
181
|
-
...schemaInheritedFixedFields,
|
|
182
|
-
// validation vocabulary
|
|
183
|
-
// validation keywords for any instance type
|
|
184
|
-
allOf: SchemaAllOfVisitor,
|
|
185
|
-
anyOf: SchemaAnyOfVisitor,
|
|
186
|
-
oneOf: SchemaOneOfVisitor,
|
|
187
|
-
definitions: SchemaDefinitionsVisitor,
|
|
188
|
-
// validation keywords for arrays
|
|
189
|
-
items: SchemaItemsVisitor,
|
|
190
|
-
// Validation keywords for objects
|
|
191
|
-
dependencies: SchemaDependenciesVisitor,
|
|
192
|
-
properties: SchemaPropertiesVisitor,
|
|
193
|
-
patternProperties: SchemaPatternPropertiesVisitor,
|
|
194
|
-
// validation keywords for any instance type
|
|
195
|
-
type: SchemaTypeVisitor,
|
|
196
|
-
// OpenAPI vocabulary
|
|
197
|
-
nullable: SchemaNullableVisitor,
|
|
198
|
-
discriminator: {
|
|
199
|
-
$ref: '#/visitors/document/objects/Discriminator'
|
|
200
|
-
},
|
|
201
|
-
writeOnly: SchemaWriteOnlyVisitor,
|
|
202
|
-
xml: {
|
|
203
|
-
$ref: '#/visitors/document/objects/XML'
|
|
204
|
-
},
|
|
205
|
-
externalDocs: {
|
|
206
|
-
$ref: '#/visitors/document/objects/ExternalDocumentation'
|
|
207
|
-
},
|
|
208
|
-
example: SchemaExampleVisitor,
|
|
209
|
-
deprecated: SchemaDeprecatedVisitor
|
|
210
|
-
}
|
|
211
|
-
};
|
|
169
|
+
const {
|
|
170
|
+
fixedFields: jsonSchemaFixedFields
|
|
171
|
+
} = JSONSchemaDraft4Specification.visitors.document.objects.JSONSchema;
|
|
212
172
|
const specification = {
|
|
213
173
|
visitors: {
|
|
214
174
|
value: FallbackVisitor,
|
|
@@ -471,12 +431,66 @@ const specification = {
|
|
|
471
431
|
}
|
|
472
432
|
}
|
|
473
433
|
},
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
434
|
+
Reference: {
|
|
435
|
+
$visitor: ReferenceVisitor,
|
|
436
|
+
fixedFields: {
|
|
437
|
+
$ref: Reference$RefVisitor
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
JSONSchema: {
|
|
441
|
+
$ref: '#/visitors/document/objects/Schema'
|
|
442
|
+
},
|
|
443
|
+
JSONReference: {
|
|
444
|
+
$ref: '#/visitors/document/objects/Reference'
|
|
445
|
+
},
|
|
446
|
+
Schema: {
|
|
447
|
+
$visitor: SchemaVisitor,
|
|
448
|
+
fixedFields: {
|
|
449
|
+
// the following properties are taken directly from the JSON Schema definition and follow the same specifications
|
|
450
|
+
title: jsonSchemaFixedFields.title,
|
|
451
|
+
multipleOf: jsonSchemaFixedFields.multipleOf,
|
|
452
|
+
maximum: jsonSchemaFixedFields.maximum,
|
|
453
|
+
exclusiveMaximum: jsonSchemaFixedFields.exclusiveMaximum,
|
|
454
|
+
minimum: jsonSchemaFixedFields.minimum,
|
|
455
|
+
exclusiveMinimum: jsonSchemaFixedFields.exclusiveMinimum,
|
|
456
|
+
maxLength: jsonSchemaFixedFields.maxLength,
|
|
457
|
+
minLength: jsonSchemaFixedFields.minLength,
|
|
458
|
+
pattern: jsonSchemaFixedFields.pattern,
|
|
459
|
+
maxItems: jsonSchemaFixedFields.maxItems,
|
|
460
|
+
minItems: jsonSchemaFixedFields.minItems,
|
|
461
|
+
uniqueItems: jsonSchemaFixedFields.uniqueItems,
|
|
462
|
+
maxProperties: jsonSchemaFixedFields.maxProperties,
|
|
463
|
+
minProperties: jsonSchemaFixedFields.minProperties,
|
|
464
|
+
required: jsonSchemaFixedFields.required,
|
|
465
|
+
enum: jsonSchemaFixedFields.enum,
|
|
466
|
+
// the following properties are taken from the JSON Schema definition but their definitions were adjusted to the OpenAPI Specification
|
|
467
|
+
type: SchemaTypeVisitor,
|
|
468
|
+
allOf: SchemaAllOfVisitor,
|
|
469
|
+
anyOf: SchemaAnyOfVisitor,
|
|
470
|
+
oneOf: SchemaOneOfVisitor,
|
|
471
|
+
not: SchemaOrReferenceVisitor,
|
|
472
|
+
items: SchemaItemsVisitor,
|
|
473
|
+
properties: SchemaPropertiesVisitor,
|
|
474
|
+
additionalProperties: SchemaOrReferenceVisitor,
|
|
475
|
+
description: jsonSchemaFixedFields.description,
|
|
476
|
+
format: jsonSchemaFixedFields.format,
|
|
477
|
+
default: jsonSchemaFixedFields.default,
|
|
478
|
+
// OpenAPI vocabulary
|
|
479
|
+
nullable: SchemaNullableVisitor,
|
|
480
|
+
discriminator: {
|
|
481
|
+
$ref: '#/visitors/document/objects/Discriminator'
|
|
482
|
+
},
|
|
483
|
+
writeOnly: SchemaWriteOnlyVisitor,
|
|
484
|
+
xml: {
|
|
485
|
+
$ref: '#/visitors/document/objects/XML'
|
|
486
|
+
},
|
|
487
|
+
externalDocs: {
|
|
488
|
+
$ref: '#/visitors/document/objects/ExternalDocumentation'
|
|
489
|
+
},
|
|
490
|
+
example: SchemaExampleVisitor,
|
|
491
|
+
deprecated: SchemaDeprecatedVisitor
|
|
492
|
+
}
|
|
493
|
+
},
|
|
480
494
|
Discriminator: {
|
|
481
495
|
$visitor: DiscriminatorVisitor,
|
|
482
496
|
fixedFields: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
-
import { BREAK } from '@swagger-api/apidom-core';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
3
|
import Visitor from "./Visitor.mjs";
|
|
4
4
|
/**
|
|
5
5
|
* This visitor is responsible for falling back to current traversed element
|
|
@@ -10,7 +10,7 @@ import Visitor from "./Visitor.mjs";
|
|
|
10
10
|
const FallbackVisitor = stampit(Visitor, {
|
|
11
11
|
methods: {
|
|
12
12
|
enter(element) {
|
|
13
|
-
this.element = element
|
|
13
|
+
this.element = cloneDeep(element);
|
|
14
14
|
return BREAK;
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
-
import { BREAK } from '@swagger-api/apidom-core';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
3
|
import SpecificationVisitor from "./SpecificationVisitor.mjs";
|
|
4
4
|
const SpecificationExtensionVisitor = stampit(SpecificationVisitor, {
|
|
5
5
|
methods: {
|
|
6
6
|
MemberElement(memberElement) {
|
|
7
|
-
this.element = memberElement
|
|
7
|
+
this.element = cloneDeep(memberElement);
|
|
8
8
|
this.element.classes.push('specification-extension');
|
|
9
9
|
return BREAK;
|
|
10
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
-
import { pathSatisfies, path, pick
|
|
2
|
+
import { pathSatisfies, path, pick } from 'ramda';
|
|
3
3
|
import { isFunction, isUndefined } from 'ramda-adjunct';
|
|
4
|
-
import { visit } from '@swagger-api/apidom-core';
|
|
4
|
+
import { visit, cloneDeep } from '@swagger-api/apidom-core';
|
|
5
5
|
import Visitor from "./Visitor.mjs";
|
|
6
6
|
import { keyMap, getNodeType } from "../../traversal/visitor.mjs";
|
|
7
7
|
/**
|
|
@@ -32,7 +32,11 @@ const SpecificationVisitor = stampit(Visitor, {
|
|
|
32
32
|
return pick(this.passingOptionsNames, this);
|
|
33
33
|
},
|
|
34
34
|
retrieveFixedFields(specPath) {
|
|
35
|
-
|
|
35
|
+
const fixedFields = path(['visitors', ...specPath, 'fixedFields'], this.specObj);
|
|
36
|
+
if (typeof fixedFields === 'object' && fixedFields !== null) {
|
|
37
|
+
return Object.keys(fixedFields);
|
|
38
|
+
}
|
|
39
|
+
return [];
|
|
36
40
|
},
|
|
37
41
|
retrieveVisitor(specPath) {
|
|
38
42
|
if (pathSatisfies(isFunction, ['visitors', ...specPath], this.specObj)) {
|
|
@@ -62,7 +66,7 @@ const SpecificationVisitor = stampit(Visitor, {
|
|
|
62
66
|
this.fallbackVisitorPrototype = Object.getPrototypeOf(this.retrieveVisitorInstance(['value']));
|
|
63
67
|
}
|
|
64
68
|
if (this.fallbackVisitorPrototype === visitorPrototype) {
|
|
65
|
-
return element
|
|
69
|
+
return cloneDeep(element);
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
// standard processing continues
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
2
|
import { noop } from 'ramda-adjunct';
|
|
3
|
-
import { isStringElement, MemberElement, BREAK } from '@swagger-api/apidom-core';
|
|
3
|
+
import { isStringElement, MemberElement, BREAK, cloneDeep, toValue } from '@swagger-api/apidom-core';
|
|
4
4
|
import SpecificationVisitor from "../SpecificationVisitor.mjs";
|
|
5
5
|
import { isOpenApiExtension } from "../../predicates.mjs";
|
|
6
6
|
const FixedFieldsVisitor = stampit(SpecificationVisitor, {
|
|
@@ -30,17 +30,17 @@ const FixedFieldsVisitor = stampit(SpecificationVisitor, {
|
|
|
30
30
|
const specPath = this.specPath(objectElement);
|
|
31
31
|
const fields = this.retrieveFixedFields(specPath);
|
|
32
32
|
objectElement.forEach((value, key, memberElement) => {
|
|
33
|
-
if (isStringElement(key) && fields.includes(
|
|
34
|
-
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields',
|
|
35
|
-
const newMemberElement = new MemberElement(key
|
|
33
|
+
if (isStringElement(key) && fields.includes(toValue(key)) && !this.ignoredFields.includes(toValue(key))) {
|
|
34
|
+
const fixedFieldElement = this.toRefractedElement([...specPath, 'fixedFields', toValue(key)], value);
|
|
35
|
+
const newMemberElement = new MemberElement(cloneDeep(key), fixedFieldElement);
|
|
36
36
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
37
37
|
newMemberElement.classes.push('fixed-field');
|
|
38
38
|
this.element.content.push(newMemberElement);
|
|
39
39
|
} else if (this.canSupportSpecificationExtensions && this.specificationExtensionPredicate(memberElement)) {
|
|
40
40
|
const extensionElement = this.toRefractedElement(['document', 'extension'], memberElement);
|
|
41
41
|
this.element.content.push(extensionElement);
|
|
42
|
-
} else if (!this.ignoredFields.includes(
|
|
43
|
-
this.element.content.push(memberElement
|
|
42
|
+
} else if (!this.ignoredFields.includes(toValue(key))) {
|
|
43
|
+
this.element.content.push(cloneDeep(memberElement));
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
2
|
import { F as stubFalse } from 'ramda';
|
|
3
3
|
import { noop } from 'ramda-adjunct';
|
|
4
|
-
import { MemberElement, BREAK } from '@swagger-api/apidom-core';
|
|
4
|
+
import { MemberElement, BREAK, cloneDeep, toValue } from '@swagger-api/apidom-core';
|
|
5
5
|
import SpecificationVisitor from "../SpecificationVisitor.mjs";
|
|
6
6
|
import { isOpenApiExtension } from "../../predicates.mjs";
|
|
7
7
|
const PatternedFieldsJsonObjectVisitor = stampit(SpecificationVisitor, {
|
|
@@ -34,15 +34,15 @@ const PatternedFieldsJsonObjectVisitor = stampit(SpecificationVisitor, {
|
|
|
34
34
|
if (this.canSupportSpecificationExtensions && this.specificationExtensionPredicate(memberElement)) {
|
|
35
35
|
const extensionElement = this.toRefractedElement(['document', 'extension'], memberElement);
|
|
36
36
|
this.element.content.push(extensionElement);
|
|
37
|
-
} else if (!this.ignoredFields.includes(
|
|
37
|
+
} else if (!this.ignoredFields.includes(toValue(key)) && this.fieldPatternPredicate(toValue(key))) {
|
|
38
38
|
const specPath = this.specPath(value);
|
|
39
39
|
const patternedFieldElement = this.toRefractedElement(specPath, value);
|
|
40
|
-
const newMemberElement = new MemberElement(key
|
|
40
|
+
const newMemberElement = new MemberElement(cloneDeep(key), patternedFieldElement);
|
|
41
41
|
this.copyMetaAndAttributes(memberElement, newMemberElement);
|
|
42
42
|
newMemberElement.classes.push('patterned-field');
|
|
43
43
|
this.element.content.push(newMemberElement);
|
|
44
|
-
} else if (!this.ignoredFields.includes(
|
|
45
|
-
this.element.content.push(memberElement
|
|
44
|
+
} else if (!this.ignoredFields.includes(toValue(key))) {
|
|
45
|
+
this.element.content.push(cloneDeep(memberElement));
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
this.copyMetaAndAttributes(objectElement, this.element);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
-
import { BREAK } from '@swagger-api/apidom-core';
|
|
2
|
+
import { BREAK, toValue } from '@swagger-api/apidom-core';
|
|
3
3
|
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
4
4
|
import SpecificationVisitor from "../SpecificationVisitor.mjs";
|
|
5
5
|
import OpenapiElement from "../../../elements/Openapi.mjs";
|
|
6
6
|
const OpenapiVisitor = stampit(SpecificationVisitor, FallbackVisitor, {
|
|
7
7
|
methods: {
|
|
8
8
|
StringElement(stringElement) {
|
|
9
|
-
const openapiElement = new OpenapiElement(
|
|
9
|
+
const openapiElement = new OpenapiElement(toValue(stringElement));
|
|
10
10
|
this.copyMetaAndAttributes(stringElement, openapiElement);
|
|
11
11
|
this.element = openapiElement;
|
|
12
12
|
return BREAK;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
-
import { isObjectElement, BREAK } from '@swagger-api/apidom-core';
|
|
2
|
+
import { isObjectElement, BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
3
|
import SecurityElement from "../../../elements/nces/Security.mjs";
|
|
4
4
|
import SpecificationVisitor from "../SpecificationVisitor.mjs";
|
|
5
5
|
import FallbackVisitor from "../FallbackVisitor.mjs";
|
|
@@ -14,7 +14,7 @@ const SecurityVisitor = stampit(SpecificationVisitor, FallbackVisitor, {
|
|
|
14
14
|
const element = this.toRefractedElement(['document', 'objects', 'SecurityRequirement'], item);
|
|
15
15
|
this.element.push(element);
|
|
16
16
|
} else {
|
|
17
|
-
this.element.push(item
|
|
17
|
+
this.element.push(cloneDeep(item));
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
this.copyMetaAndAttributes(arrayElement, this.element);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
2
|
import { test, always } from 'ramda';
|
|
3
|
+
import { toValue } from '@swagger-api/apidom-core';
|
|
3
4
|
import CallbackElement from "../../../../elements/Callback.mjs";
|
|
4
5
|
import PatternedFieldsVisitor from "../../generics/PatternedFieldsVisitor.mjs";
|
|
5
6
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
@@ -21,7 +22,7 @@ const CallbackVisitor = stampit(PatternedFieldsVisitor, FallbackVisitor, {
|
|
|
21
22
|
|
|
22
23
|
// decorate every PathItemElement with Callback Object expression metadata
|
|
23
24
|
this.element.filter(isPathItemElement).forEach((pathItemElement, key) => {
|
|
24
|
-
pathItemElement.setMetaProperty('runtime-expression',
|
|
25
|
+
pathItemElement.setMetaProperty('runtime-expression', toValue(key));
|
|
25
26
|
});
|
|
26
27
|
return result;
|
|
27
28
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
+
import { toValue } from '@swagger-api/apidom-core';
|
|
2
3
|
import ComponentsHeadersElement from "../../../../elements/nces/ComponentsHeaders.mjs";
|
|
3
4
|
import MapVisitor from "../../generics/MapVisitor.mjs";
|
|
4
5
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
@@ -26,7 +27,7 @@ const HeadersVisitor = stampit(MapVisitor, FallbackVisitor, {
|
|
|
26
27
|
|
|
27
28
|
// decorate every HeaderElement with metadata about their name
|
|
28
29
|
this.element.filter(isHeaderElement).forEach((value, key) => {
|
|
29
|
-
value.setMetaProperty('header-name',
|
|
30
|
+
value.setMetaProperty('header-name', toValue(key));
|
|
30
31
|
});
|
|
31
32
|
return result;
|
|
32
33
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
+
import { toValue } from '@swagger-api/apidom-core';
|
|
2
3
|
import ComponentsResponsesElement from "../../../../elements/nces/ComponentsResponses.mjs";
|
|
3
4
|
import MapVisitor from "../../generics/MapVisitor.mjs";
|
|
4
5
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
@@ -26,7 +27,7 @@ const ResponsesVisitor = stampit(MapVisitor, FallbackVisitor, {
|
|
|
26
27
|
|
|
27
28
|
// decorate every ResponseElement with metadata about their status code
|
|
28
29
|
this.element.filter(isResponseElement).forEach((value, key) => {
|
|
29
|
-
value.setMetaProperty('http-status-code',
|
|
30
|
+
value.setMetaProperty('http-status-code', toValue(key));
|
|
30
31
|
});
|
|
31
32
|
return result;
|
|
32
33
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
+
import { toValue } from '@swagger-api/apidom-core';
|
|
2
3
|
import MapVisitor from "../../generics/MapVisitor.mjs";
|
|
3
4
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
4
5
|
import { isReferenceLikeElement } from "../../../predicates.mjs";
|
|
@@ -24,7 +25,7 @@ const HeadersVisitor = stampit(MapVisitor, FallbackVisitor, {
|
|
|
24
25
|
// decorate every HeaderElement with metadata about their name
|
|
25
26
|
this.element.forEach((value, key) => {
|
|
26
27
|
if (!isHeaderElement(value)) return;
|
|
27
|
-
const headerName =
|
|
28
|
+
const headerName = toValue(key);
|
|
28
29
|
value.setMetaProperty('headerName', headerName);
|
|
29
30
|
});
|
|
30
31
|
return result;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
2
|
import { always } from 'ramda';
|
|
3
|
-
import { isObjectElement } from '@swagger-api/apidom-core';
|
|
3
|
+
import { isObjectElement, toValue } from '@swagger-api/apidom-core';
|
|
4
4
|
import EncodingElement from "../../../../elements/Encoding.mjs";
|
|
5
5
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
6
6
|
import FixedFieldsVisitor from "../../generics/FixedFieldsVisitor.mjs";
|
|
@@ -21,7 +21,7 @@ const EncodingVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, {
|
|
|
21
21
|
// decorate every Header with media type metadata
|
|
22
22
|
if (isObjectElement(this.element.headers)) {
|
|
23
23
|
this.element.headers.filter(isHeaderElement).forEach((headerElement, key) => {
|
|
24
|
-
headerElement.setMetaProperty('header-name',
|
|
24
|
+
headerElement.setMetaProperty('header-name', toValue(key));
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
return result;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
-
import { BREAK } from '@swagger-api/apidom-core';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
3
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
4
4
|
const ExternalValueVisitor = stampit(FallbackVisitor, {
|
|
5
5
|
methods: {
|
|
6
6
|
StringElement(stringElement) {
|
|
7
|
-
this.element = stringElement
|
|
7
|
+
this.element = cloneDeep(stringElement);
|
|
8
8
|
this.element.classes.push('reference-value');
|
|
9
9
|
return BREAK;
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
-
import { BREAK } from '@swagger-api/apidom-core';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
3
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
4
4
|
const VersionVisitor = stampit(FallbackVisitor, {
|
|
5
5
|
methods: {
|
|
6
6
|
StringElement(stringElement) {
|
|
7
|
-
this.element = stringElement
|
|
7
|
+
this.element = cloneDeep(stringElement);
|
|
8
8
|
this.element.classes.push('api-version');
|
|
9
9
|
this.element.classes.push('version');
|
|
10
10
|
return BREAK;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
-
import { BREAK } from '@swagger-api/apidom-core';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
3
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
4
4
|
const OperationIdVisitor = stampit(FallbackVisitor, {
|
|
5
5
|
methods: {
|
|
6
6
|
StringElement(stringElement) {
|
|
7
|
-
this.element = stringElement
|
|
7
|
+
this.element = cloneDeep(stringElement);
|
|
8
8
|
this.element.classes.push('reference-value');
|
|
9
9
|
return BREAK;
|
|
10
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
-
import { BREAK } from '@swagger-api/apidom-core';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
3
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
4
4
|
const OperationRefVisitor = stampit(FallbackVisitor, {
|
|
5
5
|
methods: {
|
|
6
6
|
StringElement(stringElement) {
|
|
7
|
-
this.element = stringElement
|
|
7
|
+
this.element = cloneDeep(stringElement);
|
|
8
8
|
this.element.classes.push('reference-value');
|
|
9
9
|
return BREAK;
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import stampit from 'stampit';
|
|
2
|
-
import { BREAK } from '@swagger-api/apidom-core';
|
|
2
|
+
import { BREAK, cloneDeep } from '@swagger-api/apidom-core';
|
|
3
3
|
import OperationTagsElement from "../../../../elements/nces/OperationTags.mjs";
|
|
4
4
|
import FallbackVisitor from "../../FallbackVisitor.mjs";
|
|
5
5
|
const TagsVisitor = stampit(FallbackVisitor, {
|
|
@@ -8,7 +8,7 @@ const TagsVisitor = stampit(FallbackVisitor, {
|
|
|
8
8
|
},
|
|
9
9
|
methods: {
|
|
10
10
|
ArrayElement(arrayElement) {
|
|
11
|
-
this.element = this.element.concat(arrayElement
|
|
11
|
+
this.element = this.element.concat(cloneDeep(arrayElement));
|
|
12
12
|
return BREAK;
|
|
13
13
|
}
|
|
14
14
|
}
|