Releases: aml-org/amf
Changes in AMF 5.4.0
What's Changed
Bump ScalaJS, Scala and SBT versions
- Scala
2.12.15
(before2.12.13
) - ScalaJS
1.6.0
(before0.6.33
) - SBT
1.7.3
(before1.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 anAmfObject
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).
- The enum
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
- W-12711738/jsonld-schema-fixes by @tomsfernandez in #1788
- W-12711728: cast internal JSON-LD Scalars Long representations to Integers by @nschejtman in #1790
- W-11460908: fix no iteration on element pipeline by @nschejtman in #1789
- W-11460908: fix starting update iteration on non-updated shape by @nschejtman in #1791
- W-11460908: added test for property position by @nschejtman in #1799
- W-11460908: remove full JSON path from property terms in JSON-LD objects by @nschejtman in #1800
- W-12697293: skip re-visiting shapes in cycle detection by @nschejtman in #1802
- W-13217761: make jsonldobject mutable by @pope1838 in #1803
- W-13191540: bump to ScalaJS 1.6 & Scala 2.12.15 & SBT 1.7.3 by @arielmirra in #1804
- typings: move JSOutputBuilder to root-level by @arielmirra in #1805
Full Changelog: 5.3.0...5.4.0
Changes in AMF 5.3.0
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
- W-11460908: fix pipeline name by @nschejtman in #1763
- W-12784127: add json ld instance document wrap fn converter by @pope1838 in #1774
- W-12980908 by @damianpedra in #1775
- W-12670897: add mediatype to the payload validators cache key by @arielmirra in #1776
- Update NexusIQCLI and gradle-common version by @looseale in #1778
- W-11460908: Replace java.util.List.of with list creation by @nschejtman in #1779
- Shape Normalization by @nschejtman in #1781
- W-12989569 - Implemented everit date validators with strict mode and … by @looseale in #1782
- W-12673312: prevent ServersNormalizationStage from overriding Server IDs by @arielmirra in #1783
- (ci): use 1.3.1 ci image version. This sets Eclipse Temurin as JDK distribution by @tomsfernandez in #1784
- (ci): use 1.3.1 ci image version. This sets Eclipse Temurin as JDK distribution by @arielmirra in #1786
- cherry-pick SN fixes, publish RC.2 by @arielmirra in #1792
- cherry-pick JSONLD fixes by @arielmirra in #1793
Full Changelog: 5.2.6...5.3.0
Changes in AMF 5.2.6
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
What's Changed
- Add typing for grpc configuration by @pope1838 in #1717
- (fix): properties with same semantics but different sub tree weren't being merged by @tomsfernandez in #1718
- W-12438860: syntax recovery by @nschejtman in #1725
- W-12385375: refactor getDeclaringUnit logic to improve performance by @nschejtman in #1726
- W-11351848: added discrminator value validation candidate collector by @nschejtman in #1727
- W-12361132 (fix): removed ast tampering in and, or and xone parsers by @tomsfernandez in #1729
- W-12521486: fixed wrong type expression parsing by @tomsfernandez in #1728
- W-11680259: avoid throwing remote context error in canParse method by @arielmirra in #1730
- update typings with JSONLD features by @arielmirra in #1739
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
What's Changed
- W-12150964: add annotations in graphql parsing by @arielmirra in #1694
- Fix client list at jsonld object interfaces by @pope1838 in #1698
- W-12348272: fix HasShapeFederationMetadata interface change by @nschejtman in #1700
- Register jsonldobject wrapper in platform at jsonld configuration by @pope1838 in #1703
- W-11757246/fail-fast-json-schema-plugin by @tomsfernandez in #1696
- Fix repo name in JenkinsFile by @looseale in #1707
- W 12292129 by @damianpedra in #1708
- (fix): removed DefaultShaclOptions as it isn't used by @tomsfernandez in #1709
- Add jsonld instance rendering by syntax, using terms names without lo… by @pope1838 in #1711
- W-11460908: update dialect snapshots by @arielmirra in #1712
- fix import in JsoLDSchemaResult and add a new converter by @damianpedra in #1710
- W-12355752: add lexical to virtual elements in editing pipeline by @arielmirra in #1713
- modify imports from scala to Platform by @damianpedra in #1714
- W-12276263 - Created parsing plugin and extracted common methods by @looseale in #1715
- W-12362160 - Added pattern properties support for JSON-LD Schema by @looseale in #1716
- update typings with JSONLD features by @arielmirra in #1721
Full Changelog: 5.2.3...5.2.4
5.2.3
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
- Import fully qualyfied static method at hacked json object parser by @pope1838 in #1673
- W-12111901 by @hghianni in #1672
- W-11818372: Fix ref from definition to another definition not resolved by @hghianni in #1674
- W-12184902 - Change in emission of unions with null elements by @looseale in #1675
- Added sorted column to clarify in the exported model if an array is s… by @looseale in #1678
- W-11921177: minor refactors and improvements by @arielmirra in #1677
- IRI expansion in JSON-LD Schema by @looseale in #1688
- W-11755322 - Added validation for @type usage by @looseale in #1689
- W-12073855: Add annotation to facilitate linking external schemas by @hghianni in #1690
- W-12073855: Change TargetName annotation to store name as YPart inste… by @hghianni in #1692
- W 12218465 by @damianpedra in #1687
- Add setters for property and values at jsonldobject, cloning the inst… by @pope1838 in #1695
- (interface): make withAliases public by @tomsfernandez in #1697
Full Changelog: 5.2.2...5.2.3
5.2.2
Model Changes
Payload
: addedrequired
fieldEndPoint
: addedEndpointFederationMetadata
field. EndPoints can now contain metadata about to federation capabilitiesParameter
: addedParameterFederationMetadata
field. EndPoints can now contain metadata about to federation capabilities
RenderOption changes
- added
withoutImplicitRamlTypes
option to avoid rendering thetype
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
- JSON-LD Schema PoC by @tomsfernandez in #1627
- W-11756604, W-11861750, W-11756966: added support to @container in JS… by @looseale in #1628
- W-11756604: added doc to JsonLDInstanceDocumentModel by @looseale in #1629
- W-11756604: another fixes in doc and model locations by @looseale in #1631
- Update npm README by @hghianni in #1632
- W-11818324: Bump model version -> 3.8.0 by @hghianni in #1633
- W-11698494 - Changed reference collector for JSON references by @looseale in #1636
- W-11861760 (feat): added array item type narrowing based on the content of arrays in an instance by @tomsfernandez in #1637
- Publish 5.3.0 snapshot by @damianpedra in #1640
- W-11778938: Fix null value location by @hghianni in #1635
- Support empty files at antlr based plugins by @pope1838 in #1641
- W-11970750 - Hack in DataType client convertion by @looseale in #1643
- (ci): added Github Action to run tests in the Windows platform. Action is triggered manually by @tomsfernandez in #1645
- W-11732773 - Added a parameter with a default value to limit nesting … by @looseale in #1644
- W-11755356 - Added tests of @characteristics (valid and invalid cases) by @looseale in #1646
- W 11754577/property term collisions - W-11754747/jsonld-schema-id-adoption by @tomsfernandez in #1630
- W 11918512: Fix typings by @hghianni in #1647
- W-11755406 - Added test of @characteristics parsing in property by @looseale in #1648
- W-11991575 - Increase payload size in test depth due fix in syaml by @looseale in #1649
- Update graph class typings by @pope1838 in #1651
- W-11989055: fix CastClassException in PropertykeyMapping.target by @damianpedra in #1652
- publish 5.2.1 rc.1 by @nschejtman in #1655
- Bump amf-aml to 6.2.1-RC.1. Publish 5.2.1-RC.2 by @looseale in #1656
- Publish 5.2.1 by @looseale in #1659
- Publish 5.2.1 by @looseale in #1661
Full Changelog: 5.2.1...5.2.2
5.2.1
What's Changed
- JSON-LD Schema PoC by @tomsfernandez in #1627
- W-11756604, W-11861750, W-11756966: added support to @container in JS… by @looseale in #1628
- W-11756604: added doc to JsonLDInstanceDocumentModel by @looseale in #1629
- W-11756604: another fixes in doc and model locations by @looseale in #1631
- Update npm README by @hghianni in #1632
- W-11818324: Bump model version -> 3.8.0 by @hghianni in #1633
- W-11698494 - Changed reference collector for JSON references by @looseale in #1636
- W-11861760 (feat): added array item type narrowing based on the content of arrays in an instance by @tomsfernandez in #1637
- Publish 5.3.0 snapshot by @damianpedra in #1640
- W-11778938: Fix null value location by @hghianni in #1635
- Support empty files at antlr based plugins by @pope1838 in #1641
- W-11970750 - Hack in DataType client convertion by @looseale in #1643
- (ci): added Github Action to run tests in the Windows platform. Action is triggered manually by @tomsfernandez in #1645
- W-11732773 - Added a parameter with a default value to limit nesting … by @looseale in #1644
- W-11755356 - Added tests of @characteristics (valid and invalid cases) by @looseale in #1646
- W 11754577/property term collisions - W-11754747/jsonld-schema-id-adoption by @tomsfernandez in #1630
- W 11918512: Fix typings by @hghianni in #1647
- W-11755406 - Added test of @characteristics parsing in property by @looseale in #1648
- W-11991575 - Increase payload size in test depth due fix in syaml by @looseale in #1649
- Update graph class typings by @pope1838 in #1651
- W-11989055: fix CastClassException in PropertykeyMapping.target by @damianpedra in #1652
- publish 5.2.1 rc.1 by @nschejtman in #1655
- Bump amf-aml to 6.2.1-RC.1. Publish 5.2.1-RC.2 by @looseale in #1656
- Publish 5.2.1 by @looseale in #1659
- Publish 5.2.1 by @looseale in #1661
Full Changelog: 5.2.0...5.2.1
Changes in 5.2.0
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
- (chore): use lowercase 'introspection' instead of 'Introspection' in GraphQLIntrospectionPipeline. Delegate to ENUM by @tomsfernandez in #1600
- W-11558536 (feat): added validations for oas components by @tomsfernandez in #1597
- (test): added comment to test by @tomsfernandez in #1595
- W-11554068 by @nschejtman in #1603
- W 11778719 by @nschejtman in #1602
- W 11781292 by @nschejtman in #1608
- W-11631501 (fix): fixed regression regarding Json Schemas in RAML by @tomsfernandez in #1609
- Fix typings generation by @nschejtman in #1612
- W-11697864/json-schema-fix by @tomsfernandez in #1613
- (typings): updated typings by @tomsfernandez in #1614
- W-11697864: test json schema nested ref by id by @arielmirra in #1615
- W-11730600: Fix simplified union annotations were lost during transformation by @hghianni in #1617
- W-11787652: Fix some Json Schema bugs by @hghianni in #1616
- W-11787652: Change displayName for new fields by @hghianni in #1618
- W-11350149: adopt VirtualElement changes from core, and some minor refactors by @arielmirra in #1619
- W-11350149: revert annotation traits changes and adopt core changes by @arielmirra in #1621
- W-11785261 - Fixed root references from JSON Schema Documents by @looseale in #1620
- W-11830050 - push endpoint cookie parameters to operations by @damianpedra in #1624
- W-11350149: Add lexical to implicit parameters by @hghianni in #1623
New Contributors
- @damianpedra made their first contribution in #1624
Full Changelog: 5.1.0...5.2.0
Changes in 5.1.0
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
- W-11580922: validate required fields by @arielmirra in #1542
- W-11349298: Split duplicated paths detection logic by @hghianni in #1546
- W-11618110: return a new error handler in every request to the eh provider in shape validation by @arielmirra in #1548
- W-11495708 - Fixed search of JSON declared node with encodeable chars by @looseale in #1549
- Directives emission by @hghianni in #1553
- Add properties field in oas parser if properties entry is present by @pope1838 in #1554
- graphql 2021 by @nschejtman in #1555
- some fixes by @nschejtman in #1561
- W-11581261: Add link directive to GraphQL Federation by @hghianni in #1563
- GraphQL Fixes by @hghianni in #1565
- W 11460908 by @nschejtman in #1566
- W-11086896: add @key validations for graphql federation by @arielmirra in #1564
- W-11574054: test interfaces that implement interfaces + other fixes by @arielmirra in #1567
- W-11558453, W-11558514: added OAS Component classes, plugin, parser, … by @looseale in #1570
- W-11469432: add test to check tracked element cloning by @pope1838 in #1571
- W-11558453, W-11558514: revert NamedDomainElement name change in plat… by @looseale in #1573
- W-11574022: test covariance in a chain of interfaces by @arielmirra in #1568
- W-11558604: added support for oas3 components document indexing by @tomsfernandez in #1572
- fix: removed com.sun.tools import by @tomsfernandez in #1575
- W-11574043: add repeatable directive emission by @arielmirra in #1574
- W 11574036 by @nschejtman in #1577
- W 11645489 - Added references to JSON Schema Document by @looseale in #1578
- W-11574070: add matrix initial support & examples to graphql tck by @arielmirra in #1580
- W 11542569 by @nschejtman in #1576
- W-11646230: Add ANTLR errors to Parse report by @hghianni in #1579
- Adopt NpmOpsPlugin changes from amf-antlr-ast by @nschejtman in #1582
- W 11690311 by @hghianni in #1583
- argument parsing and rendering by @nschejtman in #1581
- W-11690333: fix schema emission logic, update dumped graphql goldens by @arielmirra in #1584
- W-11718652 (fix): implemented max json depth level for application/json strict validation by @tomsfernandez in #1586
- W 11691599 by @nschejtman in #1587
- W 11460908: bunch of GraphQL fixes (pack 1) by @nschejtman in #1588
- W 11740498 by @nschejtman in #1589
- W-11748903: Add description to directive args & fix directive descrip… by @hghianni in #1590
- W-11721862: validate cyclic inheritance in GraphQL by @arielmirra in #1593
- W-11460908: bump AMF model -> 3.7.0 by @nschejtman in #1596
- W-11558572 - Added tests for cross-spec validation and updated OAS Co… by @looseale in #1591
- W-11517554 - Update typings by @looseale in #1598
Full Changelog: 5.0.12...5.1.0