Changes in 4.0.3
OAS 3.0 EA
This version comes with early access to OAS3.0 support.
Check interface changes for detail of new Objects.
JSON-LD model updated to version 2.0.0
Some namespaces of the fields have changed in the JSON-LD representation.
This change does not affect the use of the object model of AMF (interfaces remain the same).
Key changes in JSON-LD model
The key that identifies the name of an annotation has been changed from http://a.ml/vocabularies/document#name
to http://a.ml/vocabularies/core#extensionName
.
Interface Changes
OAS 3.0 Objects
New objects for OAS 3.0
- amf.client.parse.Oas30Parser
- amf.client.parse.Oas30YamlParser
- amf.client.resolve.Oas30Resolver
- amf.client.render.Oas30Renderer
Added Render Options
- amf.client.render.RenderOptions.withNodeIds()
- amf.client.render.RenderOptions.isEmitNodeIds()
Flattened
Flattened JSON-LD emission support for AMF (AML pending).
To use flattened emission use RenderOptions.withFlattenedJsonLd
- New method amf.client.render.RenderOptions.withFlattenedJsonLd()
- New method amf.client.render.RenderOptions.withoutFlattenedJsonLd()
- New method amf.client.render.RenderOptions.isFlattenedJsonLd()
Security model changes
Security model in OAS3 has a change that affects compatibility, the property of security
in WebApi, EndPoint and Operation that returned a List[ParametrizedSecurityScheme], now returns a List[SecurityRequirement]. SecurityRequirement is an object that contains a property schemes
which is a List[ParametrizedSecurityScheme]. If there were three security schemes in the list before, now there will be three security requirements each with one security scheme, for example.
The second change is with the flows in an OAuth2Settings object. When accessing the settings of an OAuth 2 security scheme, there used to be some specific properties, now there is the authorizationGrants
property and a flows
property which contains a List[OAuth2Flow]. OAuth2Flow contains the other properties that used to be immediately in the settings of the scheme.
JSON Schema building
buildJsonSchema() available for Shapes:
- amf.client.model.domain.UnionShape.buildJsonSchema()
- amf.client.model.domain.DataArrangeShape.buildJsonSchema()
- amf.client.model.domain.SchemaShape.buildJsonSchema()
- amf.client.model.domain.MatrixShape.buildJsonSchema()
- amf.client.model.domain.NilShape.buildJsonSchema()
- amf.client.model.domain.TupleShape.buildJsonSchema()
- amf.client.model.domain.AnyShape.buildJsonSchema()
- amf.client.model.domain.ArrayShape.buildJsonSchema()
- amf.client.model.domain.NodeShape.buildJsonSchema()
Validation changes
Enum value types in OAS are now properly validated, i.e. the following example is no longer valid.
"test": {
"type": "string",
"enum":
[{
"key": "value"
}]
}
Fixed invalid validation with !include tag, i.e. the following example is valid now (as it is considered a string payload)
#%RAML 1.0
title: test API
/resource:
get:
responses:
200:
body:
application/json:
example: !includedexample
Fixed wrong validation of additionalItems with values that are not Boolean, for example, the following schema is now valid:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"description": "Allows the insertion of a Contact Us request into Unilever backend systems",
"properties": {
"consumer": {
"type": "object",
"properties": {
"contactDetail": {
"type": "array",
"minItems": 1,
"items": [
{
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
}
],
"additionalItems": {
"type": "string"
}
}
}
}
}
}
Fixed a case in which a payload with null value for an optional enum used inside a trait was not correctly validated
AMF Fixed issues
- APIMF-1670 - User facets with two inheritance levels are not supported
- APIMF-1702 - Fix restriction computation of additional properties
- APIMF-1708 - Json schemas should have the option to not render examples
- APIMF-1709 - Can't generate RAML with null value in example
- APIMF-1710 - Annotations has no name
- APIMF-1713 - OAS' API key security scheme does not support logical AND operation
- APIMF-1714 - Duplicated declaration in generated JSON-LD
- APIMF-1718 - Improve ReferenceResolver logic on order to differentiate files with the same name in other directories
- APIMF-1724 - Error in validation/resolution in AMF service
- APIMF-1727 - JSON_LD repeats enums values
- APIMF-1729 - JSON_LD Rendering produces duplicates keys
- APIMF-1730 - Security issue with lib.thrift 0.10.0
- APIMF-1773 - Missing closure shape in recursive type
- APIMF-1798 - Conflict of IDs with cached refs resolved with editing