Skip to content

Releases: aml-org/amf

Changes in AMF 5.4.0

30 May 20:31
be00014
Compare
Choose a tag to compare

What's Changed

Bump ScalaJS, Scala and SBT versions

  • Scala 2.12.15 (before 2.12.13)
  • ScalaJS 1.6.0 (before 0.6.33)
  • SBT 1.7.3 (before 1.7.1)

ScalaJS bump side-effects and changes

Now the scalajs artifacts names that ended with _sjs0.6 now end with _sjs1.

Type-checking methods like instanceOf have stopped working in JS (they never really did work fully). To recover functionality and even simplify it, we created the class TypeUtil with type-checking methods:

  • isTypeOf receives an AmfObject and an IRI (string), and returns if that object corresponds to that IRI.
    • The enum TypeIRI has the IRI of every Shape in the model and more, but the method can also receive a string that you can get from the amf model (first element).

Similarly, ExceptionUtil has a method isExceptionType that receives an AmfException and an exceptionCode (string) and returns true if the exception matches with that code. AmfExceptionCode has all codes from FileLoaderExceptions.

Finally, if you're using JSOutputBuilder, now it's being exported from root level, you can get it by doing

import {JsOutputBuilder} from 'amf-client-js';

Commits

Full Changelog: 5.3.0...5.4.0

Changes in AMF 5.3.0

04 May 19:59
21704c6
Compare
Choose a tag to compare

Shape Normalization Refactor

This release includes a re-implemention of the algorithm used to normalize types (Shapes) in the graph. Our previous implementation produced information loss in cases with complex type systems. The new implementation is more sound and proved to not lose information in our tests.
This normalization includes the following algorithms: inheritance resolution, cycle detection & validation and type guessing (AnyShapeAdjuster)
Impact
Since we are now processing more information (that was previously lost) this can produce the following effects:

  • Change of the validation status of APIs: particularly expect a reduction of false positives and some reduction of false negatives
  • Change in the annotations of some Shapes: particularly inherited annotations & inheritance related annotations

Validation Changes

Leap year validation

Previously the leap year was note validated in the instances of date like datatypes, now it is validated.
e.g.: this example use to conform, now it is invalid.

  some-date:
    type: datetime
    example: 2023-02-29T16:41:41.090Z

What's Changed

Full Changelog: 5.2.6...5.3.0

Changes in AMF 5.2.6

04 Apr 21:37
0671099
Compare
Choose a tag to compare

What's Changed

  • Add tracked element annotation to shape serializable annotation index by @pope1838 in #1734
  • W-11802973: add warning when using a JSON Schema in type expressions by @arielmirra in #1733
  • W-12587175: union shouldn't propagate custom domain properties to its members by @tomsfernandez in #1732
  • Bump org.json.json to 20230227 by @looseale in #1745
  • W-11802973: check discriminator usage in inline schemas by @arielmirra in #1747
  • W-11460908 [fix regression]: parsing & validating discriminator value as a DataNode in the model by @nschejtman in #1752
  • Update Dockerfile by @tomsfernandez in #1759

Full Changelog: 5.2.5...5.2.6

Changes in AMF 5.2.5

09 Mar 16:13
cda9e79
Compare
Choose a tag to compare

What's Changed

Important validation - New RAML type validation

When a raml type has the value type: [] we now validate it with the message [] is not a valid type.

For example in the following API:

/test:
  post:
    body:
      application/json:
        properties: 
          products: []

The type of products is not valid, and the validation [] is not a valid type will show up.

Full Changelog: 5.2.4...5.2.5

Changes in AMF 5.2.4

07 Feb 19:34
972cdb0
Compare
Choose a tag to compare

What's Changed

Full Changelog: 5.2.3...5.2.4

5.2.3

11 Jan 15:36
e3346fb
Compare
Choose a tag to compare

Validation Changes

The RAML validation to detect a conflict between queryString and queryParameter was moved from parsing to validation stage, and now it also detects if the conflict is originated after applying a trait.

What's Changed

Full Changelog: 5.2.2...5.2.3

5.2.2

14 Dec 21:52
c9e1b40
Compare
Choose a tag to compare

Model Changes

  • Payload: added required field
  • EndPoint: added EndpointFederationMetadata field. EndPoints can now contain metadata about to federation capabilities
  • Parameter: added ParameterFederationMetadata field. EndPoints can now contain metadata about to federation capabilities

RenderOption changes

  • added withoutImplicitRamlTypes option to avoid rendering the type entry of Raml types when it can be inferred from the type's properties. Thanks to @Shadow-Devil for the contribution.

Validation changes

  • examples and default values with 'null' value were not validated against the Shape. Those values are validated now.
    The error was in the example/default collector, not in the validation itself. In payload validation, it was always validated correctly.

Scala Bump

We upgraded the version of the scala-library to 2.12.13

Interface Changes

The interface changes reflect the model and render option changes described above.

What's Changed

Full Changelog: 5.2.1...5.2.2

5.2.1

16 Nov 14:52
f2ed69f
Compare
Choose a tag to compare

What's Changed

Full Changelog: 5.2.0...5.2.1

Changes in 5.2.0

18 Oct 20:03
78afea2
Compare
Choose a tag to compare

Released Oct 18, 2022.

JS asset

JVM asset

OpenApi 3.0 Component

We're happy to announce that AMF now supports OpenApi 3 Component

An "OpenApi 3 Component" is a semantically valid OpenApi API spec that is defined with an empty Paths Object.

The reason for writing a file of this type is to be able to reuse any item within the Components Object throughout several APIs.

For more info and examples check out the OpenApi 3 Component section of the AMF Documentation.

What's Changed

New Contributors

Full Changelog: 5.1.0...5.2.0

Changes in 5.1.0

20 Sep 15:32
9faa683
Compare
Choose a tag to compare

Released Sep 20, 2022.

JS asset

JVM asset

Announcing GraphQL and Apollo Federation support

We're happy to announce that AMF now supports GraphQL APIs and Apollo Federation APIs for all its operations (parsing, transformation, validation, rendering).

We've worked hard to integrate all GraphQL features into our model, up to the October 2021 GraphQL Spec.

How to use GraphQL in AMF

To use these new features you only need to:

  • create a new GraphQLConfiguration.GraphQL()
  • create a client graphqlConfig.baseUnitClient()
  • use this client to parse, transform, validate and render GraphQL APIs

There are multiple examples of GraphQL parsing in Scala, Java, and TypeScript in the GraphQL Parsing section of the AMF Documentation.

Apollo Federation

We've also added support for GraphQL APIs compliant with the Apollo Federation v2 Spec.

These APIs require a different configuration called GraphQLFederationConfiguration.GraphQLFederation() to differentiate them from plain GraphQL APIs.

We've detailed exactly what is supported and how it works in the GraphQL Federation section of the AMF Documentation.

Resources

Specification Configuration More information
GraphQL GraphQLConfiguration GraphQL Parsing
Apollo Federation GraphQLFederationConfiguration GraphQL Federation

What's Changed

Full Changelog: 5.0.12...5.1.0