Skip to content

Releases: aml-org/amf

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

Changes in 5.0.12

23 Aug 20:19
d6af327
Compare
Choose a tag to compare

What's Changed

Full Changelog: 5.0.11...5.0.12

Changes in 5.0.11

27 Jul 14:14
808a6c5
Compare
Choose a tag to compare

Released Jul 27, 2022.

JS asset

JVM asset

JSON Schema Document

Added support to JSON Schema

Now you can operate with JSON Schema documents as root level elements in AMF.
You can parse, validate and resolve JSON Schemas draft 3, 4, 7, and 2019-09 (in the last case there are some unsupported features, like meta-schema).

How to use it

You need to create a JsonSchemaConfiguration. The other functionalities are quite the same as working with APIs.

val client = JsonSchemaConfiguration.JsonSchema().baseUnitClient()
for {
  parsingResult     <- client.parse("file://pathToYourFile.json")
  validationReport <- client.validate(parsed.baseUnit)
} yield {
 (...)
}

The parsed BaseUnit will be a JsonSchemaDocument. This new kind of Document will have a Shape containing the base schema in the encodes and a list of Shape in the declares containing the schemas under the declaration key. The declaration key must be declarations for the draft before draft 2019-09 and $defs or declarations for draft 2019-09.

To take into account

  • The $schema key specifying the draft is MANDATORY.
  • There only could be one declaration key at the same time ($defs or declarations, not both). If not, an error will be shown.
  • In the validation stage, some basic model validations are applied to the schemas.
  • In the validation stage, examples, defaults, and enum values are validated.
  • For compatibility reasons, the JSON Schemas processed with other configurations are not parsed as a JsonSchemaDocument.
    e.g.: if you parse an OAS API with an OAS configuration, and that OAS API has references to a JSON Schema file. That file is still processed as an ExternalFragment.

What's Changed

Full Changelog: 5.0.10...5.0.11