Skip to content

Releases: aml-org/amf

Changes in 4.7.2

Changes in 4.7.1

11 Mar 14:31
44c9a82
Compare
Choose a tag to compare

Released March 10, 2021.

JS asset

JVM asset

Model changes (AMF model version from 2.4.0 to 3.0.0)

Fixed IRI clash between Server,Operation,Message and ChannelBindings's binding field and:

  • OperationModel -> Bindings
  • EndpointModel -> Bindings
  • ServerModel -> Bindings
  • MessageModel -> Bindings

The iri for the Server,Operation,Message and ChannelBindings "binding" field was changed from http://a.ml/vocabularies/apiBinding#binding to http://a.ml/vocabularies/apiBinding#bindings

Adjust error messages in JVM validation associated to decimal values

In the previous release of AMF (4.7.0) our json schema library was updated generating certain differences in our messages for payload validations. More specifically, as all decimal values are now parsed as BigDecimals, this was reflected in messages of the following type:

previous to 4.7.0 - expected type: Integer, found: Double
4.7.0 - expected type: Integer, found: BigDecimal

In this release a minor fix was made to maintain our old messages, as they are more clear for the end user and abstract away implementation specific terminology.

AMF Fixed issues

APIMF-2929 - Adjust error messages in JVM validation associated to decimal values
APIMF-2902 - Payload validation ignores text at the right of the main JSON flow
APIMF-2897 - $ref not resolved in operationTraits defined in components
APIMF-2854 - Implement: JSON-LD encoded URI's checker for internal testing
APIMF-2853 - Analysis: Compatibility pipeline should convert non-used declarations
APIMF-2829 - StackOverflow on fromNativeRdfModel
APIMF-2376 - AMF invalid validation with object payloads inside enum
APIMF-2264 - Do not throw validations when merging inferred nodes
APIMF-2105 - IRI ApiContract + binding is used for fields of different type.

Changes in 4.7.0

09 Feb 19:26
9b9ab57
Compare
Choose a tag to compare

Released Feb 9, 2021.

JS asset

JVM asset

Model changes (AMF model version from 2.3.0 to 2.4.0)

CustomDomainProperties were added to Module.

Paths Refactor

We made some internal changes in the methods that we use to normalize and resolve paths and URIs. This refactor will bring more consistency and robustness when managing paths and URIs.

RAML 1.0 - Fixed parsing of inlined raw external schema wrappers

Before, external type wrapper facets were involuntarily overriden if the inlined schema defined the same facet.

For example:

A:
  description: an inlined json schema
  examples:
      test:
        input: "my string"
  type: |
              {
                "$schema": "http://json-schema.org/draft-03/schema",
                "properties": {
                  "input": {
                    "required": false,
                    "type": "string"
                  }
                },
                "description": "Inner description",
                "required": false,
                "type": "object"
              }

In the example, type A defines a wrapper for the inlined JSON Schema. Before, the inlined type overrode some of the facets of type A like "description. Querying the "description" facet of A would yield "inner description", not "an inlined json schema".
Now, the inlined JSON Schema is parsed as an inheritance to type A, thus maintaining A's own facets intact. Querying the new A's "description" facet will now yield "an inlined json schema". This applies to all the fields that are allowed in type wrappers as defined by the spec.

Interface Changes

CustomDomainProperties (annotations) in Module

A new CustomizableElement interface was created defining common CustomDomainProperties getter and setter methods which where defined in DomainElement. Module and DomainElement now extends this interface.

Added

  • amf.client.model.document.Module.customDomainProperties(..)
  • amf.client.model.document.Module.withCustomDomainProperties(..)

Generic Parse Method

A new method of generic parser was added to the CoreWrapper client interface.

Added

  • amf.client.CoreWrapper.parser(..)

Dependencies Changes

Updated

  • com.github.everit-org.json-schema % org.everit.json.schema moved from 1.9.2 to 1.12.2
  • org.json % json moved from 20180130 to 20201115

AMF Fixed issues

APIMF-2875 - Can't parse JSON-LD from a RAML Extension
APIMF-2873 - Delta: Everit exception with $ref in adittionalProperties
APIMF-2862 - '$ref' key must be validated in operation object
APIMF-2852 - JSON-LD parser resolves non-relative URIs
APIMF-2845 - Implement: custom types support
APIMF-2814 - Validation not working OK with 16 digit number
APIMF-2811 - Review custom thread pool usage
APIMF-2810 - High memory consumption/timeout at transforming time
APIMF-2805 - Custom resource loader not working in JS
APIMF-2799 - Custom Validation with SPARQL query is not working in JS :octocat: Github Issue #790
APIMF-2797 - Analyze SBT API to obtain sources path from source dependencies
APIMF-2790 - Operation node method is overriden by trait
APIMF-2789 - Automatic JSON-LD context generation for AML
APIMF-2786 - Analyze performance fixes for forked repository of SHACL
APIMF-2777 - Initial analysis on node parsers indexation
APIMF-2769 - Annotations in root level of RAML library are missing :octocat: Github Issue #779
APIMF-2763 - PoC to unify resolve methods in amf.core.Context and WebApiContext
APIMF-2759 - Performance improvement: improve performance of new AstIndexBuilder to match or improve JsonSchemaAstIndex's.
APIMF-2732 - No way to distinguish inline Json Schema from Raml type
APIMF-2723 - Spaces are not being encoded for jsonld
APIMF-2722 - Error with canonical transformation for async api
APIMF-2721 - Analyze: @types publication in Plugin
APIMF-2719 - Analyze Scala's reflection capabilities to avoid depending entirely on parsing
APIMF-2716 - Analyze implementation feasibility for typings cases with Scalameta
APIMF-2711 - Analysis/Profiling/Debugging Performance: Custom validation takes more than 2 minutes
APIMF-2684 - Missing closed shape for json schema draft versions
APIMF-2607 - Wrong range in RAML example inclusion
APIMF-2241 - Float is getting validated as Long
APIMF-1994 - AnyShape facet validation makes rendering throw exception
APIMF-1796 - Missing validation for additionalProperties facet

Changes in 4.6.0

11 Jan 17:57
7262e5b
Compare
Choose a tag to compare

Released Jan 11, 2021.

JS asset

JVM asset

Interface Changes

Payload and parameter validator for RecursiveShape

A new ValidatorAware interface was created defining common payload and parameter validation methods which where defined in AnyShape. RecursiveShape now extends this interface.

Added

  • amf.client.model.domain.RecursiveShape.payloadValidator(..)
  • amf.client.model.domain.RecursiveShape.parameterValidator(..)

Dependencies Changes

Updated

  • com.fasterxml.jackson.core % jackson-databind moved from 2.10.1 to 2.11.0

Removed

  • org.topbraid % shacl 1.3.0

AMF Fixed issues

APIMF-2768 - Many SYAML conversions produce Exception instead of being accumulated in the ErrorHandler
APIMF-2765 - Analyze and remove unused dependencies
APIMF-2760 - Not being able to get validator from recursive shape
APIMF-2749 - Id lost with Query String
APIMF-2735 - SE: Unexpected key 'anyOf' when convert OAS with "nullable" field to RAML
APIMF-2733 - integrate stg.a.ml landing to our docs
APIMF-2770 - Integrate new stg.a.ml changes to our docs
APIMF-2712 - Syntax error in included file is duplicated when applied on resourcetype/traits
APIMF-2686 - Analysis for update jackson databind version to 2.11.x
APIMF-2588 - Wrong required value in header due to duplicate id

Changes in 4.5.1

16 Dec 19:39
68006a1
Compare
Choose a tag to compare

Released Dec 15, 2020.

JS asset

JVM asset

Model changes (AMF model version 2.2.0 -> 2.3.0)

PropertySource and PropertyTarget properties in the AMF model where modified from Uri to String.

In JSON Schema definitions which use the dependencies facet, the source and target of such dependencies were stored in the graph as Uri references to the parsed properties. Now the graph stores the raw names of such properties (as defined in the JSON Schema) rather than the ID of the parsed properties.

New Features

JSON parsing recovery

  • More entries saved in case or error
  • Some optimizations in SYAML JSON parser enables AMF to recover from JSON syntax errors and parse parts of a JSON file.
    This translates into more entries in the model in case of syntax error and more precise error messages.
  • Multiline JSON strings now are validated
  • According to the JSON definition, a line break in a JSON string MUST be escaped ('\n').
    This was not working correctly in some cases but now a syntax error will be shown in case of a line break in a string.

JSON Schema 2019

AMF can now parse and emit JSON Schema 2019 referenced in other specs.

Caveats

  • We are still waiting for validator support for JSON Schema 2019. Therefore, AMF Shapes containing fields of said draft that are incompatible with draft-7 will not be used in validation. A warning will be emitted for each incompatible field. The incompatible fields are:
    • unevaluatedProperties
    • unevaluatedItems
    • minContains
    • maxContains

Interface Changes

AML Links

Added

  • amf.client.model.domain.Scope.isExternalLink(..)
  • amf.client.model.domain.Scope.withIsExternalLink(..)
  • amf.client.model.domain.CreativeWork.isExternalLink(..)
  • amf.client.model.domain.CreativeWork.withIsExternalLink(..)
  • amf.client.model.domain.MqttOperationBinding.isExternalLink(..)
  • amf.client.model.domain.MqttOperationBinding.withIsExternalLink(..)
  • amf.client.model.domain.CustomDomainProperty.isExternalLink(..)
  • amf.client.model.domain.CustomDomainProperty.withIsExternalLink(..)
  • amf.client.model.domain.ParametrizedSecurityScheme.isExternalLink(..)
  • amf.client.model.domain.ParametrizedSecurityScheme.withIsExternalLink(..)
  • amf.client.model.domain.Example.isExternalLink(..)
  • amf.client.model.domain.Example.withIsExternalLink(..)
  • amf.client.model.domain.MqttMessageBinding.isExternalLink(..)
  • amf.client.model.domain.MqttMessageBinding.withIsExternalLink(..)
  • amf.client.model.domain.MessageBindings.isExternalLink(..)
  • amf.client.model.domain.MessageBindings.withIsExternalLink(..)
  • amf.client.model.domain.Callback.isExternalLink(..)
  • amf.client.model.domain.Callback.withIsExternalLink(..)
  • amf.client.model.domain.ParametrizedTrait.isExternalLink(..)
  • amf.client.model.domain.ParametrizedTrait.withIsExternalLink(..)
  • amf.client.model.domain.Amqp091OperationBinding.isExternalLink(..)
  • amf.client.model.domain.Amqp091OperationBinding.withIsExternalLink(..)
  • amf.client.model.domain.KafkaOperationBinding.isExternalLink(..)
  • amf.client.model.domain.KafkaOperationBinding.withIsExternalLink(..)
  • amf.client.model.domain.ResourceType.isExternalLink(..)
  • amf.client.model.domain.ResourceType.withIsExternalLink(..)
  • amf.client.model.domain.NodeShape.isExternalLink(..)
  • amf.client.model.domain.NodeShape.withIsExternalLink(..)
  • amf.client.model.domain.WebApi.isExternalLink(..)
  • amf.client.model.domain.WebApi.withIsExternalLink(..)
  • amf.client.model.domain.TemplatedLink.isExternalLink(..)
  • amf.client.model.domain.TemplatedLink.withIsExternalLink(..)
  • amf.client.model.domain.SchemaShape.isExternalLink(..)
  • amf.client.model.domain.SchemaShape.withIsExternalLink(..)
  • amf.client.model.domain.ServerBindings.isExternalLink(..)
  • amf.client.model.domain.ServerBindings.withIsExternalLink(..)
  • amf.client.model.domain.KafkaMessageBinding.isExternalLink(..)
  • amf.client.model.domain.KafkaMessageBinding.withIsExternalLink(..)
  • amf.client.model.domain.HttpMessageBinding.isExternalLink(..)
  • amf.client.model.domain.HttpMessageBinding.withIsExternalLink(..)
  • amf.client.model.domain.ParametrizedDeclaration.isExternalLink(..)
  • amf.client.model.domain.ParametrizedDeclaration.withIsExternalLink(..)
  • amf.client.model.domain.Operation.isExternalLink(..)
  • amf.client.model.domain.Operation.withIsExternalLink(..)
  • amf.client.model.domain.Amqp091MessageBinding.isExternalLink(..)
  • amf.client.model.domain.Amqp091MessageBinding.withIsExternalLink(..)
  • amf.client.model.domain.SecurityRequirement.isExternalLink(..)
  • amf.client.model.domain.SecurityRequirement.withIsExternalLink(..)
  • amf.client.model.domain.Settings.isExternalLink(..)
  • amf.client.model.domain.Settings.withIsExternalLink(..)
  • amf.client.model.domain.VariableValue.isExternalLink(..)
  • amf.client.model.domain.VariableValue.withIsExternalLink(..)
  • amf.client.model.domain.DialectDomainElement.isExternalLink(..)
  • amf.client.model.domain.DialectDomainElement.withIsExternalLink(..)
  • amf.client.model.domain.MqttServerBinding.isExternalLink(..)
  • amf.client.model.domain.MqttServerBinding.withIsExternalLink(..)
  • amf.client.model.domain.OAuth2Flow.isExternalLink(..)
  • amf.client.model.domain.OAuth2Flow.withIsExternalLink(..)
  • amf.client.model.domain.MqttServerLastWill.isExternalLink(..)
  • amf.client.model.domain.MqttServerLastWill.withIsExternalLink(..)
  • amf.client.model.domain.HttpOperationBinding.isExternalLink(..)
  • amf.client.model.domain.HttpOperationBinding.withIsExternalLink(..)
  • amf.client.model.domain.Amqp091ChannelBinding.isExternalLink(..)
  • amf.client.model.domain.Amqp091ChannelBinding.withIsExternalLink(..)
  • amf.client.model.domain.Response.isExternalLink(..)
  • amf.client.model.domain.Response.withIsExternalLink(..)
  • amf.client.model.domain.MatrixShape.isExternalLink(..)
  • amf.client.model.domain.MatrixShape.withIsExternalLink(..)
  • amf.client.model.domain.TupleShape.isExternalLink(..)
  • amf.client.model.domain.TupleShape.withIsExternalLink(..)
  • amf.client.model.domain.XMLSerializer.isExternalLink(..)
  • amf.client.model.domain.XMLSerializer.withIsExternalLink(..)
  • amf.client.model.domain.Parameter.isExternalLink(..)
  • amf.client.model.domain.Parameter.withIsExternalLink(..)
  • amf.client.model.domain.ArrayShape.isExternalLink(..)
  • amf.client.model.domain.ArrayShape.withIsExternalLink(..)
  • amf.client.model.domain.NodeMapping.isExternalLink(..)
  • amf.client.model.domain.NodeMapping.withIsExternalLink(..)
  • amf.client.model.domain.PropertyDependencies.isExternalLink(..)
  • amf.client.model.domain.PropertyDependencies.withIsExternalLink(..)
  • amf.client.model.domain.License.isExternalLink(..)
  • amf.client.model.domain.License.withIsExternalLink(..)
  • amf.client.model.domain.DataNode.isExternalLink(..)
  • amf.client.model.domain.DataNode.withIsExternalLink(..)
  • amf.client.model.domain.FileShape.isExternalLink(..)
  • amf.client.model.domain.FileShape.withIsExternalLink(..)
  • amf.client.model.domain.DomainExtension.isExternalLink(..)
  • amf.client.model.domain.DomainExtension.withIsExternalLink(..)
  • amf.client.model.domain.EndPoint.isExternalLink(..)
  • amf.client.model.domain.EndPoint.withIsExternalLink(..)
  • amf.client.model.domain.PropertyShape.isExternalLink(..)
  • amf.client.model.domain.PropertyShape.withIsExternalLink(..)
  • amf.client.model.domain.ClassTerm.isExternalLink(..)
  • amf.client.model.domain.ClassTerm.withIsExternalLink(..)
  • amf.client.model.domain.AbstractDeclaration.isExternalLink(..)
  • amf.client.model.domain.AbstractDeclaration.withIsExternalLink(..)
  • amf.client.model.domain.Message.isExternalLink(..)
  • amf.client.model.domain.Message.withIsExternalLink(..)
  • amf.client.model.domain.ObjectNode.isExternalLink(..)
  • amf.client.model.domain.ObjectNode.withIsExternalLink(..)
  • amf.client.model.domain.DataArrangeShape.isExternalLink(..)
  • amf.client.model.domain.DataArrangeShape.withIsExternalLink(..)
  • amf.client.model.domain.WebSocketsChannelBinding.isExternalLink(..)
  • amf.client.model.domain.WebSocketsChannelBinding.withIsExternalLink(..)
  • amf.client.model.domain.UnionShape.isExternalLink(..)
  • amf.client.model.domain.UnionShape.withIsExternalLink(..)
  • amf.client.model.domain.ShapeExtension.isExternalLink(..)
  • amf.client.model.domain.ShapeExtension.withIsExternalLink(..)
  • amf.client.model.domain.ExternalDomainElement.isExternalLink(..)
  • amf.client.model.domain.ExternalDomainElement.withIsExternalLink(..)
  • amf.client.model.domain.Organization.isExternalLink(..)
  • amf.client.model.domain.Organization.withIsExternalLink(..)
  • amf.client.model.domain.Request.isExternalLink(..)
  • amf.client.model.domain.Request.withIsExternalLink(..)
  • amf.client.model.domain.AnyShape.isExternalLink(..)
  • amf.client.model.domain.AnyShape.withIsExternalLink(..)
  • amf.client.model.domain.Encoding.isExternalLink(..)
  • amf.client.model.domain.Encoding.withIsExternalLink(..)
  • amf.client.model.domain.PropertyMapping.externallyLinkable(..)
  • amf.client.model.domain.PropertyMapping.isExternalLink(..)
  • amf.client.model.domain.PropertyMapping.withExternallyLinkable(..)
  • amf.client.model.domain.PropertyMapping.withIsExternalLink(..)
  • amf.client.model.domain.RecursiveShape.isExternalLink(..)
  • amf.client.model.domain.RecursiveShape.withIsExternalLink(..)
  • amf.client.model.domain.Server.isExternalLink(..)
  • amf.client.model.domain.Server.withIsExternalLink(..)
  • amf.client.model.domain.SecurityScheme.isExternalLink(..)
  • amf.client.model.domain.SecurityScheme.withIsExternalLink(..)
  • amf.client.model.domain.OperationBindings.isExternalLink(..)
  • amf.client.model.domain.OperationBindings.withIsExternalLink(..)
  • amf...
Read more

Changes in 4.5.0

20 Nov 12:32
12ddf38
Compare
Choose a tag to compare

Released Nov 19, 2020.

JS asset

JVM asset

New Features

AsyncAPI 2.0 final release

We are releasing AsyncAPI 2.0 to GA! All previous updates had the beta tag. Now it's finally here!

New domain element emitters

Two interfaces have been added to the public interface that allow users to render individual elements parsed by AMF. The output of the emission is stored in the provided document builder.

  • amf.client.render.WebApiDomainElementEmitter
    For webapi elements, the vendor of the specific web api spec must be provided.
emitToBuilder[T](element: DomainElement, 
                       emissionStructure: Vendor, 
                       eh: ClientErrorHandler, 
                       builder: DocBuilder[T]): Unit
  • amf.client.render.AmlDomainElementEmitter
    For the case of AML elements, current only DialectDomainElement's are handled. The Dialect from which the element was parsed must be provided.
emitToBuilder[T](element: DomainElement, 
                       emissionStructure: Dialect, 
                       eh: ClientErrorHandler, 
                       builder: DocBuilder[T]): Unit

Interface Changes

JSON Schema draft 2019 (beta)

Added

  • amf.core.remote.Vendor.JSONSCHEMA(..)
  • amf.client.model.domain.ArrayShape.maxContains(..)
  • amf.client.model.domain.ArrayShape.minContains(..)
  • amf.client.model.domain.ArrayShape.unevaluatedItemsSchema(..)
  • amf.client.model.domain.ArrayShape.unevaluatedItems(..)
  • amf.client.model.domain.ArrayShape.withMaxContains(..)
  • amf.client.model.domain.ArrayShape.withMinContains(..)
  • amf.client.model.domain.ArrayShape.withUnevaluatedItemsSchema(..)
  • amf.client.model.domain.ArrayShape.withUnevaluatedItems(..)
  • amf.client.model.domain.NodeShape.schemaDependencies(..)
  • amf.client.model.domain.NodeShape.unevaluatedPropertiesSchema(..)
  • amf.client.model.domain.NodeShape.unevaluatedProperties(..)
  • amf.client.model.domain.NodeShape.withSchemaDependencies(..)
  • amf.client.model.domain.NodeShape.withUnevaluatedPropertiesSchema(..)
  • amf.client.model.domain.NodeShape.withUnevaluatedProperties(..)
  • amf.client.model.domain.WebApi.copy(..)
  • amf.client.model.domain.ScalarShape.encoding(..)
  • amf.client.model.domain.ScalarShape.mediaType(..)
  • amf.client.model.domain.ScalarShape.schema(..)
  • amf.client.model.domain.ScalarShape.withEncoding(..)
  • amf.client.model.domain.ScalarShape.withMediaType(..)
  • amf.client.model.domain.ScalarShape.withSchema(..)
  • amf.client.model.domain.MatrixShape.maxContains(..)
  • amf.client.model.domain.MatrixShape.minContains(..)
  • amf.client.model.domain.MatrixShape.unevaluatedItemsSchema(..)
  • amf.client.model.domain.MatrixShape.unevaluatedItems(..)
  • amf.client.model.domain.MatrixShape.withMaxContains(..)
  • amf.client.model.domain.MatrixShape.withMinContains(..)
  • amf.client.model.domain.MatrixShape.withUnevaluatedItemsSchema(..)
  • amf.client.model.domain.MatrixShape.withUnevaluatedItems(..)

Async (GA release!)

Added

  • amf.client.model.domain.Message.headerExamples(..)
  • amf.client.model.domain.Message.headerSchema(..)
  • amf.client.model.domain.Message.withHeaderExamples(..)
  • amf.client.model.domain.Message.withHeaderSchema(..)
  • amf.client.model.domain.Response.headerExamples(..)
  • amf.client.model.domain.Response.headerSchema(..)
  • amf.client.model.domain.Response.withHeaderExamples(..)
  • amf.client.model.domain.Response.withHeaderSchema(..)
  • amf.client.model.domain.Request.headerExamples(..)
  • amf.client.model.domain.Request.headerSchema(..)
  • amf.client.model.domain.Request.withHeaderExamples(..)
  • amf.client.model.domain.Request.withHeaderSchema(..)

Validation Changes

JSON Schema improvements

We made some improvements on JSON Schema parsing that ended in some minor validation changes.

Default JSON versions for different specs

Before, the $schema entry of a JSON Schema object defaulted to draft-4 if it wasn't present. It was updated to use the default for each spec.

The defaults are:

  • RAML 1.0, OAS 2.0 and OAS 3.0 -> Draft 4
  • ASYNC API 2.0 -> Draft 7

"required" boolean facet in properties for draft 4 and up

The severity of this validation was downgraded from violation to warning. Although it throws a warning, this field will be parsed and set in the model correctly in any draft. We advise against doing so as it goes against the JSON Schema spec for draft's 4 and beyond.

This can be set to violation again in AMF's next major version.

Example of incorrect use that will result in a warning:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "properties": {
    "property1": {
      "type": "string",
      "required": true
    }
  }
}

Non-sequence "required" key at Object level

The key required in the root level of an object MUST be an array of strings.
In certain cases when this key wasn't an array, we ignored that key (it wasn't parsed or set in the model). Now it always will show an error if it is present and its value is not an array of strings.

Example of incorrect use that will result in an error:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "additionalProperties": false,
  "properties": {
    "property1": {
      "type": "string"
    }
  },
  "required": true
}

Model Changes

API level added

Now you can differentiate between webapi and asyncapi searching apiContract:WebAPI or apiContract:AsyncAPI @type in the root of the encodes of your API.

Example

(...)
    "doc:encodes": [
      {
        "@id": "#23",
        "@type": [
          "apiContract:AsyncAPI",
          "apiContract:API",
          "doc:RootDomainElement",
          "doc:DomainElement"
        ],
(...)

AsyncAPI HeaderScheme

AsyncApi header scheme used to be modeled as a single header with a schema object. That is not correct according to the specification as it says that message header property should be a schema object in which each one of schema properties is a valid header.
In order to be complaint with the spec and respect the fact that the schema is just a way to express a group of headers, for now on we will parse that property as a new HeaderSchema field at the MessageModel that contains an Object Schema.

Message example with header identifier MUST conform against that schema in order to the AsyncApi be valid.

AMF Fixed issues

Changes in 4.4.0

21 Oct 14:33
b584f9d
Compare
Choose a tag to compare

Released Oct 21, 2020.

JS asset

JVM asset

AML 5.0.x adopted

This release adopts AML 5.0.x. This AML release includes an amf-validation module split which is now part of the AML project.

For amf-client/amf-webapi adopters there is no action required to adopt these change unless you are manually initializing validation.

All the datails in: AML 5.0.x release notes

Interface Changes

OAS Compacted Emission

New parameter in client interface RenderOptions to disable compact emission in OAS (2.0 and 3.0)

Added

  • amf.client.render.RenderOptions.isWithCompactedEmission
  • amf.client.render.RenderOptions.withCompactedEmission

AsyncAPI (still beta) updated kafka bindings

Changed

  • amf.client.model.domain.KafkaMessageBinding.messageKey(..) changed its return type from amf.core.model.StrField to amf.client.model.domain.Shape
  • amf.client.model.domain.KafkaMessageBinding.withKey(..) now receives amf.client.model.domain.Shape instead of String
  • amf.client.model.domain.KafkaOperationBinding.clientId(..) changed its return type from amf.client.model.StrField to amf.client.model.domain.Shape
  • amf.client.model.domain.KafkaOperationBinding.groupId(..) changed its return type from amf.client.model.StrField to amf.client.model.domain.Shape
  • amf.client.model.domain.KafkaOperationBinding.withClientId(..) now receives amf.client.model.domain.Shape instead of String
  • amf.client.model.domain.KafkaOperationBinding.withGroupId(..) now receives amf.client.model.domain.Shape instead of String

Validation Changes

AsyncAPI (still beta) kafka operation and message binding change type value for keys 'groupId', 'clientId', and 'key'

These keys where parsed as string values, and are now defined as Schema Object's.
Kafka operation binding with modified 'groupId' and 'clientId' values:

publish:
  bindings:
    kafka:
      groupId:
        type: string
        pattern: '^[\w]+\.[\w]+\.[\w]+\.[\d]+$'
      clientId:
        type: string
        enum: ['myClientId']

Kafka message binding with modified 'key' value:

message:
  bindings:
    kafka:
      key:
        type: string
        maxLength: 20

AsyncAPI (still beta) allow reference to external RAML data types

Three new mechanisms have been introduced to enable referencing RAML data types present in fragments, libraries, or external files. The ‘$ref’ facet may only be used at the root of the payload definition, and its target content must be valid structurally according to the RAML specification.

Referencing external RAML data type fragments. Relative pointer is not support for this use case.

message:
  schemaFormat: application/vnd.rai.raml;version=1.0
  payload:
    $ref: external-data-type.raml

Referencing types present in libraries, the following fixed pointer must be used “{lib}#/types/{typeName}”.

message:
  schemaFormat: application/vnd.rai.raml;version=1.0
  payload:
    $ref: external-library.raml#/types/User

RAML content present in external yaml files can be referenced and the use of relative json pointers may be used.

message:
  schemaFormat: application/vnd.rai.raml;version=1.0
  payload:
    $ref: external-yaml.yaml#/nestedContent/User

Within the definition of RAML content, it is not possible to directly reference content defined in the async api. The following example is invalid as the type 'User' will result in an unresolved reference.

components:
  schemas:
    User:
      type: string

channels:
  users/signup:
    subscribe:
      message:
        schemaFormat: application/vnd.rai.raml;version=1.0
        payload:
          type: User

File Order Inconsistency

We changed the way file references were added to the BaseUnit. Before, files didn't respect the order in which the API author added them. Now, the order of the files in the references() node respects the original API order. This helps keeping consistency between API parsing processes.

Note: although we make reference to "order", order is not guaranteed in AMF as AMF is a graph and graph edges don't have a specific order.

For the api:

#%RAML 1.0

types:
  a: !include datatypes/a.raml
  b: !include datatypes/b.raml
  c: !include datatypes/c.raml
  h: !include datatypes/h.raml

Before a possible json-ld with inconsistent reference order could be:

{
  "doc:references": [
    {
      "id": "./datatypes/c.raml",
      ...
    },
    {
      "id": "./datatypes/h.raml",
      ...
    },
    {
      "id": "./datatypes/a.raml",
      ...
    },
    {
      "id": "./datatypes/b.raml",
      ...
    }
  ]
}

Now, it respects the ordering in the API:

{
  "doc:references": [
    {
      "id": "./datatypes/a.raml",
      ...
    },
    {
      "id": "./datatypes/b.raml",
      ...
    },
    {
      "id": "./datatypes/c.raml",
      ...
    },
    {
      "id": "./datatypes/d.raml",
      ...
    }
  ]
}

AMF Fixed issues

Changes in 4.3.1

23 Sep 22:14
3994665
Compare
Choose a tag to compare

Released Sep 23, 2020.

JS asset

JVM asset

Interface Changes

AsyncAPI (still beta) updated bindings

Deleted

  • amf.client.model.domain.DynamicBinding

Added

From: [APIMF-2412 - AsyncAPI - AMF invalid validation MQTT server binding with "message" property]

  • amf.client.model.domain.MqttServerLastWill.message()

Validation Changes

RAML

RAML unions

APIMF-2324 - RAML Expressions are losing shapes when uniting unions
Fixed an invalid validation under specifics conditions with unions, for example, the following API is now valid:

#%RAML 1.0
title: Secrets Provider
version: v1
baseUri: https://test.com/provider/
types:
  EncryptedResponse:
    type: object
    properties:
      encryptedKey:
        type: string
  sharedSecretUsernamePassword:
    type: object
    properties:
      username:
        type: string
  sharedSecretSymmetricKey:
    type: object
    properties:
      key:
        type: string
  SharedSecret: sharedSecretUsernamePassword | sharedSecretSymmetricKey

/path:
  get:
      responses:
        200:
          body:
            application/json:
              type: SharedSecret | EncryptedResponse
              examples: 
                encrypted: |
                  {
                    "encryptedKey": "encryptedKey",
                    "cipherText": "cipherText"
                  }

RAML version base URI parameter

APIMF-2415 - Missing validations of the "version" reserved base URI parameter

Added validation for missing version definition for baseUri, for example, the following API is now invalid:

#%RAML 1.0
title: Brown Google Admin Directory API
baseUri: https://localhost/services/cis/brown-google-admin-directory-api/v{version}

AsyncAPI (still beta)

Async components invalid names

APIMF-2451 - Async - Missing validation for component objects naming

Added validation for invalid component names, for example, the following component definition is now invalid:

asyncapi: 2.0.0

info:
  title: title
  version: 0.1.0

components:
  schemas:
    inval#d:
      type: object

Async examples structure

APIMF-2476 - Async - AMF Validation "examples" facet should be handled as JSON Schema, not OAS 3

Examples validation for Message Object were modified from a [Map[string, any]] to [any] & correspondent for the value for the schema specified in "payload".
For example the following api is now invalid:

channels:
  /user/signedup:
    subscribe:
      message:
        payload:
          type: object
          properties:
            email:
              type: string
              format: email
        examples:
          - one:
              email: [email protected]

This one becomes valid:

channels:
  /user/signedup:
    subscribe:
      message:
        payload:
          type: object
          properties:
            email:
              type: string
              format: email
        examples:
          - email: [email protected]

AMF Fixed issues

Changes in 4.3.0

27 Aug 20:26
caa8c64
Compare
Choose a tag to compare

Released Aug 27, 2020.

JS asset

JVM asset

SYAML

We bumped the version of SYAML dependency to 1.0.282, which contains some improvements that make us bump a minor. see details here https://github.com/mulesoft/syaml/releases/tag/1.0.281

Validation Changes

YAML multidocument

Added validation for a multi-document tag in YAML documents, for example, the following API is now invalid because the usage of "---":

api.raml:

#%RAML 1.0
title: api
---
/test:

RAML Security Schemes Fragments

APIMF-2261 - Missing validation in "scopes" parameter when applying a SecurityScheme fragment
Fixed a bug in which a Security Schemes wasn't properly validated if it was defined in a Typed Fragment, for example, the following API is now invalid, as it has an invalid scope definition

api.raml:

#%RAML 1.0
title: API

securitySchemes:
  oauth_2_0: !include /securitySchemes/oauth_2_0.raml

/users:
  get:
    securedBy: [ oauth_2_0: { scopes: [ USER ] } ]

/securitySchemes/oauth_2_0.raml:

#%RAML 1.0 SecurityScheme
description: |
  This API supports OAuth 2.0 for authenticating all API requests.
type: OAuth 2.0
settings:
  accessTokenUri:   https:/host/path/oauth2/access_token
  authorizationGrants: [ client_credentials ]
  scopes: [ ADMIN ]

AMF Fixed issues

Changes in 4.2.0-0

13 Aug 17:37
Compare
Choose a tag to compare

Released Aug 13, 2020.

JS asset

JVM asset

This is a hotfix for 4.2.0 that fixes an invalid validation for implicit tags in YAML.

AMF Fixed issues