Skip to content

Changes in AMF 4.1.0

Compare
Choose a tag to compare
@BlockLucas BlockLucas released this 16 Apr 21:04
· 3413 commits to develop since this release
b9e2253

Released Apr 16, 2020.

JS asset

JVM asset

Interface Changes

Thread Management (JAVA only)

This version allows creating an "ExecutionEnvironment" using a Java ScheduledExecutorService. The internal AMF threads are created in the thread pool provided by that scheduler instead of the global thread pool provided by Scala. This enables implementers to handle the pool size & other tunings on their own.
The following interfaces can now receive this:

  • amf.client.AMF.init()
  • amf.client.AMF.platform()
  • amf.client.AMF.registerDialect()
  • amf.client.environment.Environment.executionEnvironment()
  • amf.Core.generator()
  • amf.Core.init()
  • amf.Core.parser()
  • amf.plugins.document.Vocabularies.registerDialect()
  • amf.plugins.document.WebApi.register()
  • amf.plugins.features.validation.SHACLValidator.report()
  • amf.plugins.features.validation.SHACLValidator.validate()
  • AnyShape.buildJsonSchema()
  • AnyShape.buildRamlDatatype()
  • AnyShape.parameterValidator()
  • AnyShape.payloadValidator()
  • AnyShape.toJsonSchema()
  • AnyShape.toRamlDatatype()
  • AnyShape.validate()
  • AnyShape.validateParameter()

In order to build it, you have to use an "ScheduledExecutorService" in

  • amf.client.execution.ExecutionEnvironment()

OperationModel

operationId was added to OperationModel

  • amf.client.model.domain.Operation.operationId()
  • amf.client.model.domain.Operation.withOperationId()

Validation Changes

OAS Validation with references

OAS references to external YAML files is now supported.
For example, the following api definition will now be valid:

root.yaml

swagger: "2.0"
info:
  version: 1.0.0
  title: Swagger Petstore
paths:
  /pets:
    get:
      responses:
        "200":
          description: unexpected error
          schema:
            $ref: 'ref.yaml'

ref.yaml

type: object
required:
  - code
  - message
properties:
  code:
    type: integer
    format: int32
  message:
    type: string

AMF Fixed issues